From 1284ccadca40fbbcc296fafa4b5a99ff535885d0 Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Tue, 6 Apr 2021 18:17:47 -0600 Subject: [PATCH] Add picking support (#38) * Update to react-vtk-js@1.2.0 * update generated files * Update to react-vtk-js@1.2.1 * update generated files * improve pyvista-terrain demo with picking * add support for multi-array fields * udpate generated files * Apply black to demos * Change default to None instead of empty array This ensures we are safe from mutations * npm run build * Bump version Co-authored-by: xhlulu --- DESCRIPTION | 2 +- Project.toml | 2 +- R/internal.R | 4 +- R/vtkGeometryRepresentation.R | 6 +- R/vtkView.R | 6 +- dash_vtk/GeometryRepresentation.py | 11 +- dash_vtk/View.py | 15 ++- dash_vtk/dash_vtk.min.js | 14 +- dash_vtk/dash_vtk.min.js.map | 2 +- dash_vtk/metadata.json | 38 ++++++ dash_vtk/package-info.json | 4 +- dash_vtk/utils/vtk.py | 48 ++++++- demos/pyvista-terrain-following-mesh/app.py | 78 ++++++++++- deps/dash_vtk.min.js | 14 +- deps/dash_vtk.min.js.map | 2 +- docs/README.md | 4 + inst/deps/dash_vtk.min.js | 14 +- inst/deps/dash_vtk.min.js.map | 2 +- man/vtkGeometryRepresentation.Rd | 8 +- man/vtkView.Rd | 13 +- package-lock.json | 127 +++++++++++++----- package.json | 4 +- src/DashVtk.jl | 6 +- .../GeometryRepresentation.react.js | 11 ++ src/lib/components/Mesh.react.js | 10 +- src/lib/components/View.react.js | 19 +++ src/vtk_geometryrepresentation.jl | 5 +- src/vtk_view.jl | 9 +- 28 files changed, 380 insertions(+), 98 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f306995..0853517 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashVtk Title: React based declarative usage of vtk.js for Dash -Version: 0.0.6 +Version: 0.0.7 Description: React based declarative usage of vtk.js for Dash Depends: R (>= 3.0.2) Imports: diff --git a/Project.toml b/Project.toml index 2e05e48..117c6e7 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DashVtk" uuid = "1b08a953-4be3-4667-9a23-818b1eccd4c7" authors = ["Kitware Inc and Plotly Technologies "] -version = "0.0.6" +version = "0.0.7" [deps] Dash = "1b08a953-4be3-4667-9a23-3db579824955" diff --git a/R/internal.R b/R/internal.R index e1cbc0b..3abcfc3 100644 --- a/R/internal.R +++ b/R/internal.R @@ -1,12 +1,12 @@ .dashVtk_js_metadata <- function() { deps_metadata <- list(`dash_vtk` = structure(list(name = "dash_vtk", -version = "0.0.6", src = list(href = NULL, +version = "0.0.7", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_vtk.min.js', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", all_files = FALSE), class = "html_dependency"), `dash_vtk` = structure(list(name = "dash_vtk", -version = "0.0.6", src = list(href = NULL, +version = "0.0.7", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_vtk.min.js.map', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", diff --git a/R/vtkGeometryRepresentation.R b/R/vtkGeometryRepresentation.R index 59de34c..833f602 100644 --- a/R/vtkGeometryRepresentation.R +++ b/R/vtkGeometryRepresentation.R @@ -1,8 +1,8 @@ # AUTO GENERATED FILE - DO NOT EDIT -vtkGeometryRepresentation <- function(children=NULL, id=NULL, actor=NULL, mapper=NULL, property=NULL, colorMapPreset=NULL, colorDataRange=NULL) { +vtkGeometryRepresentation <- function(children=NULL, id=NULL, actor=NULL, mapper=NULL, property=NULL, colorMapPreset=NULL, colorDataRange=NULL, showCubeAxes=NULL, cubeAxesStyle=NULL) { - props <- list(children=children, id=id, actor=actor, mapper=mapper, property=property, colorMapPreset=colorMapPreset, colorDataRange=colorDataRange) + props <- list(children=children, id=id, actor=actor, mapper=mapper, property=property, colorMapPreset=colorMapPreset, colorDataRange=colorDataRange, showCubeAxes=showCubeAxes, cubeAxesStyle=cubeAxesStyle) if (length(props) > 0) { props <- props[!vapply(props, is.null, logical(1))] } @@ -10,7 +10,7 @@ vtkGeometryRepresentation <- function(children=NULL, id=NULL, actor=NULL, mapper props = props, type = 'GeometryRepresentation', namespace = 'dash_vtk', - propNames = c('children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange'), + propNames = c('children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange', 'showCubeAxes', 'cubeAxesStyle'), package = 'dashVtk' ) diff --git a/R/vtkView.R b/R/vtkView.R index dcee5e8..fc11ec2 100644 --- a/R/vtkView.R +++ b/R/vtkView.R @@ -1,8 +1,8 @@ # AUTO GENERATED FILE - DO NOT EDIT -vtkView <- function(children=NULL, id=NULL, style=NULL, className=NULL, background=NULL, interactorSettings=NULL, cameraPosition=NULL, cameraViewUp=NULL, cameraParallelProjection=NULL, triggerRender=NULL, triggerResetCamera=NULL) { +vtkView <- function(children=NULL, id=NULL, style=NULL, className=NULL, background=NULL, interactorSettings=NULL, cameraPosition=NULL, cameraViewUp=NULL, cameraParallelProjection=NULL, triggerRender=NULL, triggerResetCamera=NULL, pickingModes=NULL, clickInfo=NULL, hoverInfo=NULL) { - props <- list(children=children, id=id, style=style, className=className, background=background, interactorSettings=interactorSettings, cameraPosition=cameraPosition, cameraViewUp=cameraViewUp, cameraParallelProjection=cameraParallelProjection, triggerRender=triggerRender, triggerResetCamera=triggerResetCamera) + props <- list(children=children, id=id, style=style, className=className, background=background, interactorSettings=interactorSettings, cameraPosition=cameraPosition, cameraViewUp=cameraViewUp, cameraParallelProjection=cameraParallelProjection, triggerRender=triggerRender, triggerResetCamera=triggerResetCamera, pickingModes=pickingModes, clickInfo=clickInfo, hoverInfo=hoverInfo) if (length(props) > 0) { props <- props[!vapply(props, is.null, logical(1))] } @@ -10,7 +10,7 @@ vtkView <- function(children=NULL, id=NULL, style=NULL, className=NULL, backgrou props = props, type = 'View', namespace = 'dash_vtk', - propNames = c('children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera'), + propNames = c('children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera', 'pickingModes', 'clickInfo', 'hoverInfo'), package = 'dashVtk' ) diff --git a/dash_vtk/GeometryRepresentation.py b/dash_vtk/GeometryRepresentation.py index 0a2ef9f..16e1f2c 100644 --- a/dash_vtk/GeometryRepresentation.py +++ b/dash_vtk/GeometryRepresentation.py @@ -20,14 +20,17 @@ class GeometryRepresentation(Component): - mapper (dict; optional): Properties to set to the actor - property (dict; optional): Properties to set to the actor.property - colorMapPreset (string; default 'erdc_rainbow_bright'): Preset name for the lookup table color map -- colorDataRange (list of numbers; default [0, 1]): Data range use for the colorMap""" +- colorDataRange (list of numbers; default [0, 1]): Data range use for the colorMap +- showCubeAxes (boolean; optional): Show/Hide Cube Axes for the given representation +- cubeAxesStyle (dict; optional): Configure cube Axes style by overriding the set of properties defined +https://github.com/Kitware/vtk-js/blob/HEAD/Sources/Rendering/Core/CubeAxesActor/index.js#L703-L719""" @_explicitize_args - def __init__(self, children=None, id=Component.UNDEFINED, actor=Component.UNDEFINED, mapper=Component.UNDEFINED, property=Component.UNDEFINED, colorMapPreset=Component.UNDEFINED, colorDataRange=Component.UNDEFINED, **kwargs): - self._prop_names = ['children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange'] + def __init__(self, children=None, id=Component.UNDEFINED, actor=Component.UNDEFINED, mapper=Component.UNDEFINED, property=Component.UNDEFINED, colorMapPreset=Component.UNDEFINED, colorDataRange=Component.UNDEFINED, showCubeAxes=Component.UNDEFINED, cubeAxesStyle=Component.UNDEFINED, **kwargs): + self._prop_names = ['children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange', 'showCubeAxes', 'cubeAxesStyle'] self._type = 'GeometryRepresentation' self._namespace = 'dash_vtk' self._valid_wildcard_attributes = [] - self.available_properties = ['children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange'] + self.available_properties = ['children', 'id', 'actor', 'mapper', 'property', 'colorMapPreset', 'colorDataRange', 'showCubeAxes', 'cubeAxesStyle'] self.available_wildcard_properties = [] _explicit_args = kwargs.pop('_explicit_args') diff --git a/dash_vtk/View.py b/dash_vtk/View.py index 48cf31a..d64bc65 100644 --- a/dash_vtk/View.py +++ b/dash_vtk/View.py @@ -62,14 +62,21 @@ class View(Component): - cameraViewUp (list; default [0, 1, 0]): Initial camera position from an object in [0,0,0] - cameraParallelProjection (boolean; default False): Use parallel projection (default: false) - triggerRender (number; default 0): Property use to trigger a render when changing. -- triggerResetCamera (number; default 0): Property use to trigger a resetCamera when changing.""" +- triggerResetCamera (number; default 0): Property use to trigger a resetCamera when changing. +- pickingModes (list of strings; optional): List of picking listeners to bind. The supported values are `click` and `hover`. By default it is disabled (empty array). +- clickInfo (dict; optional): Read-only prop. To use this, make sure that `pickingModes` contains `click`. +This prop is updated when an element in the map is clicked. This contains +the picking info describing the object being clicked on. +- hoverInfo (dict; optional): Read-only prop. To use this, make sure that `pickingModes` contains `hover`. +This prop is updated when an element in the map is hovered. This contains +the picking info describing the object being hovered.""" @_explicitize_args - def __init__(self, children=None, id=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, background=Component.UNDEFINED, interactorSettings=Component.UNDEFINED, cameraPosition=Component.UNDEFINED, cameraViewUp=Component.UNDEFINED, cameraParallelProjection=Component.UNDEFINED, triggerRender=Component.UNDEFINED, triggerResetCamera=Component.UNDEFINED, **kwargs): - self._prop_names = ['children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera'] + def __init__(self, children=None, id=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, background=Component.UNDEFINED, interactorSettings=Component.UNDEFINED, cameraPosition=Component.UNDEFINED, cameraViewUp=Component.UNDEFINED, cameraParallelProjection=Component.UNDEFINED, triggerRender=Component.UNDEFINED, triggerResetCamera=Component.UNDEFINED, pickingModes=Component.UNDEFINED, clickInfo=Component.UNDEFINED, hoverInfo=Component.UNDEFINED, **kwargs): + self._prop_names = ['children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera', 'pickingModes', 'clickInfo', 'hoverInfo'] self._type = 'View' self._namespace = 'dash_vtk' self._valid_wildcard_attributes = [] - self.available_properties = ['children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera'] + self.available_properties = ['children', 'id', 'style', 'className', 'background', 'interactorSettings', 'cameraPosition', 'cameraViewUp', 'cameraParallelProjection', 'triggerRender', 'triggerResetCamera', 'pickingModes', 'clickInfo', 'hoverInfo'] self.available_wildcard_properties = [] _explicit_args = kwargs.pop('_explicit_args') diff --git a/dash_vtk/dash_vtk.min.js b/dash_vtk/dash_vtk.min.js index 6e24157..95a3225 100644 --- a/dash_vtk/dash_vtk.min.js +++ b/dash_vtk/dash_vtk.min.js @@ -1,6 +1,6 @@ -window.dash_vtk=function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=70)}([function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return C})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return A})),n.d(t,"e",(function(){return D})),n.d(t,"f",(function(){return G})),n.d(t,"g",(function(){return V})),n.d(t,"h",(function(){return L})),n.d(t,"i",(function(){return E})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return u})),n.d(t,"l",(function(){return I}));var r=n(14),s=n(33),a=n(8),i=n(9),Q=(n(6),n(20));function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(t);var n=[];function r(e){n[e]=null}function s(e){return Object.freeze({unsubscribe:function(){r(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++l),t.classHierarchy=["vtkObject"],e.isDeleted=function(){return!!t.deleted},e.modified=function(r){t.deleted?u("instance deleted - cannot call any method"):r&&r0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!1;return Object.keys(n).forEach((function(Q){var B=s?null:e["set".concat(b(Q))];B&&Array.isArray(n[Q])&&B.length>1?a=B.apply(void 0,Object(i.a)(n[Q]))||a:B?a=B(n[Q])||a:(-1!==["mtime"].indexOf(Q)||r||I("Warning: Set value to model directly ".concat(Q,", ").concat(n[Q])),t[Q]=n[Q],a=!0)})),a},e.get=function(){for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]&&arguments[1];if(n.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(n.getClassName()," into ").concat(e.getClassName()));var s=n.get(),a=Object.keys(t).sort(),i=Object.keys(s).sort();i.forEach((function(e){var n=a.indexOf(e);-1===n?r&&d("add ".concat(e," in shallowCopy")):a.splice(n,1),t[e]=s[e]})),a.length&&r&&d("Untouched keys: ".concat(a.join(", "))),e.modified()},e}function h(e,t,n){n.forEach((function(n){"object"===Object(s.a)(n)?e["get".concat(b(n.name))]=function(){return t[n.name]}:e["get".concat(b(n))]=function(){return t[n]}}))}var p={enum:function(e,t,n){return function(r){if("string"==typeof r){if(void 0!==n.enum[r])return t[n.name]!==n.enum[r]&&(t[n.name]=n.enum[r],e.modified(),!0);throw u("Set Enum with invalid argument ".concat(n,", ").concat(r)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof r){if(t[n.name]!==r){if(-1!==Object.keys(n.enum).map((function(e){return n.enum[e]})).indexOf(r))return t[n.name]=r,e.modified(),!0;throw u("Set Enum outside numeric range ".concat(n,", ").concat(r)),new RangeError("Set Enum outside numeric range")}return!1}throw u("Set Enum with invalid argument (String/Number) ".concat(n,", ").concat(r)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function R(e){if("object"===Object(s.a)(e)){var t=p[e.type];if(t)return function(n,r){return t(n,r,e)};throw u("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,n){return function(r){return n.deleted?(u("instance deleted - cannot call any method"),!1):n[e]!==r&&(n[e]=r,t.modified(),!0)}}}function V(e,t,n){n.forEach((function(n){"object"===Object(s.a)(n)?e["set".concat(b(n.name))]=R(n)(e,t):e["set".concat(b(n))]=R(n)(e,t)}))}function L(e,t,n){h(e,t,n),V(e,t,n)}function A(e,t,n){n.forEach((function(n){e["get".concat(b(n))]=function(){return[].concat(t[n])},e["get".concat(b(n),"ByReference")]=function(){return t[n]}}))}function N(e,t,n,r){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;n.forEach((function(n){e["set".concat(b(n))]=function(){if(t.deleted)return u("instance deleted - cannot call any method"),!1;for(var a=arguments.length,i=new Array(a),Q=0;Q4&&void 0!==arguments[4]?arguments[4]:void 0;A(e,t,n),N(e,t,n,r,s)}var f=Symbol("Event abort");function D(e,t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},r={};return e(r,n,t),Object.freeze(r)};return t&&Q.a.register(t,n),n}function v(e){return e&&e.isA&&e.isA("vtkObject")}function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},n),e.setKey=function(e,n){t.keystore[e]=n},e.getKey=function(e){return t.keystore[e]},e.getAllKeys=function(){return Object.keys(t.keystore)},e.deleteKey=function(e){return delete t.keystore[e]},e.clearKeystore=function(){return e.getAllKeys().forEach((function(e){return delete t.keystore[e]}))}}var W=1;var X={algo:function(e,t,n,r){function s(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?u("instance deleted - cannot call any method"):r>=t.numberOfInputs?u("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[r]!==n||t.inputConnection[r])&&(t.inputData[r]=n,t.inputConnection[r]=null,e.modified&&e.modified())}function a(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)u("instance deleted - cannot call any method");else{if(r>=t.numberOfInputs){var s="algorithm ".concat(e.getClassName()," only has ");return s+="".concat(t.numberOfInputs),void u(s+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[r]=null,t.inputConnection[r]=n}}function i(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(u("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[n])}if(t.inputData?t.inputData=t.inputData.map(Q.a):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(Q.a):t.inputConnection=[],t.output?t.output=t.output.map(Q.a):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(Q.a):t.inputArrayToProcess=[],t.numberOfInputs=n,e.shouldUpdate=function(){for(var n=e.getMTime(),s=r,a=1/0;s--;){if(!t.output[s])return!0;var i=t.output[s].getMTime();if(ia)return!0;return!1},t.numberOfInputs){for(var B=t.numberOfInputs;B--;)t.inputData.push(null),t.inputConnection.push(null);e.setInputData=s,e.setInputConnection=a,e.addInputData=function(e){t.deleted?u("instance deleted - cannot call any method"):(t.numberOfInputs++,s(e,t.numberOfInputs-1))},e.addInputConnection=function(e){t.deleted?u("instance deleted - cannot call any method"):(t.numberOfInputs++,a(e,t.numberOfInputs-1))},e.getInputData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]&&(t.inputData[e]=t.inputConnection[e]()),t.inputData[e]},e.getInputConnection=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]}}r&&(e.getOutputData=i,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=function(){return i(t)};return n.filter=e,n}),e.update=function(){var n=[];if(t.numberOfInputs)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:"Scalars";t.inputArrayToProcess.length1&&void 0!==arguments[1]?arguments[1]:0;if(!e.apply)return console.error("Invalid callback for event ".concat(n)),null;if(t.deleted)return u("instance deleted - cannot call any method"),null;var a=i++;return s.push([a,e,r]),s.sort((function(e,t){return t[2]-e[2]})),B(a)},e.delete=function(){a(),s.forEach((function(e){return Q(Object(r.a)(e,1)[0])}))}},EVENT_ABORT:f,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=["TB","GB","MB","KB"],s=Number(e),a="B";s>n;)s/=n,a=r.pop();return"".concat(s.toFixed(t)," ").concat(a)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=[],r=e;r>1e3;)n.push("000".concat(r%1e3).slice(-3)),r=Math.floor(r/1e3);return r>0&&n.push(r),n.reverse(),n.join(t)},get:h,getArray:A,getCurrentGlobalMTime:function(){return l},getStateArrayMapFunc:Z,isVtkObject:v,keystore:J,newInstance:D,normalizeWheel:function(e){var t=0,n=0,r=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,s=10*n,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||s)&&e.deltaMode&&(1===e.deltaMode?(r*=40,s*=40):(r*=800,s*=800)),r&&!t&&(t=r<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:s}},obj:G,proxy:function(e,t){J(e,t);var n=e.delete;t.proxyId="".concat(W++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),h(e,t,["proxyId","proxyGroup","proxyName"]),L(e,t,["proxyManager"]);var r={},s={};function i(e,t){s[t]||(s[t]=[]);for(var n=s[t],a=0;a0&&void 0!==arguments[0]?arguments[0]:"__root__";return s[e]}function B(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__root__",r=[],s=t.proxyId,a=Q(n)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var r=null,s=[],i=0,Q=!1;function B(n){var B=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Q)return null;var o=[],l=null;for(i=s.length;i--;){var F=s[i];F.instance===n?l=F:o.push(F)}if(!l)return null;var U=l.instance["get".concat(b(l.propertyName))]();if(!S(U,r)||B){for(r=U,Q=!0;o.length;){var c=o.pop();c.instance.set(Object(a.a)({},c.propertyName,r))}Q=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=U),U}function o(e,t){var n=[];for(i=s.length;i--;){var r=s[i];r.instance!==e||r.propertyName!==t&&void 0!==t||(r.subscription.unsubscribe(),n.push(i))}for(;n.length;)s.splice(n.pop(),1)}function l(n,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],Q=n.onModified(B),l=s[0];return s.push({instance:n,propertyName:r,subscription:Q}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?n.set(Object(a.a)({},r,t.propertyLinkMap[e].value)):l&&B(l.instance,!0)),{unsubscribe:function(){return o(n,r)}}}function F(){for(;s.length;)s.pop().subscription.unsubscribe()}var U={bind:l,unbind:o,unsubscribe:F,persistent:n};return t.propertyLinkMap[e]=U,U},e.listPropertyNames=function(){return B().map((function(e){return e.name}))},e.getPropertyByName=function(e){return B().find((function(t){return t.name===e}))},e.getPropertyDomainByName=function(e){return(r[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:B()}},e.delete=function(){for(var r=Object.keys(t.propertyLinkMap),s=r.length;s--;)t.propertyLinkMap[r[s]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),n()},x((function(){if(t.links)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function s(e){for(var n=Object.keys(e),r=n.length;r--;){var s=n[r];t[s].set(e[s])}}t.this=e;for(var a=Object.keys(r),i=a.length,Q=function(){var Q=a[i];t[Q]=r[Q];var B=n[Q];e["set".concat(b(Q))]=function(n){n!==t[Q]&&(t[Q]=n,s(B[n]),e.modified())}};i--;)Q();a.length&&h(e,t,a)},safeArrays:y,set:V,setArray:N,setGet:L,setGetArray:E,setImmediate:x,setLoggerFunction:function(e,t){g[e]&&(g[e]=t||c)},throttle:function(e,t){var n=!1,r=null;function s(){n=!1,null!==r&&(a.apply(void 0,Object(i.a)(r)),r=null)}function a(){for(var a=arguments.length,i=new Array(a),Q=0;Q2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(v(t)){if(s.indexOf(t)>=0)return r;s.push(t);var a=n(t);void 0!==a&&r.push(a);var i=t.get();Object.keys(i).forEach((function(t){var a=i[t];Array.isArray(a)?a.forEach((function(t){e(t,n,r,s)})):e(a,n,r,s)}))}return r},TYPED_ARRAYS:C,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:F,vtkDebugMacro:d,vtkErrorMacro:u,vtkInfoMacro:function(){g.info.apply(g,arguments)},vtkLogMacro:function(){g.log.apply(g,arguments)},vtkOnceErrorMacro:function(e){m[e]||(g.error(e),m[e]=!0)},vtkWarningMacro:I};t.b=X}).call(this,n(36))},function(e,t){e.exports=window.PropTypes},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return Q})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return o})),n.d(t,"f",(function(){return i})),n.d(t,"g",(function(){return U})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return Z})),n.d(t,"j",(function(){return a})),n.d(t,"k",(function(){return x})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return I})),n.d(t,"n",(function(){return F})),n.d(t,"o",(function(){return S})),n.d(t,"p",(function(){return B})),n.d(t,"q",(function(){return y})),n.d(t,"r",(function(){return f}));var r=n(12);function s(){var e=new r.a(3);return r.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function i(e,t,n){var s=new r.a(3);return s[0]=e,s[1]=t,s[2]=n,s}function Q(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function B(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function o(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function l(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function F(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function U(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function c(e,t){var n=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return Math.hypot(n,r,s)}function g(e,t){var n=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return n*n+r*r+s*s}function d(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function u(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function I(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function m(e,t){var n=t[0],r=t[1],s=t[2],a=n*n+r*r+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function b(e,t,n){var r=t[0],s=t[1],a=t[2],i=n[0],Q=n[1],B=n[2];return e[0]=s*B-a*Q,e[1]=a*i-r*B,e[2]=r*Q-s*i,e}function y(e,t,n){var r=t[0],s=t[1],a=t[2],i=n[3]*r+n[7]*s+n[11]*a+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*s+n[8]*a+n[12])/i,e[1]=(n[1]*r+n[5]*s+n[9]*a+n[13])/i,e[2]=(n[2]*r+n[6]*s+n[10]*a+n[14])/i,e}function S(e,t,n){var r=t[0],s=t[1],a=t[2];return e[0]=r*n[0]+s*n[3]+a*n[6],e[1]=r*n[1]+s*n[4]+a*n[7],e[2]=r*n[2]+s*n[5]+a*n[8],e}function Z(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function x(e,t){var n=e[0],s=e[1],a=e[2],i=t[0],Q=t[1],B=t[2];return Math.abs(n-i)<=r.b*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-Q)<=r.b*Math.max(1,Math.abs(s),Math.abs(Q))&&Math.abs(a-B)<=r.b*Math.max(1,Math.abs(a),Math.abs(B))}var G,h=o,p=l,R=F,V=c,L=g,A=a,N=d,E=(G=s(),function(e,t,n,r,s,a){var i,Q;for(t||(t=3),n||(n=0),Q=r?Math.min(r*t+n,e.length):e.length,i=n;i>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var n=new r(e),a=t&&t.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,a&&("object"==typeof a&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.alea=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),Q=Object(a.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,a&&("object"==typeof a&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.xor128=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),B=Object(a.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function a(e,t){var n=new r(e),a=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,a&&("object"==typeof a&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.xorwow=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),o=Object(a.d)((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.x,s=t.i;return e=r[s],n=(e^=e>>>7)^e<<24,n^=(e=r[s+1&7])^e>>>10,n^=(e=r[s+3&7])^e>>>3,n^=(e=r[s+4&7])^e<<7,e=r[s+7&7],n^=(e^=e<<13)^e<<9,r[s]=n,t.i=s+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var n=new r(e),a=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,a&&(a.x&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.xorshift7=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),l=Object(a.d)((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.w,s=t.X,a=t.i;return t.w=r=r+1640531527|0,n=s[a+34&127],e=s[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=s[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,s,a,i,Q=[],B=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,B=Math.max(B,t.length)),s=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,s=0==(n=Q[127&a]^=r+i)?s+1:0);for(s>=128&&(Q[127&(t&&t.length||0)]=-1),s=127,a=512;a>0;--a)r=Q[s+34&127],n=Q[s=s+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,Q[s]=r^n;e.w=i,e.X=Q,e.i=s}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var n=new r(e),a=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,a&&(a.X&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.xor4096=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),F=Object(a.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,s=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^s,s=s-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^s,t.a=s-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,a&&("object"==typeof a&&s(a,n),i.state=function(){return s(n,{})}),i}t&&t.exports?t.exports=a:this.tychei=a}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),U=Object.freeze({__proto__:null,default:{}}),c=Object(a.e)(U),g=Object(a.d)((function(e){!function(t,n,r){var s,a=256,i=r.pow(a,6),Q=r.pow(2,52),B=2*Q,o=255;function l(e,o,l){var c=[],u=g(function e(t,n){var r,s=[],a=typeof t;if(n&&"object"==a)for(r in t)try{s.push(e(t[r],n-1))}catch(t){}return s.length?s:"string"==a?t:t+"\0"}((o=1==o?{entropy:!0}:o||{}).entropy?[e,d(n)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(a):(e=new Uint8Array(a),(t.crypto||t.msCrypto).getRandomValues(e)),d(e)}catch(e){var r=t.navigator,i=r&&r.plugins;return[+new Date,t,i,t.screen,d(n)]}}():e,3),c),I=new F(c),m=function(){for(var e=I.g(6),t=i,n=0;e=B;)e/=2,t/=2,n>>>=1;return(e+n)/t};return m.int32=function(){return 0|I.g(4)},m.quick=function(){return I.g(4)/4294967296},m.double=m,g(d(I.S),n),(o.pass||l||function(e,t,n,s){return s&&(s.S&&U(s,I),e.state=function(){return U(I,{})}),n?(r.random=e,t):e})(m,u,"global"in o?o.global:this==r,o.state)}function F(e){var t,n=e.length,r=this,s=0,i=r.i=r.j=0,Q=r.S=[];for(n||(e=[n++]);s0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,s=-1/0,a=t,i=e.length;a0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t-e;return e+n*Math.random()}function x(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n}function G(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function h(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function p(e,t,n){var r=e[1]*t[2]-e[2]*t[1],s=e[2]*t[0]-e[0]*t[2],a=e[0]*t[1]-e[1]*t[0];return n[0]=r,n[1]=s,n[2]=a,n}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;switch(t){case 1:return Math.abs(e);case 2:return Math.sqrt(e[0]*e[0]+e[1]*e[1]);case 3:return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);default:for(var n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-6;if(!e.length===t.length)return!1;function r(e,r){return Math.abs(e-t[r])i&&(i=o);if(0===i)return d("Unable to factor linear system"),0;F[r]=1/i}for(s=0;s=i&&(i=B,l=r)}if(s!==l){for(a=0;a=0)for(a=i;a<=s-1;a++)B-=e[s][a]*n[a];else 0!==B&&(i=s);n[s]=B}for(s=r-1;s>=0;s--){for(B=n[s],a=s+1;ao?o=Q:Qo?o=B:B0?(o-l)/o:0)>0?(n=i===o?1/6*(Q-B)/(o-l):Q===o?1/3+1/6*(B-i)/(o-l):2/3+1/6*(i-Q)/(o-l))<0&&(n+=1):n=0,t[0]=n,t[1]=s,t[2]=F}function v(e,t){var n,s,a,i=Object(r.a)(e,3),Q=i[0],B=i[1],o=i[2],l=1/3,F=1/6,U=2/3;Q>F&&Q<=l?(s=1,n=(l-Q)/F,a=0):Q>l&&Q<=.5?(s=1,a=(Q-l)/F,n=0):Q>.5&&Q<=U?(a=1,s=(U-Q)/F,n=0):Q>U&&Q<=5/6?(a=1,n=(Q-U)/F,s=0):Q>5/6&&Q<=1?(n=1,a=(1-Q)/F,s=0):(n=1,s=Q/F,a=0),n=B*n+(1-B),s=B*s+(1-B),a=B*a+(1-B),n*=o,s*=o,a*=o,t[0]=n,t[1]=s,t[2]=a}function J(e,t){var n=[0,0,0];(function(e,t){var n=Object(r.a)(e,3),s=n[0],a=n[1],i=n[2];s>.04045?s=Math.pow((s+.055)/1.055,2.4):s/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,i>.04045?i=Math.pow((i+.055)/1.055,2.4):i/=12.92,t[0]=.4124*s+.3576*a+.1805*i,t[1]=.2126*s+.7152*a+.0722*i,t[2]=.0193*s+.1192*a+.9505*i})(e,n),function(e,t){var n=Object(r.a)(e,3),s=n[0]/.9505,a=n[1]/1,i=n[2]/1.089;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,t[0]=116*a-16,t[1]=500*(s-a),t[2]=200*(a-i)}(n,t)}function W(e,t){var n=[0,0,0];(function(e,t){var n=Object(r.a)(e,3),s=(n[0]+16)/116,a=n[1]/500+s,i=s-n[2]/200;s=Math.pow(s,3)>.008856?Math.pow(s,3):(s-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,i=Math.pow(i,3)>.008856?Math.pow(i,3):(i-16/116)/7.787,t[0]=.9505*a,t[1]=1*s,t[2]=1.089*i})(e,n),function(e,t){var n=Object(r.a)(e,3),s=n[0],a=n[1],i=n[2],Q=3.2406*s+-1.5372*a+-.4986*i,B=-.9689*s+1.8758*a+.0415*i,o=.0557*s+-.204*a+1.057*i;Q>.0031308?Q=1.055*Math.pow(Q,1/2.4)-.055:Q*=12.92,B>.0031308?B=1.055*Math.pow(B,1/2.4)-.055:B*=12.92,o>.0031308?o=1.055*Math.pow(o,1/2.4)-.055:o*=12.92;var l=Q;l1&&(Q/=l,B/=l,o/=l),Q<0&&(Q=0),B<0&&(B=0),o<0&&(o=0),t[0]=Q,t[1]=B,t[2]=o}(n,t)}function X(e){e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1}function H(e){return!(e[1]-e[0]<0)}function k(e,t,n){n[0]=Math.min(e[0],t[0]),n[1]=Math.max(e[0],t[0]),n[2]=Math.min(e[1],t[1]),n[3]=Math.max(e[1],t[1]),n[4]=Math.min(e[2],t[2]),n[5]=Math.max(e[2],t[2])}function T(e,t,n){return en?n:e}function M(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return r[0]=T(e[0],t[0],n[0]),r[1]=T(e[1],t[1],n[1]),r[2]=T(e[2],t[2],n[2]),r}function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}var w=function(e){return!Number.isFinite(e)},O=Number.isNaN;function z(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return I})),n.d(t,"g",(function(){return B})),n.d(t,"h",(function(){return s})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return Q})),n.d(t,"k",(function(){return x})),n.d(t,"l",(function(){return o})),n.d(t,"m",(function(){return S})),n.d(t,"n",(function(){return Z})),n.d(t,"o",(function(){return b})),n.d(t,"p",(function(){return y})),n.d(t,"q",(function(){return U})),n.d(t,"r",(function(){return F})),n.d(t,"s",(function(){return l})),n.d(t,"t",(function(){return R}));var r=n(12);function s(){var e=new r.a(16);return r.a!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function i(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Q(e,t){if(e===t){var n=t[1],r=t[2],s=t[3],a=t[6],i=t[7],Q=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=s,e[13]=i,e[14]=Q}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function B(e,t){var n=t[0],r=t[1],s=t[2],a=t[3],i=t[4],Q=t[5],B=t[6],o=t[7],l=t[8],F=t[9],U=t[10],c=t[11],g=t[12],d=t[13],u=t[14],I=t[15],m=n*Q-r*i,C=n*B-s*i,b=n*o-a*i,y=r*B-s*Q,S=r*o-a*Q,Z=s*o-a*B,x=l*d-F*g,G=l*u-U*g,h=l*I-c*g,p=F*u-U*d,R=F*I-c*d,V=U*I-c*u,L=m*V-C*R+b*p+y*h-S*G+Z*x;return L?(L=1/L,e[0]=(Q*V-B*R+o*p)*L,e[1]=(s*R-r*V-a*p)*L,e[2]=(d*Z-u*S+I*y)*L,e[3]=(U*S-F*Z-c*y)*L,e[4]=(B*h-i*V-o*G)*L,e[5]=(n*V-s*h+a*G)*L,e[6]=(u*b-g*Z-I*C)*L,e[7]=(l*Z-U*b+c*C)*L,e[8]=(i*R-Q*h+o*x)*L,e[9]=(r*h-n*R-a*x)*L,e[10]=(g*S-d*b+I*m)*L,e[11]=(F*b-l*S-c*m)*L,e[12]=(Q*G-i*p-B*x)*L,e[13]=(n*p-r*G+s*x)*L,e[14]=(d*C-g*y-u*m)*L,e[15]=(l*y-F*C+U*m)*L,e):null}function o(e,t,n){var r=t[0],s=t[1],a=t[2],i=t[3],Q=t[4],B=t[5],o=t[6],l=t[7],F=t[8],U=t[9],c=t[10],g=t[11],d=t[12],u=t[13],I=t[14],m=t[15],C=n[0],b=n[1],y=n[2],S=n[3];return e[0]=C*r+b*Q+y*F+S*d,e[1]=C*s+b*B+y*U+S*u,e[2]=C*a+b*o+y*c+S*I,e[3]=C*i+b*l+y*g+S*m,C=n[4],b=n[5],y=n[6],S=n[7],e[4]=C*r+b*Q+y*F+S*d,e[5]=C*s+b*B+y*U+S*u,e[6]=C*a+b*o+y*c+S*I,e[7]=C*i+b*l+y*g+S*m,C=n[8],b=n[9],y=n[10],S=n[11],e[8]=C*r+b*Q+y*F+S*d,e[9]=C*s+b*B+y*U+S*u,e[10]=C*a+b*o+y*c+S*I,e[11]=C*i+b*l+y*g+S*m,C=n[12],b=n[13],y=n[14],S=n[15],e[12]=C*r+b*Q+y*F+S*d,e[13]=C*s+b*B+y*U+S*u,e[14]=C*a+b*o+y*c+S*I,e[15]=C*i+b*l+y*g+S*m,e}function l(e,t,n){var r,s,a,i,Q,B,o,l,F,U,c,g,d=n[0],u=n[1],I=n[2];return t===e?(e[12]=t[0]*d+t[4]*u+t[8]*I+t[12],e[13]=t[1]*d+t[5]*u+t[9]*I+t[13],e[14]=t[2]*d+t[6]*u+t[10]*I+t[14],e[15]=t[3]*d+t[7]*u+t[11]*I+t[15]):(r=t[0],s=t[1],a=t[2],i=t[3],Q=t[4],B=t[5],o=t[6],l=t[7],F=t[8],U=t[9],c=t[10],g=t[11],e[0]=r,e[1]=s,e[2]=a,e[3]=i,e[4]=Q,e[5]=B,e[6]=o,e[7]=l,e[8]=F,e[9]=U,e[10]=c,e[11]=g,e[12]=r*d+Q*u+F*I+t[12],e[13]=s*d+B*u+U*I+t[13],e[14]=a*d+o*u+c*I+t[14],e[15]=i*d+l*u+g*I+t[15]),e}function F(e,t,n){var r=n[0],s=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function U(e,t,n,s){var a,i,Q,B,o,l,F,U,c,g,d,u,I,m,C,b,y,S,Z,x,G,h,p,R,V=s[0],L=s[1],A=s[2],N=Math.hypot(V,L,A);return N0?(I=2*Math.sqrt(u+1),e[3]=.25*I,e[0]=(U-g)/I,e[1]=(c-o)/I,e[2]=(B-l)/I):Q>F&&Q>d?(I=2*Math.sqrt(1+Q-F-d),e[3]=(U-g)/I,e[0]=.25*I,e[1]=(B+l)/I,e[2]=(c+o)/I):F>d?(I=2*Math.sqrt(1+F-Q-d),e[3]=(c-o)/I,e[0]=(B+l)/I,e[1]=.25*I,e[2]=(U+g)/I):(I=2*Math.sqrt(1+d-Q-F),e[3]=(B-l)/I,e[0]=(c+o)/I,e[1]=(U+g)/I,e[2]=.25*I),e}function y(e,t,n,r){var s=t[0],a=t[1],i=t[2],Q=t[3],B=s+s,o=a+a,l=i+i,F=s*B,U=s*o,c=s*l,g=a*o,d=a*l,u=i*l,I=Q*B,m=Q*o,C=Q*l,b=r[0],y=r[1],S=r[2];return e[0]=(1-(g+u))*b,e[1]=(U+C)*b,e[2]=(c-m)*b,e[3]=0,e[4]=(U-C)*y,e[5]=(1-(F+u))*y,e[6]=(d+I)*y,e[7]=0,e[8]=(c+m)*S,e[9]=(d-I)*S,e[10]=(1-(F+g))*S,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function S(e,t){var n=t[0],r=t[1],s=t[2],a=t[3],i=n+n,Q=r+r,B=s+s,o=n*i,l=r*i,F=r*Q,U=s*i,c=s*Q,g=s*B,d=a*i,u=a*Q,I=a*B;return e[0]=1-F-g,e[1]=l+I,e[2]=U-u,e[3]=0,e[4]=l-I,e[5]=1-o-g,e[6]=c+d,e[7]=0,e[8]=U+u,e[9]=c-d,e[10]=1-o-F,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Z(e,t,n,r,s,a,i){var Q=1/(t-n),B=1/(r-s),o=1/(a-i);return e[0]=-2*Q,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*B,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*o,e[11]=0,e[12]=(t+n)*Q,e[13]=(s+r)*B,e[14]=(i+a)*o,e[15]=1,e}function x(e,t,n,s){var a,Q,B,o,l,F,U,c,g,d,u=t[0],I=t[1],m=t[2],C=s[0],b=s[1],y=s[2],S=n[0],Z=n[1],x=n[2];return Math.abs(u-S)0?(n[0]=2*(B*Q+F*s+o*i-l*a)/U,n[1]=2*(o*Q+F*a+l*s-B*i)/U,n[2]=2*(l*Q+F*i+B*a-o*s)/U):(n[0]=2*(B*Q+F*s+o*i-l*a),n[1]=2*(o*Q+F*a+l*s-B*i),n[2]=2*(l*Q+F*i+B*a-o*s)),m(e,t,n),e},getTranslation:function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},getScaling:C,getRotation:b,fromRotationTranslationScale:y,fromRotationTranslationScaleOrigin:function(e,t,n,r,s){var a=t[0],i=t[1],Q=t[2],B=t[3],o=a+a,l=i+i,F=Q+Q,U=a*o,c=a*l,g=a*F,d=i*l,u=i*F,I=Q*F,m=B*o,C=B*l,b=B*F,y=r[0],S=r[1],Z=r[2],x=s[0],G=s[1],h=s[2],p=(1-(d+I))*y,R=(c+b)*y,V=(g-C)*y,L=(c-b)*S,A=(1-(U+I))*S,N=(u+m)*S,E=(g+C)*Z,f=(u-m)*Z,D=(1-(U+d))*Z;return e[0]=p,e[1]=R,e[2]=V,e[3]=0,e[4]=L,e[5]=A,e[6]=N,e[7]=0,e[8]=E,e[9]=f,e[10]=D,e[11]=0,e[12]=n[0]+x-(p*x+L*G+E*h),e[13]=n[1]+G-(R*x+A*G+f*h),e[14]=n[2]+h-(V*x+N*G+D*h),e[15]=1,e},fromQuat:S,frustum:function(e,t,n,r,s,a,i){var Q=1/(n-t),B=1/(s-r),o=1/(a-i);return e[0]=2*a*Q,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*B,e[6]=0,e[7]=0,e[8]=(n+t)*Q,e[9]=(s+r)*B,e[10]=(i+a)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*a*2*o,e[15]=0,e},perspective:function(e,t,n,r,s){var a,i=1/Math.tan(t/2);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=s&&s!==1/0?(a=1/(r-s),e[10]=(s+r)*a,e[14]=2*s*r*a):(e[10]=-1,e[14]=-2*r),e},perspectiveFromFieldOfView:function(e,t,n,r){var s=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),Q=Math.tan(t.rightDegrees*Math.PI/180),B=2/(i+Q),o=2/(s+a);return e[0]=B,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=-(i-Q)*B*.5,e[9]=(s-a)*o*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e},ortho:Z,lookAt:x,targetTo:function(e,t,n,r){var s=t[0],a=t[1],i=t[2],Q=r[0],B=r[1],o=r[2],l=s-n[0],F=a-n[1],U=i-n[2],c=l*l+F*F+U*U;c>0&&(l*=c=1/Math.sqrt(c),F*=c,U*=c);var g=B*U-o*F,d=o*l-Q*U,u=Q*F-B*l;return(c=g*g+d*d+u*u)>0&&(g*=c=1/Math.sqrt(c),d*=c,u*=c),e[0]=g,e[1]=d,e[2]=u,e[3]=0,e[4]=F*u-U*d,e[5]=U*g-l*u,e[6]=l*d-F*g,e[7]=0,e[8]=l,e[9]=F,e[10]=U,e[11]=0,e[12]=s,e[13]=a,e[14]=i,e[15]=1,e},str:function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},frob:function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},subtract:G,multiplyScalar:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},multiplyScalarAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},equals:function(e,t){var n=e[0],s=e[1],a=e[2],i=e[3],Q=e[4],B=e[5],o=e[6],l=e[7],F=e[8],U=e[9],c=e[10],g=e[11],d=e[12],u=e[13],I=e[14],m=e[15],C=t[0],b=t[1],y=t[2],S=t[3],Z=t[4],x=t[5],G=t[6],h=t[7],p=t[8],R=t[9],V=t[10],L=t[11],A=t[12],N=t[13],E=t[14],f=t[15];return Math.abs(n-C)<=r.b*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(s-b)<=r.b*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-y)<=r.b*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(i-S)<=r.b*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(Q-Z)<=r.b*Math.max(1,Math.abs(Q),Math.abs(Z))&&Math.abs(B-x)<=r.b*Math.max(1,Math.abs(B),Math.abs(x))&&Math.abs(o-G)<=r.b*Math.max(1,Math.abs(o),Math.abs(G))&&Math.abs(l-h)<=r.b*Math.max(1,Math.abs(l),Math.abs(h))&&Math.abs(F-p)<=r.b*Math.max(1,Math.abs(F),Math.abs(p))&&Math.abs(U-R)<=r.b*Math.max(1,Math.abs(U),Math.abs(R))&&Math.abs(c-V)<=r.b*Math.max(1,Math.abs(c),Math.abs(V))&&Math.abs(g-L)<=r.b*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(d-A)<=r.b*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(u-N)<=r.b*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(I-E)<=r.b*Math.max(1,Math.abs(I),Math.abs(E))&&Math.abs(m-f)<=r.b*Math.max(1,Math.abs(m),Math.abs(f))},mul:h,sub:p})},function(e,t){e.exports=window.React},function(e,t,n){"use strict";(function(e){var t=n(10),r=n(29),s=n(48),a=n(50);Object(t.c)("/$$rollup_base$$/node_modules/readable-stream/lib/_stream_duplex.js",(function(t,n){var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=U;var Q=s.a,B=a.a;Object(r.a)(U,Q);for(var o=i(B.prototype),l=0;l1;)try{return o.stringifyByChunk(e,r,n)}catch(e){n=Math.floor(n/2)}return o.stringifyByChar(e)}function F(e,t){for(var n=0;n",exports:{},parent:void 0,filename:null,loaded:!1,children:[],paths:[]},F=["",".js",".json"];function U(e){const t=(e=e.replace(/\\/g,"/")).split("/"),n=""===t[0];for(let e=1;e0&&".."!==t[e-1]&&"."!==t[e-1]&&(t.splice(--e,2),e--);return e=t.join("/"),n&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}function c(){if(0===arguments.length)return".";let e;for(let t=0;t0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":e}function g(e){if(0===e.length)return".";let t=e.length-1;for(;t>0;){const n=e.charCodeAt(t);if((47===n||92===n)&&t!==e.length-1)break;t--}return t>0?e.substr(0,t):47===e.chartCodeAt(0)||92===e.chartCodeAt(0)?e.charAt(0):"."}function d(e,t){const s=function(e){let t=e[0];if("/"===t||"\\"===t)return!1;let n=e[1],r=e[2];return!(!("."!==t||n&&"/"!==n&&"\\"!==n)||!("."!==t||"."!==n||r&&"/"!==r&&"\\"!==r))&&(":"!==n||"/"!==r&&"\\"!==r)}(e);let a;for(e=U(e);;){a=s?U(t?t+"/node_modules/"+e:c("node_modules",e)):t?U(t+"/"+e):e;for(let e=0;es&&(e=s),t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=F(),s=e.length,a=0;if(t<0&&n>1){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=e||[];n.length<=t;)n.push(null);return n}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}var d={computeRange:U,createRangeHelper:F,getDataType:g,getMaxNorm:function(e){for(var t=e.getNumberOfComponents(),n=0,r=0;rn&&(n=s)}return n}};function u(e,t){function n(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+n]},e.setComponent=function(e,r,s){s!==t.values[e*t.numberOfComponents+r]&&(t.values[e*t.numberOfComponents+r]=s,n())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=e<0?t.numberOfComponents:e,r=null;return t.ranges||(t.ranges=c(t.ranges,t.numberOfComponents)),(r=t.ranges[n])?(t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple):(r=U(t.values,e,t.numberOfComponents),t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple)},e.setRange=function(e,n){t.ranges||(t.ranges=c(t.ranges,t.numberOfComponents));var r={min:e.min,max:e.max};return t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple},e.setTuple=function(e,n){for(var r=e*t.numberOfComponents,s=0;s1&&void 0!==arguments[1]?arguments[1]:l,r=t.numberOfComponents||1;n.length!==r&&(n.length=r);var s=e*r;if(1===r)n[0]=t.values[s];else if(2===r)n[0]=t.values[s],n[1]=t.values[s+1];else if(3===r)n[0]=t.values[s],n[1]=t.values[s+1],n[2]=t.values[s+2];else if(4===r)n[0]=t.values[s],n[1]=t.values[s+1],n[2]=t.values[s+2],n[3]=t.values[s+3];else for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:1;return e*t.numberOfComponents},e.getNumberOfComponents=function(){return t.numberOfComponents},e.getNumberOfValues=function(){return t.values.length},e.getNumberOfTuples=function(){return t.values.length/t.numberOfComponents},e.getDataType=function(){return t.dataType},e.newClone=function(){return C({empty:!0,name:t.name,dataType:t.dataType,numberOfComponents:t.numberOfComponents})},e.getName=function(){return t.name||(e.modified(),t.name="vtkDataArray".concat(e.getMTime())),t.name},e.setData=function(e,r){t.values=e,t.size=e.length,t.dataType=g(e),r&&(t.numberOfComponents=r),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),n()},e.getState=function(){var n=B(B({},t),{},{vtkClass:e.getClassName()});n.values=Array.from(n.values),delete n.buffer,Object.keys(n).forEach((function(e){n[e]||delete n[e]}));var r={};return Object.keys(n).sort().forEach((function(e){r[e]=n[e]})),r.mtime&&delete r.mtime,r}}var I={name:"",numberOfComponents:1,size:0,dataType:o,rangeTuple:[0,0]};function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,I,n),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");t.values?Array.isArray(t.values)&&(t.values=window[t.dataType].from(t.values)):t.values=new window[t.dataType](t.size),t.values&&(t.size=t.values.length,t.dataType=g(t.values)),Object(s.f)(e,t),Object(s.g)(e,t,["name","numberOfComponents"]),u(e,t)}var C=Object(s.e)(m,"vtkDataArray"),b=B(B({newInstance:C,extend:m},d),a.c);t.a=b},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return Q}));var r=1e-6,s="undefined"!=typeof Float32Array?Float32Array:Array,a=Math.random,i=Math.PI/180;function Q(e){return e*i}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)})},function(e,t,n){"use strict";function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.d(t,"a",(function(){return s})),r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}};var s=r},function(e,t,n){"use strict";var r=function(e){if(Array.isArray(e))return e},s=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,s=!1,a=void 0;try{for(var i,Q=e[Symbol.iterator]();!(r=(i=Q.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{r||null==Q.return||Q.return()}finally{if(s)throw a}}return n}},a=n(47),i=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};t.a=function(e,t){return r(e)||s(e,t)||Object(a.a)(e,t)||i()}},function(e,t,n){"use strict";var r=n(8),s=(n(6),n(20)),a=n(0),i=n(46),Q=n(9),B=n(3),o=n(30);function l(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n){t.pointsIds=n;var r=t.points.getData();r.length!==3*t.pointsIds.length&&(r=new(window[e.getDataType()])(3*t.pointsIds.length));var s=e.getData();t.pointsIds.forEach((function(e,t){var n=3*e,a=3*t;r[a]=s[n],r[++a]=s[++n],r[++a]=s[++n]})),t.points.setData(r)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var a=e.getNumberOfPoints()-1;a>=0;--a)t.pointsIds[a]=a}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),n=[];if(e){t.points.getPoint(0,n),t.bounds[0]=n[0],t.bounds[1]=n[0],t.bounds[2]=n[1],t.bounds[3]=n[1],t.bounds[4]=n[2],t.bounds[5]=n[2];for(var r=1;rt.bounds[1]?n[0]:t.bounds[1],t.bounds[2]=n[1]t.bounds[3]?n[1]:t.bounds[3],t.bounds[4]=n[2]t.bounds[5]?n[2]:t.bounds[5]}else Object(B.b)(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var n=0,r=0,s=0;s<3;s++)n+=(r=t.bounds[2*s+1]-t.bounds[2*s])*r;return n},e.getParametricDistance=function(e){for(var t,n=0,r=0;r<3;r++)(t=e[r]<0?-e[r]:e[r]>1?e[r]-1:0)>n&&(n=t);return n},e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.deepCopy=function(e){e.initialize(t.points,t.pointsIds)},e.getCellDimension=function(){},e.intersectWithLine=function(e,t,n,r,s,a,i){},e.evaluatePosition=function(e,t,n,r,s,a){}}var F={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,F,n),a.b.obj(e,t),t.points||(t.points=o.a.newInstance()),a.b.get(e,t,["points","pointsIds"]),l(e,t)}var c={newInstance:a.b.newInstance(U,"vtkCell"),extend:U};function g(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(n){var r=n.getPoints().getNumberOfPoints(),s=n.getNumberOfCells(),a=new Uint32Array(r);if(n.isA("vtkPolyData")){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1e3;t.array=Array(e).fill().map((function(){return{ncells:0,cells:null}})),t.extend=n,t.maxId=-1},e.initialize=function(){t.array=null},e.getLink=function(e){return t.array[e]},e.getNcells=function(e){return t.array[e].ncells},e.getCells=function(e){return t.array[e].cells},e.insertNextPoint=function(e){t.array.push({ncells:e,cells:Array(e)}),++t.maxId},e.insertNextCellReference=function(e,n){t.array[e].cells[t.array[e].ncells++]=n},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,n){t.array[n].cells=t.array[n].cells.filter((function(t){return t!==e})),t.array[n].ncells=t.array[n].cells.length},e.addCellReference=function(e,n){t.array[n].cells[t.array[n].ncells++]=e},e.resizeCellList=function(e,n){t.array[e].cells.length=n},e.squeeze=function(){!function(e,t){var n=t;for(t>=e.array.length&&(n+=e.array.length);n>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=n}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=Object(Q.a)(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),a.b.obj(e,t),g(e,t)}var I={newInstance:a.b.newInstance(u,"vtkCellLinks"),extend:u},m=0,C=1,b=2,y=3,S=4,Z=5,x=6,G=7,h=9,p=21,R=41,V=42,L=["vtkEmptyCell","vtkVertex","vtkPolyVertex","vtkLine","vtkPolyLine","vtkTriangle","vtkTriangleStrip","vtkPolygon","vtkPixel","vtkQuad","vtkTetra","vtkVoxel","vtkHexahedron","vtkWedge","vtkPyramid","vtkPentagonalPrism","vtkHexagonalPrism","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkQuadraticEdge","vtkQuadraticTriangle","vtkQuadraticQuad","vtkQuadraticTetra","vtkQuadraticHexahedron","vtkQuadraticWedge","vtkQuadraticPyramid","vtkBiQuadraticQuad","vtkTriQuadraticHexahedron","vtkQuadraticLinearQuad","vtkQuadraticLinearWedge","vtkBiQuadraticQuadraticWedge","vtkBiQuadraticQuadraticHexahedron","vtkBiQuadraticTriangle","vtkCubicLine","vtkQuadraticPolygon","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkConvexPointSet","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkParametricCurve","vtkParametricSurface","vtkParametricTriSurface","vtkParametricQuadSurface","vtkParametricTetraRegion","vtkParametricHexRegion","UnknownClass","UnknownClass","UnknownClass","vtkHigherOrderEdge","vtkHigherOrderTriangle","vtkHigherOrderQuad","vtkHigherOrderPolygon","vtkHigherOrderTetrahedron","vtkHigherOrderWedge","vtkHigherOrderPyramid","vtkHigherOrderHexahedron"];function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var N={getClassNameFromTypeId:function(e){return e0&&void 0!==arguments[0]?arguments[0]:512,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=n>0?n:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=function(e,n,r){t.typeArray[e]=n,t.locationArray[e]=r,e>t.maxId&&(t.maxId=e)},e.insertNextCell=function(n,r){return e.insertCell(++t.maxId,n,r),t.maxId},e.setCellTypes=function(e,n,r){t.size=e,t.typeArray=n,t.locationArray=r,t.maxId=e-1},e.getCellLocation=function(e){return t.locationArray[e]},e.deleteCell=function(e){t.typeArray[e]=m},e.getNumberOfTypes=function(){return t.maxId+1},e.isType=function(t){for(var n=e.getNumberOfTypes(),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,f,n),a.b.obj(e,t),a.b.get(e,t,["size","maxId","extend"]),a.b.getArray(e,t,["typeArray","locationArray"]),E(e,t)}var v=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,a={t:Number.MIN_VALUE,distance:0},i=[];i[0]=n[0]-t[0],i[1]=n[1]-t[1],i[2]=n[2]-t[2];var Q=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),o=Object(B.p)(i,i),l=1e-5*Q;return 0!==o&&(a.t=Q/o),l<0&&(l=-l),-l1?r=n:(r=i,i[0]=t[0]+a.t*i[0],i[1]=t[1]+a.t*i[1],i[2]=t[2]+a.t*i[2]),s&&(s[0]=r[0],s[1]=r[1],s[2]=r[2]),a.distance=Object(B.r)(r,e),a}function T(e,t,n,r,s,a){var i=[],Q=[],o=[];s[0]=0,a[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],Q[0]=r[0]-n[0],Q[1]=r[1]-n[1],Q[2]=r[2]-n[2],o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2];var l=[];l[0]=[Object(B.p)(i,i),-Object(B.p)(i,Q)],l[1]=[l[0][1],Object(B.p)(Q,Q)];var F=[];if(F[0]=Object(B.p)(i,o),F[1]=-Object(B.p)(Q,o),0===Object(B.B)(l,F,2)){for(var U,c=Number.MAX_VALUE,g=[e,t,n,r],d=[n,n,e,e],u=[r,r,t,t],I=[a[0],a[0],s[0],s[0]],m=[s[0],s[0],a[0],a[0]],C=0;C<4;C++)(U=k(g[C],d[C],u[C])).distance=0&&s[0]<=1&&a[0]>=0&&a[0]<=1?H.YES_INTERSECTION:H.NO_INTERSECTION}var M={distanceToLine:k,intersection:T};function Y(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,n,r,s,a){var i={intersect:0,t:Number.MIN_VALUE,subId:0};a[1]=0,a[2]=0;var Q=[],o=[],l=[];t.points.getPoint(0,o),t.points.getPoint(1,l);var F=[],U=[],c=T(e,n,o,l,F,U);if(i.t=F[0],a[0]=U[0],c===H.YES_INTERSECTION){for(var g=0;g<3;g++)s[g]=o[g]+a[0]*(l[g]-o[g]),Q[g]=e[g]+i.t*(n[g]-e[g]);if(Object(B.r)(s,Q)<=r*r)return i.intersect=1,i}else{var d;if(i.t<0)return i.t=0,d=k(e,o,l,s),a[0]=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(i.t>1)return i.t=1,d=k(n,o,l,s),a[0]=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(a[0]<0)return a[0]=0,d=k(o,e,n,s),i.t=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(a[1]>1)return a[1]=1,d=k(l,e,n,s),i.t=d.t,d.distance<=r*r?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,n,r,s,a){}}var w={};function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,w,n),c.extend(e,t,n),Y(e,t)}var z=X(X({newInstance:a.b.newInstance(O,"vtkLine"),extend:O},M),J),P=n(32);function K(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=Object(s.a)(t.points):t.points=o.a.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),t.points=o.a.newInstance(),t.points.shallowCopy(e.getPoints())}}var j={};function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,j,n),P.a.extend(e,t,n),a.b.setGet(e,t,["points"]),K(e,t)}var q={newInstance:a.b.newInstance(_,"vtkPointSet"),extend:_},$=n(37);function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e,t,n,r){var s=n[0]-t[0],a=n[1]-t[1],i=n[2]-t[2],Q=e[0]-t[0],B=e[1]-t[1],o=e[2]-t[2];r[0]=a*o-i*B,r[1]=i*Q-s*o,r[2]=s*B-a*Q}function ne(e,t,n,r){te(e,t,n,r);var s=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);0!==s&&(r[0]/=s,r[1]/=s,r[2]/=s)}var re={computeNormalDirection:te,computeNormal:ne};function se(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(n,r,s,a,i){var Q={subId:0,t:0,intersect:-1};i[2]=0;var o=s*s,l=[],F=[],U=[];t.points.getPoint(0,l),t.points.getPoint(1,F),t.points.getPoint(2,U);var c=[];if(ne(l,F,U,c),0!==c[0]||0!==c[1]||0!==c[2]){var g=$.a.intersectWithLine(n,r,l,c);if(Q.t=g.t,a[0]=g.x[0],a[1]=g.x[1],a[2]=g.x[2],!g.intersection)return i[0]=0,i[1]=0,Q.intersect=0,Q;var d=e.evaluatePosition(a,[],i,[]);if(d.evaluation>=0)return d.dist2<=o?(Q.intersect=1,Q):(Q.intersect=d.evaluation,Q)}var u=Object(B.r)(l,F),I=Object(B.r)(F,U),m=Object(B.r)(U,l);if(t.line||(t.line=z.newInstance()),u>I&&u>m?(t.line.getPoints().setPoint(0,l),t.line.getPoints().setPoint(1,F)):I>m&&I>u?(t.line.getPoints().setPoint(0,F),t.line.getPoints().setPoint(1,U)):(t.line.getPoints().setPoint(0,U),t.line.getPoints().setPoint(1,l)),t.line.intersectWithLine(n,r,s,a,i).intersect){for(var C=[],b=[],y=[],S=0;S<3;S++)C[S]=l[S]-U[S],b[S]=F[S]-U[S],y[S]=a[S]-U[S];return i[0]=Object(B.p)(y,C)/m,i[1]=Object(B.p)(y,b)/I,Q.evaluation=1,Q}return i[0]=0,i[1]=0,Q.evaluation=0,Q},e.evaluatePosition=function(e,n,r,s){var a,i,Q,o,l,F,U,c={subId:0,dist2:0,evaluation:-1},g=[],d=[],u=[],I=[],m=[],C=[],b=[],y=0,S=[],Z=[],x=[],G=[],h=[];c.subId=0,r[2]=0,t.points.getPoint(1,g),t.points.getPoint(2,d),t.points.getPoint(0,u),te(g,d,u,I),$.a.generalizedProjectPoint(e,g,I,h);var p=0;for(a=0;a<3;a++)(Q=I[a]<0?-I[a]:I[a])>p&&(p=Q,y=a);for(i=0,a=0;a<3;a++)a!==y&&(S[i++]=a);for(a=0;a<2;a++)m[a]=h[S[a]]-u[S[a]],C[a]=g[S[a]]-u[S[a]],b[a]=d[S[a]]-u[S[a]];if(0===(o=Object(B.y)(C,b)))return r[0]=0,r[1]=0,c.evaluation=-1,c;if(r[0]=Object(B.y)(m,b)/o,r[1]=Object(B.y)(C,m)/o,s[0]=1-(r[0]+r[1]),s[1]=r[0],s[2]=r[1],s[0]>=0&&s[0]<=1&&s[1]>=0&&s[1]<=1&&s[2]>=0&&s[2]<=1)n&&(c.dist2=Object(B.r)(h,e),n[0]=h[0],n[1]=h[1],n[2]=h[2]),c.evaluation=1;else{var R;if(n)if(s[1]<0&&s[2]<0)for(l=Object(B.r)(e,u),F=z.distanceToLine(e,g,u,R,x),U=z.distanceToLine(e,u,d,R,G),l1?r[s]-1:0)>n&&(n=t);return n}}var ae={};function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ae,n),c.extend(e,t,n),se(e,t)}var Qe,Be=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];n(e,r),oe.forEach((function(n){t[n]=i.a.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))}))},e.buildCells=function(){var n=e.getNumberOfVerts(),r=e.getNumberOfLines(),s=e.getNumberOfPolys(),a=e.getNumberOfStrips(),i=n+r+s+a,Q=new Uint8Array(i),B=Q,o=new Uint32Array(i),l=o;if(n){var F=0;t.verts.getCellSizes().forEach((function(e,t){l[t]=F,B[t]=e>1?b:C,F+=e+1})),l=l.subarray(n),B=B.subarray(n)}if(r){var U=0;t.lines.getCellSizes().forEach((function(e,t){l[t]=U,B[t]=e>2?S:y,1===e&&le("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),U+=e+1})),l=l.subarray(r),B=B.subarray(r)}if(s){var c=0;t.polys.getCellSizes().forEach((function(e,t){switch(l[t]=c,e){case 3:B[t]=Z;break;case 4:B[t]=h;break;default:B[t]=G}e<3&&le("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),c+=e+1})),l+=l.subarray(s),B+=B.subarray(s)}if(a){var g=0;B.fill(x,0,a),t.strips.getCellSizes().forEach((function(e,t){l[t]=g,g+=e+1}))}t.cells=v.newInstance(),t.cells.setCellTypes(i,Q,o)},e.buildLinks=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=I.newInstance(),n>0?t.links.allocate(n):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var n=t.cells.getCellType(e),r=null;switch(n){case C:case b:r=t.verts;break;case y:case S:r=t.lines;break;case Z:case h:case G:r=t.polys;break;case x:r=t.strips;break;default:return r=null,{type:0,cellPointIds:null}}var s=t.cells.getCellLocation(e);return{cellType:n,cellPointIds:r.getCell(s)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,n,r){var s=t.links.getLink(n),a=t.links.getLink(r);return s.cells.filter((function(t){return t!==e&&-1!==a.cells.indexOf(t)}))},e.getCell=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.getCellPoints(t),s=n||Fe[r.cellType].newInstance();return s.initialize(e.getPoints(),r.cellPointIds),s}}var ce={};function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ce,n),q.extend(e,t,n),a.b.get(e,t,["cells","links"]),a.b.setGet(e,t,["verts","lines","polys","strips"]),Ue(e,t)}var de={newInstance:a.b.newInstance(ge,"vtkPolyData"),extend:ge};t.a=de},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));n(6);var r={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},s={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},a={DefaultDataType:s.FLOAT,DataTypeByteSize:r,VtkDataTypes:s};t.c=a},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(10),s=n(53),a=Object(r.d)((function(t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==e,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=0===new Blob([r],{type:"application/zip"}).size}catch(t){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(r),n.blob=0===a.getBlob("application/zip").size}catch(t){n.blob=!1}}}try{n.nodestream=!!s.a.Readable}catch(t){n.nodestream=!1}}),"/$$rollup_base$$/node_modules/jszip/lib")}).call(this,n(54).Buffer)},function(e,t,n){"use strict";t.a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(t);var n=[];function r(e){n[e]=null}function a(e){return Object.freeze({unsubscribe:function(){r(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++Q),t.classHierarchy=["vtkObject"],e.isDeleted=function(){return!!t.deleted},e.modified=function(r){t.deleted?u("instance deleted - cannot call any method"):r&&r0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=!1;return Object.keys(n).forEach((function(o){var l=a?null:e["set".concat(b(o))];l&&Array.isArray(n[o])&&l.length>1?s=l.apply(void 0,Object(i.a)(n[o]))||s:l?s=l(n[o])||s:(-1!==["mtime"].indexOf(o)||r||I("Warning: Set value to model directly ".concat(o,", ").concat(n[o])),t[o]=n[o],s=!0)})),s},e.get=function(){for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]&&arguments[1];if(n.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(n.getClassName()," into ").concat(e.getClassName()));var a=n.get(),s=Object.keys(t).sort(),i=Object.keys(a).sort();i.forEach((function(e){var n=s.indexOf(e);-1===n?r&&d("add ".concat(e," in shallowCopy")):s.splice(n,1),t[e]=a[e]})),s.length&&r&&d("Untouched keys: ".concat(s.join(", "))),e.modified()},e}function p(e,t,n){n.forEach((function(n){"object"===Object(a.a)(n)?e["get".concat(b(n.name))]=function(){return t[n.name]}:e["get".concat(b(n))]=function(){return t[n]}}))}var G={enum:function(e,t,n){return function(r){if("string"==typeof r){if(void 0!==n.enum[r])return t[n.name]!==n.enum[r]&&(t[n.name]=n.enum[r],e.modified(),!0);throw u("Set Enum with invalid argument ".concat(n,", ").concat(r)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof r){if(t[n.name]!==r){if(-1!==Object.keys(n.enum).map((function(e){return n.enum[e]})).indexOf(r))return t[n.name]=r,e.modified(),!0;throw u("Set Enum outside numeric range ".concat(n,", ").concat(r)),new RangeError("Set Enum outside numeric range")}return!1}throw u("Set Enum with invalid argument (String/Number) ".concat(n,", ").concat(r)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function R(e){if("object"===Object(a.a)(e)){var t=G[e.type];if(t)return function(n,r){return t(n,r,e)};throw u("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,n){return function(r){return n.deleted?(u("instance deleted - cannot call any method"),!1):n[e]!==r&&(n[e]=r,t.modified(),!0)}}}function L(e,t,n){n.forEach((function(n){"object"===Object(a.a)(n)?e["set".concat(b(n.name))]=R(n)(e,t):e["set".concat(b(n))]=R(n)(e,t)}))}function V(e,t,n){p(e,t,n),L(e,t,n)}function A(e,t,n){n.forEach((function(n){e["get".concat(b(n))]=function(){return[].concat(t[n])},e["get".concat(b(n),"ByReference")]=function(){return t[n]}}))}function f(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;n.forEach((function(n){e["set".concat(b(n))]=function(){if(t.deleted)return u("instance deleted - cannot call any method"),!1;for(var s=arguments.length,i=new Array(s),o=0;o4&&void 0!==arguments[4]?arguments[4]:void 0;A(e,t,n),f(e,t,n,r,a)}var E=Symbol("Event abort");function D(e,t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},r={};return e(r,n,t),Object.freeze(r)};return t&&o.a.register(t,n),n}function v(e){return e&&e.isA&&e.isA("vtkObject")}function J(e,t,n){var r,a=this;return function(){for(var s=arguments.length,i=new Array(s),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},n),e.setKey=function(e,n){t.keystore[e]=n},e.getKey=function(e){return t.keystore[e]},e.getAllKeys=function(){return Object.keys(t.keystore)},e.deleteKey=function(e){return delete t.keystore[e]},e.clearKeystore=function(){return e.getAllKeys().forEach((function(e){return delete t.keystore[e]}))}}var X=1;var H={algo:function(e,t,n,r){function a(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?u("instance deleted - cannot call any method"):r>=t.numberOfInputs?u("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[r]!==n||t.inputConnection[r])&&(t.inputData[r]=n,t.inputConnection[r]=null,e.modified&&e.modified())}function s(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)u("instance deleted - cannot call any method");else{if(r>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void u(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[r]=null,t.inputConnection[r]=n}}function i(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(u("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[n])}if(t.inputData?t.inputData=t.inputData.map(o.a):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(o.a):t.inputConnection=[],t.output?t.output=t.output.map(o.a):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(o.a):t.inputArrayToProcess=[],t.numberOfInputs=n,e.shouldUpdate=function(){for(var n=e.getMTime(),a=r,s=1/0;a--;){if(!t.output[a])return!0;var i=t.output[a].getMTime();if(is)return!0;return!1},t.numberOfInputs){for(var l=t.numberOfInputs;l--;)t.inputData.push(null),t.inputConnection.push(null);e.setInputData=a,e.setInputConnection=s,e.addInputData=function(e){t.deleted?u("instance deleted - cannot call any method"):(t.numberOfInputs++,a(e,t.numberOfInputs-1))},e.addInputConnection=function(e){t.deleted?u("instance deleted - cannot call any method"):(t.numberOfInputs++,s(e,t.numberOfInputs-1))},e.getInputData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]&&(t.inputData[e]=t.inputConnection[e]()),t.inputData[e]},e.getInputConnection=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]}}r&&(e.getOutputData=i,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=function(){return i(t)};return n.filter=e,n}),e.update=function(){var n=[];if(t.numberOfInputs)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:"Scalars";t.inputArrayToProcess.length1&&void 0!==arguments[1]?arguments[1]:0;if(!e.apply)return console.error("Invalid callback for event ".concat(n)),null;if(t.deleted)return u("instance deleted - cannot call any method"),null;var s=i++;return a.push([s,e,r]),a.sort((function(e,t){return t[2]-e[2]})),l(s)},e.delete=function(){s(),a.forEach((function(e){return o(Object(r.a)(e,1)[0])}))}},EVENT_ABORT:E,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=["TB","GB","MB","KB"],a=Number(e),s="B";a>n;)a/=n,s=r.pop();return"".concat(a.toFixed(t)," ").concat(s)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=[],r=e;r>1e3;)n.push("000".concat(r%1e3).slice(-3)),r=Math.floor(r/1e3);return r>0&&n.push(r),n.reverse(),n.join(t)},get:p,getArray:A,getCurrentGlobalMTime:function(){return Q},getStateArrayMapFunc:x,isVtkObject:v,keystore:W,newInstance:D,normalizeWheel:function(e){var t=0,n=0,r=0,a=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,a=10*n,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||a)&&e.deltaMode&&(1===e.deltaMode?(r*=40,a*=40):(r*=800,a*=800)),r&&!t&&(t=r<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:a}},obj:h,proxy:function(e,t){W(e,t);var n=e.delete;t.proxyId="".concat(X++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),p(e,t,["proxyId","proxyGroup","proxyName"]),V(e,t,["proxyManager"]);var r={},a={};function i(e,t){a[t]||(a[t]=[]);for(var n=a[t],s=0;s0&&void 0!==arguments[0]?arguments[0]:"__root__";return a[e]}function l(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__root__",r=[],a=t.proxyId,s=o(n)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var r=null,a=[],i=0,o=!1;function l(n){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o)return null;var B=[],Q=null;for(i=a.length;i--;){var c=a[i];c.instance===n?Q=c:B.push(c)}if(!Q)return null;var F=Q.instance["get".concat(b(Q.propertyName))]();if(!S(F,r)||l){for(r=F,o=!0;B.length;){var U=B.pop();U.instance.set(Object(s.a)({},U.propertyName,r))}o=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=F),F}function B(e,t){var n=[];for(i=a.length;i--;){var r=a[i];r.instance!==e||r.propertyName!==t&&void 0!==t||(r.subscription.unsubscribe(),n.push(i))}for(;n.length;)a.splice(n.pop(),1)}function Q(n,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.onModified(l),Q=a[0];return a.push({instance:n,propertyName:r,subscription:o}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?n.set(Object(s.a)({},r,t.propertyLinkMap[e].value)):Q&&l(Q.instance,!0)),{unsubscribe:function(){return B(n,r)}}}function c(){for(;a.length;)a.pop().subscription.unsubscribe()}var F={bind:Q,unbind:B,unsubscribe:c,persistent:n};return t.propertyLinkMap[e]=F,F},e.listPropertyNames=function(){return l().map((function(e){return e.name}))},e.getPropertyByName=function(e){return l().find((function(t){return t.name===e}))},e.getPropertyDomainByName=function(e){return(r[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},e.delete=function(){for(var r=Object.keys(t.propertyLinkMap),a=r.length;a--;)t.propertyLinkMap[r[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),n()},Z((function(){if(t.links)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function a(e){for(var n=Object.keys(e),r=n.length;r--;){var a=n[r];t[a].set(e[a])}}t.this=e;for(var s=Object.keys(r),i=s.length,o=function(){var o=s[i];t[o]=r[o];var l=n[o];e["set".concat(b(o))]=function(n){n!==t[o]&&(t[o]=n,a(l[n]),e.modified())}};i--;)o();s.length&&p(e,t,s)},safeArrays:y,set:L,setArray:f,setGet:V,setGetArray:N,setImmediate:Z,setLoggerFunction:function(e,t){g[e]&&(g[e]=t||U)},throttle:function(e,t){var n=!1,r=null;function a(){n=!1,null!==r&&(s.apply(void 0,Object(i.a)(r)),r=null)}function s(){for(var s=arguments.length,i=new Array(s),o=0;o2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(v(t)){if(a.indexOf(t)>=0)return r;a.push(t);var s=n(t);void 0!==s&&r.push(s);var i=t.get();Object.keys(i).forEach((function(t){var s=i[t];Array.isArray(s)?s.forEach((function(t){e(t,n,r,a)})):e(s,n,r,a)}))}return r},TYPED_ARRAYS:C,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:c,vtkDebugMacro:d,vtkErrorMacro:u,vtkInfoMacro:function(){g.info.apply(g,arguments)},vtkLogMacro:function(){g.log.apply(g,arguments)},vtkOnceErrorMacro:function(e){m[e]||(g.error(e),m[e]=!0)},vtkWarningMacro:I};t.c=H}).call(this,n(38))},function(e,t){e.exports=window.PropTypes},function(e,t,n){"use strict";n.d(t,"a",(function(){return Q})),n.d(t,"b",(function(){return V})),n.d(t,"c",(function(){return X})),n.d(t,"d",(function(){return W})),n.d(t,"e",(function(){return L})),n.d(t,"f",(function(){return A})),n.d(t,"g",(function(){return f})),n.d(t,"h",(function(){return B})),n.d(t,"i",(function(){return c})),n.d(t,"j",(function(){return y})),n.d(t,"k",(function(){return H})),n.d(t,"l",(function(){return x})),n.d(t,"m",(function(){return E})),n.d(t,"n",(function(){return F})),n.d(t,"o",(function(){return Z})),n.d(t,"p",(function(){return p})),n.d(t,"q",(function(){return D})),n.d(t,"r",(function(){return u})),n.d(t,"s",(function(){return J})),n.d(t,"t",(function(){return b})),n.d(t,"u",(function(){return d})),n.d(t,"v",(function(){return I})),n.d(t,"w",(function(){return g})),n.d(t,"x",(function(){return C})),n.d(t,"y",(function(){return S})),n.d(t,"z",(function(){return m})),n.d(t,"A",(function(){return U})),n.d(t,"B",(function(){return o})),n.d(t,"C",(function(){return R})),n.d(t,"D",(function(){return N})),n.d(t,"E",(function(){return l})),n.d(t,"F",(function(){return v}));var r=n(14),a=(n(4),n(0)),s=(n(55),a.c.vtkWarningMacro);function i(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,a=-1/0,s=t,i=e.length;s0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t-e;return e+n*Math.random()}function g(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n}function d(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function u(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function I(e,t,n){var r=e[1]*t[2]-e[2]*t[1],a=e[2]*t[0]-e[0]*t[2],s=e[0]*t[1]-e[1]*t[0];return n[0]=r,n[1]=a,n[2]=s,n}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;switch(t){case 1:return Math.abs(e);case 2:return Math.sqrt(e[0]*e[0]+e[1]*e[1]);case 3:return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);default:for(var n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;function r(e,r){return Math.abs(e-t[r])<=n}return e.every(r)};function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!"".concat(e).includes("e"))return+"".concat(Math.round("".concat(e,"e+").concat(t)),"e-").concat(t);var n="".concat(e).split("e"),r="";return+n[1]+t>0&&(r="+"),+"".concat(Math.round("".concat(+n[0],"e").concat(r).concat(+n[1]+t)),"e-").concat(t)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=h(e[0],n),t[1]=h(e[1],n),t[2]=h(e[2],n),t}function G(e,t,n){var r,a,o,l,B,Q,c,F=0,U=i(n);for(r=0;rl&&(l=c);if(0===l)return s("Unable to factor linear system"),0;U[r]=1/l}for(a=0;a=l&&(l=Q,F=r)}if(a!==F){for(o=0;o=0)for(s=i;s<=a-1;s++)l-=e[a][s]*n[s];else 0!==l&&(i=a);n[a]=l}for(a=r-1;a>=0;a--){for(l=n[a],s=a+1;sB?B=o:oB?B=l:l0?(B-Q)/B:0)>0?(n=i===B?1/6*(o-l)/(B-Q):o===B?1/3+1/6*(l-i)/(B-Q):2/3+1/6*(i-o)/(B-Q))<0&&(n+=1):n=0,t[0]=n,t[1]=a,t[2]=c}function V(e,t){var n,a,s,i=Object(r.a)(e,3),o=i[0],l=i[1],B=i[2],Q=1/3,c=1/6,F=2/3;o>c&&o<=Q?(a=1,n=(Q-o)/c,s=0):o>Q&&o<=.5?(a=1,s=(o-Q)/c,n=0):o>.5&&o<=F?(s=1,a=(F-o)/c,n=0):o>F&&o<=5/6?(s=1,n=(o-F)/c,a=0):o>5/6&&o<=1?(n=1,s=(1-o)/c,a=0):(n=1,a=o/c,s=0),n=l*n+(1-l),a=l*a+(1-l),s=l*s+(1-l),n*=B,a*=B,s*=B,t[0]=n,t[1]=a,t[2]=s}function A(e,t){var n=[0,0,0];(function(e,t){var n=Object(r.a)(e,3),a=n[0],s=n[1],i=n[2];a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,s>.04045?s=Math.pow((s+.055)/1.055,2.4):s/=12.92,i>.04045?i=Math.pow((i+.055)/1.055,2.4):i/=12.92,t[0]=.4124*a+.3576*s+.1805*i,t[1]=.2126*a+.7152*s+.0722*i,t[2]=.0193*a+.1192*s+.9505*i})(e,n),function(e,t){var n=Object(r.a)(e,3),a=n[0]/.9505,s=n[1]/1,i=n[2]/1.089;a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,t[0]=116*s-16,t[1]=500*(a-s),t[2]=200*(s-i)}(n,t)}function f(e,t){var n=[0,0,0];(function(e,t){var n=Object(r.a)(e,3),a=(n[0]+16)/116,s=n[1]/500+a,i=a-n[2]/200;a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,s=Math.pow(s,3)>.008856?Math.pow(s,3):(s-16/116)/7.787,i=Math.pow(i,3)>.008856?Math.pow(i,3):(i-16/116)/7.787,t[0]=.9505*s,t[1]=1*a,t[2]=1.089*i})(e,n),function(e,t){var n=Object(r.a)(e,3),a=n[0],s=n[1],i=n[2],o=3.2406*a+-1.5372*s+-.4986*i,l=-.9689*a+1.8758*s+.0415*i,B=.0557*a+-.204*s+1.057*i;o>.0031308?o=1.055*Math.pow(o,1/2.4)-.055:o*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92,B>.0031308?B=1.055*Math.pow(B,1/2.4)-.055:B*=12.92;var Q=o;Q1&&(o/=Q,l/=Q,B/=Q),o<0&&(o=0),l<0&&(l=0),B<0&&(B=0),t[0]=o,t[1]=l,t[2]=B}(n,t)}function N(e){e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1}function E(e){return!(e[1]-e[0]<0)}function D(e,t,n){n[0]=Math.min(e[0],t[0]),n[1]=Math.max(e[0],t[0]),n[2]=Math.min(e[1],t[1]),n[3]=Math.max(e[1],t[1]),n[4]=Math.min(e[2],t[2]),n[5]=Math.max(e[2],t[2])}function v(e,t,n){return en?n:e}function J(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return r[0]=v(e[0],t[0],n[0]),r[1]=v(e[1],t[1],n[1]),r[2]=v(e[2],t[2],n[2]),r}var W=function(e){return!Number.isFinite(e)},X=Number.isNaN;function H(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return F})),n.d(t,"b",(function(){return U})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return s})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return C})),n.d(t,"k",(function(){return y})),n.d(t,"l",(function(){return l})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return G})),n.d(t,"o",(function(){return x})),n.d(t,"p",(function(){return S})),n.d(t,"q",(function(){return c})),n.d(t,"r",(function(){return Q})),n.d(t,"s",(function(){return B}));var r=n(12);function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function s(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function i(e,t){if(e===t){var n=t[1],r=t[2],a=t[3],s=t[6],i=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=s,e[11]=t[14],e[12]=a,e[13]=i,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function o(e,t){var n=t[0],r=t[1],a=t[2],s=t[3],i=t[4],o=t[5],l=t[6],B=t[7],Q=t[8],c=t[9],F=t[10],U=t[11],g=t[12],d=t[13],u=t[14],I=t[15],m=n*o-r*i,C=n*l-a*i,b=n*B-s*i,y=r*l-a*o,S=r*B-s*o,x=a*B-s*l,Z=Q*d-c*g,h=Q*u-F*g,p=Q*I-U*g,G=c*u-F*d,R=c*I-U*d,L=F*I-U*u,V=m*L-C*R+b*G+y*p-S*h+x*Z;return V?(V=1/V,e[0]=(o*L-l*R+B*G)*V,e[1]=(a*R-r*L-s*G)*V,e[2]=(d*x-u*S+I*y)*V,e[3]=(F*S-c*x-U*y)*V,e[4]=(l*p-i*L-B*h)*V,e[5]=(n*L-a*p+s*h)*V,e[6]=(u*b-g*x-I*C)*V,e[7]=(Q*x-F*b+U*C)*V,e[8]=(i*R-o*p+B*Z)*V,e[9]=(r*p-n*R-s*Z)*V,e[10]=(g*S-d*b+I*m)*V,e[11]=(c*b-Q*S-U*m)*V,e[12]=(o*h-i*G-l*Z)*V,e[13]=(n*G-r*h+a*Z)*V,e[14]=(d*C-g*y-u*m)*V,e[15]=(Q*y-c*C+F*m)*V,e):null}function l(e,t,n){var r=t[0],a=t[1],s=t[2],i=t[3],o=t[4],l=t[5],B=t[6],Q=t[7],c=t[8],F=t[9],U=t[10],g=t[11],d=t[12],u=t[13],I=t[14],m=t[15],C=n[0],b=n[1],y=n[2],S=n[3];return e[0]=C*r+b*o+y*c+S*d,e[1]=C*a+b*l+y*F+S*u,e[2]=C*s+b*B+y*U+S*I,e[3]=C*i+b*Q+y*g+S*m,C=n[4],b=n[5],y=n[6],S=n[7],e[4]=C*r+b*o+y*c+S*d,e[5]=C*a+b*l+y*F+S*u,e[6]=C*s+b*B+y*U+S*I,e[7]=C*i+b*Q+y*g+S*m,C=n[8],b=n[9],y=n[10],S=n[11],e[8]=C*r+b*o+y*c+S*d,e[9]=C*a+b*l+y*F+S*u,e[10]=C*s+b*B+y*U+S*I,e[11]=C*i+b*Q+y*g+S*m,C=n[12],b=n[13],y=n[14],S=n[15],e[12]=C*r+b*o+y*c+S*d,e[13]=C*a+b*l+y*F+S*u,e[14]=C*s+b*B+y*U+S*I,e[15]=C*i+b*Q+y*g+S*m,e}function B(e,t,n){var r,a,s,i,o,l,B,Q,c,F,U,g,d=n[0],u=n[1],I=n[2];return t===e?(e[12]=t[0]*d+t[4]*u+t[8]*I+t[12],e[13]=t[1]*d+t[5]*u+t[9]*I+t[13],e[14]=t[2]*d+t[6]*u+t[10]*I+t[14],e[15]=t[3]*d+t[7]*u+t[11]*I+t[15]):(r=t[0],a=t[1],s=t[2],i=t[3],o=t[4],l=t[5],B=t[6],Q=t[7],c=t[8],F=t[9],U=t[10],g=t[11],e[0]=r,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=l,e[6]=B,e[7]=Q,e[8]=c,e[9]=F,e[10]=U,e[11]=g,e[12]=r*d+o*u+c*I+t[12],e[13]=a*d+l*u+F*I+t[13],e[14]=s*d+B*u+U*I+t[14],e[15]=i*d+Q*u+g*I+t[15]),e}function Q(e,t,n){var r=n[0],a=n[1],s=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function c(e,t,n,a){var s,i,o,l,B,Q,c,F,U,g,d,u,I,m,C,b,y,S,x,Z,h,p,G,R,L=a[0],V=a[1],A=a[2],f=Math.hypot(L,V,A);return f0?(I=2*Math.sqrt(u+1),e[3]=.25*I,e[0]=(F-g)/I,e[1]=(U-B)/I,e[2]=(l-Q)/I):o>c&&o>d?(I=2*Math.sqrt(1+o-c-d),e[3]=(F-g)/I,e[0]=.25*I,e[1]=(l+Q)/I,e[2]=(U+B)/I):c>d?(I=2*Math.sqrt(1+c-o-d),e[3]=(U-B)/I,e[0]=(l+Q)/I,e[1]=.25*I,e[2]=(F+g)/I):(I=2*Math.sqrt(1+d-o-c),e[3]=(l-Q)/I,e[0]=(U+B)/I,e[1]=(F+g)/I,e[2]=.25*I),e}function b(e,t,n,r){var a=t[0],s=t[1],i=t[2],o=t[3],l=a+a,B=s+s,Q=i+i,c=a*l,F=a*B,U=a*Q,g=s*B,d=s*Q,u=i*Q,I=o*l,m=o*B,C=o*Q,b=r[0],y=r[1],S=r[2];return e[0]=(1-(g+u))*b,e[1]=(F+C)*b,e[2]=(U-m)*b,e[3]=0,e[4]=(F-C)*y,e[5]=(1-(c+u))*y,e[6]=(d+I)*y,e[7]=0,e[8]=(U+m)*S,e[9]=(d-I)*S,e[10]=(1-(c+g))*S,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function y(e,t){var n=t[0],r=t[1],a=t[2],s=t[3],i=n+n,o=r+r,l=a+a,B=n*i,Q=r*i,c=r*o,F=a*i,U=a*o,g=a*l,d=s*i,u=s*o,I=s*l;return e[0]=1-c-g,e[1]=Q+I,e[2]=F-u,e[3]=0,e[4]=Q-I,e[5]=1-B-g,e[6]=U+d,e[7]=0,e[8]=F+u,e[9]=U-d,e[10]=1-B-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function S(e,t,n,r,a,s,i){var o=1/(t-n),l=1/(r-a),B=1/(s-i);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*B,e[11]=0,e[12]=(t+n)*o,e[13]=(a+r)*l,e[14]=(i+s)*B,e[15]=1,e}function x(e,t,n,a){var i,o,l,B,Q,c,F,U,g,d,u=t[0],I=t[1],m=t[2],C=a[0],b=a[1],y=a[2],S=n[0],x=n[1],Z=n[2];return Math.abs(u-S)0?(n[0]=2*(l*o+c*a+B*i-Q*s)/F,n[1]=2*(B*o+c*s+Q*a-l*i)/F,n[2]=2*(Q*o+c*i+l*s-B*a)/F):(n[0]=2*(l*o+c*a+B*i-Q*s),n[1]=2*(B*o+c*s+Q*a-l*i),n[2]=2*(Q*o+c*i+l*s-B*a)),I(e,t,n),e},getTranslation:function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},getScaling:m,getRotation:C,fromRotationTranslationScale:b,fromRotationTranslationScaleOrigin:function(e,t,n,r,a){var s=t[0],i=t[1],o=t[2],l=t[3],B=s+s,Q=i+i,c=o+o,F=s*B,U=s*Q,g=s*c,d=i*Q,u=i*c,I=o*c,m=l*B,C=l*Q,b=l*c,y=r[0],S=r[1],x=r[2],Z=a[0],h=a[1],p=a[2],G=(1-(d+I))*y,R=(U+b)*y,L=(g-C)*y,V=(U-b)*S,A=(1-(F+I))*S,f=(u+m)*S,N=(g+C)*x,E=(u-m)*x,D=(1-(F+d))*x;return e[0]=G,e[1]=R,e[2]=L,e[3]=0,e[4]=V,e[5]=A,e[6]=f,e[7]=0,e[8]=N,e[9]=E,e[10]=D,e[11]=0,e[12]=n[0]+Z-(G*Z+V*h+N*p),e[13]=n[1]+h-(R*Z+A*h+E*p),e[14]=n[2]+p-(L*Z+f*h+D*p),e[15]=1,e},fromQuat:y,frustum:function(e,t,n,r,a,s,i){var o=1/(n-t),l=1/(a-r),B=1/(s-i);return e[0]=2*s*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*s*l,e[6]=0,e[7]=0,e[8]=(n+t)*o,e[9]=(a+r)*l,e[10]=(i+s)*B,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*s*2*B,e[15]=0,e},perspective:function(e,t,n,r,a){var s,i=1/Math.tan(t/2);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(s=1/(r-a),e[10]=(a+r)*s,e[14]=2*a*r*s):(e[10]=-1,e[14]=-2*r),e},perspectiveFromFieldOfView:function(e,t,n,r){var a=Math.tan(t.upDegrees*Math.PI/180),s=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+o),B=2/(a+s);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=B,e[6]=0,e[7]=0,e[8]=-(i-o)*l*.5,e[9]=(a-s)*B*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e},ortho:S,lookAt:x,targetTo:function(e,t,n,r){var a=t[0],s=t[1],i=t[2],o=r[0],l=r[1],B=r[2],Q=a-n[0],c=s-n[1],F=i-n[2],U=Q*Q+c*c+F*F;U>0&&(Q*=U=1/Math.sqrt(U),c*=U,F*=U);var g=l*F-B*c,d=B*Q-o*F,u=o*c-l*Q;return(U=g*g+d*d+u*u)>0&&(g*=U=1/Math.sqrt(U),d*=U,u*=U),e[0]=g,e[1]=d,e[2]=u,e[3]=0,e[4]=c*u-F*d,e[5]=F*g-Q*u,e[6]=Q*d-c*g,e[7]=0,e[8]=Q,e[9]=c,e[10]=F,e[11]=0,e[12]=a,e[13]=s,e[14]=i,e[15]=1,e},str:function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},frob:function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},subtract:Z,multiplyScalar:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},multiplyScalarAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},equals:function(e,t){var n=e[0],a=e[1],s=e[2],i=e[3],o=e[4],l=e[5],B=e[6],Q=e[7],c=e[8],F=e[9],U=e[10],g=e[11],d=e[12],u=e[13],I=e[14],m=e[15],C=t[0],b=t[1],y=t[2],S=t[3],x=t[4],Z=t[5],h=t[6],p=t[7],G=t[8],R=t[9],L=t[10],V=t[11],A=t[12],f=t[13],N=t[14],E=t[15];return Math.abs(n-C)<=r.b*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(a-b)<=r.b*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(s-y)<=r.b*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(i-S)<=r.b*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-x)<=r.b*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(l-Z)<=r.b*Math.max(1,Math.abs(l),Math.abs(Z))&&Math.abs(B-h)<=r.b*Math.max(1,Math.abs(B),Math.abs(h))&&Math.abs(Q-p)<=r.b*Math.max(1,Math.abs(Q),Math.abs(p))&&Math.abs(c-G)<=r.b*Math.max(1,Math.abs(c),Math.abs(G))&&Math.abs(F-R)<=r.b*Math.max(1,Math.abs(F),Math.abs(R))&&Math.abs(U-L)<=r.b*Math.max(1,Math.abs(U),Math.abs(L))&&Math.abs(g-V)<=r.b*Math.max(1,Math.abs(g),Math.abs(V))&&Math.abs(d-A)<=r.b*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(u-f)<=r.b*Math.max(1,Math.abs(u),Math.abs(f))&&Math.abs(I-N)<=r.b*Math.max(1,Math.abs(I),Math.abs(N))&&Math.abs(m-E)<=r.b*Math.max(1,Math.abs(m),Math.abs(E))},mul:h,sub:p})},function(e,t,n){"use strict";(function(e){var t=n(11),r=n(30),a=n(48),s=n(50);Object(t.c)("/$$rollup_base$$/node_modules/readable-stream/lib/_stream_duplex.js",(function(t,n){var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=F;var o=a.a,l=s.a;Object(r.a)(F,o);for(var B=i(l.prototype),Q=0;Q0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function b(e,t,n){var r=t[0],a=t[1],s=t[2],i=n[0],o=n[1],l=n[2];return e[0]=a*l-s*o,e[1]=s*i-r*l,e[2]=r*o-a*i,e}function y(e,t,n){var r=t[0],a=t[1],s=t[2],i=n[3]*r+n[7]*a+n[11]*s+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*a+n[8]*s+n[12])/i,e[1]=(n[1]*r+n[5]*a+n[9]*s+n[13])/i,e[2]=(n[2]*r+n[6]*a+n[10]*s+n[14])/i,e}function S(e,t,n){var r=t[0],a=t[1],s=t[2];return e[0]=r*n[0]+a*n[3]+s*n[6],e[1]=r*n[1]+a*n[4]+s*n[7],e[2]=r*n[2]+a*n[5]+s*n[8],e}function x(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Z(e,t){var n=e[0],a=e[1],s=e[2],i=t[0],o=t[1],l=t[2];return Math.abs(n-i)<=r.b*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-o)<=r.b*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(s-l)<=r.b*Math.max(1,Math.abs(s),Math.abs(l))}var h,p=B,G=Q,R=c,L=U,V=g,A=s,f=d,N=(h=a(),function(e,t,n,r,a,s){var i,o;for(t||(t=3),n||(n=0),o=r?Math.min(r*t+n,e.length):e.length,i=n;i1;)try{return B.stringifyByChunk(e,r,n)}catch(e){n=Math.floor(n/2)}return B.stringifyByChar(e)}function c(e,t){for(var n=0;na&&(e=a),t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=c(),a=e.length,s=0;if(t<0&&n>1){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=e||[];n.length<=t;)n.push(null);return n}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}var d={computeRange:F,createRangeHelper:c,getDataType:g,getMaxNorm:function(e){for(var t=e.getNumberOfComponents(),n=0,r=0;rn&&(n=a)}return n}};function u(e,t){function n(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+n]},e.setComponent=function(e,r,a){a!==t.values[e*t.numberOfComponents+r]&&(t.values[e*t.numberOfComponents+r]=a,n())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=e<0?t.numberOfComponents:e,r=null;return t.ranges||(t.ranges=U(t.ranges,t.numberOfComponents)),(r=t.ranges[n])?(t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple):(r=F(t.values,e,t.numberOfComponents),t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple)},e.setRange=function(e,n){t.ranges||(t.ranges=U(t.ranges,t.numberOfComponents));var r={min:e.min,max:e.max};return t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple},e.setTuple=function(e,n){for(var r=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:Q,r=t.numberOfComponents||1;n.length!==r&&(n.length=r);var a=e*r;if(1===r)n[0]=t.values[a];else if(2===r)n[0]=t.values[a],n[1]=t.values[a+1];else if(3===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2];else if(4===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2],n[3]=t.values[a+3];else for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:1;return e*t.numberOfComponents},e.getNumberOfComponents=function(){return t.numberOfComponents},e.getNumberOfValues=function(){return t.values.length},e.getNumberOfTuples=function(){return t.values.length/t.numberOfComponents},e.getDataType=function(){return t.dataType},e.newClone=function(){return C({empty:!0,name:t.name,dataType:t.dataType,numberOfComponents:t.numberOfComponents})},e.getName=function(){return t.name||(e.modified(),t.name="vtkDataArray".concat(e.getMTime())),t.name},e.setData=function(e,r){t.values=e,t.size=e.length,t.dataType=g(e),r&&(t.numberOfComponents=r),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),n()},e.getState=function(){var n=l(l({},t),{},{vtkClass:e.getClassName()});n.values=Array.from(n.values),delete n.buffer,Object.keys(n).forEach((function(e){n[e]||delete n[e]}));var r={};return Object.keys(n).sort().forEach((function(e){r[e]=n[e]})),r.mtime&&delete r.mtime,r}}var I={name:"",numberOfComponents:1,size:0,dataType:B,rangeTuple:[0,0]};function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,I,n),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");t.values?Array.isArray(t.values)&&(t.values=window[t.dataType].from(t.values)):t.values=new window[t.dataType](t.size),t.values&&(t.size=t.values.length,t.dataType=g(t.values)),Object(a.g)(e,t),Object(a.h)(e,t,["name","numberOfComponents"]),u(e,t)}var C=Object(a.f)(m,"vtkDataArray"),b=l(l({newInstance:C,extend:m},d),s.c);t.a=b},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return a}));var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function i(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return d(e,null==t?n.path:t)}},n.exports),n.exports}function o(e,t){l[e]=t}const l=Object.create(null),B=Object.create(null),Q={id:"",exports:{},parent:void 0,filename:null,loaded:!1,children:[],paths:[]},c=["",".js",".json"];function F(e){const t=(e=e.replace(/\\/g,"/")).split("/"),n=""===t[0];for(let e=1;e0&&".."!==t[e-1]&&"."!==t[e-1]&&(t.splice(--e,2),e--);return e=t.join("/"),n&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}function U(){if(0===arguments.length)return".";let e;for(let t=0;t0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":e}function g(e){if(0===e.length)return".";let t=e.length-1;for(;t>0;){const n=e.charCodeAt(t);if((47===n||92===n)&&t!==e.length-1)break;t--}return t>0?e.substr(0,t):47===e.chartCodeAt(0)||92===e.chartCodeAt(0)?e.charAt(0):"."}function d(e,t){const a=function(e){let t=e[0];if("/"===t||"\\"===t)return!1;let n=e[1],r=e[2];return!(!("."!==t||n&&"/"!==n&&"\\"!==n)||!("."!==t||"."!==n||r&&"/"!==r&&"\\"!==r))&&(":"!==n||"/"!==r&&"\\"!==r)}(e);let s;for(e=F(e);;){s=a?F(t?t+"/node_modules/"+e:U("node_modules",e)):t?F(t+"/"+e):e;for(let e=0;e "+e:e}};var a=r},function(e,t,n){"use strict";var r=function(e){if(Array.isArray(e))return e},a=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,s=e}finally{try{r||null==o.return||o.return()}finally{if(a)throw s}}return n}},s=n(47),i=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};t.a=function(e,t){return r(e)||a(e,t)||Object(s.a)(e,t)||i()}},function(e,t,n){"use strict";var r=n(9),a=(n(4),n(21)),s=n(0),i=n(39),o=n(7),l=n(2),B=n(28);function Q(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n){t.pointsIds=n;var r=t.points.getData();r.length!==3*t.pointsIds.length&&(r=new(window[e.getDataType()])(3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach((function(e,t){var n=3*e,s=3*t;r[s]=a[n],r[++s]=a[++n],r[++s]=a[++n]})),t.points.setData(r)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var s=e.getNumberOfPoints()-1;s>=0;--s)t.pointsIds[s]=s}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),n=[];if(e){t.points.getPoint(0,n),t.bounds[0]=n[0],t.bounds[1]=n[0],t.bounds[2]=n[1],t.bounds[3]=n[1],t.bounds[4]=n[2],t.bounds[5]=n[2];for(var r=1;rt.bounds[1]?n[0]:t.bounds[1],t.bounds[2]=n[1]t.bounds[3]?n[1]:t.bounds[3],t.bounds[4]=n[2]t.bounds[5]?n[2]:t.bounds[5]}else Object(l.D)(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var n=0,r=0,a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return n},e.getParametricDistance=function(e){for(var t,n=0,r=0;r<3;r++)(t=e[r]<0?-e[r]:e[r]>1?e[r]-1:0)>n&&(n=t);return n},e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.deepCopy=function(e){e.initialize(t.points,t.pointsIds)},e.getCellDimension=function(){},e.intersectWithLine=function(e,t,n,r,a,s,i){},e.evaluatePosition=function(e,t,n,r,a,s){}}var c={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,c,n),s.c.obj(e,t),t.points||(t.points=B.a.newInstance()),s.c.get(e,t,["points","pointsIds"]),Q(e,t)}var U={newInstance:s.c.newInstance(F,"vtkCell"),extend:F};function g(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(n){var r=n.getPoints().getNumberOfPoints(),a=n.getNumberOfCells(),s=new Uint32Array(r);if(n.isA("vtkPolyData")){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1e3;t.array=Array(e).fill().map((function(){return{ncells:0,cells:null}})),t.extend=n,t.maxId=-1},e.initialize=function(){t.array=null},e.getLink=function(e){return t.array[e]},e.getNcells=function(e){return t.array[e].ncells},e.getCells=function(e){return t.array[e].cells},e.insertNextPoint=function(e){t.array.push({ncells:e,cells:Array(e)}),++t.maxId},e.insertNextCellReference=function(e,n){t.array[e].cells[t.array[e].ncells++]=n},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,n){t.array[n].cells=t.array[n].cells.filter((function(t){return t!==e})),t.array[n].ncells=t.array[n].cells.length},e.addCellReference=function(e,n){t.array[n].cells[t.array[n].ncells++]=e},e.resizeCellList=function(e,n){t.array[e].cells.length=n},e.squeeze=function(){!function(e,t){var n=t;for(t>=e.array.length&&(n+=e.array.length);n>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=n}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=Object(o.a)(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),s.c.obj(e,t),g(e,t)}var I={newInstance:s.c.newInstance(u,"vtkCellLinks"),extend:u},m=0,C=1,b=2,y=3,S=4,x=5,Z=6,h=7,p=9,G=21,R=41,L=42,V=["vtkEmptyCell","vtkVertex","vtkPolyVertex","vtkLine","vtkPolyLine","vtkTriangle","vtkTriangleStrip","vtkPolygon","vtkPixel","vtkQuad","vtkTetra","vtkVoxel","vtkHexahedron","vtkWedge","vtkPyramid","vtkPentagonalPrism","vtkHexagonalPrism","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkQuadraticEdge","vtkQuadraticTriangle","vtkQuadraticQuad","vtkQuadraticTetra","vtkQuadraticHexahedron","vtkQuadraticWedge","vtkQuadraticPyramid","vtkBiQuadraticQuad","vtkTriQuadraticHexahedron","vtkQuadraticLinearQuad","vtkQuadraticLinearWedge","vtkBiQuadraticQuadraticWedge","vtkBiQuadraticQuadraticHexahedron","vtkBiQuadraticTriangle","vtkCubicLine","vtkQuadraticPolygon","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkConvexPointSet","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkParametricCurve","vtkParametricSurface","vtkParametricTriSurface","vtkParametricQuadSurface","vtkParametricTetraRegion","vtkParametricHexRegion","UnknownClass","UnknownClass","UnknownClass","vtkHigherOrderEdge","vtkHigherOrderTriangle","vtkHigherOrderQuad","vtkHigherOrderPolygon","vtkHigherOrderTetrahedron","vtkHigherOrderWedge","vtkHigherOrderPyramid","vtkHigherOrderHexahedron"];function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var f={getClassNameFromTypeId:function(e){return e0&&void 0!==arguments[0]?arguments[0]:512,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=n>0?n:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=function(e,n,r){t.typeArray[e]=n,t.locationArray[e]=r,e>t.maxId&&(t.maxId=e)},e.insertNextCell=function(n,r){return e.insertCell(++t.maxId,n,r),t.maxId},e.setCellTypes=function(e,n,r){t.size=e,t.typeArray=n,t.locationArray=r,t.maxId=e-1},e.getCellLocation=function(e){return t.locationArray[e]},e.deleteCell=function(e){t.typeArray[e]=m},e.getNumberOfTypes=function(){return t.maxId+1},e.isType=function(t){for(var n=e.getNumberOfTypes(),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,E,n),s.c.obj(e,t),s.c.get(e,t,["size","maxId","extend"]),s.c.getArray(e,t,["typeArray","locationArray"]),N(e,t)}var v=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,s={t:Number.MIN_VALUE,distance:0},i=[];i[0]=n[0]-t[0],i[1]=n[1]-t[1],i[2]=n[2]-t[2];var o=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),B=Object(l.r)(i,i),Q=1e-5*o;return 0!==B&&(s.t=o/B),Q<0&&(Q=-Q),-Q1?r=n:(r=i,i[0]=t[0]+s.t*i[0],i[1]=t[1]+s.t*i[1],i[2]=t[2]+s.t*i[2]),a&&(a[0]=r[0],a[1]=r[1],a[2]=r[2]),s.distance=Object(l.t)(r,e),s}function k(e,t,n,r,a,s){var i=[],o=[],B=[];a[0]=0,s[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],o[0]=r[0]-n[0],o[1]=r[1]-n[1],o[2]=r[2]-n[2],B[0]=n[0]-e[0],B[1]=n[1]-e[1],B[2]=n[2]-e[2];var Q=[];Q[0]=[Object(l.r)(i,i),-Object(l.r)(i,o)],Q[1]=[Q[0][1],Object(l.r)(o,o)];var c=[];if(c[0]=Object(l.r)(i,B),c[1]=-Object(l.r)(o,B),0===Object(l.C)(Q,c,2)){for(var F,U=Number.MAX_VALUE,g=[e,t,n,r],d=[n,n,e,e],u=[r,r,t,t],I=[s[0],s[0],a[0],a[0]],m=[a[0],a[0],s[0],s[0]],C=0;C<4;C++)(F=T(g[C],d[C],u[C])).distance=0&&a[0]<=1&&s[0]>=0&&s[0]<=1?H.YES_INTERSECTION:H.NO_INTERSECTION}var M={distanceToLine:T,intersection:k};function w(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,n,r,a,s){var i={intersect:0,t:Number.MIN_VALUE,subId:0};s[1]=0,s[2]=0;var o=[],B=[],Q=[];t.points.getPoint(0,B),t.points.getPoint(1,Q);var c=[],F=[],U=k(e,n,B,Q,c,F);if(i.t=c[0],s[0]=F[0],U===H.YES_INTERSECTION){for(var g=0;g<3;g++)a[g]=B[g]+s[0]*(Q[g]-B[g]),o[g]=e[g]+i.t*(n[g]-e[g]);if(Object(l.t)(a,o)<=r*r)return i.intersect=1,i}else{var d;if(i.t<0)return i.t=0,d=T(e,B,Q,a),s[0]=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(i.t>1)return i.t=1,d=T(n,B,Q,a),s[0]=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(s[0]<0)return s[0]=0,d=T(B,e,n,a),i.t=d.t,d.distance<=r*r?(i.intersect=1,i):i;if(s[1]>1)return s[1]=1,d=T(Q,e,n,a),i.t=d.t,d.distance<=r*r?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,n,r,a,s){}}var Y={};function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Y,n),U.extend(e,t,n),w(e,t)}var z=X(X({newInstance:s.c.newInstance(O,"vtkLine"),extend:O},M),J),P=n(33);function K(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=Object(a.a)(t.points):t.points=B.a.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),t.points=B.a.newInstance(),t.points.shallowCopy(e.getPoints())}}var j={};function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,j,n),P.a.extend(e,t,n),s.c.setGet(e,t,["points"]),K(e,t)}var q={newInstance:s.c.newInstance(_,"vtkPointSet"),extend:_},$=n(35);function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e,t,n,r){var a=n[0]-t[0],s=n[1]-t[1],i=n[2]-t[2],o=e[0]-t[0],l=e[1]-t[1],B=e[2]-t[2];r[0]=s*B-i*l,r[1]=i*o-a*B,r[2]=a*l-s*o}function ne(e,t,n,r){te(e,t,n,r);var a=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);0!==a&&(r[0]/=a,r[1]/=a,r[2]/=a)}var re={computeNormalDirection:te,computeNormal:ne};function ae(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(n,r,a,s,i){var o={subId:0,t:0,intersect:-1};i[2]=0;var B=a*a,Q=[],c=[],F=[];t.points.getPoint(0,Q),t.points.getPoint(1,c),t.points.getPoint(2,F);var U=[];if(ne(Q,c,F,U),0!==U[0]||0!==U[1]||0!==U[2]){var g=$.a.intersectWithLine(n,r,Q,U);if(o.t=g.t,s[0]=g.x[0],s[1]=g.x[1],s[2]=g.x[2],!g.intersection)return i[0]=0,i[1]=0,o.intersect=0,o;var d=e.evaluatePosition(s,[],i,[]);if(d.evaluation>=0)return d.dist2<=B?(o.intersect=1,o):(o.intersect=d.evaluation,o)}var u=Object(l.t)(Q,c),I=Object(l.t)(c,F),m=Object(l.t)(F,Q);if(t.line||(t.line=z.newInstance()),u>I&&u>m?(t.line.getPoints().setPoint(0,Q),t.line.getPoints().setPoint(1,c)):I>m&&I>u?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,F)):(t.line.getPoints().setPoint(0,F),t.line.getPoints().setPoint(1,Q)),t.line.intersectWithLine(n,r,a,s,i).intersect){for(var C=[],b=[],y=[],S=0;S<3;S++)C[S]=Q[S]-F[S],b[S]=c[S]-F[S],y[S]=s[S]-F[S];return i[0]=Object(l.r)(y,C)/m,i[1]=Object(l.r)(y,b)/I,o.evaluation=1,o}return i[0]=0,i[1]=0,o.evaluation=0,o},e.evaluatePosition=function(e,n,r,a){var s,i,o,B,Q,c,F,U={subId:0,dist2:0,evaluation:-1},g=[],d=[],u=[],I=[],m=[],C=[],b=[],y=0,S=[],x=[],Z=[],h=[],p=[];U.subId=0,r[2]=0,t.points.getPoint(1,g),t.points.getPoint(2,d),t.points.getPoint(0,u),te(g,d,u,I),$.a.generalizedProjectPoint(e,g,I,p);var G=0;for(s=0;s<3;s++)(o=I[s]<0?-I[s]:I[s])>G&&(G=o,y=s);for(i=0,s=0;s<3;s++)s!==y&&(S[i++]=s);for(s=0;s<2;s++)m[s]=p[S[s]]-u[S[s]],C[s]=g[S[s]]-u[S[s]],b[s]=d[S[s]]-u[S[s]];if(0===(B=Object(l.y)(C,b)))return r[0]=0,r[1]=0,U.evaluation=-1,U;if(r[0]=Object(l.y)(m,b)/B,r[1]=Object(l.y)(C,m)/B,a[0]=1-(r[0]+r[1]),a[1]=r[0],a[2]=r[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)n&&(U.dist2=Object(l.t)(p,e),n[0]=p[0],n[1]=p[1],n[2]=p[2]),U.evaluation=1;else{var R;if(n)if(a[1]<0&&a[2]<0)for(Q=Object(l.t)(e,u),c=z.distanceToLine(e,g,u,R,Z),F=z.distanceToLine(e,u,d,R,h),Q1?r[a]-1:0)>n&&(n=t);return n}}var se={};function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,se,n),U.extend(e,t,n),ae(e,t)}var oe,le=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];n(e,r),Be.forEach((function(n){t[n]=i.a.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))}))},e.buildCells=function(){var n=e.getNumberOfVerts(),r=e.getNumberOfLines(),a=e.getNumberOfPolys(),s=e.getNumberOfStrips(),i=n+r+a+s,o=new Uint8Array(i),l=o,B=new Uint32Array(i),Q=B;if(n){var c=0;t.verts.getCellSizes().forEach((function(e,t){Q[t]=c,l[t]=e>1?b:C,c+=e+1})),Q=Q.subarray(n),l=l.subarray(n)}if(r){var F=0;t.lines.getCellSizes().forEach((function(e,t){Q[t]=F,l[t]=e>2?S:y,1===e&&Qe("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),F+=e+1})),Q=Q.subarray(r),l=l.subarray(r)}if(a){var U=0;t.polys.getCellSizes().forEach((function(e,t){switch(Q[t]=U,e){case 3:l[t]=x;break;case 4:l[t]=p;break;default:l[t]=h}e<3&&Qe("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),U+=e+1})),Q+=Q.subarray(a),l+=l.subarray(a)}if(s){var g=0;l.fill(Z,0,s),t.strips.getCellSizes().forEach((function(e,t){Q[t]=g,g+=e+1}))}t.cells=v.newInstance(),t.cells.setCellTypes(i,o,B)},e.buildLinks=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=I.newInstance(),n>0?t.links.allocate(n):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var n=t.cells.getCellType(e),r=null;switch(n){case C:case b:r=t.verts;break;case y:case S:r=t.lines;break;case x:case p:case h:r=t.polys;break;case Z:r=t.strips;break;default:return r=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:n,cellPointIds:r.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,n,r){var a=t.links.getLink(n),s=t.links.getLink(r);return a.cells.filter((function(t){return t!==e&&-1!==s.cells.indexOf(t)}))},e.getCell=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.getCellPoints(t),a=n||ce[r.cellType].newInstance();return a.initialize(e.getPoints(),r.cellPointIds),a}}var Ue={};function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ue,n),q.extend(e,t,n),s.c.get(e,t,["cells","links"]),s.c.setGet(e,t,["verts","lines","polys","strips"]),Fe(e,t)}var de={newInstance:s.c.newInstance(ge,"vtkPolyData"),extend:ge};t.a=de},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));n(4);var r={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},a={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},s={DefaultDataType:a.FLOAT,DataTypeByteSize:r,VtkDataTypes:a};t.c=s},function(e,t,n){"use strict";t.a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0;)e[t]=0}n.d(t,"a",(function(){return rn}));const s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B=new Array(576);r(B);const o=new Array(60);r(o);const l=new Array(512);r(l);const F=new Array(256);r(F);const U=new Array(29);r(U);const c=new Array(30);function g(e,t,n,r,s){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}let d,u,I;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}r(c);const C=e=>e<256?l[e]:l[256+(e>>>7)],b=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},y=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{y(e,n[2*t],n[2*t+1])},Z=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},x=(e,t,n)=>{const r=new Array(16);let s,a,i=0;for(s=1;s<=15;s++)r[s]=i=i+n[s-1]<<1;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=Z(r[t]++,t))}},G=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},h=e=>{e.bi_valid>8?b(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},p=(e,t,n,r)=>{const s=2*t,a=2*n;return e[s]{const r=e.heap[n];let s=n<<1;for(;s<=e.heap_len&&(s{let r,i,Q,B,o=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===r?S(e,i,t):(Q=F[i],S(e,Q+256+1,t),B=s[Q],0!==B&&(i-=U[Q],y(e,i,B)),r--,Q=C(r),S(e,Q,n),B=a[Q],0!==B&&(r-=c[Q],y(e,r,B)))}while(o{const n=t.dyn_tree,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.elems;let i,Q,B,o=-1;for(e.heap_len=0,e.heap_max=573,i=0;i>1;i>=1;i--)R(e,n,i);B=a;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,n,1),Q=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=Q,n[2*B]=n[2*i]+n[2*Q],e.depth[B]=(e.depth[i]>=e.depth[Q]?e.depth[i]:e.depth[Q])+1,n[2*i+1]=n[2*Q+1]=B,e.heap[1]=B++,R(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,Q=t.stat_desc.extra_base,B=t.stat_desc.max_length;let o,l,F,U,c,g,d=0;for(U=0;U<=15;U++)e.bl_count[U]=0;for(n[2*e.heap[e.heap_max]+1]=0,o=e.heap_max+1;o<573;o++)l=e.heap[o],U=n[2*n[2*l+1]+1]+1,U>B&&(U=B,d++),n[2*l+1]=U,l>r||(e.bl_count[U]++,c=0,l>=Q&&(c=i[l-Q]),g=n[2*l],e.opt_len+=g*(U+c),a&&(e.static_len+=g*(s[2*l+1]+c)));if(0!==d){do{for(U=B-1;0===e.bl_count[U];)U--;e.bl_count[U]--,e.bl_count[U+1]+=2,e.bl_count[B]--,d-=2}while(d>0);for(U=B;0!==U;U--)for(l=e.bl_count[U];0!==l;)F=e.heap[--o],F>r||(n[2*F+1]!==U&&(e.opt_len+=(U-n[2*F+1])*n[2*F],n[2*F+1]=U),l--)}})(e,t),x(n,o,e.bl_count)},A=(e,t,n)=>{let r,s,a=-1,i=t[1],Q=0,B=7,o=4;for(0===i&&(B=138,o=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)s=i,i=t[2*(r+1)+1],++Q{let r,s,a=-1,i=t[1],Q=0,B=7,o=4;for(0===i&&(B=138,o=3),r=0;r<=n;r++)if(s=i,i=t[2*(r+1)+1],!(++Q{y(e,0+(r?1:0),3),((e,t,n,r)=>{h(e),b(e,n),b(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n})(e,t,n)};var D={_tr_init:e=>{E||((()=>{let e,t,n,r,Q;const m=new Array(16);for(n=0,r=0;r<28;r++)for(U[r]=n,e=0;e<1<>=7;r<30;r++)for(c[r]=Q<<7,e=0;e<1<{let s,a,i=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),L(e,e.l_desc),L(e,e.d_desc),i=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),L(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Q[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=s&&(s=a)):s=a=n+5,n+4<=s&&-1!==t?f(e,t,n,r):4===e.strategy||a===s?(y(e,2+(r?1:0),3),V(e,B,o)):(y(e,4+(r?1:0),3),((e,t,n,r)=>{let s;for(y(e,t-257,5),y(e,n-1,5),y(e,r-4,4),s=0;s(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(F[n]+256+1)]++,e.dyn_dtree[2*C(t)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{y(e,2,3),S(e,256,B),(e=>{16===e.bi_valid?(b(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},v=(e,t,n,r)=>{let s=65535&e|0,a=e>>>16&65535|0,i=0;for(;0!==n;){i=n>2e3?2e3:n,n-=i;do{s=s+t[r++]|0,a=a+s|0}while(--i);s%=65521,a%=65521}return s|a<<16|0};const J=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var W=(e,t,n,r)=>{const s=J,a=r+n;e^=-1;for(let n=r;n>>8^s[255&(e^t[n])];return-1^e},X={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:k,_tr_stored_block:T,_tr_flush_block:M,_tr_tally:Y,_tr_align:w}=D,{Z_NO_FLUSH:O,Z_PARTIAL_FLUSH:z,Z_FULL_FLUSH:P,Z_FINISH:K,Z_BLOCK:j,Z_OK:_,Z_STREAM_END:q,Z_STREAM_ERROR:$,Z_DATA_ERROR:ee,Z_BUF_ERROR:te,Z_DEFAULT_COMPRESSION:ne,Z_FILTERED:re,Z_HUFFMAN_ONLY:se,Z_RLE:ae,Z_FIXED:ie,Z_DEFAULT_STRATEGY:Qe,Z_UNKNOWN:Be,Z_DEFLATED:oe}=H,le=(e,t)=>(e.msg=X[t],t),Fe=e=>(e<<1)-(e>4?9:0),Ue=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let ce=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},de=(e,t)=>{M(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ge(e.strm)},ue=(e,t)=>{e.pending_buf[e.pending++]=t},Ie=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},me=(e,t,n,r)=>{let s=e.avail_in;return s>r&&(s=r),0===s?0:(e.avail_in-=s,t.set(e.input.subarray(e.next_in,e.next_in+s),n),1===e.state.wrap?e.adler=v(e.adler,t,s,n):2===e.state.wrap&&(e.adler=W(e.adler,t,s,n)),e.next_in+=s,e.total_in+=s,s)},Ce=(e,t)=>{let n,r,s=e.max_chain_length,a=e.strstart,i=e.prev_length,Q=e.nice_match;const B=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,o=e.window,l=e.w_mask,F=e.prev,U=e.strstart+258;let c=o[a+i-1],g=o[a+i];e.prev_length>=e.good_match&&(s>>=2),Q>e.lookahead&&(Q=e.lookahead);do{if(n=t,o[n+i]===g&&o[n+i-1]===c&&o[n]===o[a]&&o[++n]===o[a+1]){a+=2,n++;do{}while(o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&ai){if(e.match_start=t,i=r,r>=Q)break;c=o[a+i-1],g=o[a+i]}}}while((t=F[t&l])>B&&0!=--s);return i<=e.lookahead?i:e.lookahead},be=e=>{const t=e.w_size;let n,r,s,a,i;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do{s=e.head[--n],e.head[n]=s>=t?s-t:0}while(--r);r=t,n=r;do{s=e.prev[--n],e.prev[n]=s>=t?s-t:0}while(--r);a+=t}if(0===e.strm.avail_in)break;if(r=me(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=ce(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=ce(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},ye=(e,t)=>{let n,r;for(;;){if(e.lookahead<262){if(be(e),e.lookahead<262&&t===O)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=ce(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=Ce(e,n)),e.match_length>=3)if(r=Y(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=ce(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ce(e,e.ins_h,e.window[e.strstart+1]);else r=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2},Se=(e,t)=>{let n,r,s;for(;;){if(e.lookahead<262){if(be(e),e.lookahead<262&&t===O)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=ce(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,r=Y(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=ce(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(de(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Y(e,0,e.window[e.strstart-1]),r&&de(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Y(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2};function Ze(e,t,n,r,s){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=s}const xe=[new Ze(0,0,0,0,(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(be(e),0===e.lookahead&&t===O)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,de(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(de(e,!1),e.strm.avail_out),1)}),new Ze(4,4,8,4,ye),new Ze(4,5,16,8,ye),new Ze(4,6,32,32,ye),new Ze(4,4,16,16,Se),new Ze(8,16,32,32,Se),new Ze(8,16,128,128,Se),new Ze(8,32,128,256,Se),new Ze(32,128,258,1024,Se),new Ze(32,258,258,4096,Se)];function Ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=oe,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Ue(this.dyn_ltree),Ue(this.dyn_dtree),Ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ue(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const he=e=>{if(!e||!e.state)return le(e,$);e.total_in=e.total_out=0,e.data_type=Be;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=O,k(t),_},pe=e=>{const t=he(e);var n;return t===_&&((n=e.state).window_size=2*n.w_size,Ue(n.head),n.max_lazy_match=xe[n.level].max_lazy,n.good_match=xe[n.level].good_length,n.nice_match=xe[n.level].nice_length,n.max_chain_length=xe[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Re=(e,t,n,r,s,a)=>{if(!e)return $;let i=1;if(t===ne&&(t=6),r<0?(i=0,r=-r):r>15&&(i=2,r-=16),s<1||s>9||n!==oe||r<8||r>15||t<0||t>9||a<0||a>ie)return le(e,$);8===r&&(r=9);const Q=new Ge;return e.state=Q,Q.strm=e,Q.wrap=i,Q.gzhead=null,Q.w_bits=r,Q.w_size=1<e&&e.state?2!==e.state.wrap?$:(e.state.gzhead=t,_):$,Ae=(e,t)=>{let n,r;if(!e||!e.state||t>j||t<0)return e?le(e,$):$;const s=e.state;if(!e.output||!e.input&&0!==e.avail_in||666===s.status&&t!==K)return le(e,0===e.avail_out?te:$);s.strm=e;const a=s.last_flush;if(s.last_flush=t,42===s.status)if(2===s.wrap)e.adler=0,ue(s,31),ue(s,139),ue(s,8),s.gzhead?(ue(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),ue(s,255&s.gzhead.time),ue(s,s.gzhead.time>>8&255),ue(s,s.gzhead.time>>16&255),ue(s,s.gzhead.time>>24&255),ue(s,9===s.level?2:s.strategy>=se||s.level<2?4:0),ue(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(ue(s,255&s.gzhead.extra.length),ue(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(e.adler=W(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69):(ue(s,0),ue(s,0),ue(s,0),ue(s,0),ue(s,0),ue(s,9===s.level?2:s.strategy>=se||s.level<2?4:0),ue(s,3),s.status=113);else{let t=oe+(s.w_bits-8<<4)<<8,n=-1;n=s.strategy>=se||s.level<2?0:s.level<6?1:6===s.level?2:3,t|=n<<6,0!==s.strstart&&(t|=32),t+=31-t%31,s.status=113,Ie(s,t),0!==s.strstart&&(Ie(s,e.adler>>>16),Ie(s,65535&e.adler)),e.adler=1}if(69===s.status)if(s.gzhead.extra){for(n=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),ge(e),n=s.pending,s.pending!==s.pending_buf_size));)ue(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=73)}else s.status=73;if(73===s.status)if(s.gzhead.name){n=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),ge(e),n=s.pending,s.pending===s.pending_buf_size)){r=1;break}r=s.gzindexn&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),0===r&&(s.gzindex=0,s.status=91)}else s.status=91;if(91===s.status)if(s.gzhead.comment){n=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),ge(e),n=s.pending,s.pending===s.pending_buf_size)){r=1;break}r=s.gzindexn&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),0===r&&(s.status=103)}else s.status=103;if(103===s.status&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&ge(e),s.pending+2<=s.pending_buf_size&&(ue(s,255&e.adler),ue(s,e.adler>>8&255),e.adler=0,s.status=113)):s.status=113),0!==s.pending){if(ge(e),0===e.avail_out)return s.last_flush=-1,_}else if(0===e.avail_in&&Fe(t)<=Fe(a)&&t!==K)return le(e,te);if(666===s.status&&0!==e.avail_in)return le(e,te);if(0!==e.avail_in||0!==s.lookahead||t!==O&&666!==s.status){let n=s.strategy===se?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(be(e),0===e.lookahead)){if(t===O)return 1;break}if(e.match_length=0,n=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(s,t):s.strategy===ae?((e,t)=>{let n,r,s,a;const i=e.window;for(;;){if(e.lookahead<=258){if(be(e),e.lookahead<=258&&t===O)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(s=e.strstart-1,r=i[s],r===i[++s]&&r===i[++s]&&r===i[++s])){a=e.strstart+258;do{}while(r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&se.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Y(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(s,t):xe[s.level].func(s,t);if(3!==n&&4!==n||(s.status=666),1===n||3===n)return 0===e.avail_out&&(s.last_flush=-1),_;if(2===n&&(t===z?w(s):t!==j&&(T(s,0,0,!1),t===P&&(Ue(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),ge(e),0===e.avail_out))return s.last_flush=-1,_}return t!==K?_:s.wrap<=0?q:(2===s.wrap?(ue(s,255&e.adler),ue(s,e.adler>>8&255),ue(s,e.adler>>16&255),ue(s,e.adler>>24&255),ue(s,255&e.total_in),ue(s,e.total_in>>8&255),ue(s,e.total_in>>16&255),ue(s,e.total_in>>24&255)):(Ie(s,e.adler>>>16),Ie(s,65535&e.adler)),ge(e),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?_:q)},Ne=e=>{if(!e||!e.state)return $;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?le(e,$):(e.state=null,113===t?le(e,ee):_)},Ee=(e,t)=>{let n=t.length;if(!e||!e.state)return $;const r=e.state,s=r.wrap;if(2===s||1===s&&42!==r.status||r.lookahead)return $;if(1===s&&(e.adler=v(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===s&&(Ue(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const a=e.avail_in,i=e.next_in,Q=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,be(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=ce(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,be(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=i,e.input=Q,e.avail_in=a,r.wrap=s,_};const fe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var De=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)fe(n,t)&&(e[t]=n[t])}}return e},ve=e=>{let t=0;for(let n=0,r=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;We[254]=We[254]=1;var Xe=e=>{let t,n,r,s,a,i=e.length,Q=0;for(s=0;s>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},He=(e,t)=>{let n,r;const s=t||e.length,a=new Array(2*s);for(r=0,n=0;n4)a[r++]=65533,n+=i-1;else{for(t&=2===i?31:3===i?15:7;i>1&&n1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Je)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+We[e[n]]>t?n:t},Te=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Me=Object.prototype.toString,{Z_NO_FLUSH:Ye,Z_SYNC_FLUSH:we,Z_FULL_FLUSH:Oe,Z_FINISH:ze,Z_OK:Pe,Z_STREAM_END:Ke,Z_DEFAULT_COMPRESSION:je,Z_DEFAULT_STRATEGY:_e,Z_DEFLATED:qe}=H;function $e(e){this.options=De({level:je,method:qe,chunkSize:16384,windowBits:15,memLevel:8,strategy:_e},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Te,this.strm.avail_out=0;let n=Ve(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Pe)throw new Error(X[n]);if(t.header&&Le(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Xe(t.dictionary):"[object ArrayBuffer]"===Me.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=Ee(this.strm,e),n!==Pe)throw new Error(X[n]);this._dict_set=!0}}function et(e,t){const n=new $e(t);if(n.push(e,!0),n.err)throw n.msg||X[n.err];return n.result}$e.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let s,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?ze:Ye,"string"==typeof e?n.input=Xe(e):"[object ArrayBuffer]"===Me.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===we||a===Oe)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(s=Ae(n,a),s===Ke)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),s=Ne(this.strm),this.onEnd(s),this.ended=!0,s===Pe;if(0!==n.avail_out){if(a>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},$e.prototype.onData=function(e){this.chunks.push(e)},$e.prototype.onEnd=function(e){e===Pe&&(this.result=ve(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var tt={Deflate:$e,deflate:et,deflateRaw:function(e,t){return(t=t||{}).raw=!0,et(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,et(e,t)},constants:H},nt=function(e,t){let n,r,s,a,i,Q,B,o,l,F,U,c,g,d,u,I,m,C,b,y,S,Z,x,G;const h=e.state;n=e.next_in,x=e.input,r=n+(e.avail_in-5),s=e.next_out,G=e.output,a=s-(t-e.avail_out),i=s+(e.avail_out-257),Q=h.dmax,B=h.wsize,o=h.whave,l=h.wnext,F=h.window,U=h.hold,c=h.bits,g=h.lencode,d=h.distcode,u=(1<>>24,U>>>=C,c-=C,C=m>>>16&255,0===C)G[s++]=65535&m;else{if(!(16&C)){if(0==(64&C)){m=g[(65535&m)+(U&(1<>>=C,c-=C),c<15&&(U+=x[n++]<>>24,U>>>=C,c-=C,C=m>>>16&255,!(16&C)){if(0==(64&C)){m=d[(65535&m)+(U&(1<Q){e.msg="invalid distance too far back",h.mode=30;break e}if(U>>>=C,c-=C,C=s-a,y>C){if(C=y-C,C>o&&h.sane){e.msg="invalid distance too far back",h.mode=30;break e}if(S=0,Z=F,0===l){if(S+=B-C,C2;)G[s++]=Z[S++],G[s++]=Z[S++],G[s++]=Z[S++],b-=3;b&&(G[s++]=Z[S++],b>1&&(G[s++]=Z[S++]))}else{S=s-y;do{G[s++]=G[S++],G[s++]=G[S++],G[s++]=G[S++],b-=3}while(b>2);b&&(G[s++]=G[S++],b>1&&(G[s++]=G[S++]))}break}}break}}while(n>3,n-=b,c-=b<<3,U&=(1<{const B=Q.bits;let o,l,F,U,c,g,d=0,u=0,I=0,m=0,C=0,b=0,y=0,S=0,Z=0,x=0,G=null,h=0;const p=new Uint16Array(16),R=new Uint16Array(16);let V,L,A,N=null,E=0;for(d=0;d<=15;d++)p[d]=0;for(u=0;u=1&&0===p[m];m--);if(C>m&&(C=m),0===m)return s[a++]=20971520,s[a++]=20971520,Q.bits=1,0;for(I=1;I0&&(0===e||1!==m))return-1;for(R[1]=0,d=1;d<15;d++)R[d+1]=R[d]+p[d];for(u=0;u852||2===e&&Z>592)return 1;for(;;){V=d-y,i[u]g?(L=N[E+i[u]],A=G[h+i[u]]):(L=96,A=0),o=1<>y)+l]=V<<24|L<<16|A|0}while(0!==l);for(o=1<>=1;if(0!==o?(x&=o-1,x+=o):x=0,u++,0==--p[d]){if(d===m)break;d=t[n+i[u]]}if(d>C&&(x&U)!==F){for(0===y&&(y=C),c+=I,b=d-y,S=1<852||2===e&&Z>592)return 1;F=x&U,s[F]=C<<24|b<<16|c-a|0}}return 0!==x&&(s[c+x]=d-y<<24|64<<16|0),Q.bits=C,0};const{Z_FINISH:Bt,Z_BLOCK:ot,Z_TREES:lt,Z_OK:Ft,Z_STREAM_END:Ut,Z_NEED_DICT:ct,Z_STREAM_ERROR:gt,Z_DATA_ERROR:dt,Z_MEM_ERROR:ut,Z_BUF_ERROR:It,Z_DEFLATED:mt}=H,Ct=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function bt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const yt=e=>{if(!e||!e.state)return gt;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Ft},St=e=>{if(!e||!e.state)return gt;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yt(e)},Zt=(e,t)=>{let n;if(!e||!e.state)return gt;const r=e.state;return t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?gt:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,St(e))},xt=(e,t)=>{if(!e)return gt;const n=new bt;e.state=n,n.window=null;const r=Zt(e,t);return r!==Ft&&(e.state=null),r};let Gt,ht,pt=!0;const Rt=e=>{if(pt){Gt=new Int32Array(512),ht=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Qt(1,e.lens,0,288,Gt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Qt(2,e.lens,0,32,ht,0,e.work,{bits:5}),pt=!1}e.lencode=Gt,e.lenbits=9,e.distcode=ht,e.distbits=5},Vt=(e,t,n,r)=>{let s;const a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>r&&(s=r),a.window.set(t.subarray(n-r,n-r+s),a.wnext),(r-=s)?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave{let n,r,s,a,i,Q,B,o,l,F,U,c,g,d,u,I,m,C,b,y,S,Z,x=0;const G=new Uint8Array(4);let h,p;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return gt;n=e.state,12===n.mode&&(n.mode=13),i=e.next_out,s=e.output,B=e.avail_out,a=e.next_in,r=e.input,Q=e.avail_in,o=n.hold,l=n.bits,F=Q,U=B,Z=Ft;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===Q)break e;Q--,o+=r[a++]<>>8&255,n.check=W(n.check,G,2,0),o=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&o)<<8)+(o>>8))%31){e.msg="incorrect header check",n.mode=30;break}if((15&o)!==mt){e.msg="unknown compression method",n.mode=30;break}if(o>>>=4,l-=4,S=8+(15&o),0===n.wbits)n.wbits=S;else if(S>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(G[0]=255&o,G[1]=o>>>8&255,n.check=W(n.check,G,2,0)),o=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,n.check=W(n.check,G,4,0)),o=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===Q)break e;Q--,o+=r[a++]<>8),512&n.flags&&(G[0]=255&o,G[1]=o>>>8&255,n.check=W(n.check,G,2,0)),o=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===Q)break e;Q--,o+=r[a++]<>>8&255,n.check=W(n.check,G,2,0)),o=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(c=n.length,c>Q&&(c=Q),c&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+c),S)),512&n.flags&&(n.check=W(n.check,r,c,a)),Q-=c,a+=c,n.length-=c),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===Q)break e;c=0;do{S=r[a+c++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&c>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===Q)break e;Q--,o+=r[a++]<>>=1,l-=1,3&o){case 0:n.mode=14;break;case 1:if(Rt(n),n.mode=20,t===lt){o>>>=2,l-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}o>>>=2,l-=2;break;case 14:for(o>>>=7&l,l-=7&l;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&o,o=0,l=0,n.mode=15,t===lt)break e;case 15:n.mode=16;case 16:if(c=n.length,c){if(c>Q&&(c=Q),c>B&&(c=B),0===c)break e;s.set(r.subarray(a,a+c),i),Q-=c,a+=c,B-=c,i+=c,n.length-=c;break}n.mode=12;break;case 17:for(;l<14;){if(0===Q)break e;Q--,o+=r[a++]<>>=5,l-=5,n.ndist=1+(31&o),o>>>=5,l-=5,n.ncode=4+(15&o),o>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,l-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,h={bits:n.lenbits},Z=Qt(0,n.lens,0,19,n.lencode,0,n.work,h),n.lenbits=h.bits,Z){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>24,I=x>>>16&255,m=65535&x,!(u<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=u,l-=u,n.lens[n.have++]=m;else{if(16===m){for(p=u+2;l>>=u,l-=u,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],c=3+(3&o),o>>>=2,l-=2}else if(17===m){for(p=u+3;l>>=u,l-=u,S=0,c=3+(7&o),o>>>=3,l-=3}else{for(p=u+7;l>>=u,l-=u,S=0,c=11+(127&o),o>>>=7,l-=7}if(n.have+c>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;c--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,h={bits:n.lenbits},Z=Qt(1,n.lens,0,n.nlen,n.lencode,0,n.work,h),n.lenbits=h.bits,Z){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,h={bits:n.distbits},Z=Qt(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,h),n.distbits=h.bits,Z){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,t===lt)break e;case 20:n.mode=21;case 21:if(Q>=6&&B>=258){e.next_out=i,e.avail_out=B,e.next_in=a,e.avail_in=Q,n.hold=o,n.bits=l,nt(e,U),i=e.next_out,s=e.output,B=e.avail_out,a=e.next_in,r=e.input,Q=e.avail_in,o=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;x=n.lencode[o&(1<>>24,I=x>>>16&255,m=65535&x,!(u<=l);){if(0===Q)break e;Q--,o+=r[a++]<>C)],u=x>>>24,I=x>>>16&255,m=65535&x,!(C+u<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=C,l-=C,n.back+=C}if(o>>>=u,l-=u,n.back+=u,n.length=m,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(p=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;x=n.distcode[o&(1<>>24,I=x>>>16&255,m=65535&x,!(u<=l);){if(0===Q)break e;Q--,o+=r[a++]<>C)],u=x>>>24,I=x>>>16&255,m=65535&x,!(C+u<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=C,l-=C,n.back+=C}if(o>>>=u,l-=u,n.back+=u,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(p=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===B)break e;if(c=U-B,n.offset>c){if(c=n.offset-c,c>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}c>n.wnext?(c-=n.wnext,g=n.wsize-c):g=n.wnext-c,c>n.length&&(c=n.length),d=n.window}else d=s,g=i-n.offset,c=n.length;c>B&&(c=B),B-=c,n.length-=c;do{s[i++]=d[g++]}while(--c);0===n.length&&(n.mode=21);break;case 26:if(0===B)break e;s[i++]=n.length,B--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===Q)break e;Q--,o|=r[a++]<{if(!e||!e.state)return gt;let t=e.state;return t.window&&(t.window=null),e.state=null,Ft},ft=(e,t)=>{if(!e||!e.state)return gt;const n=e.state;return 0==(2&n.wrap)?gt:(n.head=t,t.done=!1,Ft)},Dt=(e,t)=>{const n=t.length;let r,s,a;return e&&e.state?(r=e.state,0!==r.wrap&&11!==r.mode?gt:11===r.mode&&(s=1,s=v(s,t,n,0),s!==r.check)?dt:(a=Vt(e,t,n,n),a?(r.mode=31,ut):(r.havedict=1,Ft))):gt},vt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Wt,Z_FINISH:Xt,Z_OK:Ht,Z_STREAM_END:kt,Z_NEED_DICT:Tt,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:Yt,Z_MEM_ERROR:wt}=H;function Ot(e){this.options=De({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Te,this.strm.avail_out=0;let n=At(this.strm,t.windowBits);if(n!==Ht)throw new Error(X[n]);if(this.header=new vt,ft(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Xe(t.dictionary):"[object ArrayBuffer]"===Jt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Dt(this.strm,t.dictionary),n!==Ht)))throw new Error(X[n])}function zt(e,t){const n=new Ot(t);if(n.push(e),n.err)throw n.msg||X[n.err];return n.result}Ot.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let a,i,Q;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Xt:Wt,"[object ArrayBuffer]"===Jt.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=Nt(n,i),a===Tt&&s&&(a=Dt(n,s),a===Ht?a=Nt(n,i):a===Yt&&(a=Tt));n.avail_in>0&&a===kt&&n.state.wrap>0&&0!==e[n.next_in];)Lt(n),a=Nt(n,i);switch(a){case Mt:case Yt:case Tt:case wt:return this.onEnd(a),this.ended=!0,!1}if(Q=n.avail_out,n.next_out&&(0===n.avail_out||a===kt))if("string"===this.options.to){let e=ke(n.output,n.next_out),t=n.next_out-e,s=He(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(s)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==Ht||0!==Q){if(a===kt)return a=Et(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ot.prototype.onData=function(e){this.chunks.push(e)},Ot.prototype.onEnd=function(e){e===Ht&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ve(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Pt={Inflate:Ot,inflate:zt,inflateRaw:function(e,t){return(t=t||{}).raw=!0,zt(e,t)},ungzip:zt,constants:H};const{Deflate:Kt,deflate:jt,deflateRaw:_t,gzip:qt}=tt,{Inflate:$t,inflate:en,inflateRaw:tn,ungzip:nn}=Pt;var rn={Deflate:Kt,deflate:jt,deflateRaw:_t,gzip:qt,Inflate:$t,inflate:en,inflateRaw:tn,ungzip:nn,constants:H}},function(e,t,n){"use strict";var r,s,a=n(10),i=a.b.MutationObserver||a.b.WebKitMutationObserver;if(i){var Q=0,B=new i(U),o=a.b.document.createTextNode("");B.observe(o,{characterData:!0}),r=function(){o.data=Q=++Q%2}}else if(a.b.setImmediate||void 0===a.b.MessageChannel)r="document"in a.b&&"onreadystatechange"in a.b.document.createElement("script")?function(){var e=a.b.document.createElement("script");e.onreadystatechange=function(){U(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},a.b.document.documentElement.appendChild(e)}:function(){setTimeout(U,0)};else{var l=new a.b.MessageChannel;l.port1.onmessage=U,r=function(){l.port2.postMessage(0)}}var F=[];function U(){var e,t;s=!0;for(var n=F.length;n;){for(t=F,F=[],e=-1;++e2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}s("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),s("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,s,i;if("string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var Q=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(Q," ").concat(r," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof n)}),TypeError),s("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),s("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),s("ERR_STREAM_PREMATURE_CLOSE","Premature close"),s("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),s("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),s("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),s("ERR_STREAM_WRITE_AFTER_END","write after end"),s("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),s("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),s("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var i={codes:r}},function(e,t,n){"use strict";n(6);var r=n(0),s=n(38),a=n(16);function i(){var e=new ArrayBuffer(4),t=new Uint8Array(e),n=new Uint32Array(e);return t[0]=161,t[1]=178,t[2]=195,t[3]=212,3569595041===n[0]?"LittleEndian":2712847316===n[0]?"BigEndian":null}var Q={ENDIANNESS:i(),getEndianness:i,swapBytes:function(e,t){if(!(t<2))for(var n=new Int8Array(e),r=n.length,s=[],a=0;a1?arguments[1]:void 0;return new Promise((function(t,n){var r=U(g(e));null===r?n(new Error("No such JSON ".concat(e))):t(JSON.parse(r))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(t,n){var r=U(e);null===r?n(new Error("No such text ".concat(e))):t(r)}))},fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(i,c){var d=g([t,n.ref.basepath,r.compression?"".concat(n.ref.id,".gz"):n.ref.id].join("/")),u=U(d);if(null===u)c(new Error("No such array ".concat(d)));else{if("string"===n.dataType){var I=atob(u);r.compression&&(I=B.a.inflate(I,{to:"string"})),n.values=JSON.parse(I)}else{var m=new Uint8Array(s.a.toArrayBuffer(u));n.buffer=new ArrayBuffer(m.length),new Uint8Array(n.buffer).set(m),r.compression&&("string"===n.dataType||"JSON"===n.dataType?n.buffer=B.a.inflate(new Uint8Array(n.buffer),{to:"string"}):n.buffer=B.a.inflate(new Uint8Array(n.buffer)).buffer),"JSON"===n.ref.encode?n.values=JSON.parse(n.buffer):(Q.ENDIANNESS!==n.ref.encode&&Q.ENDIANNESS&&(l("Swap bytes of ".concat(n.name)),Q.swapBytes(n.buffer,a.a[n.dataType])),n.values=new window[n.dataType](n.buffer)),n.values.length!==n.size&&o("Error in FetchArray: ".concat(n.name," does not have the proper array size. Got ").concat(n.values.length,", instead of ").concat(n.size))}delete n.ref,0==--F&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),i(n)}}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(t,n){var r=c(e);r?t(r):n(new Error("No such image ".concat(e)))}))}},u=n(14),I=r.b.vtkErrorMacro,m=r.b.vtkDebugMacro,C=0;function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new XMLHttpRequest;return r.open(e,t,!0),n.headers&&Object.entries(n.headers).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],s=t[1];return r.setRequestHeader(n,s)})),n.progressCallback&&r.addEventListener("progress",n.progressCallback),r}var y={fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n.ref&&!n.ref.pending?new Promise((function(s,i){var o=b("GET",[t,n.ref.basepath,r.compression?"".concat(n.ref.id,".gz"):n.ref.id].join("/"),r);o.onreadystatechange=function(t){1===o.readyState&&(n.ref.pending=!0,1==++C&&e.invokeBusy&&e.invokeBusy(!0)),4===o.readyState&&(n.ref.pending=!1,200===o.status||0===o.status?(n.buffer=o.response,r.compression&&("string"===n.dataType||"JSON"===n.dataType?n.buffer=B.a.inflate(new Uint8Array(n.buffer),{to:"string"}):n.buffer=B.a.inflate(new Uint8Array(n.buffer)).buffer),"JSON"===n.ref.encode?n.values=JSON.parse(n.buffer):(Q.ENDIANNESS!==n.ref.encode&&Q.ENDIANNESS&&(m("Swap bytes of ".concat(n.name)),Q.swapBytes(n.buffer,a.a[n.dataType])),n.values=new window[n.dataType](n.buffer)),n.values.length!==n.size&&I("Error in FetchArray: ".concat(n.name,", does not have the proper array size. Got ").concat(n.values.length,", instead of ").concat(n.size)),delete n.ref,0==--C&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),s(n)):i({xhr:o,e:t}))},o.responseType=r.compression||"string"!==n.dataType?"arraybuffer":"text",o.send()})):Promise.resolve(n)},fetchJSON:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(r,s){var a=b("GET",t,n);a.onreadystatechange=function(t){1===a.readyState&&1==++C&&e.invokeBusy&&e.invokeBusy(!0),4===a.readyState&&(0==--C&&e.invokeBusy&&e.invokeBusy(!1),200===a.status||0===a.status?n.compression?r(JSON.parse(B.a.inflate(new Uint8Array(a.response),{to:"string"}))):r(JSON.parse(a.responseText)):s({xhr:a,e:t}))},a.responseType=n.compression?"arraybuffer":"text",a.send()}))},fetchText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n&&n.compression&&"gz"!==n.compression&&(I("Supported algorithms are: [gz]"),I("Unkown compression algorithm: ".concat(n.compression))),new Promise((function(r,s){var a=b("GET",t,n);a.onreadystatechange=function(t){1===a.readyState&&1==++C&&e.invokeBusy&&e.invokeBusy(!0),4===a.readyState&&(0==--C&&e.invokeBusy&&e.invokeBusy(!1),200===a.status||0===a.status?n.compression?r(B.a.inflate(new Uint8Array(a.response),{to:"string"})):r(a.responseText):s({xhr:a,e:t}))},a.responseType=n.compression?"arraybuffer":"text",a.send()}))},fetchBinary:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var s=b("GET",e,t);s.onreadystatechange=function(e){4===s.readyState&&(200===s.status||0===s.status?n(s.response):r({xhr:s,e:e}))},s.responseType="arraybuffer",s.send()}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(n,r){var s=new Image;t.crossOrigin&&(s.crossOrigin=t.crossOrigin),s.onload=function(){return n(s)},s.onerror=r,s.src=e}))}},S=n(17),Z=n(23),x={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},G=n(24),h=n(7),p=n(13),R=n(10),V=Object(R.d)((function(e,t){for(var n=new Array(256),r=0;r<256;r++)n[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function s(){p.a.call(this,"utf-8 decode"),this.leftOver=null}function a(){p.a.call(this,"utf-8 encode")}n[254]=n[254]=1,t.utf8encode=function(e){return S.a.nodebuffer?G.a.newBufferFrom(e,"utf-8"):function(e){var t,n,r,s,a,i=e.length,Q=0;for(s=0;s>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t}(e)},t.utf8decode=function(e){return S.a.nodebuffer?h.a.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,s,a,i=e.length,Q=new Array(2*i);for(r=0,t=0;t4)Q[r++]=65533,t+=a-1;else{for(s&=2===a?31:3===a?15:7;a>1&&t1?Q[r++]=65533:s<65536?Q[r++]=s:(s-=65536,Q[r++]=55296|s>>10&1023,Q[r++]=56320|1023&s)}return Q.length!==r&&(Q.subarray?Q=Q.subarray(0,r):Q.length=r),h.a.applyFromCharCode(Q)}(e=h.a.transformTo(S.a.uint8array?"uint8array":"array",e))},h.a.inherits(s,p.a),s.prototype.processChunk=function(e){var r=h.a.transformTo(S.a.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(S.a.uint8array){var s=r;(r=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),r.set(s,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}(r),i=r;a!==r.length&&(S.a.uint8array?(i=r.subarray(0,a),this.leftOver=r.subarray(a,r.length)):(i=r.slice(0,a),this.leftOver=r.slice(a,r.length))),this.push({data:t.utf8decode(i),meta:e.meta})},s.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=s,h.a.inherits(a,p.a),a.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=a}),"/$$rollup_base$$/node_modules/jszip/lib"),L=n(52);function A(e){p.a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=h.a.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}h.a.inherits(A,p.a),A.prototype.cleanUp=function(){p.a.prototype.cleanUp.call(this),this.data=null},A.prototype.resume=function(){return!!p.a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.a.delay(this._tickAndRepeat,[],this)),!0)},A.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},A.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var N=A;function E(e){p.a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}h.a.inherits(E,p.a),E.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}p.a.prototype.processChunk.call(this,e)};var f=E,D=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),v=function(e,t){return void 0!==e&&e.length?"string"!==h.a.getTypeOf(e)?function(e,t,n,r){var s=D,a=0+n;e^=-1;for(var i=0;i>>8^s[255&(e^t[i])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var s=D,a=0+n;e^=-1;for(var i=0;i>>8^s[255&(e^t.charCodeAt(i))];return-1^e}(0|t,e,e.length):0};function J(){p.a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}h.a.inherits(J,p.a),J.prototype.processChunk=function(e){this.streamInfo.crc32=v(e.data,this.streamInfo.crc32||0),this.push(e)};var W=J;function X(e,t,n,r,s){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=s}X.prototype={getContentWorker:function(){var e=new N(Z.a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new f("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new N(Z.a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},X.createWorkerFrom=function(e,t,n){return e.pipe(new W).pipe(new f("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new f("compressedSize")).withStreamInfo("compression",t)};var H=X,k=function(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};k.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(t=t.pipe(new V.Utf8EncodeWorker)),!s&&r&&(t=t.pipe(new V.Utf8DecodeWorker))}catch(e){(t=new p.a("error")).error(e)}return new L.a(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof H&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new V.Utf8EncodeWorker)),H.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof H?this._data.getContentWorker():this._data instanceof p.a?this._data:new N(this._data)}};for(var T=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],M=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},Y=0;Y=0;)e[t]=0}var K=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$=new Array(576);P($);var ee=new Array(60);P(ee);var te=new Array(512);P(te);var ne=new Array(256);P(ne);var re=new Array(29);P(re);var se,ae,ie,Qe=new Array(30);function Be(e,t,n,r,s){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}function oe(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function le(e){return e<256?te[e]:te[256+(e>>>7)]}function Fe(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Ue(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function de(e,t,n){var r,s,a=new Array(16),i=0;for(r=1;r<=15;r++)a[r]=i=i+n[r-1]<<1;for(s=0;s<=t;s++){var Q=e[2*s+1];0!==Q&&(e[2*s]=ge(a[Q]++,Q))}}function ue(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Ie(e){e.bi_valid>8?Fe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function me(e,t,n,r){var s=2*t,a=2*n;return e[s]>1;n>=1;n--)Ce(e,a,n);s=B;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ce(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*s]=a[2*n]+a[2*r],e.depth[s]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=s,e.heap[1]=s++,Ce(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,s,a,i,Q,B=t.dyn_tree,o=t.max_code,l=t.stat_desc.static_tree,F=t.stat_desc.has_stree,U=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,g=t.stat_desc.max_length,d=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(B[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(a=B[2*B[2*(r=e.heap[n])+1]+1]+1)>g&&(a=g,d++),B[2*r+1]=a,r>o||(e.bl_count[a]++,i=0,r>=c&&(i=U[r-c]),Q=B[2*r],e.opt_len+=Q*(a+i),F&&(e.static_len+=Q*(l[2*r+1]+i)));if(0!==d){do{for(a=g-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,d-=2}while(d>0);for(a=g;0!==a;a--)for(r=e.bl_count[a];0!==r;)(s=e.heap[--n])>o||(B[2*s+1]!==a&&(e.opt_len+=(a-B[2*s+1])*B[2*s],B[2*s+1]=a),r--)}}(e,t),de(a,o,e.bl_count)}function Se(e,t,n){var r,s,a=-1,i=t[1],Q=0,B=7,o=4;for(0===i&&(B=138,o=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)s=i,i=t[2*(r+1)+1],++Q>=7;r<30;r++)for(Qe[r]=s<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),ye(e,e.l_desc),ye(e,e.d_desc),i=function(e){var t;for(Se(e,e.dyn_ltree,e.l_desc.max_code),Se(e,e.dyn_dtree,e.d_desc.max_code),ye(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*q[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=s&&(s=a)):s=a=n+5,n+4<=s&&-1!==t?Ge(e,t,n,r):4===e.strategy||a===s?(Ue(e,2+(r?1:0),3),be(e,$,ee)):(Ue(e,4+(r?1:0),3),function(e,t,n,r){var s;for(Ue(e,t-257,5),Ue(e,n-1,5),Ue(e,r-4,4),s=0;s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ne[n]+256+1)]++,e.dyn_dtree[2*le(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){Ue(e,2,3),ce(e,256,$),function(e){16===e.bi_valid?(Fe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},Re=function(e,t,n,r){for(var s=65535&e|0,a=e>>>16&65535|0,i=0;0!==n;){n-=i=n>2e3?2e3:n;do{a=a+(s=s+t[r++]|0)|0}while(--i);s%=65521,a%=65521}return s|a<<16|0},Ve=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),Le=function(e,t,n,r){var s=Ve,a=r+n;e^=-1;for(var i=r;i>>8^s[255&(e^t[i])];return-1^e};function Ae(e,t){return e.msg=z[t],t}function Ne(e){return(e<<1)-(e>4?9:0)}function Ee(e){for(var t=e.length;--t>=0;)e[t]=0}function fe(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(O.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function De(e,t){pe._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,fe(e.strm)}function ve(e,t){e.pending_buf[e.pending++]=t}function Je(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function We(e,t){var n,r,s=e.max_chain_length,a=e.strstart,i=e.prev_length,Q=e.nice_match,B=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,o=e.window,l=e.w_mask,F=e.prev,U=e.strstart+258,c=o[a+i-1],g=o[a+i];e.prev_length>=e.good_match&&(s>>=2),Q>e.lookahead&&(Q=e.lookahead);do{if(o[(n=t)+i]===g&&o[n+i-1]===c&&o[n]===o[a]&&o[++n]===o[a+1]){a+=2,n++;do{}while(o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&ai){if(e.match_start=t,i=r,r>=Q)break;c=o[a+i-1],g=o[a+i]}}}while((t=F[t&l])>B&&0!=--s);return i<=e.lookahead?i:e.lookahead}function Xe(e){var t,n,r,s,a,i,Q,B,o,l,F=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=F+(F-262)){O.arraySet(e.window,e.window,F,F,0),e.match_start-=F,e.strstart-=F,e.block_start-=F,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=F?r-F:0}while(--n);t=n=F;do{r=e.prev[--t],e.prev[t]=r>=F?r-F:0}while(--n);s+=F}if(0===e.strm.avail_in)break;if(i=e.strm,Q=e.window,B=e.strstart+e.lookahead,o=s,l=void 0,(l=i.avail_in)>o&&(l=o),n=0===l?0:(i.avail_in-=l,O.arraySet(Q,i.input,i.next_in,l,B),1===i.state.wrap?i.adler=Re(i.adler,Q,l,B):2===i.state.wrap&&(i.adler=Le(i.adler,Q,l,B)),i.next_in+=l,i.total_in+=l,l),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(r=pe._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,r=pe._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=(e.ins_h<15&&(i=2,r-=16),s<1||s>9||8!==n||r<8||r>15||t<0||t>9||a<0||a>4)return Ae(e,-2);8===r&&(r=9);var Q=new Me;return e.state=Q,Q.strm=e,Q.wrap=i,Q.gzhead=null,Q.w_bits=r,Q.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xe(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,De(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(De(e,!1),e.strm.avail_out),1)})),new Te(4,4,8,4,He),new Te(4,5,16,8,He),new Te(4,6,32,32,He),new Te(4,4,16,16,ke),new Te(8,16,32,32,ke),new Te(8,16,128,128,ke),new Te(8,32,128,256,ke),new Te(32,128,258,1024,ke),new Te(32,258,258,4096,ke)];var ze={deflateInit:function(e,t){return Oe(e,t,8,15,8,0)},deflateInit2:Oe,deflateReset:we,deflateResetKeep:Ye,deflateSetHeader:function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},deflate:function(e,t){var n,r,s,a;if(!e||!e.state||t>5||t<0)return e?Ae(e,-2):-2;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&4!==t)return Ae(e,0===e.avail_out?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead?(ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,255&r.gzhead.time),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ve(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,255&r.gzhead.extra.length),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Le(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ve(r,3),r.status=113);else{var i=8+(r.w_bits-8<<4)<<8;i|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(i|=32),i+=31-i%31,r.status=113,Je(r,i),0!==r.strstart&&(Je(r,e.adler>>>16),Je(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),fe(e),s=r.pending,r.pending!==r.pending_buf_size));)ve(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),fe(e),s=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindexs&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),0===a&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),fe(e),s=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindexs&&(e.adler=Le(e.adler,r.pending_buf,r.pending-s,s)),0===a&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&fe(e),r.pending+2<=r.pending_buf_size&&(ve(r,255&e.adler),ve(r,e.adler>>8&255),e.adler=0,r.status=113)):r.status=113),0!==r.pending){if(fe(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&Ne(t)<=Ne(n)&&4!==t)return Ae(e,-5);if(666===r.status&&0!==e.avail_in)return Ae(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var Q=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(Xe(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=pe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(De(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,r,s,a,i=e.window;;){if(e.lookahead<=258){if(Xe(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=i[s=e.strstart-1])===i[++s]&&r===i[++s]&&r===i[++s]){a=e.strstart+258;do{}while(r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&r===i[++s]&&se.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=pe._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=pe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(De(e,!1),0===e.strm.avail_out)?1:2}(r,t):he[r.level].func(r,t);if(3!==Q&&4!==Q||(r.status=666),1===Q||3===Q)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===Q&&(1===t?pe._tr_align(r):5!==t&&(pe._tr_stored_block(r,0,0,!1),3===t&&(Ee(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),fe(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(ve(r,255&e.adler),ve(r,e.adler>>8&255),ve(r,e.adler>>16&255),ve(r,e.adler>>24&255),ve(r,255&e.total_in),ve(r,e.total_in>>8&255),ve(r,e.total_in>>16&255),ve(r,e.total_in>>24&255)):(Je(r,e.adler>>>16),Je(r,65535&e.adler)),fe(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},deflateEnd:function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?Ae(e,-2):(e.state=null,113===t?Ae(e,-3):0):-2},deflateSetDictionary:function(e,t){var n,r,s,a,i,Q,B,o,l=t.length;if(!e||!e.state)return-2;if(2===(a=(n=e.state).wrap)||1===a&&42!==n.status||n.lookahead)return-2;for(1===a&&(e.adler=Re(e.adler,t,l,0)),n.wrap=0,l>=n.w_size&&(0===a&&(Ee(n.head),n.strstart=0,n.block_start=0,n.insert=0),o=new O.Buf8(n.w_size),O.arraySet(o,t,l-n.w_size,n.w_size,0),t=o,l=n.w_size),i=e.avail_in,Q=e.next_in,B=e.input,e.avail_in=l,e.next_in=0,e.input=t,Xe(n);n.lookahead>=3;){r=n.strstart,s=n.lookahead-2;do{n.ins_h=(n.ins_h<=252?6:_e>=248?5:_e>=240?4:_e>=224?3:_e>=192?2:1;function qe(e,t){if(t<65534&&(e.subarray&&Ke||!e.subarray&&Pe))return String.fromCharCode.apply(null,O.shrinkBuf(e,t));for(var n="",r=0;r>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},et=function(e){return qe(e,e.length)},tt=function(e){for(var t=new O.Buf8(e.length),n=0,r=t.length;n4)Q[r++]=65533,n+=a-1;else{for(s&=2===a?31:3===a?15:7;a>1&&n1?Q[r++]=65533:s<65536?Q[r++]=s:(s-=65536,Q[r++]=55296|s>>10&1023,Q[r++]=56320|1023&s)}return qe(Q,r)},rt=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+je[e[n]]>t?n:t},st=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},at=Object.prototype.toString;function it(e){if(!(this instanceof it))return new it(e);this.options=O.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new st,this.strm.avail_out=0;var n=ze.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(z[n]);if(t.header&&ze.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(r="string"==typeof t.dictionary?$e(t.dictionary):"[object ArrayBuffer]"===at.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=ze.deflateSetDictionary(this.strm,r)))throw new Error(z[n]);this._dict_set=!0}}function Qt(e,t){var n=new it(t);if(n.push(e,!0),n.err)throw n.msg||z[n.err];return n.result}it.prototype.push=function(e,t){var n,r,s=this.strm,a=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=$e(e):"[object ArrayBuffer]"===at.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new O.Buf8(a),s.next_out=0,s.avail_out=a),1!==(n=ze.deflate(s,r))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(et(O.shrinkBuf(s.output,s.next_out))):this.onData(O.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==n);return 4===r?(n=ze.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==r||(this.onEnd(0),s.avail_out=0,!0)},it.prototype.onData=function(e){this.chunks.push(e)},it.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=O.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Bt={Deflate:it,deflate:Qt,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Qt(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Qt(e,t)}},ot={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},lt=function(e,t){var n,r,s,a,i,Q,B,o,l,F,U,c,g,d,u,I,m,C,b,y,S,Z,x,G,h;n=e.state,r=e.next_in,G=e.input,s=r+(e.avail_in-5),a=e.next_out,h=e.output,i=a-(t-e.avail_out),Q=a+(e.avail_out-257),B=n.dmax,o=n.wsize,l=n.whave,F=n.wnext,U=n.window,c=n.hold,g=n.bits,d=n.lencode,u=n.distcode,I=(1<>>=b=C>>>24,g-=b,0==(b=C>>>16&255))h[a++]=65535&C;else{if(!(16&b)){if(0==(64&b)){C=d[(65535&C)+(c&(1<>>=b,g-=b),g<15&&(c+=G[r++]<>>=b=C>>>24,g-=b,!(16&(b=C>>>16&255))){if(0==(64&b)){C=u[(65535&C)+(c&(1<B){e.msg="invalid distance too far back",n.mode=30;break e}if(c>>>=b,g-=b,S>(b=a-i)){if((b=S-b)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(Z=0,x=U,0===F){if(Z+=o-b,b2;)h[a++]=x[Z++],h[a++]=x[Z++],h[a++]=x[Z++],y-=3;y&&(h[a++]=x[Z++],y>1&&(h[a++]=x[Z++]))}else{Z=a-S;do{h[a++]=h[Z++],h[a++]=h[Z++],h[a++]=h[Z++],y-=3}while(y>2);y&&(h[a++]=h[Z++],y>1&&(h[a++]=h[Z++]))}break}}break}}while(r>3,c&=(1<<(g-=y<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r=1&&0===L[y];y--);if(S>y&&(S=y),0===y)return s[a++]=20971520,s[a++]=20971520,Q.bits=1,0;for(b=1;b0&&(0===e||1!==y))return-1;for(A[1]=0,m=1;m<15;m++)A[m+1]=A[m]+L[m];for(C=0;C852||2===e&&h>592)return 1;for(;;){g=m-x,i[C]c?(d=N[E+i[C]],u=R[V+i[C]]):(d=96,u=0),B=1<>x)+(o-=B)]=g<<24|d<<16|u|0}while(0!==o);for(B=1<>=1;if(0!==B?(p&=B-1,p+=B):p=0,C++,0==--L[m]){if(m===y)break;m=t[n+i[C]]}if(m>S&&(p&F)!==l){for(0===x&&(x=S),U+=b,G=1<<(Z=m-x);Z+x852||2===e&&h>592)return 1;s[l=p&F]=S<<24|Z<<16|U-a|0}}return 0!==p&&(s[U+p]=m-x<<24|64<<16|0),Q.bits=S,0};function ut(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function It(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function mt(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(852),t.distcode=t.distdyn=new O.Buf32(592),t.sane=1,t.back=-1,0):-2}function Ct(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,mt(e)):-2}function bt(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Ct(e))):-2}function yt(e,t){var n,r;return e?(r=new It,e.state=r,r.window=null,0!==(n=bt(e,t))&&(e.state=null),n):-2}var St,Zt,xt=!0;function Gt(e){if(xt){var t;for(St=new O.Buf32(512),Zt=new O.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(dt(1,e.lens,0,288,St,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;dt(2,e.lens,0,32,Zt,0,e.work,{bits:5}),xt=!1}e.lencode=St,e.lenbits=9,e.distcode=Zt,e.distbits=5}function ht(e,t,n,r){var s,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(O.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((s=a.wsize-a.wnext)>r&&(s=r),O.arraySet(a.window,t,n-r,s,a.wnext),(r-=s)?(O.arraySet(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,n.check=Le(n.check,p,2,0),o=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&o)<<8)+(o>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&o)){e.msg="unknown compression method",n.mode=30;break}if(l-=4,S=8+(15&(o>>>=4)),0===n.wbits)n.wbits=S;else if(S>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(p[0]=255&o,p[1]=o>>>8&255,n.check=Le(n.check,p,2,0)),o=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>8&255,p[2]=o>>>16&255,p[3]=o>>>24&255,n.check=Le(n.check,p,4,0)),o=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===Q)break e;Q--,o+=r[a++]<>8),512&n.flags&&(p[0]=255&o,p[1]=o>>>8&255,n.check=Le(n.check,p,2,0)),o=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===Q)break e;Q--,o+=r[a++]<>>8&255,n.check=Le(n.check,p,2,0)),o=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((c=n.length)>Q&&(c=Q),c&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),O.arraySet(n.head.extra,r,a,c,S)),512&n.flags&&(n.check=Le(n.check,r,c,a)),Q-=c,a+=c,n.length-=c),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===Q)break e;c=0;do{S=r[a+c++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&c>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===Q)break e;Q--,o+=r[a++]<>>=1)){case 0:n.mode=14;break;case 1:if(Gt(n),n.mode=20,6===t){o>>>=2,l-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}o>>>=2,l-=2;break;case 14:for(o>>>=7&l,l-=7&l;l<32;){if(0===Q)break e;Q--,o+=r[a++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&o,o=0,l=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(c=n.length){if(c>Q&&(c=Q),c>B&&(c=B),0===c)break e;O.arraySet(s,r,a,c,i),Q-=c,a+=c,B-=c,i+=c,n.length-=c;break}n.mode=12;break;case 17:for(;l<14;){if(0===Q)break e;Q--,o+=r[a++]<>>=5,l-=5,n.ndist=1+(31&o),o>>>=5,l-=5,n.ncode=4+(15&o),o>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,l-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,x={bits:n.lenbits},Z=dt(0,n.lens,0,19,n.lencode,0,n.work,x),n.lenbits=x.bits,Z){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,m=65535&h,!((u=h>>>24)<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=u,l-=u,n.lens[n.have++]=m;else{if(16===m){for(G=u+2;l>>=u,l-=u,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],c=3+(3&o),o>>>=2,l-=2}else if(17===m){for(G=u+3;l>>=u)),o>>>=3,l-=3}else{for(G=u+7;l>>=u)),o>>>=7,l-=7}if(n.have+c>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;c--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,x={bits:n.lenbits},Z=dt(1,n.lens,0,n.nlen,n.lencode,0,n.work,x),n.lenbits=x.bits,Z){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,x={bits:n.distbits},Z=dt(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,x),n.distbits=x.bits,Z){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(Q>=6&&B>=258){e.next_out=i,e.avail_out=B,e.next_in=a,e.avail_in=Q,n.hold=o,n.bits=l,lt(e,U),i=e.next_out,s=e.output,B=e.avail_out,a=e.next_in,r=e.input,Q=e.avail_in,o=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;I=(h=n.lencode[o&(1<>>16&255,m=65535&h,!((u=h>>>24)<=l);){if(0===Q)break e;Q--,o+=r[a++]<>C)])>>>16&255,m=65535&h,!(C+(u=h>>>24)<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=C,l-=C,n.back+=C}if(o>>>=u,l-=u,n.back+=u,n.length=m,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(G=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;I=(h=n.distcode[o&(1<>>16&255,m=65535&h,!((u=h>>>24)<=l);){if(0===Q)break e;Q--,o+=r[a++]<>C)])>>>16&255,m=65535&h,!(C+(u=h>>>24)<=l);){if(0===Q)break e;Q--,o+=r[a++]<>>=C,l-=C,n.back+=C}if(o>>>=u,l-=u,n.back+=u,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(G=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===B)break e;if(c=U-B,n.offset>c){if((c=n.offset-c)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}c>n.wnext?(c-=n.wnext,g=n.wsize-c):g=n.wnext-c,c>n.length&&(c=n.length),d=n.window}else d=s,g=i-n.offset,c=n.length;c>B&&(c=B),B-=c,n.length-=c;do{s[i++]=d[g++]}while(--c);0===n.length&&(n.mode=21);break;case 26:if(0===B)break e;s[i++]=n.length,B--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===Q)break e;Q--,o|=r[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new st,this.strm.avail_out=0;var n=pt.inflateInit2(this.strm,t.windowBits);if(n!==ot.Z_OK)throw new Error(z[n]);if(this.header=new Rt,pt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=$e(t.dictionary):"[object ArrayBuffer]"===Vt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=pt.inflateSetDictionary(this.strm,t.dictionary))!==ot.Z_OK))throw new Error(z[n])}function At(e,t){var n=new Lt(t);if(n.push(e,!0),n.err)throw n.msg||z[n.err];return n.result}Lt.prototype.push=function(e,t){var n,r,s,a,i,Q=this.strm,B=this.options.chunkSize,o=this.options.dictionary,l=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?ot.Z_FINISH:ot.Z_NO_FLUSH,"string"==typeof e?Q.input=tt(e):"[object ArrayBuffer]"===Vt.call(e)?Q.input=new Uint8Array(e):Q.input=e,Q.next_in=0,Q.avail_in=Q.input.length;do{if(0===Q.avail_out&&(Q.output=new O.Buf8(B),Q.next_out=0,Q.avail_out=B),(n=pt.inflate(Q,ot.Z_NO_FLUSH))===ot.Z_NEED_DICT&&o&&(n=pt.inflateSetDictionary(this.strm,o)),n===ot.Z_BUF_ERROR&&!0===l&&(n=ot.Z_OK,l=!1),n!==ot.Z_STREAM_END&&n!==ot.Z_OK)return this.onEnd(n),this.ended=!0,!1;Q.next_out&&(0!==Q.avail_out&&n!==ot.Z_STREAM_END&&(0!==Q.avail_in||r!==ot.Z_FINISH&&r!==ot.Z_SYNC_FLUSH)||("string"===this.options.to?(s=rt(Q.output,Q.next_out),a=Q.next_out-s,i=nt(Q.output,s),Q.next_out=a,Q.avail_out=B-a,a&&O.arraySet(Q.output,Q.output,s,a,0),this.onData(i)):this.onData(O.shrinkBuf(Q.output,Q.next_out)))),0===Q.avail_in&&0===Q.avail_out&&(l=!0)}while((Q.avail_in>0||0===Q.avail_out)&&n!==ot.Z_STREAM_END);return n===ot.Z_STREAM_END&&(r=ot.Z_FINISH),r===ot.Z_FINISH?(n=pt.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ot.Z_OK):r!==ot.Z_SYNC_FLUSH||(this.onEnd(ot.Z_OK),Q.avail_out=0,!0)},Lt.prototype.onData=function(e){this.chunks.push(e)},Lt.prototype.onEnd=function(e){e===ot.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=O.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Nt={Inflate:Lt,inflate:At,inflateRaw:function(e,t){return(t=t||{}).raw=!0,At(e,t)},ungzip:At},Et={};(0,O.assign)(Et,Bt,Nt,ot);var ft=Et,Dt="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function vt(e,t){p.a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}h.a.inherits(vt,p.a),vt.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(h.a.transformTo(Dt,e.data),!1)},vt.prototype.flush=function(){p.a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},vt.prototype.cleanUp=function(){p.a.prototype.cleanUp.call(this),this._pako=null},vt.prototype._createPako=function(){this._pako=new ft[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var Jt={STORE:{magic:"\0\0",compressWorker:function(e){return new p.a("STORE compression")},uncompressWorker:function(){return new p.a("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new vt("Deflate",e)},uncompressWorker:function(){return new vt("Inflate",{})}}},Wt="PK",Xt="PK",Ht="PK",kt="PK",Tt="PK",Mt="PK\b",Yt=function(e,t){var n,r="";for(n=0;n>>=8;return r},wt=function(e,t,n,r,s,a){var i,Q,B=e.file,o=e.compression,l=a!==V.utf8encode,F=h.a.transformTo("string",a(B.name)),U=h.a.transformTo("string",V.utf8encode(B.name)),c=B.comment,g=h.a.transformTo("string",a(c)),d=h.a.transformTo("string",V.utf8encode(c)),u=U.length!==B.name.length,I=d.length!==c.length,m="",C="",b="",y=B.dir,S=B.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(Z.crc32=e.crc32,Z.compressedSize=e.compressedSize,Z.uncompressedSize=e.uncompressedSize);var x=0;t&&(x|=8),l||!u&&!I||(x|=2048);var G,p,R=0,L=0;y&&(R|=16),"UNIX"===s?(L=798,R|=(p=G=B.unixPermissions,G||(p=y?16893:33204),(65535&p)<<16)):(L=20,R|=63&(B.dosPermissions||0)),i=S.getUTCHours(),i<<=6,i|=S.getUTCMinutes(),i<<=5,i|=S.getUTCSeconds()/2,Q=S.getUTCFullYear()-1980,Q<<=4,Q|=S.getUTCMonth()+1,Q<<=5,Q|=S.getUTCDate(),u&&(C=Yt(1,1)+Yt(v(F),4)+U,m+="up"+Yt(C.length,2)+C),I&&(b=Yt(1,1)+Yt(v(g),4)+d,m+="uc"+Yt(b.length,2)+b);var A="";return A+="\n\0",A+=Yt(x,2),A+=o.magic,A+=Yt(i,2),A+=Yt(Q,2),A+=Yt(Z.crc32,4),A+=Yt(Z.compressedSize,4),A+=Yt(Z.uncompressedSize,4),A+=Yt(F.length,2),A+=Yt(m.length,2),{fileRecord:Wt+A+F+m,dirRecord:Xt+Yt(L,2)+A+Yt(g.length,2)+"\0\0\0\0"+Yt(R,4)+Yt(r,4)+F+m+g}},Ot=function(e){return Mt+Yt(e.crc32,4)+Yt(e.compressedSize,4)+Yt(e.uncompressedSize,4)};function zt(e,t,n,r){p.a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.a.inherits(zt,p.a),zt.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,p.a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},zt.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=wt(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zt.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=wt(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:Ot(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},zt.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},en=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},tn=function(e,t){return t=void 0!==t?t:x.createFolders,e=en(e),this.files[e]||qt.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function nn(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var rn={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1===arguments.length){if(nn(e)){var r=e;return this.filter((function(e,t){return!t.dir&&r.test(e)}))}var s=this.files[this.root+e];return s&&!s.dir?s:null}return e=this.root+e,qt.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(nn(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=tn.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return h.a.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var an=sn;function Qn(e){an.call(this,e);for(var t=0;t=0;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===s)return a-this.zero;return-1},Qn.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),s=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&s===a[3]},Qn.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Bn=Qn;function on(e){an.call(this,e)}h.a.inherits(on,an),on.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},on.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},on.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},on.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var ln=on;function Fn(e){Bn.call(this,e)}h.a.inherits(Fn,Bn),Fn.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Un=Fn;function cn(e){Un.call(this,e)}h.a.inherits(cn,Un),cn.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var gn=cn,dn=function(e){var t=h.a.getTypeOf(e);return h.a.checkSupport(t),"string"!==t||S.a.uint8array?"nodebuffer"===t?new gn(e):S.a.uint8array?new Un(h.a.transformTo("uint8array",e)):new Bn(h.a.transformTo("array",e)):new ln(e)};function un(e,t){this.options=e,this.loadOptions=t}un.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in Jt)if(Jt.hasOwnProperty(t)&&Jt[t].magic===e)return Jt[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+h.a.pretty(this.compressionMethod)+" unknown (inner file : "+h.a.transformTo("string",this.fileName)+")");this.decompressed=new H(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=dn(this.extraFields[1].value);this.uncompressedSize===h.a.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===h.a.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===h.a.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===h.a.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,s=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,Xt)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=dn(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var Cn=mn;function bn(e){return new Z.a.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new W);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function yn(){if(!(this instanceof yn))return new yn;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new yn;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}yn.prototype=rn,yn.prototype.loadAsync=function(e,t){var n=this;return t=h.a.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:V.utf8decode}),G.a.isNode&&G.a.isStream(e)?Z.a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):h.a.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new Cn(t);return n.load(e),n})).then((function(e){var n=[Z.a.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var s=0;s1;){var i=a.shift();s=s.folder(i)}e.callback&&e.callback(r)})),{fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(Q,B){t||Zn("ERROR!!! zip not ready...");var o=pn([r,a.ref.basepath,i.compression?"".concat(a.ref.id,".gz"):a.ref.id].join("/"));1==++n&&e.invokeBusy&&e.invokeBusy(!0);var l="string"!==a.dataType||i.compression?"uint8array":"string",F=hn[l](a,i.compression,(function(){delete a.ref,0==--n&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),Q(a)}));s.file(o).async(l).then(F)}))},fetchJSON:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=pn(e);return t||Zn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?s.file(r).async("uint8array").then((function(e){var t=B.a.inflate(e,{to:"string"});return Promise.resolve(JSON.parse(t))})):Promise.reject(new Error("Invalid compression")):s.file(r).async("string").then((function(e){return Promise.resolve(JSON.parse(e))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=pn(e);return t||Zn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?s.file(r).async("uint8array").then((function(e){var t=B.a.inflate(e,{to:"string"});return Promise.resolve(t)})):Promise.reject(new Error("Invalid compression")):s.file(r).async("string").then((function(e){return Promise.resolve(e)}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,n=pn(e);return t||Zn("ERROR!!! zip not ready..."),new Promise((function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,s.file(n).async("base64").then((function(e){r.src="data:image/".concat(Gn(n),";base64,").concat(e)}))}))},fetchBinary:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=pn(e);return t||Zn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?s.file(r).then((function(e){var t=B.a.inflate(e).buffer;return Promise.resolve(t)})):Promise.reject(new Error("Invalid compression")):s.file(r).async("arraybuffer").then((function(e){return Promise.resolve(e)}))}}}},Vn={http:function(e){return y},zip:function(e){return Rn.create(e)},html:function(e){return d}},Ln={get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vn[e](t)}};t.a=Ln},function(e,t,n){"use strict";var r=n(9),s=(n(6),n(3)),a=n(12),i=n(4),Q=n(2),B=n(18),o=n(19),l=function(e){return e},F=new Float64Array(16);Object(i.i)(F);var U=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Object(B.a)(this,e),this.matrix=new Float64Array(16),Object(i.i)(this.matrix),this.tmp=new Float64Array(3),this.angleConv=t?a.d:l}return Object(o.a)(e,[{key:"rotateFromDirections",value:function(e,t){var n=new Float64Array(3),r=new Float64Array(3),s=new Float64Array(16);Object(Q.p)(n,e[0],e[1],e[2]),Object(Q.p)(r,t[0],t[1],t[2]),Object(Q.l)(n,n),Object(Q.l)(r,r);var a=Object(Q.d)(n,r);return a>=1||(Object(Q.c)(this.tmp,n,r),Object(Q.j)(this.tmp)<1e-6&&(Object(Q.c)(this.tmp,[1,0,0],e),Object(Q.j)(this.tmp)<1e-6&&Object(Q.c)(this.tmp,[0,1,0],e)),Object(i.f)(s,Math.acos(a),this.tmp),Object(i.l)(this.matrix,this.matrix,s)),this}},{key:"rotate",value:function(e,t){return Q.p.apply(Q.r,[this.tmp].concat(Object(r.a)(t))),Object(Q.l)(this.tmp,this.tmp),Object(i.q)(this.matrix,this.matrix,this.angleConv(e),this.tmp),this}},{key:"rotateX",value:function(e){return Object(i.a)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateY",value:function(e){return Object(i.b)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateZ",value:function(e){return Object(i.c)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"translate",value:function(e,t,n){return Object(Q.p)(this.tmp,e,t,n),Object(i.s)(this.matrix,this.matrix,this.tmp),this}},{key:"scale",value:function(e,t,n){return Object(Q.p)(this.tmp,e,t,n),Object(i.r)(this.matrix,this.matrix,this.tmp),this}},{key:"identity",value:function(){return Object(i.i)(this.matrix),this}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(Object(s.m)(F,this.matrix))return this;for(var r=-1===n?e.length:t+3*n,a=t;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function F(e,t,n){for(var r,a,i=[],Q=t;Q>18&63]+s[a>>12&63]+s[a>>6&63]+s[63&a]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63;var U=function(e){var t,n,r=l(e),s=r[0],Q=r[1],B=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,Q)),o=0,F=Q>0?s-4:s;for(n=0;n>16&255,B[o++]=t>>8&255,B[o++]=255&t;return 2===Q&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,B[o++]=255&t),1===Q&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,B[o++]=t>>8&255,B[o++]=255&t),B},c=function(e){for(var t,n=e.length,r=n%3,a=[],i=16383,Q=0,B=n-r;QB?B:Q+i));return 1===r?(t=e[n-1],a.push(s[t>>2]+s[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"=")),a.join("")},g=function(e,t,n,r,s){var a,i,Q=8*s-r-1,B=(1<>1,l=-7,F=n?s-1:0,U=n?-1:1,c=e[t+F];for(F+=U,a=c&(1<<-l)-1,c>>=-l,l+=Q;l>0;a=256*a+e[t+F],F+=U,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=r;l>0;i=256*i+e[t+F],F+=U,l-=8);if(0===a)a=1-o;else{if(a===B)return i?NaN:1/0*(c?-1:1);i+=Math.pow(2,r),a-=o}return(c?-1:1)*i*Math.pow(2,a-r)},d=function(e,t,n,r,s,a){var i,Q,B,o=8*a-s-1,l=(1<>1,U=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:a-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(Q=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(B=Math.pow(2,-i))<1&&(i--,B*=2),(t+=i+F>=1?U/B:U*Math.pow(2,1-F))*B>=2&&(i++,B/=2),i+F>=l?(Q=0,i=l):i+F>=1?(Q=(t*B-1)*Math.pow(2,s),i+=F):(Q=t*Math.pow(2,F-1)*Math.pow(2,s),i=0));s>=8;e[n+c]=255&Q,c+=g,Q/=256,s-=8);for(i=i<0;e[n+c]=255&i,c+=g,i/=256,o-=8);e[n+c-g]|=128*d}; +function r(e){let t=e.length;for(;--t>=0;)e[t]=0}n.d(t,"a",(function(){return rn}));const a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),s=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=new Array(576);r(l);const B=new Array(60);r(B);const Q=new Array(512);r(Q);const c=new Array(256);r(c);const F=new Array(29);r(F);const U=new Array(30);function g(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let d,u,I;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}r(U);const C=e=>e<256?Q[e]:Q[256+(e>>>7)],b=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},y=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{y(e,n[2*t],n[2*t+1])},x=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Z=(e,t,n)=>{const r=new Array(16);let a,s,i=0;for(a=1;a<=15;a++)r[a]=i=i+n[a-1]<<1;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=x(r[t]++,t))}},h=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},p=e=>{e.bi_valid>8?b(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},G=(e,t,n,r)=>{const a=2*t,s=2*n;return e[a]{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a{let r,i,o,l,B=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*B]<<8|e.pending_buf[e.d_buf+2*B+1],i=e.pending_buf[e.l_buf+B],B++,0===r?S(e,i,t):(o=c[i],S(e,o+256+1,t),l=a[o],0!==l&&(i-=F[o],y(e,i,l)),r--,o=C(r),S(e,o,n),l=s[o],0!==l&&(r-=U[o],y(e,r,l)))}while(B{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.elems;let i,o,l,B=-1;for(e.heap_len=0,e.heap_max=573,i=0;i>1;i>=1;i--)R(e,n,i);l=s;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=o,n[2*l]=n[2*i]+n[2*o],e.depth[l]=(e.depth[i]>=e.depth[o]?e.depth[i]:e.depth[o])+1,n[2*i+1]=n[2*o+1]=l,e.heap[1]=l++,R(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let B,Q,c,F,U,g,d=0;for(F=0;F<=15;F++)e.bl_count[F]=0;for(n[2*e.heap[e.heap_max]+1]=0,B=e.heap_max+1;B<573;B++)Q=e.heap[B],F=n[2*n[2*Q+1]+1]+1,F>l&&(F=l,d++),n[2*Q+1]=F,Q>r||(e.bl_count[F]++,U=0,Q>=o&&(U=i[Q-o]),g=n[2*Q],e.opt_len+=g*(F+U),s&&(e.static_len+=g*(a[2*Q+1]+U)));if(0!==d){do{for(F=l-1;0===e.bl_count[F];)F--;e.bl_count[F]--,e.bl_count[F+1]+=2,e.bl_count[l]--,d-=2}while(d>0);for(F=l;0!==F;F--)for(Q=e.bl_count[F];0!==Q;)c=e.heap[--B],c>r||(n[2*c+1]!==F&&(e.opt_len+=(F-n[2*c+1])*n[2*c],n[2*c+1]=F),Q--)}})(e,t),Z(n,B,e.bl_count)},A=(e,t,n)=>{let r,a,s=-1,i=t[1],o=0,l=7,B=4;for(0===i&&(l=138,B=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)a=i,i=t[2*(r+1)+1],++o{let r,a,s=-1,i=t[1],o=0,l=7,B=4;for(0===i&&(l=138,B=3),r=0;r<=n;r++)if(a=i,i=t[2*(r+1)+1],!(++o{y(e,0+(r?1:0),3),((e,t,n,r)=>{p(e),b(e,n),b(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n})(e,t,n)};var D={_tr_init:e=>{N||((()=>{let e,t,n,r,o;const m=new Array(16);for(n=0,r=0;r<28;r++)for(F[r]=n,e=0;e<1<>=7;r<30;r++)for(U[r]=o<<7,e=0;e<1<{let a,s,i=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),V(e,e.l_desc),V(e,e.d_desc),i=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),V(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),a=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=a&&(a=s)):a=s=n+5,n+4<=a&&-1!==t?E(e,t,n,r):4===e.strategy||s===a?(y(e,2+(r?1:0),3),L(e,l,B)):(y(e,4+(r?1:0),3),((e,t,n,r)=>{let a;for(y(e,t-257,5),y(e,n-1,5),y(e,r-4,4),a=0;a(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(c[n]+256+1)]++,e.dyn_dtree[2*C(t)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{y(e,2,3),S(e,256,l),(e=>{16===e.bi_valid?(b(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},v=(e,t,n,r)=>{let a=65535&e|0,s=e>>>16&65535|0,i=0;for(;0!==n;){i=n>2e3?2e3:n,n-=i;do{a=a+t[r++]|0,s=s+a|0}while(--i);a%=65521,s%=65521}return a|s<<16|0};const J=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var W=(e,t,n,r)=>{const a=J,s=r+n;e^=-1;for(let n=r;n>>8^a[255&(e^t[n])];return-1^e},X={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:T,_tr_stored_block:k,_tr_flush_block:M,_tr_tally:w,_tr_align:Y}=D,{Z_NO_FLUSH:O,Z_PARTIAL_FLUSH:z,Z_FULL_FLUSH:P,Z_FINISH:K,Z_BLOCK:j,Z_OK:_,Z_STREAM_END:q,Z_STREAM_ERROR:$,Z_DATA_ERROR:ee,Z_BUF_ERROR:te,Z_DEFAULT_COMPRESSION:ne,Z_FILTERED:re,Z_HUFFMAN_ONLY:ae,Z_RLE:se,Z_FIXED:ie,Z_DEFAULT_STRATEGY:oe,Z_UNKNOWN:le,Z_DEFLATED:Be}=H,Qe=(e,t)=>(e.msg=X[t],t),ce=e=>(e<<1)-(e>4?9:0),Fe=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let Ue=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},de=(e,t)=>{M(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ge(e.strm)},ue=(e,t)=>{e.pending_buf[e.pending++]=t},Ie=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},me=(e,t,n,r)=>{let a=e.avail_in;return a>r&&(a=r),0===a?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),1===e.state.wrap?e.adler=v(e.adler,t,a,n):2===e.state.wrap&&(e.adler=W(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},Ce=(e,t)=>{let n,r,a=e.max_chain_length,s=e.strstart,i=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,B=e.window,Q=e.w_mask,c=e.prev,F=e.strstart+258;let U=B[s+i-1],g=B[s+i];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(n=t,B[n+i]===g&&B[n+i-1]===U&&B[n]===B[s]&&B[++n]===B[s+1]){s+=2,n++;do{}while(B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&si){if(e.match_start=t,i=r,r>=o)break;U=B[s+i-1],g=B[s+i]}}}while((t=c[t&Q])>l&&0!=--a);return i<=e.lookahead?i:e.lookahead},be=e=>{const t=e.w_size;let n,r,a,s,i;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do{a=e.head[--n],e.head[n]=a>=t?a-t:0}while(--r);r=t,n=r;do{a=e.prev[--n],e.prev[n]=a>=t?a-t:0}while(--r);s+=t}if(0===e.strm.avail_in)break;if(r=me(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Ue(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Ue(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},ye=(e,t)=>{let n,r;for(;;){if(e.lookahead<262){if(be(e),e.lookahead<262&&t===O)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Ue(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=Ce(e,n)),e.match_length>=3)if(r=w(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Ue(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Ue(e,e.ins_h,e.window[e.strstart+1]);else r=w(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2},Se=(e,t)=>{let n,r,a;for(;;){if(e.lookahead<262){if(be(e),e.lookahead<262&&t===O)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Ue(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,r=w(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=Ue(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(de(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=w(e,0,e.window[e.strstart-1]),r&&de(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=w(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2};function xe(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}const Ze=[new xe(0,0,0,0,(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(be(e),0===e.lookahead&&t===O)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,de(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(de(e,!1),e.strm.avail_out),1)}),new xe(4,4,8,4,ye),new xe(4,5,16,8,ye),new xe(4,6,32,32,ye),new xe(4,4,16,16,Se),new xe(8,16,32,32,Se),new xe(8,16,128,128,Se),new xe(8,32,128,256,Se),new xe(32,128,258,1024,Se),new xe(32,258,258,4096,Se)];function he(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Be,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Fe(this.dyn_ltree),Fe(this.dyn_dtree),Fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Fe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const pe=e=>{if(!e||!e.state)return Qe(e,$);e.total_in=e.total_out=0,e.data_type=le;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=O,T(t),_},Ge=e=>{const t=pe(e);var n;return t===_&&((n=e.state).window_size=2*n.w_size,Fe(n.head),n.max_lazy_match=Ze[n.level].max_lazy,n.good_match=Ze[n.level].good_length,n.nice_match=Ze[n.level].nice_length,n.max_chain_length=Ze[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Re=(e,t,n,r,a,s)=>{if(!e)return $;let i=1;if(t===ne&&(t=6),r<0?(i=0,r=-r):r>15&&(i=2,r-=16),a<1||a>9||n!==Be||r<8||r>15||t<0||t>9||s<0||s>ie)return Qe(e,$);8===r&&(r=9);const o=new he;return e.state=o,o.strm=e,o.wrap=i,o.gzhead=null,o.w_bits=r,o.w_size=1<e&&e.state?2!==e.state.wrap?$:(e.state.gzhead=t,_):$,Ae=(e,t)=>{let n,r;if(!e||!e.state||t>j||t<0)return e?Qe(e,$):$;const a=e.state;if(!e.output||!e.input&&0!==e.avail_in||666===a.status&&t!==K)return Qe(e,0===e.avail_out?te:$);a.strm=e;const s=a.last_flush;if(a.last_flush=t,42===a.status)if(2===a.wrap)e.adler=0,ue(a,31),ue(a,139),ue(a,8),a.gzhead?(ue(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),ue(a,255&a.gzhead.time),ue(a,a.gzhead.time>>8&255),ue(a,a.gzhead.time>>16&255),ue(a,a.gzhead.time>>24&255),ue(a,9===a.level?2:a.strategy>=ae||a.level<2?4:0),ue(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(ue(a,255&a.gzhead.extra.length),ue(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=W(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69):(ue(a,0),ue(a,0),ue(a,0),ue(a,0),ue(a,0),ue(a,9===a.level?2:a.strategy>=ae||a.level<2?4:0),ue(a,3),a.status=113);else{let t=Be+(a.w_bits-8<<4)<<8,n=-1;n=a.strategy>=ae||a.level<2?0:a.level<6?1:6===a.level?2:3,t|=n<<6,0!==a.strstart&&(t|=32),t+=31-t%31,a.status=113,Ie(a,t),0!==a.strstart&&(Ie(a,e.adler>>>16),Ie(a,65535&e.adler)),e.adler=1}if(69===a.status)if(a.gzhead.extra){for(n=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>n&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),ge(e),n=a.pending,a.pending!==a.pending_buf_size));)ue(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>n&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=73)}else a.status=73;if(73===a.status)if(a.gzhead.name){n=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>n&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),ge(e),n=a.pending,a.pending===a.pending_buf_size)){r=1;break}r=a.gzindexn&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),0===r&&(a.gzindex=0,a.status=91)}else a.status=91;if(91===a.status)if(a.gzhead.comment){n=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>n&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),ge(e),n=a.pending,a.pending===a.pending_buf_size)){r=1;break}r=a.gzindexn&&(e.adler=W(e.adler,a.pending_buf,a.pending-n,n)),0===r&&(a.status=103)}else a.status=103;if(103===a.status&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ge(e),a.pending+2<=a.pending_buf_size&&(ue(a,255&e.adler),ue(a,e.adler>>8&255),e.adler=0,a.status=113)):a.status=113),0!==a.pending){if(ge(e),0===e.avail_out)return a.last_flush=-1,_}else if(0===e.avail_in&&ce(t)<=ce(s)&&t!==K)return Qe(e,te);if(666===a.status&&0!==e.avail_in)return Qe(e,te);if(0!==e.avail_in||0!==a.lookahead||t!==O&&666!==a.status){let n=a.strategy===ae?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(be(e),0===e.lookahead)){if(t===O)return 1;break}if(e.match_length=0,n=w(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(a,t):a.strategy===se?((e,t)=>{let n,r,a,s;const i=e.window;for(;;){if(e.lookahead<=258){if(be(e),e.lookahead<=258&&t===O)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(a=e.strstart-1,r=i[a],r===i[++a]&&r===i[++a]&&r===i[++a])){s=e.strstart+258;do{}while(r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=w(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=w(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===K?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(a,t):Ze[a.level].func(a,t);if(3!==n&&4!==n||(a.status=666),1===n||3===n)return 0===e.avail_out&&(a.last_flush=-1),_;if(2===n&&(t===z?Y(a):t!==j&&(k(a,0,0,!1),t===P&&(Fe(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ge(e),0===e.avail_out))return a.last_flush=-1,_}return t!==K?_:a.wrap<=0?q:(2===a.wrap?(ue(a,255&e.adler),ue(a,e.adler>>8&255),ue(a,e.adler>>16&255),ue(a,e.adler>>24&255),ue(a,255&e.total_in),ue(a,e.total_in>>8&255),ue(a,e.total_in>>16&255),ue(a,e.total_in>>24&255)):(Ie(a,e.adler>>>16),Ie(a,65535&e.adler)),ge(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?_:q)},fe=e=>{if(!e||!e.state)return $;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?Qe(e,$):(e.state=null,113===t?Qe(e,ee):_)},Ne=(e,t)=>{let n=t.length;if(!e||!e.state)return $;const r=e.state,a=r.wrap;if(2===a||1===a&&42!==r.status||r.lookahead)return $;if(1===a&&(e.adler=v(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===a&&(Fe(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const s=e.avail_in,i=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,be(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Ue(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,be(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=i,e.input=o,e.avail_in=s,r.wrap=a,_};const Ee=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var De=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Ee(n,t)&&(e[t]=n[t])}}return e},ve=e=>{let t=0;for(let n=0,r=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;We[254]=We[254]=1;var Xe=e=>{let t,n,r,a,s,i=e.length,o=0;for(a=0;a>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t},He=(e,t)=>{let n,r;const a=t||e.length,s=new Array(2*a);for(r=0,n=0;n4)s[r++]=65533,n+=i-1;else{for(t&=2===i?31:3===i?15:7;i>1&&n1?s[r++]=65533:t<65536?s[r++]=t:(t-=65536,s[r++]=55296|t>>10&1023,s[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Je)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+We[e[n]]>t?n:t},ke=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Me=Object.prototype.toString,{Z_NO_FLUSH:we,Z_SYNC_FLUSH:Ye,Z_FULL_FLUSH:Oe,Z_FINISH:ze,Z_OK:Pe,Z_STREAM_END:Ke,Z_DEFAULT_COMPRESSION:je,Z_DEFAULT_STRATEGY:_e,Z_DEFLATED:qe}=H;function $e(e){this.options=De({level:je,method:qe,chunkSize:16384,windowBits:15,memLevel:8,strategy:_e},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ke,this.strm.avail_out=0;let n=Le(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Pe)throw new Error(X[n]);if(t.header&&Ve(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Xe(t.dictionary):"[object ArrayBuffer]"===Me.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=Ne(this.strm,e),n!==Pe)throw new Error(X[n]);this._dict_set=!0}}function et(e,t){const n=new $e(t);if(n.push(e,!0),n.err)throw n.msg||X[n.err];return n.result}$e.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let a,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ze:we,"string"==typeof e?n.input=Xe(e):"[object ArrayBuffer]"===Me.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===Ye||s===Oe)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(a=Ae(n,s),a===Ke)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=fe(this.strm),this.onEnd(a),this.ended=!0,a===Pe;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},$e.prototype.onData=function(e){this.chunks.push(e)},$e.prototype.onEnd=function(e){e===Pe&&(this.result=ve(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var tt={Deflate:$e,deflate:et,deflateRaw:function(e,t){return(t=t||{}).raw=!0,et(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,et(e,t)},constants:H},nt=function(e,t){let n,r,a,s,i,o,l,B,Q,c,F,U,g,d,u,I,m,C,b,y,S,x,Z,h;const p=e.state;n=e.next_in,Z=e.input,r=n+(e.avail_in-5),a=e.next_out,h=e.output,s=a-(t-e.avail_out),i=a+(e.avail_out-257),o=p.dmax,l=p.wsize,B=p.whave,Q=p.wnext,c=p.window,F=p.hold,U=p.bits,g=p.lencode,d=p.distcode,u=(1<>>24,F>>>=C,U-=C,C=m>>>16&255,0===C)h[a++]=65535&m;else{if(!(16&C)){if(0==(64&C)){m=g[(65535&m)+(F&(1<>>=C,U-=C),U<15&&(F+=Z[n++]<>>24,F>>>=C,U-=C,C=m>>>16&255,!(16&C)){if(0==(64&C)){m=d[(65535&m)+(F&(1<o){e.msg="invalid distance too far back",p.mode=30;break e}if(F>>>=C,U-=C,C=a-s,y>C){if(C=y-C,C>B&&p.sane){e.msg="invalid distance too far back",p.mode=30;break e}if(S=0,x=c,0===Q){if(S+=l-C,C2;)h[a++]=x[S++],h[a++]=x[S++],h[a++]=x[S++],b-=3;b&&(h[a++]=x[S++],b>1&&(h[a++]=x[S++]))}else{S=a-y;do{h[a++]=h[S++],h[a++]=h[S++],h[a++]=h[S++],b-=3}while(b>2);b&&(h[a++]=h[S++],b>1&&(h[a++]=h[S++]))}break}}break}}while(n>3,n-=b,U-=b<<3,F&=(1<{const l=o.bits;let B,Q,c,F,U,g,d=0,u=0,I=0,m=0,C=0,b=0,y=0,S=0,x=0,Z=0,h=null,p=0;const G=new Uint16Array(16),R=new Uint16Array(16);let L,V,A,f=null,N=0;for(d=0;d<=15;d++)G[d]=0;for(u=0;u=1&&0===G[m];m--);if(C>m&&(C=m),0===m)return a[s++]=20971520,a[s++]=20971520,o.bits=1,0;for(I=1;I0&&(0===e||1!==m))return-1;for(R[1]=0,d=1;d<15;d++)R[d+1]=R[d]+G[d];for(u=0;u852||2===e&&x>592)return 1;for(;;){L=d-y,i[u]g?(V=f[N+i[u]],A=h[p+i[u]]):(V=96,A=0),B=1<>y)+Q]=L<<24|V<<16|A|0}while(0!==Q);for(B=1<>=1;if(0!==B?(Z&=B-1,Z+=B):Z=0,u++,0==--G[d]){if(d===m)break;d=t[n+i[u]]}if(d>C&&(Z&F)!==c){for(0===y&&(y=C),U+=I,b=d-y,S=1<852||2===e&&x>592)return 1;c=Z&F,a[c]=C<<24|b<<16|U-s|0}}return 0!==Z&&(a[U+Z]=d-y<<24|64<<16|0),o.bits=C,0};const{Z_FINISH:lt,Z_BLOCK:Bt,Z_TREES:Qt,Z_OK:ct,Z_STREAM_END:Ft,Z_NEED_DICT:Ut,Z_STREAM_ERROR:gt,Z_DATA_ERROR:dt,Z_MEM_ERROR:ut,Z_BUF_ERROR:It,Z_DEFLATED:mt}=H,Ct=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function bt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const yt=e=>{if(!e||!e.state)return gt;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,ct},St=e=>{if(!e||!e.state)return gt;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yt(e)},xt=(e,t)=>{let n;if(!e||!e.state)return gt;const r=e.state;return t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?gt:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,St(e))},Zt=(e,t)=>{if(!e)return gt;const n=new bt;e.state=n,n.window=null;const r=xt(e,t);return r!==ct&&(e.state=null),r};let ht,pt,Gt=!0;const Rt=e=>{if(Gt){ht=new Int32Array(512),pt=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ot(1,e.lens,0,288,ht,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ot(2,e.lens,0,32,pt,0,e.work,{bits:5}),Gt=!1}e.lencode=ht,e.lenbits=9,e.distcode=pt,e.distbits=5},Lt=(e,t,n,r)=>{let a;const s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>r&&(a=r),s.window.set(t.subarray(n-r,n-r+a),s.wnext),(r-=a)?(s.window.set(t.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave{let n,r,a,s,i,o,l,B,Q,c,F,U,g,d,u,I,m,C,b,y,S,x,Z=0;const h=new Uint8Array(4);let p,G;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return gt;n=e.state,12===n.mode&&(n.mode=13),i=e.next_out,a=e.output,l=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,B=n.hold,Q=n.bits,c=o,F=l,x=ct;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;Q<16;){if(0===o)break e;o--,B+=r[s++]<>>8&255,n.check=W(n.check,h,2,0),B=0,Q=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&B)<<8)+(B>>8))%31){e.msg="incorrect header check",n.mode=30;break}if((15&B)!==mt){e.msg="unknown compression method",n.mode=30;break}if(B>>>=4,Q-=4,S=8+(15&B),0===n.wbits)n.wbits=S;else if(S>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(h[0]=255&B,h[1]=B>>>8&255,n.check=W(n.check,h,2,0)),B=0,Q=0,n.mode=3;case 3:for(;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>8&255,h[2]=B>>>16&255,h[3]=B>>>24&255,n.check=W(n.check,h,4,0)),B=0,Q=0,n.mode=4;case 4:for(;Q<16;){if(0===o)break e;o--,B+=r[s++]<>8),512&n.flags&&(h[0]=255&B,h[1]=B>>>8&255,n.check=W(n.check,h,2,0)),B=0,Q=0,n.mode=5;case 5:if(1024&n.flags){for(;Q<16;){if(0===o)break e;o--,B+=r[s++]<>>8&255,n.check=W(n.check,h,2,0)),B=0,Q=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(U=n.length,U>o&&(U=o),U&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+U),S)),512&n.flags&&(n.check=W(n.check,r,U,s)),o-=U,s+=U,n.length-=U),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===o)break e;U=0;do{S=r[s+U++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>=7&Q,Q-=7&Q,n.mode=27;break}for(;Q<3;){if(0===o)break e;o--,B+=r[s++]<>>=1,Q-=1,3&B){case 0:n.mode=14;break;case 1:if(Rt(n),n.mode=20,t===Qt){B>>>=2,Q-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}B>>>=2,Q-=2;break;case 14:for(B>>>=7&Q,Q-=7&Q;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&B,B=0,Q=0,n.mode=15,t===Qt)break e;case 15:n.mode=16;case 16:if(U=n.length,U){if(U>o&&(U=o),U>l&&(U=l),0===U)break e;a.set(r.subarray(s,s+U),i),o-=U,s+=U,l-=U,i+=U,n.length-=U;break}n.mode=12;break;case 17:for(;Q<14;){if(0===o)break e;o--,B+=r[s++]<>>=5,Q-=5,n.ndist=1+(31&B),B>>>=5,Q-=5,n.ncode=4+(15&B),B>>>=4,Q-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,Q-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,p={bits:n.lenbits},x=ot(0,n.lens,0,19,n.lencode,0,n.work,p),n.lenbits=p.bits,x){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>24,I=Z>>>16&255,m=65535&Z,!(u<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=u,Q-=u,n.lens[n.have++]=m;else{if(16===m){for(G=u+2;Q>>=u,Q-=u,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],U=3+(3&B),B>>>=2,Q-=2}else if(17===m){for(G=u+3;Q>>=u,Q-=u,S=0,U=3+(7&B),B>>>=3,Q-=3}else{for(G=u+7;Q>>=u,Q-=u,S=0,U=11+(127&B),B>>>=7,Q-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;U--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,p={bits:n.lenbits},x=ot(1,n.lens,0,n.nlen,n.lencode,0,n.work,p),n.lenbits=p.bits,x){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,p={bits:n.distbits},x=ot(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,p),n.distbits=p.bits,x){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,t===Qt)break e;case 20:n.mode=21;case 21:if(o>=6&&l>=258){e.next_out=i,e.avail_out=l,e.next_in=s,e.avail_in=o,n.hold=B,n.bits=Q,nt(e,F),i=e.next_out,a=e.output,l=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,B=n.hold,Q=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;Z=n.lencode[B&(1<>>24,I=Z>>>16&255,m=65535&Z,!(u<=Q);){if(0===o)break e;o--,B+=r[s++]<>C)],u=Z>>>24,I=Z>>>16&255,m=65535&Z,!(C+u<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=C,Q-=C,n.back+=C}if(B>>>=u,Q-=u,n.back+=u,n.length=m,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(G=n.extra;Q>>=n.extra,Q-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;Z=n.distcode[B&(1<>>24,I=Z>>>16&255,m=65535&Z,!(u<=Q);){if(0===o)break e;o--,B+=r[s++]<>C)],u=Z>>>24,I=Z>>>16&255,m=65535&Z,!(C+u<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=C,Q-=C,n.back+=C}if(B>>>=u,Q-=u,n.back+=u,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(G=n.extra;Q>>=n.extra,Q-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===l)break e;if(U=F-l,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}U>n.wnext?(U-=n.wnext,g=n.wsize-U):g=n.wnext-U,U>n.length&&(U=n.length),d=n.window}else d=a,g=i-n.offset,U=n.length;U>l&&(U=l),l-=U,n.length-=U;do{a[i++]=d[g++]}while(--U);0===n.length&&(n.mode=21);break;case 26:if(0===l)break e;a[i++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;Q<32;){if(0===o)break e;o--,B|=r[s++]<{if(!e||!e.state)return gt;let t=e.state;return t.window&&(t.window=null),e.state=null,ct},Et=(e,t)=>{if(!e||!e.state)return gt;const n=e.state;return 0==(2&n.wrap)?gt:(n.head=t,t.done=!1,ct)},Dt=(e,t)=>{const n=t.length;let r,a,s;return e&&e.state?(r=e.state,0!==r.wrap&&11!==r.mode?gt:11===r.mode&&(a=1,a=v(a,t,n,0),a!==r.check)?dt:(s=Lt(e,t,n,n),s?(r.mode=31,ut):(r.havedict=1,ct))):gt},vt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Wt,Z_FINISH:Xt,Z_OK:Ht,Z_STREAM_END:Tt,Z_NEED_DICT:kt,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:wt,Z_MEM_ERROR:Yt}=H;function Ot(e){this.options=De({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ke,this.strm.avail_out=0;let n=At(this.strm,t.windowBits);if(n!==Ht)throw new Error(X[n]);if(this.header=new vt,Et(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Xe(t.dictionary):"[object ArrayBuffer]"===Jt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Dt(this.strm,t.dictionary),n!==Ht)))throw new Error(X[n])}function zt(e,t){const n=new Ot(t);if(n.push(e),n.err)throw n.msg||X[n.err];return n.result}Ot.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let s,i,o;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Xt:Wt,"[object ArrayBuffer]"===Jt.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=ft(n,i),s===kt&&a&&(s=Dt(n,a),s===Ht?s=ft(n,i):s===wt&&(s=kt));n.avail_in>0&&s===Tt&&n.state.wrap>0&&0!==e[n.next_in];)Vt(n),s=ft(n,i);switch(s){case Mt:case wt:case kt:case Yt:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||s===Tt))if("string"===this.options.to){let e=Te(n.output,n.next_out),t=n.next_out-e,a=He(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(a)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==Ht||0!==o){if(s===Tt)return s=Nt(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ot.prototype.onData=function(e){this.chunks.push(e)},Ot.prototype.onEnd=function(e){e===Ht&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ve(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Pt={Inflate:Ot,inflate:zt,inflateRaw:function(e,t){return(t=t||{}).raw=!0,zt(e,t)},ungzip:zt,constants:H};const{Deflate:Kt,deflate:jt,deflateRaw:_t,gzip:qt}=tt,{Inflate:$t,inflate:en,inflateRaw:tn,ungzip:nn}=Pt;var rn={Deflate:Kt,deflate:jt,deflateRaw:_t,gzip:qt,Inflate:$t,inflate:en,inflateRaw:tn,ungzip:nn,constants:H}},function(e,t,n){"use strict";var r,a,s=n(11),i=s.b.MutationObserver||s.b.WebKitMutationObserver;if(i){var o=0,l=new i(F),B=s.b.document.createTextNode("");l.observe(B,{characterData:!0}),r=function(){B.data=o=++o%2}}else if(s.b.setImmediate||void 0===s.b.MessageChannel)r="document"in s.b&&"onreadystatechange"in s.b.document.createElement("script")?function(){var e=s.b.document.createElement("script");e.onreadystatechange=function(){F(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},s.b.document.documentElement.appendChild(e)}:function(){setTimeout(F,0)};else{var Q=new s.b.MessageChannel;Q.port1.onmessage=F,r=function(){Q.port2.postMessage(0)}}var c=[];function F(){var e,t;a=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e0&&void 0!==arguments[0]&&arguments[0];Object(s.a)(this,e),this.matrix=Object(l.h)(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=t?o.d:Q}return Object(i.a)(e,[{key:"rotateFromDirections",value:function(e,t){var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(16);Object(B.p)(n,e[0],e[1],e[2]),Object(B.p)(r,t[0],t[1],t[2]),Object(B.l)(n,n),Object(B.l)(r,r);var s=Object(B.d)(n,r);return s>=1||(Object(B.c)(this.tmp,n,r),Object(B.j)(this.tmp)<1e-6&&(Object(B.c)(this.tmp,[1,0,0],e),Object(B.j)(this.tmp)<1e-6&&Object(B.c)(this.tmp,[0,1,0],e)),Object(l.f)(a,Math.acos(s),this.tmp),Object(l.l)(this.matrix,this.matrix,a)),this}},{key:"rotate",value:function(e,t){return B.p.apply(B.r,[this.tmp].concat(Object(r.a)(t))),Object(B.l)(this.tmp,this.tmp),Object(l.q)(this.matrix,this.matrix,this.angleConv(e),this.tmp),this}},{key:"rotateX",value:function(e){return Object(l.a)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateY",value:function(e){return Object(l.b)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateZ",value:function(e){return Object(l.c)(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"translate",value:function(e,t,n){return Object(B.p)(this.tmp,e,t,n),Object(l.s)(this.matrix,this.matrix,this.tmp),this}},{key:"scale",value:function(e,t,n){return Object(B.p)(this.tmp,e,t,n),Object(l.r)(this.matrix,this.matrix,this.tmp),this}},{key:"multiply",value:function(e){return Object(l.l)(this.matrix,this.matrix,e),this}},{key:"identity",value:function(){return Object(l.h)(this.matrix),this}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(Object(a.o)(c,this.matrix))return this;for(var r=-1===n?e.length:t+3*n,s=t;s2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,a,i;if("string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(s(t,"type"));else{var o=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(s(t,"type"))}return i+". Received type ".concat(typeof n)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var i={codes:r}},function(e,t,n){"use strict";n(4);var r=n(0),a=n(40),s=n(16);function i(){var e=new ArrayBuffer(4),t=new Uint8Array(e),n=new Uint32Array(e);return t[0]=161,t[1]=178,t[2]=195,t[3]=212,3569595041===n[0]?"LittleEndian":2712847316===n[0]?"BigEndian":null}var o={ENDIANNESS:i(),getEndianness:i,swapBytes:function(e,t){if(!(t<2))for(var n=new Int8Array(e),r=n.length,a=[],s=0;s1?arguments[1]:void 0;return new Promise((function(t,n){var r=F(g(e));null===r?n(new Error("No such JSON ".concat(e))):t(JSON.parse(r))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(t,n){var r=F(e);null===r?n(new Error("No such text ".concat(e))):t(r)}))},fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(i,U){var d=g([t,n.ref.basepath,r.compression?"".concat(n.ref.id,".gz"):n.ref.id].join("/")),u=F(d);if(null===u)U(new Error("No such array ".concat(d)));else{if("string"===n.dataType){var I=atob(u);r.compression&&(I=l.a.inflate(I,{to:"string"})),n.values=JSON.parse(I)}else{var m=new Uint8Array(a.a.toArrayBuffer(u));n.buffer=new ArrayBuffer(m.length),new Uint8Array(n.buffer).set(m),r.compression&&("string"===n.dataType||"JSON"===n.dataType?n.buffer=l.a.inflate(new Uint8Array(n.buffer),{to:"string"}):n.buffer=l.a.inflate(new Uint8Array(n.buffer)).buffer),"JSON"===n.ref.encode?n.values=JSON.parse(n.buffer):(o.ENDIANNESS!==n.ref.encode&&o.ENDIANNESS&&(Q("Swap bytes of ".concat(n.name)),o.swapBytes(n.buffer,s.a[n.dataType])),n.values=new window[n.dataType](n.buffer)),n.values.length!==n.size&&B("Error in FetchArray: ".concat(n.name," does not have the proper array size. Got ").concat(n.values.length,", instead of ").concat(n.size))}delete n.ref,0==--c&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),i(n)}}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(t,n){var r=U(e);r?t(r):n(new Error("No such image ".concat(e)))}))}},u=n(14),I=r.c.vtkErrorMacro,m=r.c.vtkDebugMacro,C=0;function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new XMLHttpRequest;return r.open(e,t,!0),n.headers&&Object.entries(n.headers).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],a=t[1];return r.setRequestHeader(n,a)})),n.progressCallback&&r.addEventListener("progress",n.progressCallback),r}var y={fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n.ref&&!n.ref.pending?new Promise((function(a,i){var B=b("GET",[t,n.ref.basepath,r.compression?"".concat(n.ref.id,".gz"):n.ref.id].join("/"),r);B.onreadystatechange=function(t){1===B.readyState&&(n.ref.pending=!0,1==++C&&e.invokeBusy&&e.invokeBusy(!0)),4===B.readyState&&(n.ref.pending=!1,200===B.status||0===B.status?(n.buffer=B.response,r.compression&&("string"===n.dataType||"JSON"===n.dataType?n.buffer=l.a.inflate(new Uint8Array(n.buffer),{to:"string"}):n.buffer=l.a.inflate(new Uint8Array(n.buffer)).buffer),"JSON"===n.ref.encode?n.values=JSON.parse(n.buffer):(o.ENDIANNESS!==n.ref.encode&&o.ENDIANNESS&&(m("Swap bytes of ".concat(n.name)),o.swapBytes(n.buffer,s.a[n.dataType])),n.values=new window[n.dataType](n.buffer)),n.values.length!==n.size&&I("Error in FetchArray: ".concat(n.name,", does not have the proper array size. Got ").concat(n.values.length,", instead of ").concat(n.size)),delete n.ref,0==--C&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),a(n)):i({xhr:B,e:t}))},B.responseType=r.compression||"string"!==n.dataType?"arraybuffer":"text",B.send()})):Promise.resolve(n)},fetchJSON:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(r,a){var s=b("GET",t,n);s.onreadystatechange=function(t){1===s.readyState&&1==++C&&e.invokeBusy&&e.invokeBusy(!0),4===s.readyState&&(0==--C&&e.invokeBusy&&e.invokeBusy(!1),200===s.status||0===s.status?n.compression?r(JSON.parse(l.a.inflate(new Uint8Array(s.response),{to:"string"}))):r(JSON.parse(s.responseText)):a({xhr:s,e:t}))},s.responseType=n.compression?"arraybuffer":"text",s.send()}))},fetchText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n&&n.compression&&"gz"!==n.compression&&(I("Supported algorithms are: [gz]"),I("Unkown compression algorithm: ".concat(n.compression))),new Promise((function(r,a){var s=b("GET",t,n);s.onreadystatechange=function(t){1===s.readyState&&1==++C&&e.invokeBusy&&e.invokeBusy(!0),4===s.readyState&&(0==--C&&e.invokeBusy&&e.invokeBusy(!1),200===s.status||0===s.status?n.compression?r(l.a.inflate(new Uint8Array(s.response),{to:"string"})):r(s.responseText):a({xhr:s,e:t}))},s.responseType=n.compression?"arraybuffer":"text",s.send()}))},fetchBinary:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var a=b("GET",e,t);a.onreadystatechange=function(e){4===a.readyState&&(200===a.status||0===a.status?n(a.response):r({xhr:a,e:e}))},a.responseType="arraybuffer",a.send()}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(n,r){var a=new Image;t.crossOrigin&&(a.crossOrigin=t.crossOrigin),a.onload=function(){return n(a)},a.onerror=r,a.src=e}))}},S=n(19),x=n(23),Z={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},h=n(24),p=n(8),G=n(13),R=n(11),L=Object(R.d)((function(e,t){for(var n=new Array(256),r=0;r<256;r++)n[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function a(){G.a.call(this,"utf-8 decode"),this.leftOver=null}function s(){G.a.call(this,"utf-8 encode")}n[254]=n[254]=1,t.utf8encode=function(e){return S.a.nodebuffer?h.a.newBufferFrom(e,"utf-8"):function(e){var t,n,r,a,s,i=e.length,o=0;for(a=0;a>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t}(e)},t.utf8decode=function(e){return S.a.nodebuffer?p.a.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,a,s,i=e.length,o=new Array(2*i);for(r=0,t=0;t4)o[r++]=65533,t+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&t1?o[r++]=65533:a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|1023&a)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),p.a.applyFromCharCode(o)}(e=p.a.transformTo(S.a.uint8array?"uint8array":"array",e))},p.a.inherits(a,G.a),a.prototype.processChunk=function(e){var r=p.a.transformTo(S.a.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(S.a.uint8array){var a=r;(r=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),r.set(a,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var s=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}(r),i=r;s!==r.length&&(S.a.uint8array?(i=r.subarray(0,s),this.leftOver=r.subarray(s,r.length)):(i=r.slice(0,s),this.leftOver=r.slice(s,r.length))),this.push({data:t.utf8decode(i),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=a,p.a.inherits(s,G.a),s.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=s}),"/$$rollup_base$$/node_modules/jszip/lib"),V=n(52);function A(e){G.a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=p.a.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}p.a.inherits(A,G.a),A.prototype.cleanUp=function(){G.a.prototype.cleanUp.call(this),this.data=null},A.prototype.resume=function(){return!!G.a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,p.a.delay(this._tickAndRepeat,[],this)),!0)},A.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(p.a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},A.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var f=A;function N(e){G.a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}p.a.inherits(N,G.a),N.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}G.a.prototype.processChunk.call(this,e)};var E=N,D=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),v=function(e,t){return void 0!==e&&e.length?"string"!==p.a.getTypeOf(e)?function(e,t,n,r){var a=D,s=0+n;e^=-1;for(var i=0;i>>8^a[255&(e^t[i])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var a=D,s=0+n;e^=-1;for(var i=0;i>>8^a[255&(e^t.charCodeAt(i))];return-1^e}(0|t,e,e.length):0};function J(){G.a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}p.a.inherits(J,G.a),J.prototype.processChunk=function(e){this.streamInfo.crc32=v(e.data,this.streamInfo.crc32||0),this.push(e)};var W=J;function X(e,t,n,r,a){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=a}X.prototype={getContentWorker:function(){var e=new f(x.a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new E("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new f(x.a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},X.createWorkerFrom=function(e,t,n){return e.pipe(new W).pipe(new E("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new E("compressedSize")).withStreamInfo("compression",t)};var H=X,T=function(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};T.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var a=!this._dataBinary;a&&!r&&(t=t.pipe(new L.Utf8EncodeWorker)),!a&&r&&(t=t.pipe(new L.Utf8DecodeWorker))}catch(e){(t=new G.a("error")).error(e)}return new V.a(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof H&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new L.Utf8EncodeWorker)),H.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof H?this._data.getContentWorker():this._data instanceof G.a?this._data:new f(this._data)}};for(var k=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],M=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},w=0;w=0;)e[t]=0}var K=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$=new Array(576);P($);var ee=new Array(60);P(ee);var te=new Array(512);P(te);var ne=new Array(256);P(ne);var re=new Array(29);P(re);var ae,se,ie,oe=new Array(30);function le(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}function Be(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Qe(e){return e<256?te[e]:te[256+(e>>>7)]}function ce(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Fe(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function de(e,t,n){var r,a,s=new Array(16),i=0;for(r=1;r<=15;r++)s[r]=i=i+n[r-1]<<1;for(a=0;a<=t;a++){var o=e[2*a+1];0!==o&&(e[2*a]=ge(s[o]++,o))}}function ue(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Ie(e){e.bi_valid>8?ce(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function me(e,t,n,r){var a=2*t,s=2*n;return e[a]>1;n>=1;n--)Ce(e,s,n);a=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ce(e,s,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,s[2*a]=s[2*n]+s[2*r],e.depth[a]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,s[2*n+1]=s[2*r+1]=a,e.heap[1]=a++,Ce(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,a,s,i,o,l=t.dyn_tree,B=t.max_code,Q=t.stat_desc.static_tree,c=t.stat_desc.has_stree,F=t.stat_desc.extra_bits,U=t.stat_desc.extra_base,g=t.stat_desc.max_length,d=0;for(s=0;s<=15;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(s=l[2*l[2*(r=e.heap[n])+1]+1]+1)>g&&(s=g,d++),l[2*r+1]=s,r>B||(e.bl_count[s]++,i=0,r>=U&&(i=F[r-U]),o=l[2*r],e.opt_len+=o*(s+i),c&&(e.static_len+=o*(Q[2*r+1]+i)));if(0!==d){do{for(s=g-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[g]--,d-=2}while(d>0);for(s=g;0!==s;s--)for(r=e.bl_count[s];0!==r;)(a=e.heap[--n])>B||(l[2*a+1]!==s&&(e.opt_len+=(s-l[2*a+1])*l[2*a],l[2*a+1]=s),r--)}}(e,t),de(s,B,e.bl_count)}function Se(e,t,n){var r,a,s=-1,i=t[1],o=0,l=7,B=4;for(0===i&&(l=138,B=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)a=i,i=t[2*(r+1)+1],++o>=7;r<30;r++)for(oe[r]=a<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),ye(e,e.l_desc),ye(e,e.d_desc),i=function(e){var t;for(Se(e,e.dyn_ltree,e.l_desc.max_code),Se(e,e.dyn_dtree,e.d_desc.max_code),ye(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*q[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=n+5,n+4<=a&&-1!==t?he(e,t,n,r):4===e.strategy||s===a?(Fe(e,2+(r?1:0),3),be(e,$,ee)):(Fe(e,4+(r?1:0),3),function(e,t,n,r){var a;for(Fe(e,t-257,5),Fe(e,n-1,5),Fe(e,r-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ne[n]+256+1)]++,e.dyn_dtree[2*Qe(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){Fe(e,2,3),Ue(e,256,$),function(e){16===e.bi_valid?(ce(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},Re=function(e,t,n,r){for(var a=65535&e|0,s=e>>>16&65535|0,i=0;0!==n;){n-=i=n>2e3?2e3:n;do{s=s+(a=a+t[r++]|0)|0}while(--i);a%=65521,s%=65521}return a|s<<16|0},Le=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),Ve=function(e,t,n,r){var a=Le,s=r+n;e^=-1;for(var i=r;i>>8^a[255&(e^t[i])];return-1^e};function Ae(e,t){return e.msg=z[t],t}function fe(e){return(e<<1)-(e>4?9:0)}function Ne(e){for(var t=e.length;--t>=0;)e[t]=0}function Ee(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(O.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function De(e,t){Ge._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ee(e.strm)}function ve(e,t){e.pending_buf[e.pending++]=t}function Je(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function We(e,t){var n,r,a=e.max_chain_length,s=e.strstart,i=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,B=e.window,Q=e.w_mask,c=e.prev,F=e.strstart+258,U=B[s+i-1],g=B[s+i];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(B[(n=t)+i]===g&&B[n+i-1]===U&&B[n]===B[s]&&B[++n]===B[s+1]){s+=2,n++;do{}while(B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&B[++s]===B[++n]&&si){if(e.match_start=t,i=r,r>=o)break;U=B[s+i-1],g=B[s+i]}}}while((t=c[t&Q])>l&&0!=--a);return i<=e.lookahead?i:e.lookahead}function Xe(e){var t,n,r,a,s,i,o,l,B,Q,c=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-262)){O.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=c?r-c:0}while(--n);t=n=c;do{r=e.prev[--t],e.prev[t]=r>=c?r-c:0}while(--n);a+=c}if(0===e.strm.avail_in)break;if(i=e.strm,o=e.window,l=e.strstart+e.lookahead,B=a,Q=void 0,(Q=i.avail_in)>B&&(Q=B),n=0===Q?0:(i.avail_in-=Q,O.arraySet(o,i.input,i.next_in,Q,l),1===i.state.wrap?i.adler=Re(i.adler,o,Q,l):2===i.state.wrap&&(i.adler=Ve(i.adler,o,Q,l)),i.next_in+=Q,i.total_in+=Q,Q),e.lookahead+=n,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(r=Ge._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,r=Ge._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=(e.ins_h<15&&(i=2,r-=16),a<1||a>9||8!==n||r<8||r>15||t<0||t>9||s<0||s>4)return Ae(e,-2);8===r&&(r=9);var o=new Me;return e.state=o,o.strm=e,o.wrap=i,o.gzhead=null,o.w_bits=r,o.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xe(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,De(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(De(e,!1),e.strm.avail_out),1)})),new ke(4,4,8,4,He),new ke(4,5,16,8,He),new ke(4,6,32,32,He),new ke(4,4,16,16,Te),new ke(8,16,32,32,Te),new ke(8,16,128,128,Te),new ke(8,32,128,256,Te),new ke(32,128,258,1024,Te),new ke(32,258,258,4096,Te)];var ze={deflateInit:function(e,t){return Oe(e,t,8,15,8,0)},deflateInit2:Oe,deflateReset:Ye,deflateResetKeep:we,deflateSetHeader:function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},deflate:function(e,t){var n,r,a,s;if(!e||!e.state||t>5||t<0)return e?Ae(e,-2):-2;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&4!==t)return Ae(e,0===e.avail_out?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead?(ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,255&r.gzhead.time),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ve(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,255&r.gzhead.extra.length),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Ve(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ve(r,3),r.status=113);else{var i=8+(r.w_bits-8<<4)<<8;i|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(i|=32),i+=31-i%31,r.status=113,Je(r,i),0!==r.strstart&&(Je(r,e.adler>>>16),Je(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),Ee(e),a=r.pending,r.pending!==r.pending_buf_size));)ve(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),Ee(e),a=r.pending,r.pending===r.pending_buf_size)){s=1;break}s=r.gzindexa&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),0===s&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),Ee(e),a=r.pending,r.pending===r.pending_buf_size)){s=1;break}s=r.gzindexa&&(e.adler=Ve(e.adler,r.pending_buf,r.pending-a,a)),0===s&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Ee(e),r.pending+2<=r.pending_buf_size&&(ve(r,255&e.adler),ve(r,e.adler>>8&255),e.adler=0,r.status=113)):r.status=113),0!==r.pending){if(Ee(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&fe(t)<=fe(n)&&4!==t)return Ae(e,-5);if(666===r.status&&0!==e.avail_in)return Ae(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var o=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(Xe(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=Ge._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(De(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,r,a,s,i=e.window;;){if(e.lookahead<=258){if(Xe(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=i[a=e.strstart-1])===i[++a]&&r===i[++a]&&r===i[++a]){s=e.strstart+258;do{}while(r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Ge._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Ge._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(De(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(De(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(De(e,!1),0===e.strm.avail_out)?1:2}(r,t):pe[r.level].func(r,t);if(3!==o&&4!==o||(r.status=666),1===o||3===o)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===o&&(1===t?Ge._tr_align(r):5!==t&&(Ge._tr_stored_block(r,0,0,!1),3===t&&(Ne(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Ee(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(ve(r,255&e.adler),ve(r,e.adler>>8&255),ve(r,e.adler>>16&255),ve(r,e.adler>>24&255),ve(r,255&e.total_in),ve(r,e.total_in>>8&255),ve(r,e.total_in>>16&255),ve(r,e.total_in>>24&255)):(Je(r,e.adler>>>16),Je(r,65535&e.adler)),Ee(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},deflateEnd:function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?Ae(e,-2):(e.state=null,113===t?Ae(e,-3):0):-2},deflateSetDictionary:function(e,t){var n,r,a,s,i,o,l,B,Q=t.length;if(!e||!e.state)return-2;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return-2;for(1===s&&(e.adler=Re(e.adler,t,Q,0)),n.wrap=0,Q>=n.w_size&&(0===s&&(Ne(n.head),n.strstart=0,n.block_start=0,n.insert=0),B=new O.Buf8(n.w_size),O.arraySet(B,t,Q-n.w_size,n.w_size,0),t=B,Q=n.w_size),i=e.avail_in,o=e.next_in,l=e.input,e.avail_in=Q,e.next_in=0,e.input=t,Xe(n);n.lookahead>=3;){r=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<=252?6:_e>=248?5:_e>=240?4:_e>=224?3:_e>=192?2:1;function qe(e,t){if(t<65534&&(e.subarray&&Ke||!e.subarray&&Pe))return String.fromCharCode.apply(null,O.shrinkBuf(e,t));for(var n="",r=0;r>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t},et=function(e){return qe(e,e.length)},tt=function(e){for(var t=new O.Buf8(e.length),n=0,r=t.length;n4)o[r++]=65533,n+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&n1?o[r++]=65533:a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|1023&a)}return qe(o,r)},rt=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+je[e[n]]>t?n:t},at=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},st=Object.prototype.toString;function it(e){if(!(this instanceof it))return new it(e);this.options=O.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new at,this.strm.avail_out=0;var n=ze.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(z[n]);if(t.header&&ze.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(r="string"==typeof t.dictionary?$e(t.dictionary):"[object ArrayBuffer]"===st.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=ze.deflateSetDictionary(this.strm,r)))throw new Error(z[n]);this._dict_set=!0}}function ot(e,t){var n=new it(t);if(n.push(e,!0),n.err)throw n.msg||z[n.err];return n.result}it.prototype.push=function(e,t){var n,r,a=this.strm,s=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=$e(e):"[object ArrayBuffer]"===st.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new O.Buf8(s),a.next_out=0,a.avail_out=s),1!==(n=ze.deflate(a,r))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(et(O.shrinkBuf(a.output,a.next_out))):this.onData(O.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==n);return 4===r?(n=ze.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==r||(this.onEnd(0),a.avail_out=0,!0)},it.prototype.onData=function(e){this.chunks.push(e)},it.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=O.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var lt={Deflate:it,deflate:ot,deflateRaw:function(e,t){return(t=t||{}).raw=!0,ot(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,ot(e,t)}},Bt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Qt=function(e,t){var n,r,a,s,i,o,l,B,Q,c,F,U,g,d,u,I,m,C,b,y,S,x,Z,h,p;n=e.state,r=e.next_in,h=e.input,a=r+(e.avail_in-5),s=e.next_out,p=e.output,i=s-(t-e.avail_out),o=s+(e.avail_out-257),l=n.dmax,B=n.wsize,Q=n.whave,c=n.wnext,F=n.window,U=n.hold,g=n.bits,d=n.lencode,u=n.distcode,I=(1<>>=b=C>>>24,g-=b,0==(b=C>>>16&255))p[s++]=65535&C;else{if(!(16&b)){if(0==(64&b)){C=d[(65535&C)+(U&(1<>>=b,g-=b),g<15&&(U+=h[r++]<>>=b=C>>>24,g-=b,!(16&(b=C>>>16&255))){if(0==(64&b)){C=u[(65535&C)+(U&(1<l){e.msg="invalid distance too far back",n.mode=30;break e}if(U>>>=b,g-=b,S>(b=s-i)){if((b=S-b)>Q&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(x=0,Z=F,0===c){if(x+=B-b,b2;)p[s++]=Z[x++],p[s++]=Z[x++],p[s++]=Z[x++],y-=3;y&&(p[s++]=Z[x++],y>1&&(p[s++]=Z[x++]))}else{x=s-S;do{p[s++]=p[x++],p[s++]=p[x++],p[s++]=p[x++],y-=3}while(y>2);y&&(p[s++]=p[x++],y>1&&(p[s++]=p[x++]))}break}}break}}while(r>3,U&=(1<<(g-=y<<3))-1,e.next_in=r,e.next_out=s,e.avail_in=r=1&&0===V[y];y--);if(S>y&&(S=y),0===y)return a[s++]=20971520,a[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===e||1!==y))return-1;for(A[1]=0,m=1;m<15;m++)A[m+1]=A[m]+V[m];for(C=0;C852||2===e&&p>592)return 1;for(;;){g=m-Z,i[C]U?(d=f[N+i[C]],u=R[L+i[C]]):(d=96,u=0),l=1<>Z)+(B-=l)]=g<<24|d<<16|u|0}while(0!==B);for(l=1<>=1;if(0!==l?(G&=l-1,G+=l):G=0,C++,0==--V[m]){if(m===y)break;m=t[n+i[C]]}if(m>S&&(G&c)!==Q){for(0===Z&&(Z=S),F+=b,h=1<<(x=m-Z);x+Z852||2===e&&p>592)return 1;a[Q=G&c]=S<<24|x<<16|F-s|0}}return 0!==G&&(a[F+G]=m-Z<<24|64<<16|0),o.bits=S,0};function ut(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function It(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function mt(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(852),t.distcode=t.distdyn=new O.Buf32(592),t.sane=1,t.back=-1,0):-2}function Ct(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,mt(e)):-2}function bt(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Ct(e))):-2}function yt(e,t){var n,r;return e?(r=new It,e.state=r,r.window=null,0!==(n=bt(e,t))&&(e.state=null),n):-2}var St,xt,Zt=!0;function ht(e){if(Zt){var t;for(St=new O.Buf32(512),xt=new O.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(dt(1,e.lens,0,288,St,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;dt(2,e.lens,0,32,xt,0,e.work,{bits:5}),Zt=!1}e.lencode=St,e.lenbits=9,e.distcode=xt,e.distbits=5}function pt(e,t,n,r){var a,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(O.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>r&&(a=r),O.arraySet(s.window,t,n-r,a,s.wnext),(r-=a)?(O.arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=Ve(n.check,G,2,0),B=0,Q=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&B)<<8)+(B>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&B)){e.msg="unknown compression method",n.mode=30;break}if(Q-=4,S=8+(15&(B>>>=4)),0===n.wbits)n.wbits=S;else if(S>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(G[0]=255&B,G[1]=B>>>8&255,n.check=Ve(n.check,G,2,0)),B=0,Q=0,n.mode=3;case 3:for(;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>8&255,G[2]=B>>>16&255,G[3]=B>>>24&255,n.check=Ve(n.check,G,4,0)),B=0,Q=0,n.mode=4;case 4:for(;Q<16;){if(0===o)break e;o--,B+=r[s++]<>8),512&n.flags&&(G[0]=255&B,G[1]=B>>>8&255,n.check=Ve(n.check,G,2,0)),B=0,Q=0,n.mode=5;case 5:if(1024&n.flags){for(;Q<16;){if(0===o)break e;o--,B+=r[s++]<>>8&255,n.check=Ve(n.check,G,2,0)),B=0,Q=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((U=n.length)>o&&(U=o),U&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),O.arraySet(n.head.extra,r,s,U,S)),512&n.flags&&(n.check=Ve(n.check,r,U,s)),o-=U,s+=U,n.length-=U),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===o)break e;U=0;do{S=r[s+U++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>=7&Q,Q-=7&Q,n.mode=27;break}for(;Q<3;){if(0===o)break e;o--,B+=r[s++]<>>=1)){case 0:n.mode=14;break;case 1:if(ht(n),n.mode=20,6===t){B>>>=2,Q-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}B>>>=2,Q-=2;break;case 14:for(B>>>=7&Q,Q-=7&Q;Q<32;){if(0===o)break e;o--,B+=r[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&B,B=0,Q=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(U=n.length){if(U>o&&(U=o),U>l&&(U=l),0===U)break e;O.arraySet(a,r,s,U,i),o-=U,s+=U,l-=U,i+=U,n.length-=U;break}n.mode=12;break;case 17:for(;Q<14;){if(0===o)break e;o--,B+=r[s++]<>>=5,Q-=5,n.ndist=1+(31&B),B>>>=5,Q-=5,n.ncode=4+(15&B),B>>>=4,Q-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,Q-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Z={bits:n.lenbits},x=dt(0,n.lens,0,19,n.lencode,0,n.work,Z),n.lenbits=Z.bits,x){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,m=65535&p,!((u=p>>>24)<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=u,Q-=u,n.lens[n.have++]=m;else{if(16===m){for(h=u+2;Q>>=u,Q-=u,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],U=3+(3&B),B>>>=2,Q-=2}else if(17===m){for(h=u+3;Q>>=u)),B>>>=3,Q-=3}else{for(h=u+7;Q>>=u)),B>>>=7,Q-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;U--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,Z={bits:n.lenbits},x=dt(1,n.lens,0,n.nlen,n.lencode,0,n.work,Z),n.lenbits=Z.bits,x){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,Z={bits:n.distbits},x=dt(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Z),n.distbits=Z.bits,x){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(o>=6&&l>=258){e.next_out=i,e.avail_out=l,e.next_in=s,e.avail_in=o,n.hold=B,n.bits=Q,Qt(e,F),i=e.next_out,a=e.output,l=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,B=n.hold,Q=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;I=(p=n.lencode[B&(1<>>16&255,m=65535&p,!((u=p>>>24)<=Q);){if(0===o)break e;o--,B+=r[s++]<>C)])>>>16&255,m=65535&p,!(C+(u=p>>>24)<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=C,Q-=C,n.back+=C}if(B>>>=u,Q-=u,n.back+=u,n.length=m,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(h=n.extra;Q>>=n.extra,Q-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;I=(p=n.distcode[B&(1<>>16&255,m=65535&p,!((u=p>>>24)<=Q);){if(0===o)break e;o--,B+=r[s++]<>C)])>>>16&255,m=65535&p,!(C+(u=p>>>24)<=Q);){if(0===o)break e;o--,B+=r[s++]<>>=C,Q-=C,n.back+=C}if(B>>>=u,Q-=u,n.back+=u,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(h=n.extra;Q>>=n.extra,Q-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===l)break e;if(U=F-l,n.offset>U){if((U=n.offset-U)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}U>n.wnext?(U-=n.wnext,g=n.wsize-U):g=n.wnext-U,U>n.length&&(U=n.length),d=n.window}else d=a,g=i-n.offset,U=n.length;U>l&&(U=l),l-=U,n.length-=U;do{a[i++]=d[g++]}while(--U);0===n.length&&(n.mode=21);break;case 26:if(0===l)break e;a[i++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;Q<32;){if(0===o)break e;o--,B|=r[s++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new at,this.strm.avail_out=0;var n=Gt.inflateInit2(this.strm,t.windowBits);if(n!==Bt.Z_OK)throw new Error(z[n]);if(this.header=new Rt,Gt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=$e(t.dictionary):"[object ArrayBuffer]"===Lt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Gt.inflateSetDictionary(this.strm,t.dictionary))!==Bt.Z_OK))throw new Error(z[n])}function At(e,t){var n=new Vt(t);if(n.push(e,!0),n.err)throw n.msg||z[n.err];return n.result}Vt.prototype.push=function(e,t){var n,r,a,s,i,o=this.strm,l=this.options.chunkSize,B=this.options.dictionary,Q=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?Bt.Z_FINISH:Bt.Z_NO_FLUSH,"string"==typeof e?o.input=tt(e):"[object ArrayBuffer]"===Lt.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new O.Buf8(l),o.next_out=0,o.avail_out=l),(n=Gt.inflate(o,Bt.Z_NO_FLUSH))===Bt.Z_NEED_DICT&&B&&(n=Gt.inflateSetDictionary(this.strm,B)),n===Bt.Z_BUF_ERROR&&!0===Q&&(n=Bt.Z_OK,Q=!1),n!==Bt.Z_STREAM_END&&n!==Bt.Z_OK)return this.onEnd(n),this.ended=!0,!1;o.next_out&&(0!==o.avail_out&&n!==Bt.Z_STREAM_END&&(0!==o.avail_in||r!==Bt.Z_FINISH&&r!==Bt.Z_SYNC_FLUSH)||("string"===this.options.to?(a=rt(o.output,o.next_out),s=o.next_out-a,i=nt(o.output,a),o.next_out=s,o.avail_out=l-s,s&&O.arraySet(o.output,o.output,a,s,0),this.onData(i)):this.onData(O.shrinkBuf(o.output,o.next_out)))),0===o.avail_in&&0===o.avail_out&&(Q=!0)}while((o.avail_in>0||0===o.avail_out)&&n!==Bt.Z_STREAM_END);return n===Bt.Z_STREAM_END&&(r=Bt.Z_FINISH),r===Bt.Z_FINISH?(n=Gt.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Bt.Z_OK):r!==Bt.Z_SYNC_FLUSH||(this.onEnd(Bt.Z_OK),o.avail_out=0,!0)},Vt.prototype.onData=function(e){this.chunks.push(e)},Vt.prototype.onEnd=function(e){e===Bt.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=O.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ft={Inflate:Vt,inflate:At,inflateRaw:function(e,t){return(t=t||{}).raw=!0,At(e,t)},ungzip:At},Nt={};(0,O.assign)(Nt,lt,ft,Bt);var Et=Nt,Dt="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function vt(e,t){G.a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}p.a.inherits(vt,G.a),vt.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(p.a.transformTo(Dt,e.data),!1)},vt.prototype.flush=function(){G.a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},vt.prototype.cleanUp=function(){G.a.prototype.cleanUp.call(this),this._pako=null},vt.prototype._createPako=function(){this._pako=new Et[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var Jt={STORE:{magic:"\0\0",compressWorker:function(e){return new G.a("STORE compression")},uncompressWorker:function(){return new G.a("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new vt("Deflate",e)},uncompressWorker:function(){return new vt("Inflate",{})}}},Wt="PK",Xt="PK",Ht="PK",Tt="PK",kt="PK",Mt="PK\b",wt=function(e,t){var n,r="";for(n=0;n>>=8;return r},Yt=function(e,t,n,r,a,s){var i,o,l=e.file,B=e.compression,Q=s!==L.utf8encode,c=p.a.transformTo("string",s(l.name)),F=p.a.transformTo("string",L.utf8encode(l.name)),U=l.comment,g=p.a.transformTo("string",s(U)),d=p.a.transformTo("string",L.utf8encode(U)),u=F.length!==l.name.length,I=d.length!==U.length,m="",C="",b="",y=l.dir,S=l.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var Z=0;t&&(Z|=8),Q||!u&&!I||(Z|=2048);var h,G,R=0,V=0;y&&(R|=16),"UNIX"===a?(V=798,R|=(G=h=l.unixPermissions,h||(G=y?16893:33204),(65535&G)<<16)):(V=20,R|=63&(l.dosPermissions||0)),i=S.getUTCHours(),i<<=6,i|=S.getUTCMinutes(),i<<=5,i|=S.getUTCSeconds()/2,o=S.getUTCFullYear()-1980,o<<=4,o|=S.getUTCMonth()+1,o<<=5,o|=S.getUTCDate(),u&&(C=wt(1,1)+wt(v(c),4)+F,m+="up"+wt(C.length,2)+C),I&&(b=wt(1,1)+wt(v(g),4)+d,m+="uc"+wt(b.length,2)+b);var A="";return A+="\n\0",A+=wt(Z,2),A+=B.magic,A+=wt(i,2),A+=wt(o,2),A+=wt(x.crc32,4),A+=wt(x.compressedSize,4),A+=wt(x.uncompressedSize,4),A+=wt(c.length,2),A+=wt(m.length,2),{fileRecord:Wt+A+c+m,dirRecord:Xt+wt(V,2)+A+wt(g.length,2)+"\0\0\0\0"+wt(R,4)+wt(r,4)+c+m+g}},Ot=function(e){return Mt+wt(e.crc32,4)+wt(e.compressedSize,4)+wt(e.uncompressedSize,4)};function zt(e,t,n,r){G.a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}p.a.inherits(zt,G.a),zt.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,G.a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},zt.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=Yt(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zt.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=Yt(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:Ot(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},zt.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},en=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},tn=function(e,t){return t=void 0!==t?t:Z.createFolders,e=en(e),this.files[e]||qt.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function nn(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var rn={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1===arguments.length){if(nn(e)){var r=e;return this.filter((function(e,t){return!t.dir&&r.test(e)}))}var a=this.files[this.root+e];return a&&!a.dir?a:null}return e=this.root+e,qt.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(nn(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=tn.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return p.a.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var sn=an;function on(e){sn.call(this,e);for(var t=0;t=0;--s)if(this.data[s]===t&&this.data[s+1]===n&&this.data[s+2]===r&&this.data[s+3]===a)return s-this.zero;return-1},on.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),a=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&n===s[1]&&r===s[2]&&a===s[3]},on.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var ln=on;function Bn(e){sn.call(this,e)}p.a.inherits(Bn,sn),Bn.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Bn.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Bn.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Bn.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Qn=Bn;function cn(e){ln.call(this,e)}p.a.inherits(cn,ln),cn.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Fn=cn;function Un(e){Fn.call(this,e)}p.a.inherits(Un,Fn),Un.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var gn=Un,dn=function(e){var t=p.a.getTypeOf(e);return p.a.checkSupport(t),"string"!==t||S.a.uint8array?"nodebuffer"===t?new gn(e):S.a.uint8array?new Fn(p.a.transformTo("uint8array",e)):new ln(p.a.transformTo("array",e)):new Qn(e)};function un(e,t){this.options=e,this.loadOptions=t}un.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in Jt)if(Jt.hasOwnProperty(t)&&Jt[t].magic===e)return Jt[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+p.a.pretty(this.compressionMethod)+" unknown (inner file : "+p.a.transformTo("string",this.fileName)+")");this.decompressed=new H(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=dn(this.extraFields[1].value);this.uncompressedSize===p.a.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===p.a.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===p.a.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===p.a.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,a=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,Xt)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=dn(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var Cn=mn;function bn(e){return new x.a.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new W);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function yn(){if(!(this instanceof yn))return new yn;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new yn;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}yn.prototype=rn,yn.prototype.loadAsync=function(e,t){var n=this;return t=p.a.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:L.utf8decode}),h.a.isNode&&h.a.isStream(e)?x.a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):p.a.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new Cn(t);return n.load(e),n})).then((function(e){var n=[x.a.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var a=0;a1;){var i=s.shift();a=a.folder(i)}e.callback&&e.callback(r)})),{fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,l){t||xn("ERROR!!! zip not ready...");var B=Gn([r,s.ref.basepath,i.compression?"".concat(s.ref.id,".gz"):s.ref.id].join("/"));1==++n&&e.invokeBusy&&e.invokeBusy(!0);var Q="string"!==s.dataType||i.compression?"uint8array":"string",c=pn[Q](s,i.compression,(function(){delete s.ref,0==--n&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),o(s)}));a.file(B).async(Q).then(c)}))},fetchJSON:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Gn(e);return t||xn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?a.file(r).async("uint8array").then((function(e){var t=l.a.inflate(e,{to:"string"});return Promise.resolve(JSON.parse(t))})):Promise.reject(new Error("Invalid compression")):a.file(r).async("string").then((function(e){return Promise.resolve(JSON.parse(e))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Gn(e);return t||xn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?a.file(r).async("uint8array").then((function(e){var t=l.a.inflate(e,{to:"string"});return Promise.resolve(t)})):Promise.reject(new Error("Invalid compression")):a.file(r).async("string").then((function(e){return Promise.resolve(e)}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,n=Gn(e);return t||xn("ERROR!!! zip not ready..."),new Promise((function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,a.file(n).async("base64").then((function(e){r.src="data:image/".concat(hn(n),";base64,").concat(e)}))}))},fetchBinary:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Gn(e);return t||xn("ERROR!!! zip not ready..."),n.compression?"gz"===n.compression?a.file(r).then((function(e){var t=l.a.inflate(e).buffer;return Promise.resolve(t)})):Promise.reject(new Error("Invalid compression")):a.file(r).async("arraybuffer").then((function(e){return Promise.resolve(e)}))}}}},Ln={http:function(e){return y},zip:function(e){return Rn.create(e)},html:function(e){return d}},Vn={get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ln[e](t)}};t.a=Vn},function(e,t,n){"use strict";n(4);var r=n(0),a=n(16),s=n(10),i=r.c.vtkErrorMacro,o=[1,-1,1,-1,1,-1];function l(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==n&&(t.size=n*r,t.values=new window[t.dataType](t.size),e.setNumberOfComponents(r),e.modified())},e.setPoint=function(e){for(var n=e*t.numberOfComponents,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,B,n),s.a.extend(e,t,n),l(e,t)}var c={newInstance:r.c.newInstance(Q,"vtkPoints"),extend:Q};t.a=c},function(e,t,n){"use strict";for(var r=n(11),a=[],s=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,B=o.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var r,s,i=[],o=t;o>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return i.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63;var F=function(e){var t,n,r=Q(e),a=r[0],o=r[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,o)),B=0,c=o>0?a-4:a;for(n=0;n>16&255,l[B++]=t>>8&255,l[B++]=255&t;return 2===o&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,l[B++]=255&t),1===o&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,l[B++]=t>>8&255,l[B++]=255&t),l},U=function(e){for(var t,n=e.length,r=n%3,s=[],i=16383,o=0,l=n-r;ol?l:o+i));return 1===r?(t=e[n-1],s.push(a[t>>2]+a[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"=")),s.join("")},g=function(e,t,n,r,a){var s,i,o=8*a-r-1,l=(1<>1,Q=-7,c=n?a-1:0,F=n?-1:1,U=e[t+c];for(c+=F,s=U&(1<<-Q)-1,U>>=-Q,Q+=o;Q>0;s=256*s+e[t+c],c+=F,Q-=8);for(i=s&(1<<-Q)-1,s>>=-Q,Q+=r;Q>0;i=256*i+e[t+c],c+=F,Q-=8);if(0===s)s=1-B;else{if(s===l)return i?NaN:1/0*(U?-1:1);i+=Math.pow(2,r),s-=B}return(U?-1:1)*i*Math.pow(2,s-r)},d=function(e,t,n,r,a,s){var i,o,l,B=8*s-a-1,Q=(1<>1,F=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,U=r?0:s-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,i=Q):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),(t+=i+c>=1?F/l:F*Math.pow(2,1-c))*l>=2&&(i++,l/=2),i+c>=Q?(o=0,i=Q):i+c>=1?(o=(t*l-1)*Math.pow(2,a),i+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,a),i=0));a>=8;e[n+U]=255&o,U+=g,o/=256,a-=8);for(i=i<0;e[n+U]=255&i,U+=g,i/=256,B-=8);e[n+U-g]|=128*d}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */n.d(t,"a",(function(){return u})); /*! * The buffer module from node.js, for the browser. @@ -8,16 +8,16 @@ function r(e){let t=e.length;for(;--t>=0;)e[t]=0}n.d(t,"a",(function(){return rn * @author Feross Aboukhadijeh * @license MIT */ -var u=Object(r.d)((function(e,t){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50;const r=2147483647;function s(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return i(e,t,n)}function i(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|u(e,t);let r=s(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(j(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return o(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);const i=function(e){if(a.isBuffer(e)){const t=0|F(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||_(e.length)?s(0):o(e):"Buffer"===e.type&&Array.isArray(e.data)?o(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Q(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function B(e){return Q(e),s(e<0?0:0|F(e))}function o(e){const t=e.length<0?0:0|F(e.length),n=s(t);for(let r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function u(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let s=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(e).length;default:if(s)return r?-1:z(e).length;t=(""+t).toLowerCase(),s=!0}}function I(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return p(this,t,n);case"ascii":return V(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return h(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function C(e,t,n,r,s){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),_(n=+n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,s);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,s){let a,i=1,Q=e.length,B=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,Q/=2,B/=2,n/=2}function o(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(s){let r=-1;for(a=n;aQ&&(n=Q-B),a=n;a>=0;a--){let n=!0;for(let r=0;rs&&(r=s):r=s;const a=t.length;let i;for(r>a/2&&(r=a/2),i=0;i>8,s=n%256,a.push(s),a.push(r);return a}(t,e.length-n),e,n,r)}function h(e,t,n){return 0===t&&n===e.length?c(e):c(e.slice(t,n))}function p(e,t,n){n=Math.min(e.length,n);const r=[];let s=t;for(;s239?4:t>223?3:t>191?2:1;if(s+i<=n){let n,r,Q,B;switch(i){case 1:t<128&&(a=t);break;case 2:n=e[s+1],128==(192&n)&&(B=(31&t)<<6|63&n,B>127&&(a=B));break;case 3:n=e[s+1],r=e[s+2],128==(192&n)&&128==(192&r)&&(B=(15&t)<<12|(63&n)<<6|63&r,B>2047&&(B<55296||B>57343)&&(a=B));break;case 4:n=e[s+1],r=e[s+2],Q=e[s+3],128==(192&n)&&128==(192&r)&&128==(192&Q)&&(B=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&Q,B>65535&&B<1114112&&(a=B))}}null===a?(a=65533,i=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),s+=i}return function(e){const t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(r,s)):Uint8Array.prototype.set.call(r,t,s);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,s)}s+=t.length}return r},a.byteLength=u,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,s){if(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(s>>>=0)-(r>>>=0),Q=(n>>>=0)-(t>>>=0);const B=Math.min(i,Q),o=this.slice(r,s),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const s=this.length-t;if((void 0===n||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return Z(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function V(e,t,n){let r="";n=Math.min(e.length,n);for(let s=t;sr)&&(n=r);let s="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function f(e,t,n,r,s,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r,s){M(t,r,s,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,n}function v(e,t,n,r,s){M(t,r,s,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=i,i>>=8,e[n+2]=i,i>>=8,e[n+1]=i,i>>=8,e[n]=i,n+8}function J(e,t,n,r,s,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function W(e,t,n,r,s){return t=+t,n>>>=0,s||J(e,0,n,4),d(e,t,n,r,23,4),n+4}function X(e,t,n,r,s){return t=+t,n>>>=0,s||J(e,0,n,8),d(e,t,n,r,52,8),n+8}a.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],s=1,a=0;for(;++a>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e+--t],s=1;for(;t>0&&(s*=256);)r+=this[e+--t]*s;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=$((function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||w(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,s=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(s)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||w(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],s=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],s=1,a=0;for(;++a=s&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=t,s=1,a=this[e+--r];for(;r>0&&(s*=256);)a+=this[e+--r]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=$((function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||w(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||w(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||E(e,4,this.length),g(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),g(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),g(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),g(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||f(this,e,t,n,Math.pow(2,8*n)-1,0);let s=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||f(this,e,t,n,Math.pow(2,8*n)-1,0);let s=n-1,a=1;for(this[t+s]=255&e;--s>=0&&(a*=256);)this[t+s]=e/a&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=$((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=$((function(e,t=0){return v(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);f(this,e,t,n,r-1,-r)}let s=0,a=1,i=0;for(this[t]=255&e;++s>0)-i&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);f(this,e,t,n,r-1,-r)}let s=n-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a>>0)-i&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||f(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=$((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=$((function(e,t=0){return v(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,n){return W(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return W(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return X(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return X(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function M(e,t,n,r,s,a){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE("value",s,e)}!function(e,t,n){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||w(t,e.length-(n+1))}(r,s,a)}function Y(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function w(e,t,n){if(Math.floor(e)!==e)throw Y(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}k("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"}),RangeError),k("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),k("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,s=n;return Number.isInteger(n)&&Math.abs(n)>2**32?s=T(String(n)):"bigint"==typeof n&&(s=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(s=T(s)),s+="n"),r+=` It must be ${t}. Received ${s}`,r}),RangeError);const O=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let s=null;const a=[];for(let i=0;i55295&&n<57344){if(!s){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}s=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(t-=3)>-1&&a.push(239,191,189);if(s=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function P(e){return U(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,r){let s;for(s=0;s=t.length||s>=e.length);++s)t[s+n]=e[s];return s}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function _(e){return e!=e}const q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let s=0;s<16;++s)t[r+s]=e[n]+e[s]}return t}();function $(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}}),"/$$rollup_base$$/node_modules/buffer")},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),s=Object(r.d)((function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),"/$$rollup_base$$/node_modules/inherits")},function(e,t,n){"use strict";n(6);var r=n(0),s=n(16),a=n(11),i=r.b.vtkErrorMacro,Q=[1,-1,1,-1,1,-1];function B(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==n&&(t.size=n*r,t.values=new window[t.dataType](t.size),e.setNumberOfComponents(r),e.modified())},e.setPoint=function(e){for(var n=e*t.numberOfComponents,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,n),a.a.extend(e,t,n),B(e,t)}var F={newInstance:r.b.newInstance(l,"vtkPoints"),extend:l};t.a=F},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=n(44).a.EventEmitter},function(e,t,n){"use strict";var r=n(8),s=(n(6),n(20)),a=n(0),i=n(11);function Q(e,t){t.classHierarchy.push("vtkFieldData");var n=e.getState;t.arrays&&(t.arrays=t.arrays.map((function(e){return{data:Object(s.a)(e.data)}}))),e.initialize=function(){e.initializeFields(),e.copyAllOn(),e.clearFieldFlags()},e.initializeFields=function(){t.arrays=[],t.copyFieldFlags={},e.modified()},e.copyStructure=function(n){e.initializeFields(),t.copyFieldFlags=n.getCopyFieldFlags().map((function(e){return e})),t.arrays=n.arrays().map((function(e){return{array:e}}))},e.getNumberOfArrays=function(){return t.arrays.length},e.getNumberOfActiveArrays=function(){return t.arrays.length},e.addArray=function(e){return t.arrays=[].concat(t.arrays,{data:e}),t.arrays.length-1},e.removeAllArrays=function(){t.arrays=[]},e.removeArray=function(e){t.arrays=t.arrays.filter((function(t){return e!==t.data.getName()}))},e.removeArrayByIndex=function(e){t.arrays=t.arrays.filter((function(t,n){return n!==e}))},e.getArrays=function(){return t.arrays.map((function(e){return e.data}))},e.getArray=function(t){return"number"==typeof t?e.getArrayByIndex(t):e.getArrayByName(t)},e.getArrayByName=function(e){return t.arrays.reduce((function(t,n,r){return n.data.getName()===e?n.data:t}),null)},e.getArrayWithIndex=function(e){return t.arrays.reduce((function(t,n,r){return n.data&&n.data.getName()===e?{array:n.data,index:r}:t}),{array:null,index:-1})},e.getArrayByIndex=function(e){return e>=0&&e=0},e.getArrayName=function(e){var n=t.arrays[e];return n?n.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.getArrays().forEach((function(n){var a=e.getFlag(n.getName());if(!1!==a&&(!t.doCopyAllOff||!0===a)&&n){var Q=e.getArrayByName(n.getName());if(Q){if(n.getNumberOfComponents()===Q.getNumberOfComponents())if(r>-1&&r-1?s:r;Q.setTuple(B,n.getTuple(r))}else for(var o=0;on.getNumberOfTuples())e.addArray(n);else{var l=n.getNumberOfComponents(),F=n.getNumberOfValues(),U=s>-1?s:r;Fe?t.data.getMTime():e}),t.mtime)},e.getNumberOfComponents=function(){return t.arrays.reduce((function(e,t){return e+t.data.getNumberOfComponents()}),0)},e.getNumberOfTuples=function(){return t.arrays.length>0?t.arrays[0].getNumberOfTuples():0},e.getState=function(){var e=n();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var B={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,B,n),a.b.obj(e,t),Q(e,t)}var l={newInstance:a.b.newInstance(o,"vtkFieldData"),extend:o},F=n(42);function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c=F.b.AttributeTypes,g=F.b.AttributeCopyOperations,d=a.b.vtkWarningMacro;function u(e,t){var n=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function r(e){var t=n.find((function(t){return c[t.toUpperCase()]===e||"number"!=typeof e&&t.toLowerCase()===e.toLowerCase()}));return void 0===t&&(t=null),t}t.classHierarchy.push("vtkDataSetAttributes"),e.checkNumberOfComponents=function(e){return!0},e.setAttribute=function(n,s){var a=r(s);if(n&&"PEDIGREEIDS"===a.toUpperCase()&&!n.isA("vtkDataArray"))return d("Cannot set attribute ".concat(a,". The attribute must be a vtkDataArray.")),-1;if(n&&!e.checkNumberOfComponents(n,a))return d("Cannot set attribute ".concat(a,". Incorrect number of components.")),-1;var i=t["active".concat(a)];if(i>=0&&i=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,I,n),l.extend(e,t,n),a.b.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),u(e,t)}var C=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];n(e,r),S.forEach((function(n){t[n]=C.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))}))}}var x={};function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,x,n),a.b.obj(e,t),a.b.setGet(e,t,S),Z(e,t)}var h=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:null,s=r(e),a=t.exec(s);if(!a)return{text:s};var i=a.index+a[0].length,Q=s.substring(0,i),B=null,o=n?n.exec(s):null;if(o){var l=s.substr(o.index);B={text:Q+l,binaryBuffer:e.slice(i,o.index)}}else B={text:Q,binaryBuffer:e.slice(i)};return B}};t.a=s},function(e,t,n){"use strict";(function(e){function r(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}n.d(t,"a",(function(){return i}));var i={destroy:function(t,n){var i=this,Q=this._readableState&&this._readableState.destroyed,B=this._writableState&&this._writableState.destroyed;return Q||B?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(s,i):(i._writableState.errorEmitted=!0,e.nextTick(r,i,t)):e.nextTick(r,i,t):n?(e.nextTick(s,i),n(t)):e.nextTick(s,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,n(39))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(8),s=(n(6),n(0)),a=n(3);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e,t,n){var r=n[0]*(e[0]-t[0])+n[1]*(e[1]-t[1])+n[2]*(e[2]-t[2]);return Math.abs(r)}function B(e,t,n,r){var s=[];Object(a.s)(e,t,s);var i=Object(a.p)(n,s);r[0]=e[0]-i*n[0],r[1]=e[1]-i*n[1],r[2]=e[2]-i*n[2]}function o(e,t,n){var r=Object(a.p)(e,t),s=Object(a.p)(t,t);0===s&&(s=1),n[0]=e[0]-r*t[0]/s,n[1]=e[1]-r*t[1]/s,n[2]=e[2]-r*t[2]/s}function l(e,t,n,r){var s=[];Object(a.s)(e,t,s);var i=Object(a.p)(n,s),Q=Object(a.p)(n,n);0!==Q?(r[0]=e[0]-i*n[0]/Q,r[1]=e[1]-i*n[1]/Q,r[2]=e[2]-i*n[2]/Q):(r[0]=e[0],r[1]=e[1],r[2]=e[2])}function F(e,t,n,r){var s={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},i=[],Q=[];Object(a.s)(t,e,i),Object(a.s)(n,e,Q);var B=Object(a.p)(r,Q),o=Object(a.p)(r,i);return(o<0?-o:o)<=(B<0?1e-6*-B:1e-6*B)||(s.t=B/o,s.x[0]=e[0]+s.t*i[0],s.x[1]=e[1]+s.t*i[1],s.x[2]=e[2]+s.t*i[2],s.intersection=!0,s.betweenPoints=s.t>=0&&s.t<=1),s}function U(e,t,n,r){var s={intersection:!1,l0:[],l1:[],error:null},i=[];Object(a.v)(t,r,i);var Q,B=i.map((function(e){return Math.abs(e)}));if(B[0]+B[1]+B[2]<1e-6){var o=[];return Object(a.s)(e,n,o),0===Object(a.p)(t,o)?s.error="coincide":s.error="disjoint",s}Q=B[0]>B[1]&&B[0]>B[2]?"x":B[1]>B[2]?"y":"z";var l=[],F=-Object(a.p)(t,e),U=-Object(a.p)(r,n);switch(Q){case"x":l[0]=0,l[1]=(U*t[2]-F*r[2])/i[0],l[2]=(F*r[1]-U*t[1])/i[0];break;case"y":l[0]=(F*r[2]-U*t[2])/i[1],l[1]=0,l[2]=(U*t[0]-F*r[0])/i[1];break;case"z":l[0]=(U*t[1]-F*r[1])/i[2],l[1]=(F*r[0]-U*t[0])/i[2],l[2]=0}return s.l0=l,Object(a.w)(l,i,s.l1),s.intersection=!0,s}var c={evaluate:function(e,t,n){return e[0]*(n[0]-t[0])+e[1]*(n[1]-t[1])+e[2]*(n[2]-t[2])},distanceToPlane:Q,projectPoint:B,projectVector:o,generalizedProjectPoint:l,intersectWithLine:F,intersectWithPlane:U,DISJOINT:"disjoint",COINCIDE:"coincide"};function g(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return Q(e,t.origin,t.normal)},e.projectPoint=function(e,n){B(e,t.origin,t.normal,n)},e.projectVector=function(e,n){o(e,t.normal,n)},e.push=function(e){if(0!==e)for(var n=0;n<3;n++)t.origin[n]+=e*t.normal[n]},e.generalizedProjectPoint=function(e,n){l(e,t.origin,t.normal,n)},e.evaluateFunction=function(e,n,r){return Array.isArray(e)?t.normal[0]*(e[0]-t.origin[0])+t.normal[1]*(e[1]-t.origin[1])+t.normal[2]*(e[2]-t.origin[2]):t.normal[0]*(e-t.origin[0])+t.normal[1]*(n-t.origin[1])+t.normal[2]*(r-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,n){return F(e,n,t.origin,t.normal)},e.intersectWithPlane=function(e,n){return U(e,n,t.origin,t.normal)}}var d={normal:[0,0,1],origin:[0,0,0]};function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),s.b.obj(e,t),s.b.setGetArray(e,t,["normal","origin"],3),g(e,t)}var I=function(e){for(var t=1;t>16&255,s[U++]=F>>8&255,s[U++]=255&F}switch(B){case 3:for(;!i(e[l]);)l++;for(F=r[e.charCodeAt(l++)]<<10;!i(e[l]);)l++;for(F|=r[e.charCodeAt(l++)]<<4;!i(e[l]);)l++;F|=r[e.charCodeAt(l++)]>>2,s[U++]=F>>8&255,s[U++]=255&F;break;case 2:for(;!i(e[l]);)l++;for(F=r[e.charCodeAt(l++)]<<2;!i(e[l]);)l++;F|=r[e.charCodeAt(l++)]>>4,s[U++]=255&F;break;case 1:throw new Error("BASE64: remain 1 should not happen")}return U}var B={toArrayBuffer:function(e){for(var t=function(e){for(var t=e.length,n=[],r=null,s=0;s1)for(var n=1;n0&&i.length>s&&!i.warned){i.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=e,B.type=t,B.count=i.length,Q=B,console&&console.warn&&console.warn(Q)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=c.bind(r);return s.listener=n,r.wrapFn=s,s}function d(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var Q=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw Q.context=i,Q}var B=s[e];if(void 0===B)return!1;if("function"==typeof B)a(B,this,t);else{var o=B.length,l=I(B,o);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){i=n[a].listener,s=a;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},Q.prototype.listeners=function(e){return d(this,e,!0)},Q.prototype.rawListeners=function(e){return d(this,e,!1)},Q.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):u.call(e,t)},Q.prototype.listenerCount=u,Q.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]},B.once=function(e,t){return new Promise((function(n,r){function s(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,s),r(n)},e.once("error",a)),e.once(t,s)}))}},function(e,t,n){"use strict";t.a=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,F,n),i.a.extend(e,t,n),l(e,t)}var c=function(e){for(var t=1;t0)if("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===C.prototype||(t=function(e){return C.from(e)}(t)),r)i.endEmitted?L(e,new V):D(e,i,t,!0);else if(i.ended)L(e,new p);else{if(i.destroyed)return!1;i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?D(e,i,t,!1):X(e,i)):D(e,i,t,!1)}else r||(i.reading=!1,X(e,i));return!i.ended&&(i.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function J(t){var n=t._readableState;I("emitReadable",n.needReadable,n.emittedReadable),n.needReadable=!1,n.emittedReadable||(I("emitReadable",n.flowing),n.emittedReadable=!0,e.nextTick(W,t))}function W(e){var t=e._readableState;I("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Y(e)}function X(t,n){n.readingMore||(n.readingMore=!0,e.nextTick(H,t,n))}function H(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function T(e){I("readable nexttick read 0"),e.read(0)}function M(e,t){I("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Y(e),t.flowing&&!t.reading&&e.read(0)}function Y(e){var t=e._readableState;for(I("flow",t.flowing);t.flowing&&null!==e.read(););}function w(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function O(t){var n=t._readableState;I("endReadable",n.endEmitted),n.endEmitted||(n.ended=!0,e.nextTick(z,n,t))}function z(e,t){if(I("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function P(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return I("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):J(this),null;if(0===(e=v(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,s=t.needReadable;return I("need readable",s),(0===t.length||t.length-e0?w(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(e){L(this,new R("_read()"))},E.prototype.pipe=function(t,n){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,I("pipe count=%d opts=%j",s.pipesCount,n);var a=n&&!1===n.end||t===e.stdout||t===e.stderr?c:i;function i(){I("onend"),t.end()}s.endEmitted?e.nextTick(a):r.once("end",a),t.on("unpipe",(function e(n,a){I("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,I("cleanup"),t.removeListener("close",F),t.removeListener("finish",U),t.removeListener("drain",Q),t.removeListener("error",l),t.removeListener("unpipe",e),r.removeListener("end",i),r.removeListener("end",c),r.removeListener("data",o),B=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||Q())}));var Q=function(e){return function(){var t=e._readableState;I("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&m(e,"data")&&(t.flowing=!0,Y(e))}}(r);t.on("drain",Q);var B=!1;function o(e){I("ondata");var n=t.write(e);I("dest.write",n),!1===n&&((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==P(s.pipes,t))&&!B&&(I("false write response, pause",s.awaitDrain),s.awaitDrain++),r.pause())}function l(e){I("onerror",e),c(),t.removeListener("error",l),0===m(t,"error")&&L(t,e)}function F(){t.removeListener("finish",U),c()}function U(){I("onfinish"),t.removeListener("close",F),c()}function c(){I("unpipe"),r.unpipe(t)}return r.on("data",o),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",l),t.once("close",F),t.once("finish",U),t.emit("pipe",r),s.flowing||(I("pipe resume"),r.resume()),t},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==s.flowing&&this.resume()):"readable"===t&&(s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,I("on readable",s.length,s.reading),s.length?J(this):s.reading||e.nextTick(T,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,n){var r=a.a.prototype.removeListener.call(this,t,n);return"readable"===t&&e.nextTick(k,this),r},E.prototype.removeAllListeners=function(t){var n=a.a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(k,this),n},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(I("resume"),t.flowing=!t.readableListening,function(t,n){n.resumeScheduled||(n.resumeScheduled=!0,e.nextTick(M,t,n))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var s in e.on("end",(function(){if(I("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){I("wrapped data"),n.decoder&&(s=n.decoder.write(s)),n.objectMode&&null==s||(n.objectMode||s&&s.length)&&(t.push(s)||(r=!0,e.pause()))})),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var a=0;a-1))throw new p(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,n){n(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,n,r){var s=this._writableState;return"function"==typeof t?(r=t,t=null,n=null):"function"==typeof n&&(r=n,n=null),null!=t&&this.write(t,n),s.corked&&(s.corked=1,this.uncork()),s.ending||function(t,n,r){n.ending=!0,J(t,n),r&&(n.finished?e.nextTick(r):t.once("finish",r)),n.ended=!0,t.writable=!1}(this,s,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=Q.a.destroy,A.prototype._undestroy=Q.a.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this,n(39))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(17),s=n(7),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i={encode:function(e){for(var t,n,r,i,Q,B,o,l=[],F=0,U=e.length,c=U,g="string"!==s.a.getTypeOf(e);F>2,Q=(3&t)<<4|n>>4,B=c>1?(15&n)<<2|r>>6:64,o=c>2?63&r:64,l.push(a.charAt(i)+a.charAt(Q)+a.charAt(B)+a.charAt(o));return l.join("")},decode:function(e){var t,n,s,i,Q,B,o=0,l=0,F="data:";if(e.substr(0,F.length)===F)throw new Error("Invalid base64 input, it looks like a data url.");var U,c=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&c--,e.charAt(e.length-2)===a.charAt(64)&&c--,c%1!=0)throw new Error("Invalid base64 input, bad content length.");for(U=r.a.uint8array?new Uint8Array(0|c):new Array(0|c);o>4,n=(15&i)<<4|(Q=a.indexOf(e.charAt(o++)))>>2,s=(3&Q)<<6|(B=a.indexOf(e.charAt(o++))),U[l++]=t,64!==Q&&(U[l++]=n),64!==B&&(U[l++]=s);return U}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return U}));var r=n(17),s=n(51),a=n(23),i=n(7),Q=n(13),B=n(61),o=n(62),l=null;if(r.a.nodestream)try{l=o.a}catch(e){}function F(e,t,n){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=n,i.a.checkSupport(r),this._worker=e.pipe(new B.a(r)),e.lock()}catch(e){this._worker=new Q.a("error"),this._worker.error(e)}}F.prototype={accumulate:function(t){return function(t,n){return new a.a.Promise((function(r,a){var Q=[],B=t._internalType,o=t._outputType,l=t._mimeType;t.on("data",(function(e,t){Q.push(e),n&&n(t)})).on("error",(function(e){Q=[],a(e)})).on("end",(function(){try{var t=function(e,t,n){switch(e){case"blob":return i.a.newBlob(i.a.transformTo("arraybuffer",t),n);case"base64":return s.a.encode(t);default:return i.a.transformTo(e,t)}}(o,function(t,n){var r,s=0,a=null,i=0;for(r=0;r0,(function(e){r||(r=e),e&&a.forEach(L),i||(a.forEach(L),s(r))}))}));return t.reduce(A)},D.Stream=D,D.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function s(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",s),e._isStdio||t&&!1===t.end||(n.on("end",i),n.on("close",Q));var a=!1;function i(){a||(a=!0,e.end())}function Q(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function B(e){if(o(),0===f.listenerCount(this,"error"))throw e}function o(){n.removeListener("data",r),e.removeListener("drain",s),n.removeListener("end",i),n.removeListener("close",Q),n.removeListener("error",B),e.removeListener("error",B),n.removeListener("end",o),n.removeListener("close",o),e.removeListener("close",o)}return n.on("error",B),e.on("error",B),n.on("end",o),n.on("close",o),e.on("close",o),e.emit("pipe",n),e},n.d(t,"a",(function(){return v}));var v=E},function(e,t,n){"use strict";(function(e){ +var u=Object(r.d)((function(e,t){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50;const r=2147483647;function a(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return i(e,t,n)}function i(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|u(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(j(e,Uint8Array)){const t=new Uint8Array(e);return Q(t.buffer,t.byteOffset,t.byteLength)}return B(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return Q(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return Q(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return s.from(r,t,n);const i=function(e){if(s.isBuffer(e)){const t=0|c(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||_(e.length)?a(0):B(e):"Buffer"===e.type&&Array.isArray(e.data)?B(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return o(e),a(e<0?0:0|c(e))}function B(e){const t=e.length<0?0:0|c(e.length),n=a(t);for(let r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function u(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(e).length;default:if(a)return r?-1:z(e).length;t=(""+t).toLowerCase(),a=!0}}function I(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return G(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return V(this,t,n);case"base64":return p(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function C(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),_(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,a){let s,i=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,o/=2,l/=2,n/=2}function B(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){let r=-1;for(s=n;so&&(n=o-l),s=n;s>=0;s--){let n=!0;for(let r=0;ra&&(r=a):r=a;const s=t.length;let i;for(r>s/2&&(r=s/2),i=0;i>8,a=n%256,s.push(a),s.push(r);return s}(t,e.length-n),e,n,r)}function p(e,t,n){return 0===t&&n===e.length?U(e):U(e.slice(t,n))}function G(e,t,n){n=Math.min(e.length,n);const r=[];let a=t;for(;a239?4:t>223?3:t>191?2:1;if(a+i<=n){let n,r,o,l;switch(i){case 1:t<128&&(s=t);break;case 2:n=e[a+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(s=l));break;case 3:n=e[a+1],r=e[a+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:n=e[a+1],r=e[a+2],o=e[a+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&o,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,i=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),a+=i}return function(e){const t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,a)):Uint8Array.prototype.set.call(r,t,a);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,a)}a+=t.length}return r},s.byteLength=u,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,a){if(j(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const l=Math.min(i,o),B=this.slice(r,a),Q=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return Z(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function L(e,t,n){let r="";n=Math.min(e.length,n);for(let a=t;ar)&&(n=r);let a="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function E(e,t,n,r,a,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r,a){M(t,r,a,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,n}function v(e,t,n,r,a){M(t,r,a,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=i,i>>=8,e[n+2]=i,i>>=8,e[n+1]=i,i>>=8,e[n]=i,n+8}function J(e,t,n,r,a,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function W(e,t,n,r,a){return t=+t,n>>>=0,a||J(e,0,n,4),d(e,t,n,r,23,4),n+4}function X(e,t,n,r,a){return t=+t,n>>>=0,a||J(e,0,n,8),d(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],a=1,s=0;for(;++s>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e+--t],a=1;for(;t>0&&(a*=256);)r+=this[e+--t]*a;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=$((function(e){w(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,a=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(a)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],a=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],a=1,s=0;for(;++s=a&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=t,a=1,s=this[e+--r];for(;r>0&&(a*=256);)s+=this[e+--r]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*t)),s},s.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=$((function(e){w(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||N(e,4,this.length),g(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),g(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),g(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),g(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||E(this,e,t,n,Math.pow(2,8*n)-1,0);let a=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,r||E(this,e,t,n,Math.pow(2,8*n)-1,0);let a=n-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=$((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=$((function(e,t=0){return v(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);E(this,e,t,n,r-1,-r)}let a=0,s=1,i=0;for(this[t]=255&e;++a>0)-i&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);E(this,e,t,n,r-1,-r)}let a=n-1,s=1,i=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===i&&0!==this[t+a+1]&&(i=1),this[t+a]=(e/s>>0)-i&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=$((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=$((function(e,t=0){return v(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(e,t,n){return W(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return W(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return X(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return X(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function M(e,t,n,r,a,s){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,n){w(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Y(t,e.length-(n+1))}(r,a,s)}function w(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,n){if(Math.floor(e)!==e)throw w(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}T("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"}),RangeError),T("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),T("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,a=n;return Number.isInteger(n)&&Math.abs(n)>2**32?a=k(String(n)):"bigint"==typeof n&&(a=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(a=k(a)),a+="n"),r+=` It must be ${t}. Received ${a}`,r}),RangeError);const O=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let a=null;const s=[];for(let i=0;i55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function P(e){return F(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,r){let a;for(a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function _(e){return e!=e}const q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let a=0;a<16;++a)t[r+a]=e[n]+e[a]}return t}();function $(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}}),"/$$rollup_base$$/node_modules/buffer")},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(11),a=Object(r.d)((function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),"/$$rollup_base$$/node_modules/inherits")},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));n(4);var r={SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},a={DEFAULT:0,SINGLE:1,DOUBLE:2},s={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:r,CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:a,PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};t.c=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=n(45).a.EventEmitter},function(e,t,n){"use strict";var r=n(9),a=(n(4),n(21)),s=n(0),i=n(10);function o(e,t){t.classHierarchy.push("vtkFieldData");var n=e.getState;t.arrays&&(t.arrays=t.arrays.map((function(e){return{data:Object(a.a)(e.data)}}))),e.initialize=function(){e.initializeFields(),e.copyAllOn(),e.clearFieldFlags()},e.initializeFields=function(){t.arrays=[],t.copyFieldFlags={},e.modified()},e.copyStructure=function(n){e.initializeFields(),t.copyFieldFlags=n.getCopyFieldFlags().map((function(e){return e})),t.arrays=n.arrays().map((function(e){return{array:e}}))},e.getNumberOfArrays=function(){return t.arrays.length},e.getNumberOfActiveArrays=function(){return t.arrays.length},e.addArray=function(e){return t.arrays=[].concat(t.arrays,{data:e}),t.arrays.length-1},e.removeAllArrays=function(){t.arrays=[]},e.removeArray=function(e){t.arrays=t.arrays.filter((function(t){return e!==t.data.getName()}))},e.removeArrayByIndex=function(e){t.arrays=t.arrays.filter((function(t,n){return n!==e}))},e.getArrays=function(){return t.arrays.map((function(e){return e.data}))},e.getArray=function(t){return"number"==typeof t?e.getArrayByIndex(t):e.getArrayByName(t)},e.getArrayByName=function(e){return t.arrays.reduce((function(t,n,r){return n.data.getName()===e?n.data:t}),null)},e.getArrayWithIndex=function(e){return t.arrays.reduce((function(t,n,r){return n.data&&n.data.getName()===e?{array:n.data,index:r}:t}),{array:null,index:-1})},e.getArrayByIndex=function(e){return e>=0&&e=0},e.getArrayName=function(e){var n=t.arrays[e];return n?n.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.getArrays().forEach((function(n){var s=e.getFlag(n.getName());if(!1!==s&&(!t.doCopyAllOff||!0===s)&&n){var o=e.getArrayByName(n.getName());if(o){if(n.getNumberOfComponents()===o.getNumberOfComponents())if(r>-1&&r-1?a:r;o.setTuple(l,n.getTuple(r))}else for(var B=0;Bn.getNumberOfTuples())e.addArray(n);else{var Q=n.getNumberOfComponents(),c=n.getNumberOfValues(),F=a>-1?a:r;ce?t.data.getMTime():e}),t.mtime)},e.getNumberOfComponents=function(){return t.arrays.reduce((function(e,t){return e+t.data.getNumberOfComponents()}),0)},e.getNumberOfTuples=function(){return t.arrays.length>0?t.arrays[0].getNumberOfTuples():0},e.getState=function(){var e=n();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var l={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function B(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,l,n),s.c.obj(e,t),o(e,t)}var Q={newInstance:s.c.newInstance(B,"vtkFieldData"),extend:B},c=n(31);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var U=c.c.AttributeTypes,g=c.c.AttributeCopyOperations,d=s.c.vtkWarningMacro;function u(e,t){var n=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function r(e){var t=n.find((function(t){return U[t.toUpperCase()]===e||"number"!=typeof e&&t.toLowerCase()===e.toLowerCase()}));return void 0===t&&(t=null),t}t.classHierarchy.push("vtkDataSetAttributes"),e.checkNumberOfComponents=function(e){return!0},e.setAttribute=function(n,a){var s=r(a);if(n&&"PEDIGREEIDS"===s.toUpperCase()&&!n.isA("vtkDataArray"))return d("Cannot set attribute ".concat(s,". The attribute must be a vtkDataArray.")),-1;if(n&&!e.checkNumberOfComponents(n,s))return d("Cannot set attribute ".concat(s,". Incorrect number of components.")),-1;var i=t["active".concat(s)];if(i>=0&&i=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,I,n),Q.extend(e,t,n),s.c.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),u(e,t)}var C=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];n(e,r),S.forEach((function(n){t[n]=C.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))}))}}var Z={};function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Z,n),s.c.obj(e,t),s.c.setGet(e,t,S),x(e,t)}var p=function(e){for(var t=1;t=0&&a.t<=1),a}function F(e,t,n,r){var a={intersection:!1,l0:[],l1:[],error:null},i=[];Object(s.v)(t,r,i);var o,l=i.map((function(e){return Math.abs(e)}));if(l[0]+l[1]+l[2]<1e-6){var B=[];return Object(s.u)(e,n,B),0===Object(s.r)(t,B)?a.error="coincide":a.error="disjoint",a}o=l[0]>l[1]&&l[0]>l[2]?"x":l[1]>l[2]?"y":"z";var Q=[],c=-Object(s.r)(t,e),F=-Object(s.r)(r,n);switch(o){case"x":Q[0]=0,Q[1]=(F*t[2]-c*r[2])/i[0],Q[2]=(c*r[1]-F*t[1])/i[0];break;case"y":Q[0]=(c*r[2]-F*t[2])/i[1],Q[1]=0,Q[2]=(F*t[0]-c*r[0])/i[1];break;case"z":Q[0]=(F*t[1]-c*r[1])/i[2],Q[1]=(c*r[0]-F*t[0])/i[2],Q[2]=0}return a.l0=Q,Object(s.w)(Q,i,a.l1),a.intersection=!0,a}var U={evaluate:function(e,t,n){return e[0]*(n[0]-t[0])+e[1]*(n[1]-t[1])+e[2]*(n[2]-t[2])},distanceToPlane:o,projectPoint:l,projectVector:B,generalizedProjectPoint:Q,intersectWithLine:c,intersectWithPlane:F,DISJOINT:"disjoint",COINCIDE:"coincide"};function g(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return o(e,t.origin,t.normal)},e.projectPoint=function(e,n){l(e,t.origin,t.normal,n)},e.projectVector=function(e,n){return B(e,t.normal,n)},e.push=function(e){if(0!==e)for(var n=0;n<3;n++)t.origin[n]+=e*t.normal[n]},e.generalizedProjectPoint=function(e,n){Q(e,t.origin,t.normal,n)},e.evaluateFunction=function(e,n,r){return Array.isArray(e)?t.normal[0]*(e[0]-t.origin[0])+t.normal[1]*(e[1]-t.origin[1])+t.normal[2]*(e[2]-t.origin[2]):t.normal[0]*(e-t.origin[0])+t.normal[1]*(n-t.origin[1])+t.normal[2]*(r-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,n){return c(e,n,t.origin,t.normal)},e.intersectWithPlane=function(e,n){return F(e,n,t.origin,t.normal)}}var d={normal:[0,0,1],origin:[0,0,0]};function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),a.c.obj(e,t),a.c.setGetArray(e,t,["normal","origin"],3),g(e,t)}var I=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:null,a=r(e),s=t.exec(a);if(!s)return{text:a};var i=s.index+s[0].length,o=a.substring(0,i),l=null,B=n?n.exec(a):null;if(B){var Q=a.substr(B.index);l={text:o+Q,binaryBuffer:e.slice(i,B.index)}}else l={text:o,binaryBuffer:e.slice(i)};return l}};t.a=a},function(e,t,n){"use strict";(function(e){function r(e,t){s(e,t),a(e)}function a(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}n.d(t,"a",(function(){return i}));var i={destroy:function(t,n){var i=this,o=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return o||l?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(s,this,t)):e.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(a,i):(i._writableState.errorEmitted=!0,e.nextTick(r,i,t)):e.nextTick(r,i,t):n?(e.nextTick(a,i),n(t)):e.nextTick(a,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,n(41))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(9),a=(n(4),n(0)),s=n(16),i=n(10);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};i.a.extend(e,t,F(n)),c(e,t)}var g=l({newInstance:a.c.newInstance(U,"vtkCellArray"),extend:U},Q);t.a=g},function(e,t,n){"use strict";n(4);var r=[];r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63;for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s>16&255,a[F++]=c>>8&255,a[F++]=255&c}switch(l){case 3:for(;!i(e[Q]);)Q++;for(c=r[e.charCodeAt(Q++)]<<10;!i(e[Q]);)Q++;for(c|=r[e.charCodeAt(Q++)]<<4;!i(e[Q]);)Q++;c|=r[e.charCodeAt(Q++)]>>2,a[F++]=c>>8&255,a[F++]=255&c;break;case 2:for(;!i(e[Q]);)Q++;for(c=r[e.charCodeAt(Q++)]<<2;!i(e[Q]);)Q++;c|=r[e.charCodeAt(Q++)]>>4,a[F++]=255&c;break;case 1:throw new Error("BASE64: remain 1 should not happen")}return F}var l={toArrayBuffer:function(e){for(var t=function(e){for(var t=e.length,n=[],r=null,a=0;a1)for(var n=1;n0&&i.length>a&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,o=l,console&&console.warn&&console.warn(o)}return e}function U(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=U.bind(r);return a.listener=n,r.wrapFn=a,a}function d(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)s(l,this,t);else{var B=l.length,Q=I(l,B);for(n=0;n=0;s--)if(n[s]===t||n[s].listener===t){i=n[s].listener,a=s;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):u.call(e,t)},o.prototype.listenerCount=u,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]},l.once=function(e,t){return new Promise((function(n,r){function a(){void 0!==s&&e.removeListener("error",s),n([].slice.call(arguments))}var s;"error"!==t&&(s=function(n){e.removeListener(t,a),r(n)},e.once("error",s)),e.once(t,a)}))}},function(e,t,n){"use strict";t.a=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)if("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===C.prototype||(t=function(e){return C.from(e)}(t)),r)i.endEmitted?V(e,new L):D(e,i,t,!0);else if(i.ended)V(e,new G);else{if(i.destroyed)return!1;i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?D(e,i,t,!1):X(e,i)):D(e,i,t,!1)}else r||(i.reading=!1,X(e,i));return!i.ended&&(i.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function J(t){var n=t._readableState;I("emitReadable",n.needReadable,n.emittedReadable),n.needReadable=!1,n.emittedReadable||(I("emitReadable",n.flowing),n.emittedReadable=!0,e.nextTick(W,t))}function W(e){var t=e._readableState;I("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,w(e)}function X(t,n){n.readingMore||(n.readingMore=!0,e.nextTick(H,t,n))}function H(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){I("readable nexttick read 0"),e.read(0)}function M(e,t){I("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),w(e),t.flowing&&!t.reading&&e.read(0)}function w(e){var t=e._readableState;for(I("flow",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function O(t){var n=t._readableState;I("endReadable",n.endEmitted),n.endEmitted||(n.ended=!0,e.nextTick(z,n,t))}function z(e,t){if(I("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function P(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return I("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):J(this),null;if(0===(e=v(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,a=t.needReadable;return I("need readable",a),(0===t.length||t.length-e0?Y(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},N.prototype._read=function(e){V(this,new R("_read()"))},N.prototype.pipe=function(t,n){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,I("pipe count=%d opts=%j",a.pipesCount,n);var s=n&&!1===n.end||t===e.stdout||t===e.stderr?U:i;function i(){I("onend"),t.end()}a.endEmitted?e.nextTick(s):r.once("end",s),t.on("unpipe",(function e(n,s){I("onunpipe"),n===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,I("cleanup"),t.removeListener("close",c),t.removeListener("finish",F),t.removeListener("drain",o),t.removeListener("error",Q),t.removeListener("unpipe",e),r.removeListener("end",i),r.removeListener("end",U),r.removeListener("data",B),l=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||o())}));var o=function(e){return function(){var t=e._readableState;I("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&m(e,"data")&&(t.flowing=!0,w(e))}}(r);t.on("drain",o);var l=!1;function B(e){I("ondata");var n=t.write(e);I("dest.write",n),!1===n&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==P(a.pipes,t))&&!l&&(I("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function Q(e){I("onerror",e),U(),t.removeListener("error",Q),0===m(t,"error")&&V(t,e)}function c(){t.removeListener("finish",F),U()}function F(){I("onfinish"),t.removeListener("close",c),U()}function U(){I("unpipe"),r.unpipe(t)}return r.on("data",B),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",Q),t.once("close",c),t.once("finish",F),t.emit("pipe",r),a.flowing||(I("pipe resume"),r.resume()),t},N.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==a.flowing&&this.resume()):"readable"===t&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,I("on readable",a.length,a.reading),a.length?J(this):a.reading||e.nextTick(k,this))),r},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(t,n){var r=s.a.prototype.removeListener.call(this,t,n);return"readable"===t&&e.nextTick(T,this),r},N.prototype.removeAllListeners=function(t){var n=s.a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(T,this),n},N.prototype.resume=function(){var t=this._readableState;return t.flowing||(I("resume"),t.flowing=!t.readableListening,function(t,n){n.resumeScheduled||(n.resumeScheduled=!0,e.nextTick(M,t,n))}(this,t)),t.paused=!1,this},N.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},N.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",(function(){if(I("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){I("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var s=0;s-1))throw new G(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,n){n(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,n,r){var a=this._writableState;return"function"==typeof t?(r=t,t=null,n=null):"function"==typeof n&&(r=n,n=null),null!=t&&this.write(t,n),a.corked&&(a.corked=1,this.uncork()),a.ending||function(t,n,r){n.ending=!0,J(t,n),r&&(n.finished?e.nextTick(r):t.once("finish",r)),n.ended=!0,t.writable=!1}(this,a,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=o.a.destroy,A.prototype._undestroy=o.a.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this,n(41))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(19),a=n(8),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i={encode:function(e){for(var t,n,r,i,o,l,B,Q=[],c=0,F=e.length,U=F,g="string"!==a.a.getTypeOf(e);c>2,o=(3&t)<<4|n>>4,l=U>1?(15&n)<<2|r>>6:64,B=U>2?63&r:64,Q.push(s.charAt(i)+s.charAt(o)+s.charAt(l)+s.charAt(B));return Q.join("")},decode:function(e){var t,n,a,i,o,l,B=0,Q=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");var F,U=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&U--,e.charAt(e.length-2)===s.charAt(64)&&U--,U%1!=0)throw new Error("Invalid base64 input, bad content length.");for(F=r.a.uint8array?new Uint8Array(0|U):new Array(0|U);B>4,n=(15&i)<<4|(o=s.indexOf(e.charAt(B++)))>>2,a=(3&o)<<6|(l=s.indexOf(e.charAt(B++))),F[Q++]=t,64!==o&&(F[Q++]=n),64!==l&&(F[Q++]=a);return F}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return F}));var r=n(19),a=n(51),s=n(23),i=n(8),o=n(13),l=n(62),B=n(63),Q=null;if(r.a.nodestream)try{Q=B.a}catch(e){}function c(e,t,n){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=n,i.a.checkSupport(r),this._worker=e.pipe(new l.a(r)),e.lock()}catch(e){this._worker=new o.a("error"),this._worker.error(e)}}c.prototype={accumulate:function(t){return function(t,n){return new s.a.Promise((function(r,s){var o=[],l=t._internalType,B=t._outputType,Q=t._mimeType;t.on("data",(function(e,t){o.push(e),n&&n(t)})).on("error",(function(e){o=[],s(e)})).on("end",(function(){try{var t=function(e,t,n){switch(e){case"blob":return i.a.newBlob(i.a.transformTo("arraybuffer",t),n);case"base64":return a.a.encode(t);default:return i.a.transformTo(e,t)}}(B,function(t,n){var r,a=0,s=null,i=0;for(r=0;r0,(function(e){r||(r=e),e&&s.forEach(V),i||(s.forEach(V),a(r))}))}));return t.reduce(A)},D.Stream=D,D.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",i),n.on("close",o));var s=!1;function i(){s||(s=!0,e.end())}function o(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(B(),0===E.listenerCount(this,"error"))throw e}function B(){n.removeListener("data",r),e.removeListener("drain",a),n.removeListener("end",i),n.removeListener("close",o),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",B),n.removeListener("close",B),e.removeListener("close",B)}return n.on("error",l),e.on("error",l),n.on("end",B),n.on("close",B),e.on("close",B),e.emit("pipe",n),e},n.d(t,"a",(function(){return v}));var v=N},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var r=n(64),s=n(65),a=n(66);function i(){return B.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Q(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e,t){if(B.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return k(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return V(this,t,n);case"utf8":case"utf-8":return h(this,t,n);case"ascii":return p(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return G(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function u(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function I(e,t,n,r,s){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=B.from(t,r)),B.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,s);if("number"==typeof t)return t&=255,B.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,s);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,s){var a,i=1,Q=e.length,B=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,Q/=2,B/=2,n/=2}function o(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(s){var l=-1;for(a=n;aQ&&(n=Q-B),a=n;a>=0;a--){for(var F=!0,U=0;Us&&(r=s):r=s;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var i=0;i>8,s=n%256,a.push(s),a.push(r);return a}(t,e.length-n),e,n,r)}function G(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function h(e,t,n){n=Math.min(e.length,n);for(var r=[],s=t;s239?4:o>223?3:o>191?2:1;if(s+F<=n)switch(F){case 1:o<128&&(l=o);break;case 2:128==(192&(a=e[s+1]))&&(B=(31&o)<<6|63&a)>127&&(l=B);break;case 3:a=e[s+1],i=e[s+2],128==(192&a)&&128==(192&i)&&(B=(15&o)<<12|(63&a)<<6|63&i)>2047&&(B<55296||B>57343)&&(l=B);break;case 4:a=e[s+1],i=e[s+2],Q=e[s+3],128==(192&a)&&128==(192&i)&&128==(192&Q)&&(B=(15&o)<<18|(63&a)<<12|(63&i)<<6|63&Q)>65535&&B<1114112&&(l=B)}null===l?(l=65533,F=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),s+=F}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},B.prototype.compare=function(e,t,n,r,s){if(!B.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(s>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0),Q=Math.min(a,i),o=this.slice(r,s),l=e.slice(t,n),F=0;Fs)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return Z(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},B.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function p(e,t,n){var r="";n=Math.min(e.length,n);for(var s=t;sr)&&(n=r);for(var s="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,s,a){if(!B.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function E(e,t,n,r){t<0&&(t=65535+t+1);for(var s=0,a=Math.min(e.length-n,2);s>>8*(r?s:1-s)}function f(e,t,n,r){t<0&&(t=4294967295+t+1);for(var s=0,a=Math.min(e.length-n,4);s>>8*(r?s:3-s)&255}function D(e,t,n,r,s,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function v(e,t,n,r,a){return a||D(e,0,n,4),s.write(e,t,n,r,23,4),n+4}function J(e,t,n,r,a){return a||D(e,0,n,8),s.write(e,t,n,r,52,8),n+8}B.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(s*=256);)r+=this[e+--t]*s;return r},B.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},B.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},B.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},B.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},B.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},B.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],s=1,a=0;++a=(s*=128)&&(r-=Math.pow(2,8*t)),r},B.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,s=1,a=this[e+--r];r>0&&(s*=256);)a+=this[e+--r]*s;return a>=(s*=128)&&(a-=Math.pow(2,8*t)),a},B.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},B.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},B.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},B.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},B.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},B.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),s.read(this,e,!0,23,4)},B.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),s.read(this,e,!1,23,4)},B.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),s.read(this,e,!0,52,8)},B.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),s.read(this,e,!1,52,8)},B.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var s=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+s]=e/a&255;return t+n},B.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),B.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},B.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),B.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):E(this,e,t,!0),t+2},B.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),B.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):E(this,e,t,!1),t+2},B.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),B.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):f(this,e,t,!0),t+4},B.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),B.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):f(this,e,t,!1),t+4},B.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var s=Math.pow(2,8*n-1);N(this,e,t,n,s-1,-s)}var a=0,i=1,Q=0;for(this[t]=255&e;++a>0)-Q&255;return t+n},B.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var s=Math.pow(2,8*n-1);N(this,e,t,n,s-1,-s)}var a=n-1,i=1,Q=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===Q&&0!==this[t+a+1]&&(Q=1),this[t+a]=(e/i>>0)-Q&255;return t+n},B.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),B.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},B.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),B.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):E(this,e,t,!0),t+2},B.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),B.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):E(this,e,t,!1),t+2},B.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),B.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):f(this,e,t,!0),t+4},B.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),B.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):f(this,e,t,!1),t+4},B.prototype.writeFloatLE=function(e,t,n){return v(this,e,t,!0,n)},B.prototype.writeFloatBE=function(e,t,n){return v(this,e,t,!1,n)},B.prototype.writeDoubleLE=function(e,t,n){return J(this,e,t,!0,n)},B.prototype.writeDoubleBE=function(e,t,n){return J(this,e,t,!1,n)},B.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else if(a<1e3||!B.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!s){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}s=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(t-=3)>-1&&a.push(239,191,189);if(s=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function k(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,n,r){for(var s=0;s=t.length||s>=e.length);++s)t[s+n]=e[s];return s}}).call(this,n(36))},function(e,t,n){"use strict";var r=n(10),s=n(28),a=Object(r.d)((function(e,t){var n=s.a.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=s.a:(r(s.a,t),t.Buffer=a),r(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var s=n(e);return void 0!==t?"string"==typeof r?s.fill(t,r):s.fill(t):s.fill(0),s},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s.a.SlowBuffer(e)}}),"/$$rollup_base$$/node_modules/safe-buffer");n.d(t,"a",(function(){return m}));var i=a.Buffer,Q=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},B=o;function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===Q||!Q(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=U,this.end=c,t=4;break;case"utf8":this.fillLast=F,t=4;break;case"base64":this.text=g,this.end=d,t=3;break;default:return this.write=u,void(this.end=I)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function F(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function U(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function g(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function I(e){return e&&e.length?this.write(e):""}o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(s>0&&(e.lastNeed=s-1),s):--r=0?(s>0&&(e.lastNeed=s-2),s):--r=0?(s>0&&(2===s?s=0:e.lastNeed=s-3),s):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var m={StringDecoder:B}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(28),s=n(43);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Q=r.a.Buffer,B=s.a.inspect,o=B&&B.custom||"inspect",l=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},t.concat=function(e){if(0===this.length)return Q.alloc(0);for(var t,n,r,s=Q.allocUnsafe(e>>>0),a=this.head,i=0;a;)t=a.data,n=s,r=i,Q.prototype.copy.call(t,n,r),i+=a.data.length,a=a.next;return s},t.consume=function(e,t){var n;return es.length?s.length:e;if(a===s.length?r+=s:r+=s.slice(0,e),0==(e-=a)){a===s.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=s.slice(a));break}++n}return this.length-=n,r},t._getBuffer=function(e){var t=Q.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var s=n.data,a=e>s.length?s.length:e;if(s.copy(t,t.length-e,0,a),0==(e-=a)){a===s.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++r}return this.length-=r,t},t[o]=function(e,t){return B(this,function(e){for(var t=1;t0?i-4:i;for(n=0;n>16&255,B[l++]=t>>8&255,B[l++]=255&t;2===Q&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,B[l++]=255&t);1===Q&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,B[l++]=t>>8&255,B[l++]=255&t);return B},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,a=[],i=0,Q=n-s;iQ?Q:i+16383));1===s?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===s&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=0,B=i.length;Q0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var s,a,i=[],Q=t;Q>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(e,t){ +var r=n(65),a=n(66),s=n(67);function i(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return T(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return p(this,t,n);case"ascii":return G(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return h(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function u(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function I(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,a);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,a){var s,i=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,o/=2,l/=2,n/=2}function B(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var Q=-1;for(s=n;so&&(n=o-l),s=n;s>=0;s--){for(var c=!0,F=0;Fa&&(r=a):r=a;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var i=0;i>8,a=n%256,s.push(a),s.push(r);return s}(t,e.length-n),e,n,r)}function h(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function p(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a239?4:B>223?3:B>191?2:1;if(a+c<=n)switch(c){case 1:B<128&&(Q=B);break;case 2:128==(192&(s=e[a+1]))&&(l=(31&B)<<6|63&s)>127&&(Q=l);break;case 3:s=e[a+1],i=e[a+2],128==(192&s)&&128==(192&i)&&(l=(15&B)<<12|(63&s)<<6|63&i)>2047&&(l<55296||l>57343)&&(Q=l);break;case 4:s=e[a+1],i=e[a+2],o=e[a+3],128==(192&s)&&128==(192&i)&&128==(192&o)&&(l=(15&B)<<18|(63&s)<<12|(63&i)<<6|63&o)>65535&&l<1114112&&(Q=l)}null===Q?(Q=65533,c=1):Q>65535&&(Q-=65536,r.push(Q>>>10&1023|55296),Q=56320|1023&Q),r.push(Q),a+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,a){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(a>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0),o=Math.min(s,i),B=this.slice(r,a),Q=e.slice(t,n),c=0;ca)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function G(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;ar)&&(n=r);for(var a="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function f(e,t,n,r,a,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,s=Math.min(e.length-n,2);a>>8*(r?a:1-a)}function E(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,s=Math.min(e.length-n,4);a>>8*(r?a:3-a)&255}function D(e,t,n,r,a,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function v(e,t,n,r,s){return s||D(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function J(e,t,n,r,s){return s||D(e,0,n,8),a.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(a*=256);)r+=this[e+--t]*a;return r},l.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],a=1,s=0;++s=(a*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,a=1,s=this[e+--r];r>0&&(a*=256);)s+=this[e+--r]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||f(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+a]=e/s&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):E(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):E(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);f(this,e,t,n,a-1,-a)}var s=0,i=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);f(this,e,t,n,a-1,-a)}var s=n-1,i=1,o=0;for(this[t+s]=255&e;--s>=0&&(i*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/i>>0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):E(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||f(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):E(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return v(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return v(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return J(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return J(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--a)e[a+t]=this[a+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function T(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(38))},function(e,t,n){"use strict";var r=n(11),a=Object(r.d)((function(e){!function(e,t,n){function r(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var n=new r(e),s=t&&t.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,s&&("object"==typeof s&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.alea=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),s=Object(r.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,s&&("object"==typeof s&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.xor128=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),i=Object(r.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var n=new r(e),s=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,s&&("object"==typeof s&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.xorwow=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),o=Object(r.d)((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var n=new r(e),s=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,s&&(s.x&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.xorshift7=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),l=Object(r.d)((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,s=t.i;return t.w=r=r+1640531527|0,n=a[s+34&127],e=a[s=s+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[s]=n^e,t.i=s,n+(r^r>>>16)|0},function(e,t){var n,r,a,s,i,o=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),a=0,s=-32;s>>15,r^=r<<4,r^=r>>>13,s>=0&&(i=i+1640531527|0,a=0==(n=o[127&s]^=r+i)?a+1:0);for(a>=128&&(o[127&(t&&t.length||0)]=-1),a=127,s=512;s>0;--s)r=o[a+34&127],n=o[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,o[a]=r^n;e.w=i,e.X=o,e.i=a}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var n=new r(e),s=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,s&&(s.X&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.xor4096=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),B=Object(r.d)((function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,s&&("object"==typeof s&&a(s,n),i.state=function(){return a(n,{})}),i}t&&t.exports?t.exports=s:this.tychei=s}(0,e)}),"/$$rollup_base$$/node_modules/seedrandom/lib"),Q=Object.freeze({__proto__:null,default:{}}),c=Object(r.e)(Q),F=Object(r.d)((function(e){!function(t,n,r){var a,s=256,i=r.pow(s,6),o=r.pow(2,52),l=2*o,B=255;function Q(e,B,Q){var c=[],u=g(function e(t,n){var r,a=[],s=typeof t;if(n&&"object"==s)for(r in t)try{a.push(e(t[r],n-1))}catch(t){}return a.length?a:"string"==s?t:t+"\0"}((B=1==B?{entropy:!0}:B||{}).entropy?[e,d(n)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(s):(e=new Uint8Array(s),(t.crypto||t.msCrypto).getRandomValues(e)),d(e)}catch(e){var r=t.navigator,i=r&&r.plugins;return[+new Date,t,i,t.screen,d(n)]}}():e,3),c),I=new F(c),m=function(){for(var e=I.g(6),t=i,n=0;e=l;)e/=2,t/=2,n>>>=1;return(e+n)/t};return m.int32=function(){return 0|I.g(4)},m.quick=function(){return I.g(4)/4294967296},m.double=m,g(d(I.S),n),(B.pass||Q||function(e,t,n,a){return a&&(a.S&&U(a,I),e.state=function(){return U(I,{})}),n?(r.random=e,t):e})(m,u,"global"in B?B.global:this==r,B.state)}function F(e){var t,n=e.length,r=this,a=0,i=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function F(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function U(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function g(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function I(e){return e&&e.length?this.write(e):""}B.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(a>0&&(e.lastNeed=a-1),a):--r=0?(a>0&&(e.lastNeed=a-2),a):--r=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},B.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var m={StringDecoder:l}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Q}));var r=n(29),a=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=r.a.Buffer,l=a.a.inspect,B=l&&l.custom||"inspect",Q=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},t.concat=function(e){if(0===this.length)return o.alloc(0);for(var t,n,r,a=o.allocUnsafe(e>>>0),s=this.head,i=0;s;)t=s.data,n=a,r=i,o.prototype.copy.call(t,n,r),i+=s.data.length,s=s.next;return a},t.consume=function(e,t){var n;return ea.length?a.length:e;if(s===a.length?r+=a:r+=a.slice(0,e),0==(e-=s)){s===a.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(s));break}++n}return this.length-=n,r},t._getBuffer=function(e){var t=o.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,s),0==(e-=s)){s===a.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++r}return this.length-=r,t},t[B]=function(e,t){return l(this,function(e){for(var t=1;t0?i-4:i;for(n=0;n>16&255,l[Q++]=t>>8&255,l[Q++]=255&t;2===o&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,l[Q++]=255&t);1===o&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,l[Q++]=t>>8&255,l[Q++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,s=[],i=0,o=n-a;io?o:i+16383));1===a?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Q(e,t,n){for(var a,s,i=[],o=t;o>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -t.read=function(e,t,n,r,s){var a,i,Q=8*s-r-1,B=(1<>1,l=-7,F=n?s-1:0,U=n?-1:1,c=e[t+F];for(F+=U,a=c&(1<<-l)-1,c>>=-l,l+=Q;l>0;a=256*a+e[t+F],F+=U,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=r;l>0;i=256*i+e[t+F],F+=U,l-=8);if(0===a)a=1-o;else{if(a===B)return i?NaN:1/0*(c?-1:1);i+=Math.pow(2,r),a-=o}return(c?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,s,a){var i,Q,B,o=8*a-s-1,l=(1<>1,U=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:a-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(Q=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(B=Math.pow(2,-i))<1&&(i--,B*=2),(t+=i+F>=1?U/B:U*Math.pow(2,1-F))*B>=2&&(i++,B/=2),i+F>=l?(Q=0,i=l):i+F>=1?(Q=(t*B-1)*Math.pow(2,s),i+=F):(Q=t*Math.pow(2,F-1)*Math.pow(2,s),i=0));s>=8;e[n+c]=255&Q,c+=g,Q/=256,s-=8);for(i=i<0;e[n+c]=255&i,c+=g,i/=256,o-=8);e[n+c-g]|=128*d}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,s=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(s.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(s.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(68),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(36))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,s,a,i,Q,B=1,o={},l=!1,F=e.document,U=Object.getPrototypeOf&&Object.getPrototypeOf(e);U=U&&U.setTimeout?U:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){g(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){g(e.data)},r=function(e){a.port2.postMessage(e)}):F&&"onreadystatechange"in F.createElement("script")?(s=F.documentElement,r=function(e){var t=F.createElement("script");t.onreadystatechange=function(){g(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):r=function(e){setTimeout(g,0,e)}:(i="setImmediate$"+Math.random()+"$",Q=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&g(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",Q,!1):e.attachEvent("onmessage",Q),r=function(t){e.postMessage(i+t,"*")}),U.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},s=n.compression,a=n.progressCallback;return r.binary?n.dataAccessHelper.fetchBinary(e,{compression:s,progressCallback:a}):n.dataAccessHelper.fetchText(t,e,{compression:s,progressCallback:a})}n.classHierarchy.push("vtkSTLReader"),n.dataAccessHelper||(n.dataAccessHelper=Q.a.get("http")),t.setUrl=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};n.url=e;var s=e.split("/");return s.pop(),n.baseURL=s.join("/"),n.compression=r.compression,t.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},t.loadData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=o(n.url,e);return r.then(t.parse),r},t.parse=function(e){"string"==typeof e?t.parseAsText(e):t.parseAsArrayBuffer(e)},t.parseAsArrayBuffer=function(Q){if(Q&&Q!==n.parseData)if(t.modified(),n.parseData=Q,84+50*new DataView(Q,0,84).getUint32(80,!0)===Q.byteLength){var o=Q.slice(0,80),l=function(e){for(var t=e.split(" ").filter((function(e){return e.indexOf("=")>-1})),n={},r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(n,U,r),t.b.obj(e,n),t.b.get(e,n,["url","baseURL"]),t.b.setGet(e,n,["dataAccessHelper"]),t.b.algo(e,n,0,1),F(e,n),n.compression||(n.compression=null),n.progressCallback||(n.progressCallback=null)}),"vtkSTLReader")}).call(this,n(36))},function(e,t,n){"use strict";n.r(t);var r=n(5),s=n.n(r),a=n(1),i=n.n(a),Q=n(9),B=(n(6),n(0)),o=n(11),l=n(27),F=n(15);function U(e,t){function n(){for(;t.cellFields.length0&&void 0!==arguments[0]?arguments[0]:0;return t.radius[e]},e.setRadius=function(n,r){t.radius[n]=r,e.modified()},e.setCellField=function(n,r){t.cellFields[n]=r,e.modified()},e.removeMask=function(){t.mask=null,e.modified()},e.setMaskLayer=function(n,r){var s=!1;!t.mask&&r&&(s=!0,t.mask=[]),t.mask&&(!t.mask[n]!=!r&&(s=!0),t.mask[n]=r),s&&e.modified()},e.getMaskLayer=function(e){return void 0===e?t.mask:t.mask[e]},e.requestData=function(e,r){var s;if(!t.deleted&&t.radius.length){n();var a=r[0],i=t.radius.length,B=t.height/2,U=0,c=0,g=t.startThetat.startTheta?t.endTheta:t.startTheta;d*=Math.PI/180;var u=t.resolution,I=!1;d>=g+2*Math.PI?d=g+2*Math.PI:(++u,I=!0);var m=(d-g)/t.resolution,C=u*i*2+2;if(t.skipInnerFaces||t.mask)if(!t.skipInnerFaces&&t.mask){t.mask[0]||(U+=2*(u+1)+5*u+(I?10:0),c+=2+u+(I?2:0));for(var b=1;b2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,c,n),B.b.obj(e,t),B.b.setGet(e,t,["height","resolution","startTheta","endTheta","skipInnerFaces"]),B.b.setGetArray(e,t,["center","direction"],3),B.b.getArray(e,t,["cellFields"]),B.b.algo(e,t,0,1),U(e,t)}),"vtkConcentricCylinderSource");function g(e,t){t.classHierarchy.push("vtkConeSource"),e.requestData=function(e,n){var r;if(!t.deleted){var s=n[0],a=2*Math.PI/t.resolution,i=-t.height/2,B=t.resolution+1,o=4*t.resolution+1+t.resolution,U=0,c=new window[t.pointType](3*B),g=0,d=new Uint32Array(o);c[0]=t.height/2,c[1]=0,c[2]=0,t.capping&&(d[g++]=t.resolution);for(var u=0;ut.resolution?1:I+2;(r=l.a.buildFromRadian()).translate.apply(r,Object(Q.a)(t.center)).rotateFromDirections([1,0,0],t.direction).apply(c),(s=F.a.newInstance()).getPoints().setData(c,3),s.getPolys().setData(d,1),n[0]=s}}}var d={height:1,radius:.5,resolution:6,center:[0,0,0],direction:[1,0,0],capping:!0,pointType:"Float32Array"};B.b.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),B.b.obj(e,t),B.b.setGet(e,t,["height","radius","resolution","capping"]),B.b.setGetArray(e,t,["center","direction"],3),B.b.algo(e,t,0,1),g(e,t)}),"vtkConeSource");function u(e,t){t.classHierarchy.push("vtkCubeSource"),e.setBounds=function(){var e=[];if(Array.isArray(arguments.length<=0?void 0:arguments[0]))e=arguments.length<=0?void 0:arguments[0];else for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,I,n),B.b.obj(e,t),B.b.setGet(e,t,["xLength","yLength","zLength","generate3DTextureCoordinates"]),B.b.setGetArray(e,t,["center","rotations"],3),B.b.algo(e,t,0,1),u(e,t)}),"vtkCubeSource");function m(e,t){t.classHierarchy.push("vtkCylinderSource"),e.requestData=function(e,n){var r,s;if(!t.deleted){var a=n[0],i=2*Math.PI/t.resolution,B=2*t.resolution,U=5*t.resolution;t.capping&&(B=4*t.resolution,U=7*t.resolution+2);for(var c=new window[t.pointType](3*B),g=0,d=new Uint32Array(U),u=new Float32Array(3*B),I=o.a.newInstance({numberOfComponents:3,values:u,name:"Normals"}),m=new Float32Array(2*B),C=o.a.newInstance({numberOfComponents:2,values:m,name:"TCoords"}),b=[0,0,0],y=[0,0,0],S=[0,0,0],Z=[0,0,0],x=[0,0],G=[0,0],h=0;h2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,C,n),B.b.obj(e,t),B.b.setGet(e,t,["height","radius","resolution","capping"]),B.b.setGetArray(e,t,["center","direction"],3),B.b.algo(e,t,0,1),m(e,t)}),"vtkCylinderSource");var b=n(3),y=B.b.vtkWarningMacro;function S(e,t){t.classHierarchy.push("vtkLineSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],s=r?r.getPoints().getDataType():"Float32Array",a=F.a.newInstance(),i=new Float32Array(3);if(Object(b.s)(t.point2,t.point1,i),Object(b.z)(i)<=0)y("Zero-length line definition");else{var Q=t.resolution,B=Q+1,o=new window[s](3*B);a.getPoints().setData(o,3);var l=new Uint32Array(B+1);a.getLines().setData(l,1);for(var U=0,c=0,g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Z,n),B.b.obj(e,t),B.b.setGet(e,t,["resolution"]),B.b.setGetArray(e,t,["point1","point2"],3),B.b.algo(e,t,0,1),S(e,t)}),"vtkLineSource");var x=n(4),G=n(2),h=B.b.vtkWarningMacro;function p(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(n,r){if(!t.deleted){var s=r[0],a=s?s.getPoints().getDataType():"Float32Array",i=F.a.newInstance(),Q=new Float32Array(3),B=new Float32Array(3);if(Object(b.s)(t.point1,t.origin,Q),Object(b.s)(t.point2,t.origin,B),e.updatePlane(Q,B)){var l=t.xResolution,U=t.yResolution,c=(l+1)*(U+1),g=l*U,d=new window[a](3*c);i.getPoints().setData(d,3);var u=new Uint32Array(5*g);i.getPolys().setData(u,1);var I=new Float32Array(3*c),m=o.a.newInstance({numberOfComponents:3,values:I,name:"Normals"});i.getPointData().setNormals(m);var C=new Float32Array(2*c),y=o.a.newInstance({numberOfComponents:2,values:C,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var S=new Float32Array(2),Z=0,x=0;x2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,R,n),t.normal=[0,0,1],t.center=[0,0,0],B.b.obj(e,t),B.b.setGet(e,t,["xResolution","yResolution"]),B.b.setGetArray(e,t,["origin"],3),B.b.getArray(e,t,["point1","point2","normal","center"],3),B.b.algo(e,t,0,1),p(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}),"vtkPlaneSource");function V(e,t){t.classHierarchy.push("vtkPointSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],s=r?r.getPoints().getDataType():"Float32Array",a=F.a.newInstance(),i=t.numberOfPoints,Q=new window[s](3*i);a.getPoints().setData(Q,3);var B,o,l,U,c,g=new Uint32Array(i+1);a.getVerts().setData(g,1);for(var d=0;d2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,L,n),B.b.obj(e,t),B.b.setGet(e,t,["numberOfPoints","radius"]),B.b.setGetArray(e,t,["center"],3),B.b.algo(e,t,0,1),V(e,t)}),"vtkPointSource");function A(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],s=r?r.getPoints().getDataType():"Float32Array";r=F.a.newInstance();var a=0,i=t.thetaResolution,Q=t.startThetat.startTheta?t.endTheta:t.startTheta;B*=Math.PI/180;var l=t.startPhit.startPhi?t.endPhi:t.startPhi;U*=Math.PI/180,Math.abs(Q-B)<2*Math.PI&&++i;var c=(B-Q)/t.thetaResolution,g=t.startPhi<=0?1:0,d=t.phiResolution+(t.endPhi>=180?-1:0),u=t.phiResolution*i+2,I=2*t.phiResolution*t.thetaResolution,m=0,C=new window[s](3*u),b=new Float32Array(3*u),y=0,S=new Uint32Array(5*I);t.startPhi<=0&&(C[3*m+0]=t.center[0],C[3*m+1]=t.center[1],C[3*m+2]=t.center[2]+t.radius,b[3*m+0]=0,b[3*m+1]=0,b[3*m+2]=1,m++,a++),t.endPhi>=180&&(C[3*m+0]=t.center[0],C[3*m+1]=t.center[1],C[3*m+2]=t.center[2]-t.radius,b[3*m+0]=0,b[3*m+1]=0,b[3*m+2]=-1,m++,a++);for(var Z=t.phiResolution-a,x=(U-l)/(t.phiResolution-1),G=0;G=180)for(var E=Z-1+a,f=0;f2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,N,n),B.b.obj(e,t),B.b.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),B.b.setGetArray(e,t,["center"],3),B.b.algo(e,t,0,1),A(e,t)}),"vtkSphereSource");var E=n(20),f=n(30),D=B.b.vtkDebugMacro,v=B.b.vtkErrorMacro;function J(e,t){t.classHierarchy.push("vtkWarpScalar"),e.requestData=function(n,r){var s=n[0];if(!s)return v("Invalid or missing input"),1;var a=s.getPoints(),i=s.getPointData().getNormals(),Q=e.getInputArrayToProcess(0);if(!a||!Q)return D("No data to warp",!!a,!!Q),r[0]=n[0],1;var B=a.getNumberOfPoints(),o=null,l=[0,0,1];i&&!t.useNormal?(o=function(e,t){return[t.getData()[3*e],t.getData()[3*e+1],t.getData()[3*e+2]]},D("Using data normals")):e.getXyPlane()?(o=function(e,t){return l},D("Using x-y plane normal")):(o=function(e,n){return t.normal},D("Using Normal instance variable"));for(var F=new Float32Array(3*B),U=a.getData(),c=0,g=[0,0,1],d=1,u=Q.getData(),I=Q.getNumberOfComponents(),m=0;m2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,W,n),B.b.obj(e,t),B.b.algo(e,t,1,1),B.b.setGet(e,t,["scaleFactor","useNormal","xyPlane"]),B.b.setGetArray(e,t,["normal"],3),J(e,t)}),"vtkWarpScalar");var X=n(34),H=n(26),k={diffuse_red:"red",diffuse_green:"green",diffuse_blue:"blue"},T={patternHeader:/ply([\s\S]*)end_header\r?\n/,patternBody:/end_header\s([\s\S]*)$/};function M(e){var t="",n=0,r=T.patternHeader.exec(e);null!==r&&(t=r[1],n=new Blob([r[0]]).size);for(var s,a,i,Q={comments:[],elements:[],headerLength:n},B=t.split("\n"),o=0;o0,l=e.uvs.length>0,U=e.normals.length>0,c=0;c0&&(e.indices.push(r.length),r.forEach((function(t,n){e.indices.push(t)})))}}function P(e,t,n,r){var s;switch(n){case"int8":case"char":s=[e.getInt8(t),1];break;case"uint8":case"uchar":s=[e.getUint8(t),1];break;case"int16":case"short":s=[e.getInt16(t,r),2];break;case"uint16":case"ushort":s=[e.getUint16(t,r),2];break;case"int32":case"int":s=[e.getInt32(t,r),4];break;case"uint32":case"uint":s=[e.getUint32(t,r),4];break;case"float32":case"float":s=[e.getFloat32(t,r),4];break;case"float64":case"double":s=[e.getFloat64(t,r),8];break;default:console.log("Unsupported type")}return s}function K(e,t,n,r){for(var s,a={},i=0,Q=0;Q1&&void 0!==arguments[1]?arguments[1]:{},s=t.compression,a=t.progressCallback;return r.binary?t.dataAccessHelper.fetchBinary(n,{compression:s,progressCallback:a}):t.dataAccessHelper.fetchText(e,n,{compression:s,progressCallback:a})}t.classHierarchy.push("vtkPLYReader"),t.dataAccessHelper||(t.dataAccessHelper=H.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=n;var s=n.split("/");return s.pop(),t.baseURL=s.join("/"),t.compression=r.compression,e.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=n(t.url,r);return s.then(e.parse),s},e.parse=function(t){"string"==typeof t?e.parseAsText(t):e.parseAsArrayBuffer(t)},e.parseAsArrayBuffer=function(n){if(n&&n!==t.parseData){e.modified();var r=M(X.a.arrayBufferToString(n));if("ascii"!==r.format){t.parseData=n;for(var s,a={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},i="binary_little_endian"===r.format,Q=n instanceof ArrayBuffer?n:n.buffer,B=new DataView(Q,r.headerLength),o=0,l=0;l=s.elements[o].count&&(o++,l=0);var c=O(s.elements[o].properties,U);z(a,s.elements[o].name,c),l++}}var g=Y(a,s.elements);t.output[0]=g}}},e.requestData=function(n,r){e.parse(t.parseData)}}var _={};B.b.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_,n),B.b.obj(e,t),B.b.get(e,t,["url","baseURL"]),B.b.setGet(e,t,["dataAccessHelper"]),B.b.algo(e,t,0,1),j(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}),"vtkPLYReader"),n(69);var q=n(46);function $(e,t){t.classHierarchy.push("vtkElevationReader"),t.dataAccessHelper||(t.dataAccessHelper=H.a.get("http")),e.setUrl=function(n,r){return t.url=n,e.loadData(r)},e.loadData=function(n){return function(n,r){return t.dataAccessHelper.fetchText(e,n,r)}(t.url,n).then((function(t){return e.parseAsText(t),!0}))},e.parseAsText=function(n){t.csv=n,t.elevation=[],t.csv.split("\n").forEach((function(e,n){t.elevation.push(e.split(",").map((function(e){return Number(e)})))})),e.modified()},e.requestData=function(e,n){var r=F.a.newInstance();if(r.getPoints().setData(new Float32Array(0,0,0,1,1,1),3),t.elevation){var s=t.elevation.length,a=t.elevation[0].length,i=r.getPoints();i.setNumberOfPoints(a*s,3);var Q=i.getData(),B=q.a.newInstance({size:5*(a-1)*(s-1)});r.setPolys(B);var l=B.getData(),U=0,c=new Float32Array(a*s*2),g=o.a.newInstance({numberOfComponents:2,values:c,name:"TextureCoordinates"});r.getPointData().setTCoords(g);for(var d=0;d0&&d>0&&(l[U++]=4,l[U++]=I,l[U++]=I-1,l[U++]=I-1-a,l[U++]=I-a)}}t.output[0]=r},e.isBusy=function(){return!!t.requestCount}}var ee={origin:[0,0,0],xSpacing:1,ySpacing:1,zScaling:1,xDirection:1,yDirection:-1,requestCount:0};B.b.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ee,n),B.b.obj(e,t),B.b.get(e,t,["url"]),B.b.setGet(e,t,["dataAccessHelper","xSpacing","ySpacing","zScaling","xDirection","yDirection"]),B.b.algo(e,t,0,1),B.b.event(e,t,"busy"),$(e,t)}),"vtkElevationReader");var te=n(14),ne={};function re(e,t,n,r){for(var s=0;s0&&"\r"!==e})),i=a.length;s.push(i);for(var Q=0;Q1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchText(e,n,r)}t.classHierarchy.push("vtkOBJReader"),t.dataAccessHelper||(t.dataAccessHelper=H.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(-1!==n.indexOf(".obj")||r.fullpath){t.url=n;var s=n.split("/");s.pop(),t.baseURL=s.join("/")}else t.baseURL=n,t.url="".concat(n,"/index.obj");return e.loadData(r)},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(t.url,r).then(e.parseAsText)},e.parseAsText=function(n){return!n||(n!==t.parseData&&e.modified(),t.parseData=n,t.numberOfOutputs=0,r=t.splitMode,ne.splitOn=r,ne.pieces=[],ne.v=[],ne.vt=[],ne.vn=[],ne.f=[[]],ne.size=0,n.split("\n").forEach(se),function(e){var t=!!ne.vt.length,n=!!ne.vn.length;if(e.splitMode){e.numberOfOutputs=ne.size;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ie,n),B.b.obj(e,t),B.b.get(e,t,["url","baseURL"]),B.b.setGet(e,t,["dataAccessHelper","splitMode"]),B.b.algo(e,t,0,1),B.b.event(e,t,"busy"),ae(e,t)}),"vtkOBJReader");var Qe=["chemical json","name","inchi","formula","atoms","bonds","properties"];function Be(e,t){t.classHierarchy.push("vtkMolecule")}var oe={"chemical json":0,name:"",inchi:"",formula:"",atoms:null,bonds:null,properties:null};function le(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oe,n),B.b.obj(e,t),t.atoms||(t.atoms={}),t.bonds||(t.bonds={}),t.properties||(t.properties={}),B.b.setGet(e,t,Qe),Be(0,t)}var Fe={newInstance:B.b.newInstance(le,"vtkMolecule"),extend:le},Ue={H:[1],He:[2],Li:[3],Be:[4],B:[5],C:[6],N:[7],O:[8],F:[9],Ne:[10],Na:[11],Mg:[12],Al:[13],Si:[14],P:[15],S:[16],Cl:[17],Ar:[18],K:[19],Ca:[20],Sc:[21],Ti:[22],V:[23],Cr:[24],Mn:[25],Fe:[26],Co:[27],Ni:[28],Cu:[29],Zn:[30],Ga:[31],Ge:[32],As:[33],Se:[34],Br:[35],Kr:[36],Rb:[37],Sr:[38],Y:[39],Zr:[40],Nb:[41],Mo:[42],Tc:[43],Ru:[44],Rh:[45],Pd:[46],Ag:[47],Cd:[48],In:[49],Sn:[50],Sb:[51],Te:[52],I:[53],Xe:[54],Cs:[55],Ba:[56],La:[57],Ce:[58],Pr:[59],Nd:[60],Pm:[61],Sm:[62],Eu:[63],Gd:[64],Tb:[65],Dy:[66],Ho:[67],Er:[68],Tm:[69],Yb:[70],Lu:[71],Hf:[72],Ta:[73],W:[74],Re:[75],Os:[76],Ir:[77],Pt:[78],Au:[79],Hg:[80],Tl:[81],Pb:[82],Bi:[83],Po:[84],At:[85],Rn:[86],Fr:[87],Ra:[88],Ac:[89],Th:[90],Pa:[91],U:[92],Np:[93],Pu:[94],Am:[95],Cm:[96],Bk:[97],Cf:[98],Es:[99],Fm:[100],Md:[101],No:[102],Lr:[103],Rf:[104],Db:[105],Sg:[106],Bh:[107],Hs:[108],Mt:[109],Ds:[110],Rg:[111],Cn:[112],Uut:[113],Uuq:[114],Uup:[115],Uuh:[116],Uus:[117],Uuo:[118]};function ce(e,t){t.classHierarchy.push("vtkPDBReader"),t.dataAccessHelper||(t.dataAccessHelper=H.a.get("http")),e.setUrl=function(n,r){if(-1===n.indexOf(".pdb"))t.baseURL=n,t.url="".concat(n);else{t.url=n;var s=n.split("/");s.pop(),t.baseURL=s.join("/")}return e.loadData(r)},e.loadData=function(n){return function(n,r){return t.dataAccessHelper.fetchText(e,n,r)}(t.url,n).then(e.parseAsText)},e.parseAsText=function(n){return t.pdb=n,t.molecule=[],t.molecule=t.pdb.split("\n"),e.modified(),!0},e.requestData=function(e,n){var r=Fe.newInstance();if(t.molecule){var s=t.molecule.length,a=[],i=[];t.numberOfAtoms=0;for(var Q=0;Q=78&&(d=o.substr(76,2).replace(/\s+/g,"")),""===d&&(d=F.substr(0,2).replace(/\d/g,"")),a.push(U),a.push(c),a.push(g);var u=Object(te.a)(Ue[d],1)[0];i.push(u),t.numberOfAtoms++}Q++}r.getAtoms().elements={},r.getAtoms().elements.number=Int8Array.from(i),r.getAtoms().coords={},r.getAtoms().coords["3d"]=Float32Array.from(a)}t.output[0]=r},e.isBusy=function(){return!!t.requestCount}}var ge={numberOfAtoms:0,requestCount:0};B.b.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ge,n),B.b.obj(e,t),B.b.get(e,t,["url","baseURL","numberOfAtoms","requestCount"]),B.b.setGet(e,t,["dataAccessHelper"]),B.b.algo(e,t,0,1),B.b.event(e,t,"busy"),ce(e,t)}),"vtkPDBReader");var de=n(8),ue=n(37);function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var me=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];function Ce(e){return e[0]<=e[1]&&e[2]<=e[3]&&e[4]<=e[5]}function be(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function ye(e,t){return e[2*t+1]-e[2*t]}function Se(e){return[ye(e,0),ye(e,1),ye(e,2)]}function Ze(e){var t=Se(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function xe(e){if(Ce(e)){var t=Se(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Ge(e,t){return e<=0&&t>=0||e>=0&&t<=0}function he(e,t){for(var n=0,r=0;r<2;r++)for(var s=2;s<4;s++)for(var a=4;a<6;a++)t[n]=[e[r],e[s],e[a]],n++}var pe={isValid:Ce,getCenter:be,getLength:ye,getLengths:Se,getMaxLength:Ze,getDiagonalLength:xe,getXRange:function(e){return e.slice(0,2)},getYRange:function(e){return e.slice(2,4)},getZRange:function(e){return e.slice(4,6)},getCorners:he,computeCornerPoints:function(e,t,n){e[0]=n[0],e[1]=n[2],e[2]=n[4],t[0]=n[1],t[1]=n[3],t[2]=n[5]},computeLocalBounds:function(e,t,n,r){for(var s=[].concat(me),a=e.getData(),i=0;i1&&void 0!==arguments[1]?arguments[1]:[],n=be(e);return t[0]=e[1]-n[0],t[1]=e[3]-n[1],t[2]=e[5]-n[2],t},INIT_BOUNDS:me};function Re(e,t){t.classHierarchy.push("vtkBoundingBox"),e.clone=function(){var e=[].concat(t.bounds);return Ae({bounds:e})},e.equals=function(e){var n=t.bounds,r=e.getBounds();return n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3]&&n[4]===r[4]&&n[5]===r[5]},e.setMinPoint=function(e,n,r){var s=Object(te.a)(t.bounds,6),a=s[0],i=s[1],Q=s[2],B=s[3],o=s[4],l=s[5];return t.bounds=[e,e>i?e:i,n,n>B?n:B,r,r>l?r:l],a!==e||Q!==n||o!==r},e.setMaxPoint=function(e,n,r){var s=Object(te.a)(t.bounds,6),a=s[0],i=s[1],Q=s[2],B=s[3],o=s[4],l=s[5];return t.bounds=[en[s]?e:n[s]}))},e.addBounds=function(e,n,r,s,a,i){var Q=Object(te.a)(t.bounds,6),B=Q[0],o=Q[1],l=Q[2],F=Q[3],U=Q[4],c=Q[5];t.bounds=void 0===i?[Math.min(e[0],B),Math.max(e[1],o),Math.min(e[2],l),Math.max(e[3],F),Math.min(e[4],U),Math.max(e[5],c)]:[Math.min(e,B),Math.max(n,o),Math.min(r,l),Math.max(s,F),Math.min(a,U),Math.max(i,c)]},e.addBox=function(t){e.addBounds(t.getBounds())},e.isValid=function(){return Ce(t.bounds)},e.intersect=function(n){if(!e.isValid()||!n.isValid())return!1;for(var r,s=[0,0,0,0,0,0],a=n.getBounds(),i=0;i<3;i++)if(r=!1,a[2*i]>=t.bounds[2*i]&&a[2*i]<=t.bounds[2*i+1]?(r=!0,s[2*i]=a[2*i]):t.bounds[2*i]>=a[2*i]&&t.bounds[2*i]<=a[2*i+1]&&(r=!0,s[2*i]=t.bounds[2*i]),a[2*i+1]>=t.bounds[2*i]&&a[2*i+1]<=t.bounds[2*i+1]?(r=!0,s[2*i+1]=n.MaxPnt[i]):t.bounds[2*i+1]>=n.MinPnt[2*i]&&t.bounds[2*i+1]<=n.MaxPnt[2*i+1]&&(r=!0,s[2*i+1]=t.bounds[2*i+1]),!r)return!1;return t.bounds=s,!0},e.intersects=function(n){if(!e.isValid()||!n.isValid())return!1;for(var r=n.getBounds(),s=0;s<3;s++)if(!(r[2*s]>=t.bounds[2*s]&&r[2*s]<=t.bounds[2*s+1]||t.bounds[2*s]>=r[2*s]&&t.bounds[2*s]<=r[2*s+1]||r[2*s+1]>=t.bounds[2*s]&&r[2*s+1]<=t.bounds[2*s+1]||t.bounds[2*s+1]>=n.MinPnt[2*s]&&t.bounds[2*s+1]<=n.MaxPnt[2*s+1]))return!1;return!0},e.intersectPlane=function(e,n){for(var r=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],s=[0,0,0,0,0,0,0,0],a=0,i=0;i<2;i++)for(var Q=2;Q<4;Q++)for(var B=4;B<6;B++){var o=[t.bounds[i],t.bounds[Q],t.bounds[B]];s[a++]=ue.a.evaluate(n,e,o)}for(var l=2;l--&&!(Ge(s[r[l][0]],s[r[l][4]])&&Ge(s[r[l][1]],s[r[l][5]])&&Ge(s[r[l][2]],s[r[l][6]])&&Ge(s[r[l][3]],s[r[l][7]])););if(l<0)return!1;for(var F=Math.sign(n[l]),U=Math.abs((t.bounds[2*l+1]-t.bounds[2*l])*n[l]),c=F>0?1:0,g=0;g<4;g++)if(0!==U){var d=Math.abs(s[r[l][g]])/U;F>0&&dc&&(c=d)}var u=(1-c)*t.bounds[2*l]+c*t.bounds[2*l+1];return F>0?t.bounds[2*l]=u:t.bounds[2*l+1]=u,!0},e.containsPoint=function(e,n,r){return!(et.bounds[1]||nt.bounds[3]||rt.bounds[5])},e.getMinPoint=function(){return[t.bounds[0],t.bounds[2],t.bounds[4]]},e.getMaxPoint=function(){return[t.bounds[1],t.bounds[3],t.bounds[5]]},e.getBound=function(e){return t.bound[e]},e.contains=function(t){return!!e.intersects(t)&&!!e.containsPoint.apply(e,Object(Q.a)(t.getMinPoint()))&&(!!e.containsPoint.apply(e,Object(Q.a)(t.getMaxPoint()))||0)},e.getCenter=function(){return be(t.bounds)},e.getLength=function(e){return ye(t.bounds,e)},e.getLengths=function(){return Se(t.bounds)},e.getMaxLength=function(){return Ze(t.bounds)},e.getDiagonalLength=function(){return xe(t.bounds)},e.reset=function(){return e.setBounds([].concat(me))},e.inflate=function(e){t.bounds=t.bounds.map((function(t,n){return n%2==0?t-e:t+e}))},e.getCorners=function(){return he(t.bounds,t.corners),t.corners},e.scale=function(n,r,s){if(e.isValid()){var a=[].concat(t.bounds);return n>=0?(a[0]*=n,a[1]*=n):(a[0]=n*t.bounds[1],a[1]=n*t.bounds[0]),r>=0?(a[2]*=r,a[3]*=r):(a[2]=r*t.bounds[3],a[3]=r*t.bounds[2]),s>=0?(a[4]*=s,a[5]*=s):(a[4]=s*t.bounds[5],a[5]=s*t.bounds[4]),t.bounds=a,!0}return!1}}var Ve={type:"vtkBoundingBox",bounds:[].concat(me),corners:[]};function Le(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ve,n),B.b.obj(e,t),B.b.setGet(e,t,["bounds"]),Re(e,t)}var Ae=B.b.newInstance(Le,"vtkBoundingBox"),Ne=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?Je.EMPTY:3===t?Je.XYZ_GRID:2===t?e[0]===e[1]?Je.YZ_PLANE:e[2]===e[3]?Je.XZ_PLANE:Je.XY_PLANE:1===t?e[0]1&&(n*=t[r]-1)}return n},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(n){var r=e.getDimensions(),s=Object(G.f)(0,0,0),a=[0,0,0];if(0===r[0]||0===r[1]||0===r[2])return je("Requesting a point from an empty image."),null;switch(t.dataDescription){case fe.EMPTY:return null;case fe.SINGLE_POINT:break;case fe.X_LINE:s[0]=n;break;case fe.Y_LINE:s[1]=n;break;case fe.Z_LINE:s[2]=n;break;case fe.XY_PLANE:s[0]=n%r[0],s[1]=n/r[0];break;case fe.YZ_PLANE:s[1]=n%r[1],s[2]=n/r[1];break;case fe.XZ_PLANE:s[0]=n%r[0],s[2]=n/r[0];break;case fe.XYZ_GRID:s[0]=n%r[0],s[1]=n/r[0]%r[1],s[2]=n/(r[0]*r[1]);break;default:je("Invalid dataDescription")}var i=Object(G.a)();return e.indexToWorldVec3(s,i),Object(G.b)(a,i),a},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var n=[t[0],t[2],t[4],t[1],t[2],t[4],t[0],t[3],t[4],t[1],t[3],t[4],t[0],t[2],t[5],t[1],t[2],t[5],t[0],t[3],t[5],t[1],t[3],t[5]],r=Object(G.f)(n[0],n[1],n[2]),s=Object(G.a)();e.indexToWorldVec3(r,s);for(var a=[s[0],s[0],s[1],s[1],s[2],s[2]],i=3;i<24;i+=3)Object(G.p)(r,n[i],n[i+1],n[i+2]),e.indexToWorldVec3(r,s),s[0]a[1]&&(a[1]=s[0]),s[1]>a[3]&&(a[3]=s[1]),s[2]>a[5]&&(a[5]=s[2]);return a},e.computeTransforms=function(){var e=Object(G.f)(t.origin[0],t.origin[1],t.origin[2]);Object(x.e)(t.indexToWorld,e),t.indexToWorld[0]=t.direction[0],t.indexToWorld[1]=t.direction[1],t.indexToWorld[2]=t.direction[2],t.indexToWorld[4]=t.direction[3],t.indexToWorld[5]=t.direction[4],t.indexToWorld[6]=t.direction[5],t.indexToWorld[8]=t.direction[6],t.indexToWorld[9]=t.direction[7],t.indexToWorld[10]=t.direction[8];var n=Object(G.f)(t.spacing[0],t.spacing[1],t.spacing[2]);Object(x.r)(t.indexToWorld,t.indexToWorld,n),Object(x.g)(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return je("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),s=0;s1&&void 0!==arguments[1]?arguments[1]:[],r=Object(G.f)(e[0],e[1],e[2]),s=Object(G.a)();return Object(G.q)(s,r,t.indexToWorld),Object(G.b)(n,s),n},e.worldToIndexVec3=function(e,n){return Object(G.q)(n,e,t.worldToIndex),n},e.worldToIndex=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object(G.f)(e[0],e[1],e[2]),s=Object(G.a)();return Object(G.q)(s,r,t.worldToIndex),Object(G.b)(n,s),n},e.indexToWorldBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],s=[0,0,0];Ne.computeCornerPoints(r,s,e);var a=[0,0,0],i=[0,0,0];return Object(G.q)(a,r,t.indexToWorld),Object(G.q)(i,s,t.indexToWorld),Object(b.o)(a,i,n),n},e.worldToIndexBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],s=[0,0,0];Ne.computeCornerPoints(r,s,e);var a=[0,0,0],i=[0,0,0];return Object(G.q)(a,r,t.worldToIndex),Object(G.q)(i,s,t.worldToIndex),Object(b.o)(a,i,n),n},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),n=[],r=0;r<3;r++)n[r]=(t[2*r+1]+t[2*r])/2;return n},e.computeHistogram=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[0,0,0,0,0,0];e.worldToIndexBounds(t,r);var s=[0,0,0],a=[0,0,0];Ne.computeCornerPoints(s,a,r),Object(b.n)(s,s),Object(b.n)(a,a);var i=e.getDimensions();Object(b.q)(s,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],s),Object(b.q)(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a);for(var Q=i[0],B=i[0]*i[1],o=e.getPointData().getScalars().getData(),l=-1/0,F=1/0,U=0,c=0,g=0,d=s[2];d<=a[2];d++)for(var u=s[1];u<=a[1];u++)for(var I=s[0]+u*Q+d*B,m=s[0];m<=a[0];m++){if(!n||n([m,u,d],r)){var C=o[I];C>l&&(l=C),C0?c/g:0,S=U-y*y,Z=Math.sqrt(S);return{minimum:F,maximum:l,average:y,variance:S,sigma:Z}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=t,s=0;s<3;++s)n[s]=r,r*=e[2*s+1]-e[2*s]+1;return n},e.computeOffsetIndex=function(t){var n=Object(te.a)(t,3),r=n[0],s=n[1],a=n[2],i=e.getExtent(),Q=e.getPointData().getScalars().getNumberOfComponents(),B=e.computeIncrements(i,Q);return Math.floor((Math.round(r)-i[0])*B[0]+(Math.round(s)-i[2])*B[1]+(Math.round(a)-i[4])*B[2])},e.getOffsetIndexFromWorld=function(t){for(var n=e.getExtent(),r=e.worldToIndex(t),s=0;s<3;++s)if(r[s]n[2*s+1])return je("GetScalarPointer: Pixel ".concat(r," is not in memory. Current extent = ").concat(n)),NaN;return e.computeOffsetIndex(r)},e.getScalarValueFromWorld=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.getPointData().getScalars().getNumberOfComponents();if(n<0||n>=r)return je("GetScalarPointer: Scalar Component ".concat(n," is not within bounds. Current Scalar numberOfComponents: ").concat(r)),NaN;var s=e.getOffsetIndexFromWorld(t);return Number.isNaN(s)?s:e.getPointData().getScalars().getComponent(s,n)}}var qe={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:fe.EMPTY};function $e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,qe,n),Ee.a.extend(e,t,n),t.direction){if(Array.isArray(t.direction)){var r=t.direction.slice(0);t.direction=He();for(var s=0;s<9;++s)t.direction[s]=r[s]}}else t.direction=He();t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),B.b.get(e,t,["direction","indexToWorld","worldToIndex"]),B.b.setGetArray(e,t,["origin","spacing"],3),B.b.getArray(e,t,["extent"],6),_e(e,t)}var et={newInstance:B.b.newInstance($e,"vtkImageData"),extend:$e},tt=n(38),nt=n(22),rt={Int8:Int8Array,UInt8:Uint8Array,Int16:Int16Array,UInt16:Uint16Array,Int32:Int32Array,UInt32:Uint32Array,Int64:Int32Array,UInt64:Uint32Array,Float32:Float32Array,Float64:Float64Array},st={Int8:1,UInt8:1,Int16:2,UInt16:2,Int32:4,UInt32:4,Int64:8,UInt64:8,Float32:4,Float64:8};function at(e){var t=e.length-1;return e.filter((function(e,n){return n1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchBinary(e,n)}t.classHierarchy.push("vtkXMLReader"),t.dataAccessHelper||(t.dataAccessHelper=H.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.url=n;var s=n.split("/");return s.pop(),t.baseURL=s.join("/"),e.loadData(r)},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(t.url,r).then(e.parseAsArrayBuffer)},e.parseAsArrayBuffer=function(n){if(!n)return!1;if(n===t.rawDataBuffer)return!0;e.modified();var r=function(e){return X.a.extractBinary(e,/^\s*\s*_/m,/\n\s*<\/AppendedData>/m)}(n),s=r.text,a=r.binaryBuffer;t.rawDataBuffer=n,t.binaryBuffer=a;var i=function(e){if(window.ActiveXObject){var t=new window.ActiveXObject("Microsoft.XMLDOM");return t.loadXML(e),t}return(new DOMParser).parseFromString(e,"application/xml")}(s).firstChild,Q=i.getAttribute("type"),B=i.getAttribute("compressor"),o=i.getAttribute("byte_order"),l=i.getAttribute("header_type")||"UInt32";if(B&&"vtkZLibDataCompressor"!==B)return console.error("Invalid compressor",B),!1;if(o&&"LittleEndian"!==o)return console.error("Only LittleEndian encoding is supported"),!1;if(Q!==t.dataType)return console.error("Invalid data type",Q,"expecting",t.dataType),!1;if(i.querySelector("AppendedData")){var F=i.querySelector("AppendedData"),U=F.getAttribute("encoding"),c=i.querySelectorAll("DataArray"),g=t.binaryBuffer;"base64"===U&&(g=F.textContent.trim().substr(1));for(var d=[],u=0;u0?0===S[3]?new ArrayBuffer(S[2]*Z):new ArrayBuffer(S[2]*(Z-1)+S[3]):new ArrayBuffer(0);for(var G=new Uint8Array(b),h={offset:0,uint8:G},p=0;p2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lt,n),B.b.obj(e,t),B.b.get(e,t,["url","baseURL"]),B.b.setGet(e,t,["dataAccessHelper"]),B.b.algo(e,t,0,1),ot(e,t)},processDataArray:Bt,processFieldData:function(e,t,n,r,s,a,i){if(t){var Q={};["Scalars","Vectors","Normals","Tensors","TCoords"].forEach((function(e){var r=t.getAttribute(e);r&&(Q[r]=n["set".concat(e)])}));for(var B=t.getElementsByTagName("DataArray"),l=B.length,F=0;F2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ct,n),Ft.extend(e,t,n),Ut(e,t)}),"vtkXMLImageDataReader");function gt(e,t){t.classHierarchy.push("vtkXMLPolyDataReader"),e.parseXML=function(e,n,r,s,a){var i=e.getElementsByTagName(t.dataType)[0],B=i.getElementsByTagName("FieldData")[0],l=i.getElementsByTagName("Piece"),U=l.length,c=[];B&&(c=Object(Q.a)(B.getElementsByTagName("DataArray")).map((function(e){return function(e,t,n,r,s){var a=Number(e.getAttribute("NumberOfTuples"));return o.a.newInstance(Ft.processDataArray(a,e,t,n,r,s))}(e,r,s,a,t.binaryBuffer)})));for(var g=function(e){var n=F.a.newInstance(),i=l[e],Q=function(e,t,n,r,s,a,i){var Q=Number(n.getAttribute("NumberOf".concat(t)));if(Q>0){var B=n.getElementsByTagName(t)[0].getElementsByTagName("DataArray")[0],o=Ft.processDataArray(Q,B,r,s,a,i),l=o.values,F=o.numberOfComponents;e["get".concat(t)]().setData(l,F)}return Q}(n,"Points",i,r,s,a,t.binaryBuffer),B=0;["Verts","Lines","Strips","Polys"].forEach((function(e){B+=function(e,t,n,r,s,a,i){var Q=Number(n.getAttribute("NumberOf".concat(t)));if(Q>0){var B=Ft.processCells(Q,n.getElementsByTagName(t)[0],r,s,a,i);e["get".concat(t)]().setData(B)}return Q}(n,e,i,r,s,a,t.binaryBuffer)})),Ft.processFieldData(Q,i.getElementsByTagName("PointData")[0],n.getPointData(),r,s,a,t.binaryBuffer),Ft.processFieldData(B,i.getElementsByTagName("CellData")[0],n.getCellData(),r,s,a,t.binaryBuffer);for(var o=n.getFieldData(),U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dt,n),Ft.extend(e,t,n),gt(e,t)}),"vtkXMLPolyDataReader");var ut=n(18),It=n(19),mt=n(41),Ct=Object(mt.a)((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t})),bt=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ct(e,t)},yt=n(33),St=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Zt=function(e,t){return!t||"object"!==Object(yt.a)(t)&&"function"!=typeof t?St(e):t},xt=Object(mt.a)((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t})),Gt=n(16),ht=B.b.vtkErrorMacro;function pt(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(n){var r=n.getTraverseOperation(),s=e[r];if(s)s(n);else{e.apply(n,!0);for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rt,n),B.b.obj(e,t),B.b.event(e,t,"event"),t.renderableChildMap=new Map,B.b.get(e,t,["visited"]),B.b.setGet(e,t,["parent","renderable","myFactory"]),B.b.getArray(e,t,["children"]),pt(e,t)}var Lt={newInstance:B.b.newInstance(Vt,"vtkViewNode"),extend:Vt,PASS_TYPES:["Build","Render"]};function At(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(B.b.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=r,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),n.traverse(e)})),t.delegates.forEach((function(t){t.traverse(n,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),n.traverse(e)})))}}var Nt={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function Et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nt,n),B.b.obj(e,t),B.b.get(e,t,["currentOperation"]),B.b.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),At(e,t)}var ft={newInstance:B.b.newInstance(Et,"vtkRenderPass"),extend:Et},Dt={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},vt={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Jt={Wrap:Dt,Filter:vt};function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Xt=Jt.Wrap,Ht=Jt.Filter,kt=o.a.VtkDataTypes,Tt=B.b.vtkDebugMacro,Mt=B.b.vtkErrorMacro,Yt=B.b.vtkWarningMacro;function wt(e,t){var n=this;function r(e,n){var r=[];if(e!==kt.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var s=t.width*t.height*t.components,a=0;a=s&&(I=s-1);var m=d-u,C=1-m;u=u*r*a,I=I*r*a;for(var y=0;y=r&&(G=r-1);var h=Z-x;x*=a,G*=a;for(var p=0;ps[B]&&(s[B]=n[i]),i++;for(var o=[],l=[],F=0;F0&&void 0!==arguments[0]?arguments[0]:null;if(n?t.openGLRenderWindow=n:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(Ht.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(Ht.LINEAR),e.setMagnificationFilter(Ht.LINEAR)):(e.setMinificationFilter(Ht.NEAREST),e.setMagnificationFilter(Ht.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Xt.REPEAT),e.setWrapS(Xt.REPEAT),e.setWrapT(Xt.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(Ht.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified()));var r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){for(var s=r.getExtent(),a=r.getPointData().getScalars(),i=[],Q=0;Qt.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var n=0;switch(t.target){case t.context.TEXTURE_2D:n=t.context.TEXTURE_BINDING_2D;break;default:Yt("impossible case")}e=t.context.getIntegerv(n)===t.handle}return e},e.sendParameters=function(){t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t.openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=function(n,r){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(n,r)),t.internalFormat||Tt("Unable to find suitable internal format for T=".concat(n," NC= ").concat(r)),t.internalFormat},e.getDefaultInternalFormat=function(e,r){var s=0;return(s=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!1))||(s=n.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!0))||(Tt("Unsupported internal texture type!"),Tt("Unable to find suitable internal format for T=".concat(e," NC= ").concat(r))),s},e.setInternalFormat=function(n){n!==t.internalFormat&&(t.internalFormat=n,e.modified())},e.getFormat=function(n,r){return t.format=e.getDefaultFormat(n,r),t.format},e.getDefaultFormat=function(e,n){if(t.openGLRenderWindow.getWebgl2())switch(n){case 1:return t.context.RED;case 2:return t.context.RG;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}else switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){if(t.openGLRenderWindow.getWebgl2())switch(e){case kt.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case kt.FLOAT:case kt.VOID:default:return t.context.FLOAT}switch(e){case kt.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case kt.FLOAT:case kt.VOID:default:return t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?t.context.FLOAT:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(n){return t.openGLDataType=e.getDefaultDataType(n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,n=1;switch(t.openGLDataType){case t.context.BYTE:e=(n=127.5)-128;break;case t.context.UNSIGNED_BYTE:n=255,e=0;break;case t.context.SHORT:e=(n=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:n=65536,e=0;break;case t.context.INT:e=(n=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:n=4294967295,e=0;break;case t.context.FLOAT:}return{shift:e,scale:n}},e.getOpenGLFilterMode=function(e){switch(e){case Ht.NEAREST:return t.context.NEAREST;case Ht.LINEAR:return t.context.LINEAR;case Ht.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case Ht.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case Ht.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case Ht.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Xt.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Xt.REPEAT:return t.context.REPEAT;case Xt.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(n,a,i,Q,B){if(e.getOpenGLDataType(Q),e.getInternalFormat(Q,i),e.getFormat(Q,i),!t.internalFormat||!t.format||!t.openGLDataType)return Mt("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=n,t.height=a,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var o=s(r(Q,[B]));return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,o[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.createCubeFromRaw=function(n,a,i,Q,B){if(e.getOpenGLDataType(Q),e.getInternalFormat(Q,i),e.getFormat(Q,i),!t.internalFormat||!t.format||!t.openGLDataType)return Mt("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=n,t.height=a,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=B.length/6-1,e.createTexture(),e.bind();for(var o=s(r(Q,B)),l=[],F=t.width,U=t.height,c=0;c=1&&b>=1;){var y=null;m<=t.maxLevel&&(y=l[6*m+I]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+I,m,t.internalFormat,C,b,0,t.format,t.openGLDataType,y),m++,C/=2,b/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(n,r,s,a){return e.getOpenGLDataType(s),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?s===kt.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=n,t.height=r,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,a),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Mt("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(n){if(e.getOpenGLDataType(kt.UNSIGNED_CHAR),e.getInternalFormat(kt.UNSIGNED_CHAR,4),e.getFormat(kt.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return Mt("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=n.width,t.height=n.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var r=!Object(b.k)(n.width)||!Object(b.k)(n.height),s=document.createElement("canvas");s.width=r?Object(b.l)(n.width):n.width,s.height=r?Object(b.l)(n.height):n.height;var a=s.getContext("2d");a.translate(0,s.height),a.scale(1,-1),a.drawImage(n,0,0,n.width,n.height,0,0,s.width,s.height),navigator.userAgent.indexOf("Chrome/69")>=0&&a.getImageData(0,0,1,1);var i=s;return t.context.texImage2D(t.target,0,t.internalFormat,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFromRaw=function(n,r,s,a,i,Q){return e.getOpenGLDataType(i),e.getInternalFormat(i,a),e.getFormat(i,a),t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_3D,t.components=a,t.width=n,t.height=r,t.depth=s,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,Q),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Mt("Failed to determine texture parameters."),!1)},e.create3DFilterableFromRaw=function(n,r,s,i,Q,B){for(var o=n*r*s,l=[],F=[],U=0;U4096&&(S===kt.FLOAT||i>=3)&&(x=4096);var G=1,h=1;o>x*x&&(h=G=Math.ceil(Math.sqrt(o/(x*x))));var p=Math.sqrt(o)/G;p=Object(b.l)(p);var R,V=Math.floor(p*G/n),L=Math.ceil(s/V),A=Object(b.l)(r*L/h);t.width=p,t.height=A,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=V,t.volumeInfo.yreps=L,t.volumeInfo.xstride=G,t.volumeInfo.ystride=h,t.volumeInfo.offset=C.offset,t.volumeInfo.scale=C.scale;var N=p*A*i;R=S===kt.FLOAT?new Float32Array(N):new Uint8Array(N);for(var E=0,f=Math.floor(n/G),D=Math.floor(r/h),v=0;v2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ot,n),Lt.extend(e,t,n),t.sendParametersTime={},B.b.obj(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},B.b.obj(t.textureBuildTime,{mtime:0}),B.b.set(e,t,["format","openGLDataType"]),B.b.setGet(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),B.b.get(e,t,["width","height","volumeInfo","components","handle","target"]),wt(e,t)}var Pt=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0,r=t.context,s=r.COLOR_ATTACHMENT0;if(n>0){if(!t.openGLRenderWindow.getWebgl2())return void Object(B.k)("Using multiple framebuffer attachments requires WebGL 2");s+=n}t.colorTexture=e,r.framebufferTexture2D(r.FRAMEBUFFER,s,r.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.context,r=n.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void Object(B.k)("Using multiple framebuffer attachments requires WebGL 2");r+=e}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var n=t.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,e.getHandle(),0)}else Object(B.k)("Attaching depth buffer textures to fbo requires WebGL 2")},e.removeDepthBuffer=function(){if(t.openGLRenderWindow.getWebgl2()){var e=t.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,null,0)}else Object(B.k)("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.releaseGraphicsResources=function(){t.glFramebuffer&&t.context.deleteFramebuffer(t.glFramebuffer),t.colorTexture&&t.colorTexture.releaseGraphicsResources()},e.getSize=function(){var e=[0,0];return null!==t.glFramebuffer&&(e[0]=t.glFramebuffer.width,e[1]=t.glFramebuffer.height),e},e.populateFramebuffer=function(){e.bind();var n=t.context,r=Pt.newInstance();r.setOpenGLRenderWindow(t.openGLRenderWindow),r.setMinificationFilter(vt.LINEAR),r.setMagnificationFilter(vt.LINEAR),r.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,Gt.b.UNSIGNED_CHAR,null),e.setColorBuffer(r),t.depthTexture=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,t.depthTexture),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t.depthTexture)}}var jt={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function _t(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jt,n),Object(B.f)(e,t),Object(B.h)(e,t,["colorTexture"]),Kt(e,t)}var qt={newInstance:Object(B.e)(_t,"vtkFramebuffer"),extend:_t};function $t(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=r,e.setCurrentOperation("buildPass"),n.traverse(e);for(var s=n.getRenderable().getNumberOfLayers(),a=n.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var l=n.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=qt.newInstance()),t.framebuffer.setOpenGLRenderWindow(n),t.framebuffer.saveCurrentBindingsAndBuffers();var F=t.framebuffer.getSize();null!==F&&F[0]===l[0]&&F[1]===l[1]||(t.framebuffer.create(l[0],l[1]),t.framebuffer.populateFramebuffer()),t.framebuffer.bind(),e.setCurrentOperation("opaqueZBufferPass"),B.traverse(e),t.framebuffer.restorePreviousBindingsAndBuffers()}e.setCurrentOperation("cameraPass"),B.traverse(e),t.opaqueActorCount>0&&(e.setCurrentOperation("opaquePass"),B.traverse(e)),t.translucentActorCount>0&&(e.setCurrentOperation("translucentPass"),B.traverse(e)),t.volumeCount>0&&(e.setCurrentOperation("volumePass"),B.traverse(e))}}}},e.getZBufferTexture=function(){return t.framebuffer?t.framebuffer.getColorTexture():null},e.incrementOpaqueActorCount=function(){return t.opaqueActorCount++},e.incrementTranslucentActorCount=function(){return t.translucentActorCount++},e.incrementVolumeCount=function(){return t.volumeCount++}}var en={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,framebuffer:null,depthRequested:!1};function tn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,en,n),ft.extend(e,t,n),B.b.get(e,t,["framebuffer"]),B.b.setGet(e,t,["depthRequested"]),$t(e,t)}var nn={newInstance:B.b.newInstance(tn,"vtkForwardPass"),extend:tn};function rn(e,t){t.classHierarchy.push("vtkGenericWidgetRepresentation")}var sn={};function an(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sn,n),Lt.extend(e,t,n),rn(0,t)}var Qn={newInstance:B.b.newInstance(an),extend:an};function Bn(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(n){if(n){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(var r=0;rt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Object(x.d)(t.keyMatrices.mcwc,t.renderable.getMatrix()),Object(x.j)(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?Te(t.keyMatrices.normalMatrix):(ke(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),Ye(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Me(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}var on={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function ln(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,on,n),Lt.extend(e,t,n),t.keyMatrixTime={},B.b.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:He(),mcwc:Object(x.h)()},B.b.setGet(e,t,["context"]),B.b.get(e,t,["activeTextures"]),Bn(e,t)}var Fn={newInstance:B.b.newInstance(ln),extend:ln};function Un(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach((function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)})),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach((function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)})),e.apply(n,!1))},e.activateTextures=function(){t.activeTextures=[],t.children.forEach((function(e){e.isA("vtkOpenGLTexture")&&(e.render(),e.getHandle()&&t.activeTextures.push(e))}))},e.opaquePass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0),e.activateTextures()):t.activeTextures.forEach((function(e){e.deactivate()}))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1),e.activateTextures()):(t.activeTextures.forEach((function(e){e.deactivate()})),t.context.depthMask(!0))}}var cn={context:null,activeTextures:[]};function gn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cn,n),Lt.extend(e,t,n),Object(B.h)(e,t,["context"]),Object(B.c)(e,t,["activeTextures"]),Un(e,t)}var dn={newInstance:Object(B.e)(gn),extend:gn};function un(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(n){n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var n=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),t.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(n){if(n!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||n.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Object(x.d)(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),ke(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),Ye(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Object(x.j)(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var r=t.openGLRenderer.getAspectRatio();Object(x.d)(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(r,-1,1)),Object(x.j)(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Object(x.l)(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=n}return t.keyMatrices}}var In={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function mn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,In,n),Lt.extend(e,t,n),t.keyMatrixTime={},Object(B.f)(t.keyMatrixTime),t.keyMatrices={normalMatrix:He(),vcpc:Object(x.h)(),wcvc:Object(x.h)(),wcpc:Object(x.h)()},Object(B.h)(e,t,["context","keyMatrixTime"]),un(e,t)}var Cn={newInstance:Object(B.e)(mn),extend:mn},bn={FLAT:0,GOURAUD:1,PHONG:2},yn={POINTS:0,WIREFRAME:1,SURFACE:2},Sn={Shading:bn,Representation:yn,Interpolation:bn};function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var xn=Sn.Representation,Gn=Sn.Interpolation;function hn(e){return function(){return B.b.vtkErrorMacro("vtkProperty::".concat(e," - NOT IMPLEMENTED"))}}function pn(e,t){t.classHierarchy.push("vtkProperty"),e.setColor=function(n,r,s){Array.isArray(n)?t.color[0]===n[0]&&t.color[1]===n[1]&&t.color[2]===n[2]||(t.color[0]=n[0],t.color[1]=n[1],t.color[2]=n[2],e.modified()):t.color[0]===n&&t.color[1]===r&&t.color[2]===s||(t.color[0]=n,t.color[1]=r,t.color[2]=s,e.modified()),e.setDiffuseColor(t.color),e.setAmbientColor(t.color),e.setSpecularColor(t.color)},e.computeCompositeColor=hn("ComputeCompositeColor"),e.getColor=function(){var e=0;t.ambient+t.diffuse+t.specular>0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var n=0;n<3;n++)t.color[n]=e*(t.ambient*t.ambientColor[n]+t.diffuse*t.diffuseColor[n]+t.specular*t.specularColor[n]);return[].concat(t.color)},e.addShaderVariable=hn("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(Gn.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(Gn.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(Gn.PHONG)},e.getInterpolationAsString=function(){return B.b.enumToString(Gn,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(xn.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(xn.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(xn.POINTS)},e.getRepresentationAsString=function(){return B.b.enumToString(xn,t.representation)}}var Rn={color:[1,1,1],ambientColor:[1,1,1],diffuseColor:[1,1,1],specularColor:[1,1,1],edgeColor:[0,0,0],ambient:0,diffuse:1,specular:0,specularPower:1,opacity:1,interpolation:Gn.GOURAUD,representation:xn.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function Vn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rn,n),B.b.obj(e,t),B.b.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),B.b.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),pn(e,t)}var Ln=function(e){for(var t=1;t=0?t.annotationArray[s].annotation!==r&&(t.annotationArray[s].annotation=r,a=!0):(t.annotationArray.push({value:n,annotation:r}),s=t.annotationArray.length-1,a=!0),a&&(e.updateAnnotatedValueMap(),e.modified()),s},e.getNumberOfAnnotatedValues=function(){return t.annotationArray.length},e.getAnnotatedValue=function(e){return e<0||e>=t.annotationArray.length?null:t.annotationArray[e].value},e.getAnnotation=function(e){return void 0===t.annotationArray[e]?null:t.annotationArray[e].annotation},e.getAnnotatedValueIndex=function(n){return t.annotationArray.length?e.checkForAnnotatedValue(n):-1},e.removeAnnotation=function(n){var r=e.checkForAnnotatedValue(n),s=r>=0;return s&&(t.annotationArray.splice(r,1),e.updateAnnotatedValueMap(),e.modified()),s},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(n,r){if(t.indexedLookup){var s=e.getAnnotatedValueIndex(n);e.getIndexedColor(s,r)}else e.getColor(parseFloat(n),r),r[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var n=t.annotationArray.length;return t.annotatedValueMap[e]%n}return-1},e.getIndexedColor=function(e,t){t[0]=0,t[1]=0,t[2]=0,t[3]=0},e.updateAnnotatedValueMap=function(){t.annotatedValueMap=[];for(var e=t.annotationArray.length,n=0;n1?e.mapVectorsThroughTable(t,a,Dn.RGBA,-1,-1):(B<0&&(B=0),B>=s&&(B=s-1),e.mapScalarsThroughTable(t,a,Dn.RGBA,B))}return a},e.mapVectorsToMagnitude=function(e,t,n){for(var r=e.getNumberOfTuples(),s=e.getNumberOfComponents(),a=t.getData(),i=e.getData(),Q=0;Q=l&&(B=l-1)):(-1===Q&&(Q=e.getVectorSize()),Q<=0?(B=0,Q=l):(B<0&&(B=0),B>=l&&(B=l-1),B+Q>l&&(Q=l-B)),i!==vn.MAGNITUDE||1!==l&&1!==Q||(i=vn.COMPONENT));var F=0;switch(B>0&&(F=B),i){case vn.COMPONENT:e.mapScalarsThroughTable(t,n,r,F);break;default:case vn.MAGNITUDE:var U=o.a.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,U,Q),e.mapScalarsThroughTable(U,n,r,0);break;case vn.RGBCOLORS:}},e.luminanceToRGBA=function(e,t,n,r){for(var s=r(n),a=t.getData(),i=e.getData(),Q=a.length,B=0,o=0;o=1&&n.getDataType()===Jn.UNSIGNED_CHAR)return n;var i=o.a.newInstance({numberOfComponents:4,empty:!0,size:4*s,dataType:Jn.UNSIGNED_CHAR});if(s<=0)return i;a=(a=a>0?a:0)<1?a:1;var Q=Hn;switch(n.getDataType()!==Jn.FLOAT&&n.getDataType()!==Jn.DOUBLE||(Q=kn),r){case 1:e.luminanceToRGBA(i,n,a,Q);break;case 2:e.luminanceAlphaToRGBA(i,n,Q);break;case 3:e.rGBToRGBA(i,n,a,Q);break;case 4:e.rGBAToRGBA(i,n,a,Q);break;default:return Xn("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,n){return e.setMappingRange(t,n)},e.getRange=function(t,n){return e.getMappingRange()}}var Mn={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:vn.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Yn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mn,n),B.b.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],B.b.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),B.b.setArray(e,t,["mappingRange"],2),B.b.getArray(e,t,["mappingRange"]),Tn(e,t)}var wn=function(e){for(var t=1;tt.range[1]?t.maxIndex+1+1.5:(n=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(n,r,s,a){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var Q=e.getMappingRange(),B={maxIndex:e.getNumberOfColors()-1,range:Q,shift:0,scale:0};e.lookupShiftAndScale(Q,B);var o=e.getAlpha(),l=n.getNumberOfTuples(),F=n.getNumberOfComponents(),U=r.getData(),c=n.getData();if(o>=1){if(s===An.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Pn={numberOfColors:256,hueRange:[0,.66667],saturationRange:[1,1],valueRange:[1,1],alphaRange:[1,1],nanColor:[.5,0,0,1],belowRangeColor:[0,0,0,1],aboveRangeColor:[1,1,1,1],useAboveRangeColor:!1,useBelowRangeColor:!1,alpha:1};function Kn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pn,n),wn.extend(e,t,n),t.table||(t.table=[]),t.buildTime={},B.b.obj(t.buildTime),t.opaqueFlagBuildTime={},B.b.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},B.b.obj(t.insertTime,{mtime:0}),B.b.get(e,t,["buildTime"]),B.b.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),B.b.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),B.b.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),B.b.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),zn(e,t)}var jn={newInstance:B.b.newInstance(Kn,"vtkLookupTable"),extend:Kn};function _n(e,t){e.update=function(){e.getInputData()},e.addClippingPlane=function(e){"vtkPlane"===e.getClassName()&&t.clippingPlanes.push(e)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(e){e<0||e>=6||t.clippingPlanes.splice(e,1)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var n=t.length,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qn,n),B.b.obj(e,t),B.b.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),_n(e,t)}};function er(e,t){e.getBounds=function(){return 0},e.getBounds=function(n){e.getBounds();for(var r=0;r<6;r++)n[r]=t.bounds[r]},e.getCenter=function(){e.getBounds();for(var n=0;n<3;n++)t.center[n]=(t.bounds[2*n+1]+t.bounds[2*n])/2;return t.center.slice()},e.getLength=function(){var n=0,r=0;e.getBounds();for(var s=0;s<3;s++)r+=(n=t.bounds[2*s+1]-t.bounds[2*s])*n;return Math.sqrt(r)},e.getClippingPlaneInDataCoords=function(e,n,r){var s=t.clippingPlanes,a=e;if(s){var i=s.length;if(n>=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tr,n),$n.extend(e,t,n),t.bounds||Object(b.b)(t.bounds),t.center||(t.center=[0,0,0]),er(e,t)}},rr=1,sr=0,ar=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function ir(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;sr=e}var Qr={getResolveCoincidentTopologyAsString:function(){return ar[sr]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return rr},getResolveCoincidentTopology:function(){return sr},setResolveCoincidentTopology:ir,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){rr=e},setResolveCoincidentTopologyToDefault:function(){ir(0)},setResolveCoincidentTopologyToOff:function(){ir(0)},setResolveCoincidentTopologyToPolygonOffset:function(){ir(1)}};function Br(e,t,n){n.forEach((function(n){e["get".concat(n.method)]=function(){return t[n.key]},e["set".concat(n.method)]=function(e,r){t[n.key]={factor:e,offset:r}}}))}var or=["Polygon","Line","Point"],lr={};Br(lr,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},or.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var Fr={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),B.b.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Qr).forEach((function(t){e[t]=Qr[t]})),Object.keys(lr).forEach((function(t){e[t]=lr[t]})),Br(e,t.topologyOffset,or.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=lr.getResolveCoincidentTopologyPolygonOffsetParameters(),n=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=lr.getResolveCoincidentTopologyLineOffsetParameters(),n=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=lr.getResolveCoincidentTopologyPointOffsetParameters(),n=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}}},staticOffsetAPI:lr,otherStaticMethods:Qr,CATEGORIES:or};function Ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cr(e){for(var t=1;t1e3?r=1e3:r<-1e3&&(r=-1e3)),{texCoordS:r,texCoordT:s}},e.createColorTextureCoordinates=function(t,n,r,s,a,i,Q,B,o){var l=(i[1]-i[0])/B,F=[];F[0]=i[0]-l,F[1]=i[1]+l;var U=1/(F[1]-F[0]),c=n.getData(),g=t.getData(),d=0,u=0;if(a<0||a>=s)for(var I=0;It.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==r){t.lookupTable.setAlpha(r),t.colorTextureMap=null,t.lookupTable.build();var Q=t.lookupTable.getNumberOfAvailableColors();Q>4094&&(Q=4094),Q+=2;for(var B=(s[1]-s[0])/(Q-1-2),l=new Float64Array(2*Q),F=0;Ft.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var g=n.getNumberOfComponents(),d=n.getNumberOfTuples();t.colorCoordinates=o.a.newInstance({numberOfComponents:2,values:new Float32Array(2*d)});var u=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===Cr.MAGNITUDE&&n.getNumberOfComponents()>1&&(u=-1),e.createColorTextureCoordinates(n,t.colorCoordinates,d,g,u,s,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,a)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(n){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var r=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),s=r.scalars;return!(!s||r.cellFlag||t.colorMode===ur.DEFAULT&&s.getDataType()===br.UNSIGNED_CHAR||t.colorMode===ur.DIRECT_SCALARS)},e.clearColorArrays=function(){t.colorMapColors=null,t.colorCoordinates=null,t.colorTextureMap=null},e.getLookupTable=function(){return t.lookupTable||e.createDefaultLookupTable(),t.lookupTable},e.getMTime=function(){var e=t.mtime;if(null!==t.lookupTable){var n=t.lookupTable.getMTime();e=n>e?n:e}return e},e.getPrimitiveCount=function(){var t=e.getInputData();return{points:t.getPoints().getNumberOfValues()/3,verts:t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells(),lines:t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells(),triangles:t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells()}},e.acquireInvertibleLookupTable=yr("AcquireInvertibleLookupTable"),e.valueToColor=yr("ValueToColor"),e.colorToValue=yr("ColorToValue"),e.useInvertibleColorFor=yr("UseInvertibleColorFor"),e.clearInvertibleColor=yr("ClearInvertibleColor")}var Zr={colorMapColors:null,static:!1,lookupTable:null,scalarVisibility:!0,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,fieldDataTupleId:-1,interpolateScalarsBeforeMapping:!1,colorCoordinates:null,colorTextureMap:null,forceCompileOnly:0,useInvertibleColors:!1,invertibleScalars:null,viewSpecificProperties:null,customShaderAttributes:[]};function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zr,n),nr.extend(e,t,n),B.b.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),B.b.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),B.b.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Fr.implementCoincidentTopologyMethods(e,t),Sr(e,t)}var Gr=cr(cr(cr({newInstance:B.b.newInstance(xr,"vtkMapper"),extend:xr},gr),dr),En),hr=B.b.vtkErrorMacro;function pr(e,t){t.classHierarchy.push("vtkShader"),e.compile=function(){var e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;switch(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),t.shaderType){case"Fragment":e=t.context.FRAGMENT_SHADER;break;case"Vertex":default:e=t.context.VERTEX_SHADER}if(t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){var n=t.context.getShaderInfoLog(t.handle);return hr("Error compiling shader '".concat(t.source,"': ").concat(n)),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}}var Rr={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Vr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rr,n),B.b.obj(e,t),B.b.setGet(e,t,["shaderType","source","error","handle","context"]),pr(e,t)}var Lr={newInstance:B.b.newInstance(Vr,"vtkShader"),extend:Vr},Ar=B.b.vtkErrorMacro;function Nr(e,t){t.classHierarchy.push("vtkShaderProgram"),e.compileShader=function(){return t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(Ar("Links failed: ".concat(t.error)),0):(Ar(t.error),0):(Ar(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Ar(t.fragmentShader.getError()),0):(Ar(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Ar(t.vertexShader.getError()),0)},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0)},e.bind=function(){return!(!t.linked&&!e.link()||(t.context.useProgram(t.handle),e.setBound(!0),0))},e.isBound=function(){return!!t.bound},e.release=function(){t.context.useProgram(null),e.setBound(!1)},e.setContext=function(e){t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=function(){if(t.inked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){var n=t.context.getProgramInfoLog(t.handle);return Ar("Error linking shader ".concat(n)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniformMatrix4fv(s,!1,r),!0)},e.setUniformMatrix3x3=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniformMatrix3fv(s,!1,r),!0)},e.setUniformf=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1f(s,r),!0)},e.setUniformfv=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1fv(s,r),!0)},e.setUniformi=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1i(s,r),!0)},e.setUniformiv=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1iv(s,r),!0)},e.setUniform2f=function(n,r,s){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===s)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(a,r,s),!0},e.setUniform2fv=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2fv(s,r),!0)},e.setUniform2i=function(n,r,s){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===s)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(a,r,s),!0},e.setUniform2iv=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2iv(s,r),!0)},e.setUniform3f=function(n,r,s,a){var i=e.findUniform(n);if(-1===i)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,r,s,a),!0},e.setUniform3fArray=function(n,r){var s=e.findUniform(n);if(-1===s)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(!Array.isArray(r)||3!==r.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(s,r[0],r[1],r[2]),!0},e.setUniform3fv=function(n,r){var s=e.findUniform(n);return-1===s?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform3fv(s,r),!0)},e.setUniform3i=function(n){var r=e.findUniform(n);if(-1===r)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;for(var s=arguments.length,a=new Array(s>1?s-1:0),i=1;i1?s-1:0),i=1;i1?s-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Er,n),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Lr.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Lr.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Lr.newInstance(),t.geometryShader.setShaderType("Geometry"),B.b.obj(e,t),B.b.get(e,t,["lastCameraMTime"]),B.b.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),Nr(e,t)}var Dr,vr={newInstance:B.b.newInstance(fr,"vtkShaderProgram"),extend:fr,substitute:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=Array.isArray(n)?n.join("\n"):n,a=!1;-1!==e.search(t)&&(a=!0);var i="";r&&(i="g");var Q=new RegExp(t,i),B=e.replace(Q,s);return{replace:a,result:B}}};function Jr(e,t,n,r){var s=new Xe.a(4);return s[0]=e,s[1]=t,s[2]=n,s[3]=r,s}function Wr(e,t,n){var r=t[0],s=t[1],a=t[2],i=t[3];return e[0]=n[0]*r+n[4]*s+n[8]*a+n[12]*i,e[1]=n[1]*r+n[5]*s+n[9]*a+n[13]*i,e[2]=n[2]*r+n[6]*s+n[10]*a+n[14]*i,e[3]=n[3]*r+n[7]*s+n[11]*a+n[15]*i,e}function Xr(){var e=new Xe.a(4);return Xe.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Hr(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function kr(e,t,n){var r=t[0],s=t[1],a=t[2],i=t[3],Q=n[0],B=n[1],o=n[2],l=n[3];return e[0]=r*l+i*Q+s*o-a*B,e[1]=s*l+i*B+a*Q-r*o,e[2]=a*l+i*o+r*B-s*Q,e[3]=i*l-r*Q-s*B-a*o,e}Dr=new Xe.a(4),Xe.a!=Float32Array&&(Dr[0]=0,Dr[1]=0,Dr[2]=0,Dr[3]=0);var Tr=Jr;Object(G.a)(),Object(G.f)(1,0,0),Object(G.f)(0,1,0),Xr(),Xr(),He();var Mr={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},Yr={ObjectType:Mr};function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kr,n),B.b.obj(e,t),B.b.get(e,t,["openGLRenderWindow"]),Pr(e,t)}var _r=Or(Or({newInstance:B.b.newInstance(jr),extend:jr},{}),Yr),qr=B.b.vtkDebugMacro,$r=B.b.vtkErrorMacro;function es(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Mr.ARRAY_BUFFER),e.createVBO=function(n,r,s,a){if(!n.getData()||!n.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];var i=a.points.getData(),Q=null,B=null,o=null,l=a.colors?a.colors.getNumberOfComponents():0,F=a.tcoords?a.tcoords.getNumberOfComponents():0;a.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,Q=a.normals.getData()),a.customAttributes&&a.customAttributes.forEach((function(e){e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())})),a.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=F,t.blockSize+=F,B=a.tcoords.getData()),a.colors?(t.colorComponents=a.colors.getNumberOfComponents(),t.colorOffset=0,o=a.colors.getData(),t.colorBO||(t.colorBO=_r.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var U,c=0,g=0,d=0,u=0,I=0,m=0,C={anythingToPoints:function(e,t,n){for(var r=0;r0&&(Math.abs(E)/N>1e6||Math.abs(Math.log10(N))>3||0===N&&E>1e6)){for(var W=Object(G.a)(),X=Object(G.a)(),H=0;H<3;++H){var k=a.points.getRange(H),T=k[1]-k[0];W[H]=.5*(k[1]+k[0]),X[H]=T>0?1/T:1}e.setCoordShiftAndScale(W,X)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);U=function(e){if(c=3*e,t.coordShiftAndScaleEnabled?(V[L++]=(i[c++]-t.coordShift[0])*t.coordScale[0],V[L++]=(i[c++]-t.coordShift[1])*t.coordScale[1],V[L++]=(i[c++]-t.coordShift[2])*t.coordScale[2]):(V[L++]=i[c++],V[L++]=i[c++],V[L++]=i[c++]),null!==Q&&(g=a.haveCellNormals?3*(m+a.cellOffset):3*e,V[L++]=Q[g++],V[L++]=Q[g++],V[L++]=Q[g++]),t.customData.forEach((function(t){I=e*t.components;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ts,n),_r.extend(e,t,n),B.b.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),B.b.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),es(e,t)}var rs={newInstance:B.b.newInstance(ns),extend:ns};function ss(e,t){t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=function(){},e.initialize=function(){t.instancingExtension=null,t.openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t.openGLRenderWindow&&t.openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=function(){return 0!==t.handleVAO||!1===t.supported},e.bind=function(){if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+B,1):n.vertexAttribDivisor(i.index+B,1))}},e.release=function(){if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+B,0):n.vertexAttribDivisor(i.index+B,0)),n.disableVertexAttribArray(i.index+B)}},e.shaderProgramChanged=function(){e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=function(){e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=function(t,n,r,s,a,i,Q,B){return e.addAttributeArrayWithDivisor(t,n,r,s,a,i,Q,B,0,!1)},e.addAttributeArrayWithDivisor=function(n,r,s,a,i,Q,B,o,l,F){if(!n)return!1;if(!n.isBound()||0===r.getHandle()||r.getType()!==Mr.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=n.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==n.getHandle())return!1;var U=t.context,c={};if(c.name=s,c.index=U.getAttribLocation(t.handleProgram,s),c.offset=a,c.stride=i,c.type=Q,c.size=B,c.normalize=o,c.isMatrix=F,c.divisor=l,-1===c.Index)return!1;if(r.bind(),U.enableVertexAttribArray(c.index),U.vertexAttribPointer(c.index,c.size,c.type,c.normalize,c.stride,c.offset),l>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(c.index,1):U.vertexAttribDivisor(c.index,1)),c.buffer=r.getHandle(),!t.supported){for(var g=!1,d=0;d0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(c+g,1):U.vertexAttribDivisor(c+g,1));return!0},e.removeAttributeArray=function(n){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,as,n),t.buffers=[],B.b.obj(e,t),B.b.get(e,t,["supported"]),B.b.setGet(e,t,["forceEmulation"]),ss(e,t)}var Qs={newInstance:B.b.newInstance(is,"vtkOpenGLVertexArrayObject"),extend:is};function Bs(e,t){t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=function(e){t.program.setContext(e.getContext()),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=function(e){t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)}}var os={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function ls(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,os,n),B.b.obj(e,t),t.shaderSourceTime={},B.b.obj(t.shaderSourceTime),t.attributeUpdateTime={},B.b.obj(t.attributeUpdateTime),B.b.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=vr.newInstance(),t.VAO=Qs.newInstance(),t.CABO=rs.newInstance(),Bs(e,t)}var Fs={newInstance:B.b.newInstance(ls),extend:ls},Us="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nattribute vec4 vertexMC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// optional normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// camera and actor matrix values\n//VTK::Camera::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// picking support\n//VTK::Picking::Dec\n\nvoid main()\n{\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Clip::Impl\n\n //VTK::PrimID::Impl\n\n //VTK::PositionVC::Impl\n\n //VTK::Light::Impl\n\n //VTK::Picking::Impl\n}\n",cs="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n}\n",gs={implementReplaceShaderCoincidentOffset:function(e,t){e.replaceShaderCoincidentOffset=function(n,r,s){var a=e.getCoincidentParameters(r,s);if(a&&(0!==a.factor||0!==a.offset)){var i=n.Fragment;i=vr.substitute(i,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,t.context.getExtension("EXT_frag_depth")&&(0!==a.factor?(i=vr.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=vr.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=vr.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),t.openGLRenderWindow.getWebgl2()&&(0!==a.factor?(i=vr.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=vr.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=vr.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),n.Fragment=i}}}},ds={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},us=Ln.Representation,Is=Ln.Shading,ms=Gr.ScalarMode,Cs=Pt.Filter,bs=Pt.Wrap,ys=B.b.vtkErrorMacro,Ss={type:"StartEvent"},Zs={type:"EndEvent"};function xs(e,t){function n(e,t,n){return t.identity(n),e.reduce((function(e,n,r){return 0===r?n?t.copy(e,n):t.identity(e):n?t.multiply(e,e,n):e}),n)}t.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(n){n&&(t.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),t.openGLRenderer=t.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.openGLCamera=t.openGLRenderer.getViewNodeFor(t.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var n=t.openGLRenderWindow.getContext();if(t.context!==n){t.context=n;for(var r=ds.Start;r= cos(radians(lightConeAngle".concat(F,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(F,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(F,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(F,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(F,");")," }"]);Q=Q.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),s=vr.substitute(s,"//VTK::Light::Impl",Q,!1).result;break;default:ys("bad light complexity")}e.Fragment=s},e.replaceShaderNormal=function(n,r,s){if(t.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var a=n.Vertex,i=n.Geometry,Q=n.Fragment;t.lastBoundBO.getCABO().getNormalOffset()?(a=vr.substitute(a,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,a=vr.substitute(a,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=vr.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=vr.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,Q=vr.substitute(Q,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,Q=vr.substitute(Q,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.haveCellNormals?(Q=vr.substitute(Q,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,Q=vr.substitute(Q,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.getOpenGLMode(s.getProperty().getRepresentation(),t.lastBoundBO.getPrimitiveType())===t.context.LINES?(Q=vr.substitute(Q,"//VTK::UniformFlow::Impl",[" vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));"," vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));"," //VTK::UniformFlow::Impl"]).result,Q=vr.substitute(Q,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," fdx = normalize(fdx);"," fdy = normalize(fdy);"," if (abs(fdx.x) > 0.0)"," { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(Q=vr.substitute(Q,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,Q=vr.substitute(Q,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,Q=vr.substitute(Q,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=a,n.Geometry=i,n.Fragment=Q}},e.replaceShaderPositionVC=function(e,n,r){var s=e.Vertex,a=e.Geometry,i=e.Fragment;r.getProperty().getRepresentation()!==us.POINTS&&t.lastBoundBO.getPrimitiveType()!==ds.Points||(s=vr.substitute(s,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(r.getProperty().getPointSize(),".0;")],!1).result),t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(s=vr.substitute(s,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,s=vr.substitute(s,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,s=vr.substitute(s,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,a=vr.substitute(a,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,a=vr.substitute(a,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=vr.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=vr.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(s=vr.substitute(s,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,s=vr.substitute(s,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=s,e.Geometry=a,e.Fragment=i},e.replaceShaderTCoord=function(e,n,r){if(t.lastBoundBO.getCABO().getTCoordOffset()){var s=e.Vertex,a=e.Geometry,i=e.Fragment;if(t.drawingEdges)return;s=vr.substitute(s,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var Q=t.openGLActor.getActiveTextures(),B=2,o=2;if(Q&&Q.length>0&&(B=Q[0].getComponents(),Q[0].getTarget()===t.context.TEXTURE_CUBE_MAP&&(o=3)),t.renderable.getColorTextureMap()&&(B=t.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),o=2),2===o){if(s=vr.substitute(s,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,a=vr.substitute(a,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,a=vr.substitute(a,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=vr.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,Q&&Q.length>=1)switch(B){case 1:i=vr.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=vr.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=vr.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);").result}}else switch(s=vr.substitute(s,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,a=vr.substitute(a,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,a=vr.substitute(a,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=vr.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,B){case 1:i=vr.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=vr.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=vr.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);").result}e.Vertex=s,e.Geometry=a,e.Fragment=i}},e.replaceShaderClip=function(e,n,r){var s=e.Vertex,a=e.Fragment;if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(B.b.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),i=6),s=vr.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,s=vr.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,a=vr.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,a=vr.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=s,e.Fragment=a},e.getCoincidentParameters=function(e,n){var r=null,s=n.getProperty();if(t.renderable.getResolveCoincidentTopology()||s.getEdgeVisibility()&&s.getRepresentation()===us.SURFACE){var a=t.lastBoundBO.getPrimitiveType();a===ds.Points||s.getRepresentation()===us.POINTS?r=t.renderable.getCoincidentTopologyPointOffsetParameter():a===ds.Lines||s.getRepresentation()===us.WIREFRAME?r=t.renderable.getCoincidentTopologyLineOffsetParameters():a!==ds.Tris&&a!==ds.TriStrips||(r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()),a!==ds.TrisEdges&&a!==ds.TriStripsEdges||((r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,r.offset/=2)}return r},e.replaceShaderPicking=function(e,t,n){var r=e.Fragment;r=vr.substitute(r,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,r=vr.substitute(r,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=r},e.replaceShaderValues=function(n,r,s){if(e.replaceShaderColor(n,r,s),e.replaceShaderNormal(n,r,s),e.replaceShaderLight(n,r,s),e.replaceShaderTCoord(n,r,s),e.replaceShaderPicking(n,r,s),e.replaceShaderClip(n,r,s),e.replaceShaderCoincidentOffset(n,r,s),e.replaceShaderPositionVC(n,r,s),t.haveSeenDepthRequest){var a=n.Fragment;a=vr.substitute(a,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,a=vr.substitute(a,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=a}},e.getNeedToRebuildShaders=function(n,r,s){var a=0,i=0,Q=n.getPrimitiveType(),B=t.currentInput,o=!1,l=B.getPointData().getNormals(),F=B.getCellData().getNormals(),U=s.getProperty().getInterpolation()===Is.FLAT,c=s.getProperty().getRepresentation(),g=e.getOpenGLMode(c,Q);if(g===t.context.TRIANGLES||F&&!l||!U&&l?o=!0:U||g!==t.context.LINES||(o=!0),s.getProperty().getLighting()&&o){a=0;for(var d=r.getLightsByReference(),u=0;u0&&(i++,0===a&&(a=1)),1===a&&(i>1||1!==I.getIntensity()||!I.lightTypeIsHeadLight())&&(a=2),a<3&&I.getPositional()&&(a=3)}}var m=!1,C=t.lastBoundBO.getReferenceByName("lastLightComplexity"),b=t.lastBoundBO.getReferenceByName("lastLightCount");return C===a&&b===i||(t.lastBoundBO.set({lastLightComplexity:a},!0),t.lastBoundBO.set({lastLightCount:i},!0),m=!0),!!(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===n.getProgram()||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){var a=t.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||ys("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&a>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||ys("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),t.renderable.getCustomShaderAttributes().forEach((function(e,r){n.getProgram().isAttributeUsed("".concat(e,"MC"))&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"".concat(e,"MC"),n.getCABO().getCustomData()[r].offset,n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getCustomData()[r].components,!1)||ys("Error setting ".concat(e,"MC in shader VAO.")))})),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||ys("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||ys("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(B.b.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),i=6);for(var Q=[],o=0;o0){var F=l.getColorByReference(),U=l.getIntensity();t.lightColor[0]=F[0]*U,t.lightColor[1]=F[1]*U,t.lightColor[2]=F[2]*U;var c=l.getDirection(),g=n.getActiveCamera().getViewMatrix(),d=Object(Q.a)(c);l.lightTypeIsSceneLight()&&(d[0]=g[0]*c[0]+g[1]*c[1]+g[2]*c[2],d[1]=g[4]*c[0]+g[5]*c[1]+g[6]*c[2],d[2]=g[8]*c[0]+g[9]*c[1]+g[10]*c[2],Object(b.x)(d)),t.lightDirection[0]=d[0],t.lightDirection[1]=d[1],t.lightDirection[2]=d[2],t.lightHalfAngle[0]=-t.lightDirection[0],t.lightHalfAngle[1]=-t.lightDirection[1],t.lightHalfAngle[2]=1-t.lightDirection[2],Object(b.x)(t.lightDirection),a.setUniform3fArray("lightColor".concat(i),t.lightColor),a.setUniform3fArray("lightDirectionVC".concat(i),t.lightDirection),a.setUniform3fArray("lightHalfAngleVC".concat(i),t.lightHalfAngle),i++}}if(!(s<3)){var u=n.getActiveCamera().getViewMatrix();Object(x.j)(u,u),i=0;for(var I=0;I0){var C=m.getTransformedPosition(),y=Object(G.f)(C[0],C[1],C[2]);Object(G.q)(y,y,u),a.setUniform3fArray("lightAttenuation".concat(i),m.getAttenuationValuesByReference()),a.setUniformi("lightPositional".concat(i),m.getPositional()),a.setUniformf("lightExponent".concat(i),m.getExponent()),a.setUniformf("lightConeAngle".concat(i),m.getConeAngle()),a.setUniform3fArray("lightPositionVC".concat(i),[y[0],y[1],y[2]]),i++}}}}},e.setCameraShaderParameters=function(e,r,s){var a=e.getProgram(),i=t.openGLCamera.getKeyMatrices(r),Q=r.getActiveCamera(),B=t.openGLCamera.getKeyMatrixTime().getMTime(),o=a.getLastCameraMTime(),l=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,F=s.getIsIdentity(),U=F?{mcwc:null,normalMatrix:null}:t.openGLActor.getKeyMatrices();a.setUniformMatrix("MCPCMatrix",n([i.wcpc,U.mcwc,l],x.t,t.tmpMat4)),a.isUniformUsed("MCVCMatrix")&&a.setUniformMatrix("MCVCMatrix",n([i.wcvc,U.mcwc,l],x.t,t.tmpMat4)),a.isUniformUsed("normalMatrix")&&a.setUniformMatrix3x3("normalMatrix",n([i.normalMatrix,U.normalMatrix],Ke,t.tmpMat3)),o!==B&&(a.isUniformUsed("cameraParallel")&&a.setUniformi("cameraParallel",Q.getParallelProjection()),a.setLastCameraMTime(B)),F||a.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,n,r){var s=e.getProgram(),a=r.getProperty(),i=a.getOpacity();s.setUniformf("opacityUniform",i);var Q=t.drawingEdges?a.getEdgeColorByReference():a.getAmbientColorByReference();s.setUniform3fArray("ambientColorUniform",Q),s.setUniformf("ambient",a.getAmbient());var B=t.drawingEdges?a.getEdgeColorByReference():a.getDiffuseColorByReference();if(s.setUniform3fArray("diffuseColorUniform",B),s.setUniformf("diffuse",a.getDiffuse()),!(t.lastBoundBO.getReferenceByName("lastLightComplexity")<1)){var o=a.getSpecularColorByReference();s.setUniform3fArray("specularColorUniform",o),s.setUniformf("specular",a.getSpecular()),s.setUniformf("specularPowerUniform",a.getSpecularPower())}},e.renderPieceStart=function(n,r){t.primitiveIDOffset=0,t.openGLRenderer.getSelector()&&(t.openGLRenderer.getSelector().getCurrentPass(),t.openGLRenderer.getSelector().renderProp(r)),e.updateBufferObjects(n,r),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),t.lastBoundBO=null},e.renderPieceDraw=function(n,r){var s=r.getProperty().getRepresentation(),a=t.context,i=r.getProperty().getEdgeVisibility()&&s===us.SURFACE;a.lineWidth(r.getProperty().getLineWidth());for(var Q=ds.Start;Q2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gs,n),Lt.extend(e,t,n),gs.implementReplaceShaderCoincidentOffset(e,t,n),t.primitives=[],t.primTypes=ds,t.tmpMat3=He(),t.tmpMat4=Object(x.h)();for(var r=ds.Start;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,As,n),B.b.obj(e,t),t.properties={},B.b.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Ls(e,t)}var Es=function(e){for(var t=1;t0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(n){t.currentPass===vs.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+t.idOffset),t.props.push(n))},e.renderCompositeIndex=function(n){t.currentPass===vs.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(n+t.idOffset)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.getPropFromID=function(e){return e>=0&&et.area[2]||n[1]t.area[3])return null;var i=[n[0]-t.area[0],n[1]-t.area[1]],Q=e.convert(i[0],i[1],t.pixBuffer[vs.ACTOR_PASS]);if(Q<=0)return null;var B={valid:!0};B.propID=Q-t.idOffset,B.prop=e.getPropFromID(B.propID);var o=e.convert(i[0],i[1],t.pixBuffer[vs.COMPOSITE_INDEX_PASS]);if((o<0||o>16777215)&&(o=0),B.compositeID=o-t.idOffset,t.captureZValues){var l=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);B.zValue=(256*t.zBuffer[l]+t.zBuffer[l+1])/65535,B.displayPosition=n}return B}var F=[n[0],n[1]],U=[0,0],c=e.getPixelInformation(n,0,s);if(c&&c.valid)return c;for(var g=1;gg?F[1]-g:0;d<=F[1]+g;++d){if(U[1]=d,F[0]>=g&&(U[0]=F[0]-g,(c=e.getPixelInformation(U,0,s))&&c.valid))return c;if(U[0]=F[0]+g,(c=e.getPixelInformation(U,0,s))&&c.valid)return c}for(var u=F[0]>=g?F[0]-(g-1):0;u<=F[0]+(g-1);++u){if(U[0]=u,F[1]>=g&&(U[1]=F[1]-g,(c=e.getPixelInformation(U,0,s))&&c.valid))return c;if(U[1]=F[1]+g,(c=e.getPixelInformation(U,0,s))&&c.valid)return c}}return s[0]=n[0],s[1]=n[1],null},e.convertSelection=function(e,n){var r=[],s=0;return n.forEach((function(n,a){var i=Es.newInstance();switch(i.setContentType(Js.INDICES),e){case Xs.FIELD_ASSOCIATION_CELLS:i.setFieldType(Ws.CELL);break;case Xs.FIELD_ASSOCIATION_POINTS:i.setFieldType(Ws.POINT);break;default:Hs("Unknown field association")}i.getProperties().propID=n.info.propID,i.getProperties().prop=n.info.prop,i.getProperties().compositeID=n.info.compositeID,i.getProperties().pixelCount=n.pixelCount,t.captureZValues&&(i.getProperties().displayPosition=[n.info.displayPosition[0],n.info.displayPosition[1],n.info.zValue],i.getProperties().worldPosition=t.openGLRenderWindow.displayToWorld(n.info.displayPosition[0],n.info.displayPosition[1],n.info.zValue,t.renderer)),i.setSelectionList(n.attributeIDs),r[s]=i,s++})),r},e.getInfoHash=function(e){return"".concat(e.propID," ").concat(e.compositeID)},e.generateSelection=function(n,r,s,a){for(var i=Math.floor(n),Q=Math.floor(r),B=Math.floor(s),o=Math.floor(a),l=new Map,F=[0,0],U=Q;U<=o;U++)for(var c=i;c<=B;c++){var g=[c,U],d=e.getPixelInformation(g,0,F);if(d&&d.valid){var u=e.getInfoHash(d);if(l.has(u)){var I=l.get(u);I.pixelCount++,t.captureZValues&&d.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ts,n),B.b.obj(e,t),t.area=[0,0,0,0],t.propColorValue=[0,0,0],t.props=[],B.b.setGet(e,t,["fieldAssociation","renderer","currentPass","captureZValues"]),B.b.setGetArray(e,t,["area"],4),B.b.setGetArray(e,t,["propColorValue"],3),B.b.event(e,t,"event"),ks(e,t)}var Ys=function(e){for(var t=1;t0){var a=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(a=vr.substitute(a,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,a=vr.substitute(a,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=a}n.replaceShaderNormal(e,r,s)},e.replaceShaderColor=function(e,r,s){if(t.hardwareSupport&&t.renderable.getColorArray()){var a=e.Vertex,i=e.Geometry,Q=e.Fragment,B=t.lastBoundBO.getReferenceByName("lastLightComplexity"),o=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];B&&(o=o.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var l=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];B&&(l=l.concat([" vec3 specularColor;"," float specularPower;"])),l=l.concat([" opacity = opacityUniform;"]),B&&(l=l.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(o=o.concat(["varying vec4 vertexColorVSOutput;"]),a=vr.substitute(a,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,a=vr.substitute(a,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=vr.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=vr.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,l=l.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),Q=vr.substitute(Q,"//VTK::Color::Impl",l).result,Q=vr.substitute(Q,"//VTK::Color::Dec",o).result,e.Vertex=a,e.Geometry=i,e.Fragment=Q}n.replaceShaderColor(e,r,s)},e.replaceShaderPositionVC=function(e,r,s){if(t.hardwareSupport){var a=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=vr.substitute(a,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,a=vr.substitute(a,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(a=vr.substitute(a,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,a=vr.substitute(a,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=a}n.replaceShaderPositionVC(e,r,s)},e.replaceShaderPicking=function(e,r,s){if(t.hardwareSupport){var a=e.Fragment,i=e.Vertex;i=vr.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=vr.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,a=vr.substitute(a,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,a=vr.substitute(a,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,e.Fragment=a}else n.replaceShaderPicking(e,r,s)},e.updateGlyphShaderParameters=function(n,r,s,a,i,Q,B,o){var l=s.getProgram();if(n){var F=t.normalMatrix,U=Q,c=9*B,g=t.tmpMat3,d=F[0],u=F[1],I=F[2],m=F[3],C=F[4],b=F[5],y=F[6],S=F[7],Z=F[8],x=U[c],G=U[c+1],h=U[c+2],p=U[c+3],R=U[c+4],V=U[c+5],L=U[c+6],A=U[c+7],N=U[c+8];g[0]=x*d+G*m+h*y,g[1]=x*u+G*C+h*S,g[2]=x*I+G*b+h*Z,g[3]=p*d+R*m+V*y,g[4]=p*u+R*C+V*S,g[5]=p*I+R*b+V*Z,g[6]=L*d+A*m+N*y,g[7]=L*u+A*C+N*S,g[8]=L*I+A*b+N*Z,l.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*B),l.setUniformMatrix("MCPCMatrix",t.tmpMat4),r&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*B),l.setUniformMatrix("MCVCMatrix",t.tmpMat4)),a){var E=a.getData();t.tmpColor[0]=E[4*B]/255,t.tmpColor[1]=E[4*B+1]/255,t.tmpColor[2]=E[4*B+2]/255,l.setUniform3fArray("ambientColorUniform",t.tmpColor),l.setUniform3fArray("diffuseColorUniform",t.tmpColor)}o&&l.setUniform3fArray("mapperIndex",o.getPropColorValue())},e.renderPieceDraw=function(n,r){var s=r.getProperty().getRepresentation(),a=t.context,i=r.getProperty().getEdgeVisibility()&&s===zs.SURFACE,Q=t.openGLCamera.getKeyMatrices(n),B=t.openGLActor.getKeyMatrices();we(t.normalMatrix,Q.normalMatrix,B.normalMatrix),Object(x.l)(t.mcpcMatrix,Q.wcpc,B.mcwc),Object(x.l)(t.mcvcMatrix,Q.wcvc,B.mcwc);var o=t.renderable.getMatrixArray(),l=t.renderable.getNormalArray(),F=t.renderable.getColorArray(),U=o.length/16,c=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===Ks.COMPOSITE_INDEX_PASS&&(c=!0);for(var g=t.primTypes.Start;ge.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime()))return e.getProgram().isAttributeUsed("gMatrix")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.matrixBuffer,"gMatrix",0,64,t.context.FLOAT,4,!1,1)||Os("Error setting gMatrix in shader VAO."):e.getVAO().removeAttributeArray("gMatrix"),e.getProgram().isAttributeUsed("gNormal")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.normalBuffer,"gNormal",0,36,t.context.FLOAT,3,!1,1)||Os("Error setting gNormal in shader VAO."):e.getVAO().removeAttributeArray("gNormal"),e.getProgram().isAttributeUsed("gColor")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.colorBuffer,"gColor",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Os("Error setting gColor in shader VAO."):e.getVAO().removeAttributeArray("gColor"),e.getProgram().isAttributeUsed("mapperIndexVS")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.pickBuffer,"mapperIndexVS",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Os("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),n.setMapperShaderParameters(e,r,s),void e.getAttributeUpdateTime().modified();n.setMapperShaderParameters(e,r,s)},e.getNeedToRebuildBufferObjects=function(e,r){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(s,Ps.ARRAY_BUFFER),t.normalBuffer.upload(a,Ps.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),Ps.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var Q=s.length/16,B=new Uint8Array(4*Q),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$s,n),ps.extend(e,t,n),t.tmpMat3=He(),t.normalMatrix=He(),t.mcpcMatrix=Object(x.h)(),t.mcvcMatrix=Object(x.h)(),t.tmpColor=[],t.glyphBOBuildTime={},B.b.obj(t.glyphBOBuildTime,{mtime:0}),qs(e,t)}var ta={newInstance:B.b.newInstance(ea,"vtkOpenGLGlyph3DMapper"),extend:ea},na={SlicingMode:{NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5}},ra={NEAREST:0,LINEAR:1},sa={InterpolationType:ra},aa=B.b.vtkErrorMacro,ia=na.SlicingMode;function Qa(e,t,n){if(t.apply(e)){var r=e.getIndependentComponents();return"".concat(e.getMTime(),"-").concat(r,"-").concat(n)}return"0"}function Ba(e,t){t.classHierarchy.push("vtkOpenGLImageMapper"),e.buildPass=function(n){if(n){t.openGLImageSlice=e.getFirstAncestorOfType("vtkOpenGLImageSlice"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.pwfTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera()),t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(r.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.getCoincidentParameters=function(e,n){return t.renderable.getResolveCoincidentTopology()?t.renderable.getCoincidentTopologyPolygonOffsetParameters():null},e.render=function(){var n=t.openGLImageSlice.getRenderable(),r=t.openGLRenderer.getRenderable();e.renderPiece(r,n)},e.buildShaders=function(t,n,r){e.getShaderTemplate(t,n,r),e.replaceShaderValues(t,n,r)},e.getShaderTemplate=function(e,t,n){e.Vertex=Us,e.Fragment=cs,e.Geometry=""},e.replaceShaderValues=function(n,r,s){var a=n.Vertex,i=n.Fragment;a=vr.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=vr.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,a=vr.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,a=vr.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;var Q=t.openGLTexture.getComponents(),B=s.getProperty().getIndependentComponents(),o=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(B){for(var l=1;ln.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||aa("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),t.context.FALSE)||aa("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());var a=t.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",a);var i=t.openGLTexture.getComponents(),Q=s.getProperty().getIndependentComponents();if(Q)for(var B=0;B1?1:0;var Y=a.getData(),w=null;if(f===ia.I){w=new Y.constructor(X[2]*X[1]*B);for(var O=0,z=0;z2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oa,n),Lt.extend(e,t,n),gs.implementReplaceShaderCoincidentOffset(e,t,n),t.tris=Fs.newInstance(),t.openGLTexture=Pt.newInstance(),t.colorTexture=Pt.newInstance(),t.pwfTexture=Pt.newInstance(),t.imagemat=Object(x.h)(),B.b.setGet(e,t,[]),t.VBOBuildTime={},B.b.obj(t.VBOBuildTime),Ba(e,t)}var Fa={newInstance:B.b.newInstance(la,"vtkOpenGLImageMapper"),extend:la};function Ua(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(n){if(t.renderable&&t.renderable.getVisibility()&&n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach((function(e){e.traverse(n)})),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach((function(e){e.traverse(n)})),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,n){return e.opaquePass(t,n)},e.opaquePass=function(n,r){n&&(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Object(x.d)(t.keyMatrices.mcwc,t.renderable.getMatrix()),Object(x.j)(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}var ca={context:null,keyMatrixTime:null,keyMatrices:null};function ga(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ca,n),Lt.extend(e,t,n),t.keyMatrixTime={},B.b.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Object(x.h)()},B.b.setGet(e,t,["context"]),Ua(e,t)}var da={newInstance:B.b.newInstance(ga,"vtkOpenGLImageSlice"),extend:ga},ua=B.b.vtkDebugMacro;function Ia(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var s=t.openGLRenderer.getAspectRatio(),a=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),Q=null;if(t.renderable.getUseZValues()){var B=r.getZBufferTexture(),o=Math.floor(B.getWidth()),l=Math.floor(B.getHeight()),F=t.openGLRenderWindow.getContext();B.bind();var U=r.getFramebuffer();U?U.saveCurrentBindingsAndBuffers():ua("No framebuffer to save/restore");var c=F.createFramebuffer();F.bindFramebuffer(F.FRAMEBUFFER,c),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,B.getHandle(),0),F.checkFramebufferStatus(F.FRAMEBUFFER)===F.FRAMEBUFFER_COMPLETE&&(Q=new Uint8Array(o*l*4),F.viewport(0,0,o,l),F.readPixels(0,0,o,l,F.RGBA,F.UNSIGNED_BYTE,Q)),U&&U.restorePreviousBindingsAndBuffers(),F.deleteFramebuffer(c)}t.renderable.invokeCallback(t.renderable.getInputData(),a,s,i,Q)},e.queryPass=function(e,n){e&&(t.renderable.getUseZValues(),n.setDepthRequested(!0))}}var ma={};function Ca(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ma,n),Lt.extend(e,t,n),Ia(e,t)}var ba={newInstance:B.b.newInstance(Ca,"vtkOpenGLPixelSpaceCallbackMapper"),extend:Ca},ya=B.b.vtkDebugMacro;function Sa(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(ya("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(n){if(n){var r=0,s=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),r|=s.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(s.clearDepth(1),r|=s.DEPTH_BUFFER_BIT,s.depthMask(!0));var a=e.getTiledSizeAndOrigin();s.enable(s.SCISSOR_TEST),s.scissor(a.lowerLeftU,a.lowerLeftV,a.usize,a.vsize),s.viewport(a.lowerLeftU,a.lowerLeftV,a.usize,a.vsize),s.colorMask(!0,!0,!0,!0),s.clear(r),s.enable(s.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),n=t.renderable.getViewportByReference();return e[0]*(n[2]-n[0])/((n[3]-n[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),n=[0,0,1,1],r=Object(b.E)(e[0]-n[0],0,1),s=Object(b.E)(e[1]-n[1],0,1),a=t.parent.normalizedDisplayToDisplay(r,s),i=Math.round(a[0]),Q=Math.round(a[1]),B=Object(b.E)(e[2]-n[0],0,1),o=Object(b.E)(e[3]-n[1],0,1);B>n[2]-n[0]&&(B=n[2]-n[0]),o>n[3]-n[1]&&(o=n[3]-n[1]);var l=t.parent.normalizedDisplayToDisplay(B,o),F=Math.round(l[0])-i,U=Math.round(l[1])-Q;return F<0&&(F=0),U<0&&(U=0),{usize:F,vsize:U,lowerLeftU:i,lowerLeftV:Q}},e.clear=function(){var n=0,r=t.context;if(!t.renderable.getTransparent()){var s=t.renderable.getBackgroundByReference();t.context.clearColor(s[0],s[1],s[2],s[3]),n|=r.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,r.depthMask(!0)),r.colorMask(!0,!0,!0,!0);var a=e.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(a.lowerLeftU,a.lowerLeftV,a.usize,a.vsize),r.viewport(a.lowerLeftU,a.lowerLeftV,a.usize,a.vsize),r.clear(n),r.enable(r.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))}}var Za={context:null,openGLRenderWindow:null,selector:null};function xa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Za,n),Lt.extend(e,t,n),B.b.get(e,t,["shaderCache"]),B.b.setGet(e,t,["selector"]),Sa(e,t)}var Ga={newInstance:B.b.newInstance(xa,"vtkOpenGLRenderer"),extend:xa},ha=B.b.vtkErrorMacro;function pa(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(n){if(n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera())}},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},e.opaquePass=function(n,r){if(n&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.openGLRenderWindow.enableDepthMask(),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var s=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",s);var a=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(a),Q=Object(x.h)();if(Object(x.g)(Q,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",Q),"box"===t.lastFormat){var B=a.getActiveCamera().getPosition();t.tris.getProgram().setUniform3f("camPos",B[0],B[1],B[2])}t.tris.getVAO().bind(),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.openGLTexture.deactivate()}},e.updateBufferObjects=function(){if(!t.tris.getCABO().getElementCount()){for(var e=new Float32Array(12),n=0;n<4;n++)e[3*n]=n%2*2-1,e[3*n+1]=n>1?1:-1,e[3*n+2]=1;var r=o.a.newInstance({numberOfComponents:3,values:e});r.setName("points");var s=new Uint16Array(8);s[0]=3,s[1]=0,s[2]=1,s[3]=3,s[4]=3,s[5]=0,s[6]=3,s[7]=2;var a=o.a.newInstance({numberOfComponents:1,values:s});t.tris.getCABO().createVBO(a,"polys",yn.SURFACE,{points:r,cellOffset:0})}t.renderable.getFormat()!==t.lastFormat&&(t.lastFormat=t.renderable.getFormat(),"box"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec3 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = wpos.xyz/wpos.w;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec3 TexCoords;\n uniform samplerCube sbtexture;\n uniform vec3 camPos;\n void main () {\n // skybox looks from inside out\n // which means we have to adjust\n // our tcoords. Otherwise text would\n // be flipped\n vec3 tc = normalize(TexCoords - camPos);\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\n {\n tc = vec3(1.0, 1.0, -1.0) * tc;\n }\n else\n {\n tc = vec3(-1.0, 1.0, 1.0) * tc;\n }\n gl_FragData[0] = textureCube(sbtexture, tc);\n }","")),"background"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec2 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec2 TexCoords;\n uniform sampler2D sbtexture;\n void main () {\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\n }","")),t.tris.getShaderSourceTime().modified(),t.tris.getVAO().bind(),t.tris.getVAO().addAttributeArray(t.tris.getProgram(),t.tris.getCABO(),"vertexMC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ha("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||ha("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var Ra={context:null};function Va(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ra,n),Lt.extend(e,t,n),t.openGLTexture=Pt.newInstance(),t.tris=Fs.newInstance(),t.keyMatrixTime={},B.b.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:He(),mcwc:Object(x.h)()},B.b.setGet(e,t,["context"]),B.b.get(e,t,["activeTextures"]),pa(e,t)}var La={newInstance:B.b.newInstance(Va),extend:Va};function Aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Na=B.b.vtkErrorMacro;function Ea(e,t){t.classHierarchy.push("vtkOpenGLSphereMapper");var n=function(e){for(var t=1;t radiusVCVSOutput*3.0) {\n"," EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"," }\n"," EyePos = EyePos - centerVCVSOutput;\n"," EyePos = EyePos/radiusVCVSOutput;\n"," float b = 2.0*dot(EyePos,EyeDir);\n"," float c = dot(EyePos,EyePos) - 1.0;\n"," float d = b*b - 4.0*c;\n"," vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"," if (d < 0.0) { discard; }\n"," else {\n"," float t = (-b - invertedDepth*sqrt(d))*0.5;\n"," normalVCVSOutput = invertedDepth*normalize(EyePos + t*EyeDir);\n"," vertexVC.xyz = normalVCVSOutput*radiusVCVSOutput + centerVCVSOutput;\n"," }\n"," vec4 pos = VCPCMatrix * vertexVC;\n",Q]).result,i=vr.substitute(i,"//VTK::Normal::Impl","").result,t.haveSeenDepthRequest&&(i=vr.substitute(i,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),e.Vertex=a,e.Fragment=i,n.replaceShaderValues(e,r,s)},e.setMapperShaderParameters=function(e,r,s){e.getCABO().getElementCount()&&(t.VBOBuildTime>e.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime())&&e.getProgram().isAttributeUsed("offsetMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"offsetMC",12,e.getCABO().getStride(),t.context.FLOAT,2,!1)||Na("Error setting 'offsetMC' in shader VAO.")),e.getProgram().isUniformUsed("invertedDepth")&&e.getProgram().setUniformf("invertedDepth",t.invert?-1:1),n.setMapperShaderParameters(e,r,s)},e.setCameraShaderParameters=function(e,n,r){var s=e.getProgram(),a=n.getActiveCamera(),i=t.openGLCamera.getKeyMatrices(n);if(s.isUniformUsed("VCPCMatrix")&&s.setUniformMatrix("VCPCMatrix",i.vcpc),s.isUniformUsed("MCVCMatrix"))if(r.getIsIdentity())s.setUniformMatrix("MCVCMatrix",i.wcvc);else{var Q=t.openGLActor.getKeyMatrices(),B=Object(x.h)();Object(x.l)(B,i.wcvc,Q.mcwc),s.setUniformMatrix("MCVCMatrix",B)}s.isUniformUsed("cameraParallel")&&e.getProgram().setUniformi("cameraParallel",a.getParallelProjection())},e.getOpenGLMode=function(e,n){return t.context.TRIANGLES},e.buildBufferObjects=function(e,n){var r=t.currentInput;if(null!==r){t.renderable.mapScalars(r,1);var s=t.renderable.getColorMapColors(),a=t.primitives[t.primTypes.Tris].getCABO(),i=r.getPointData(),Q=r.getPoints(),B=Q.getNumberOfPoints(),o=Q.getData(),l=null;null!=t.renderable.getScaleArray()&&i.hasArray(t.renderable.getScaleArray())&&(l=i.getArray(t.renderable.getScaleArray()).getData());var F=null,U=0,c=null;s?(U=s.getNumberOfComponents(),a.setColorOffset(0),a.setColorBOStride(4),F=s.getData(),c=new Uint8Array(3*B*4),a.getColorBO()||a.setColorBO(_r.newInstance()),a.getColorBO().setOpenGLRenderWindow(t.openGLRenderWindow)):a.getColorBO()&&a.setColorBO(null),a.setColorComponents(U);var g=new Float32Array(5*B*3);a.setStride(20);for(var d=Math.cos(Object(b.A)(30)),u=0,I=0,m=0,C=0,y=0;y2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fa,n),ps.extend(e,t,n),Ea(e,t)}var va={newInstance:B.b.newInstance(Da,"vtkOpenGLSphereMapper"),extend:Da};function Ja(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Wa=B.k;function Xa(e,t){t.classHierarchy.push("vtkOpenGLStickMapper");var n=function(e){for(var t=1;t radiusVCVSOutput*3.0) {\n"," EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"," }\n"," EyePos = EyePos - centerVCVSOutput;\n"," vec3 base1;\n"," if (abs(orientVCVSOutput.z) < 0.99) {\n"," base1 = normalize(cross(orientVCVSOutput,vec3(0.0,0.0,1.0))); }\n"," else {\n"," base1 = normalize(cross(orientVCVSOutput,vec3(0.0,1.0,0.0))); }\n"," vec3 base2 = cross(orientVCVSOutput,base1);\n"," EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVCVSOutput));\n"," EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVCVSOutput));\n"," EyePos = EyePos/radiusVCVSOutput;\n"," float a = EyeDir.x*EyeDir.x + EyeDir.y*EyeDir.y;\n"," float b = 2.0*(EyePos.x*EyeDir.x + EyePos.y*EyeDir.y);\n"," float c = EyePos.x*EyePos.x + EyePos.y*EyePos.y - 1.0;\n"," float d = b*b - 4.0*a*c;\n"," vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"," if (d < 0.0) { discard; }\n"," else {\n"," float t = (-b - sqrt(d))/(2.0*a);\n"," float tz = EyePos.z + t*EyeDir.z;\n"," vec3 iPoint = EyePos + t*EyeDir;\n"," if (abs(iPoint.z)*radiusVCVSOutput > lengthVCVSOutput*0.5) {\n"," float t2 = (-b + sqrt(d))/(2.0*a);\n"," float tz2 = EyePos.z + t2*EyeDir.z;\n"," if (tz2*radiusVCVSOutput > lengthVCVSOutput*0.5 || tz*radiusVCVSOutput < -0.5*lengthVCVSOutput) { discard; }\n"," else {\n"," normalVCVSOutput = orientVCVSOutput;\n"," float t3 = (lengthVCVSOutput*0.5/radiusVCVSOutput - EyePos.z)/EyeDir.z;\n"," iPoint = EyePos + t3*EyeDir;\n"," vertexVC.xyz = radiusVCVSOutput*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"," }\n"," }\n"," else {\n"," normalVCVSOutput = iPoint.x*base1 + iPoint.y*base2;\n"," vertexVC.xyz = radiusVCVSOutput*(normalVCVSOutput + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"," }\n"," }\n"," vec4 pos = VCPCMatrix * vertexVC;\n",Q]).result,i=vr.substitute(i,"//VTK::Normal::Impl","").result,t.haveSeenDepthRequest&&(i=vr.substitute(i,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),e.Vertex=a,e.Fragment=i,n.replaceShaderValues(e,r,s)},e.setMapperShaderParameters=function(e,r,s){e.getCABO().getElementCount()&&(t.VBOBuildTime>e.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime())&&(e.getProgram().isAttributeUsed("orientMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"orientMC",12,e.getCABO().getStride(),t.context.FLOAT,3,!1)||Wa("Error setting 'orientMC' in shader VAO.")),e.getProgram().isAttributeUsed("offsetMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO().getColorBO(),"offsetMC",0,e.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,3,!0)||Wa("Error setting 'offsetMC' in shader VAO.")),e.getProgram().isAttributeUsed("radiusMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"radiusMC",24,e.getCABO().getStride(),t.context.FLOAT,1,!1)||Wa("Error setting 'radiusMC' in shader VAO."))),n.setMapperShaderParameters(e,r,s)},e.setCameraShaderParameters=function(e,n,r){var s=e.getProgram(),a=n.getActiveCamera(),i=t.openGLCamera.getKeyMatrices(n);if(s.isUniformUsed("VCPCMatrix")&&s.setUniformMatrix("VCPCMatrix",i.vcpc),r.getIsIdentity())s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",i.wcvc),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",i.normalMatrix);else{var Q=t.openGLActor.getKeyMatrices(),B=Object(x.h)();if(s.isUniformUsed("MCVCMatrix")&&(Object(x.l)(B,i.wcvc,Q.mcwc),s.setUniformMatrix("MCVCMatrix",B)),s.isUniformUsed("normalMatrix")){var o=He();we(o,i.normalMatrix,Q.normalMatrix),s.setUniformMatrix3x3("normalMatrix",o)}}s.isUniformUsed("cameraParallel")&&e.getProgram().setUniformi("cameraParallel",a.getParallelProjection())},e.getOpenGLMode=function(e,n){return t.context.TRIANGLES},e.buildBufferObjects=function(e,n){var r=t.currentInput;if(null!==r){t.renderable.mapScalars(r,1);var s=t.renderable.getColorMapColors(),a=t.primitives[t.primTypes.Tris].getCABO(),i=r.getPointData(),Q=r.getPoints(),B=Q.getNumberOfPoints(),o=Q.getData(),l=null,F=0;a.setColorBOStride(4),a.getColorBO()||a.setColorBO(_r.newInstance()),a.getColorBO().setOpenGLRenderWindow(t.openGLRenderWindow),s&&(F=s.getNumberOfComponents(),a.setColorOffset(4),l=s.getData(),a.setColorBOStride(8)),a.setColorComponents(F),a.setStride(28);var U=new Float32Array(7*B*12),c=new Uint8Array(12*B*(l?8:4)),g=null,d=null;null!=t.renderable.getScaleArray()&&i.hasArray(t.renderable.getScaleArray())&&(g=i.getArray(t.renderable.getScaleArray()).getData()),null!=t.renderable.getOrientationArray()&&i.hasArray(t.renderable.getOrientationArray())?d=i.getArray(t.renderable.getOrientationArray()).getData():Wa(["Error setting orientationArray.\n","You have to specify the stick orientation"]);for(var u=[0,1,3,0,3,2,2,3,5,2,5,4],I=0,m=0,C=0,b=0,y=0;y=4?255:0,c[b++]=u[x]>=2?255:0,c[b++]=255,m=y*F,l&&(c[b++]=l[m],c[b++]=l[m+1],c[b++]=l[m+2],c[b++]=l[m+3])}a.setElementCount(C/7),a.upload(U,Mr.ARRAY_BUFFER),a.getColorBO().upload(c,Mr.ARRAY_BUFFER),t.VBOBuildTime.modified()}}}var Ha={};function ka(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ha,n),ps.extend(e,t,n),Xa(e,t)}var Ta={newInstance:Object(B.e)(ka,"vtkOpenGLStickMapper"),extend:ka};function Ma(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementVolumeCount()}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.volumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0))},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Object(x.d)(t.MCWCMatrix,t.renderable.getMatrix()),Object(x.j)(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?Te(t.normalMatrix):(ke(t.normalMatrix,t.MCWCMatrix),Ye(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}var Ya={};function wa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ya,n),Lt.extend(e,t,n),t.keyMatrixTime={},B.b.obj(t.keyMatrixTime,{mtime:0}),t.normalMatrix=He(),t.MCWCMatrix=Object(x.h)(),B.b.setGet(e,t,["context"]),Ma(e,t)}var Oa={newInstance:B.b.newInstance(wa,"vtkOpenGLVolume"),extend:wa},za={NEAREST:0,LINEAR:1,FAST_LINEAR:2},Pa={FRACTIONAL:0,PROPORTIONAL:1},Ka={InterpolationType:za,OpacityMode:Pa},ja={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3},_a={BlendMode:ja};function qa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var $a=B.b.vtkWarningMacro,ei=B.b.vtkErrorMacro;function ti(e,t){if(e.length!==t.length)return!1;for(var n=0;n 0\nuniform float vSpecularPower;\nuniform float vAmbient;\nuniform float vDiffuse;\nuniform float vSpecular;\n//VTK::Light::Dec\n#endif\n\n// possibly define vtkGradientOpacityOn\n//VTK::GradientOpacityOn\n#ifdef vtkGradientOpacityOn\nuniform float goscale0;\nuniform float goshift0;\nuniform float gomin0;\nuniform float gomax0;\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\nuniform float goscale1;\nuniform float goshift1;\nuniform float gomin1;\nuniform float gomax1;\n#if vtkNumComponents >= 3\nuniform float goscale2;\nuniform float goshift2;\nuniform float gomin2;\nuniform float gomax2;\n#endif\n#if vtkNumComponents >= 4\nuniform float goscale3;\nuniform float goshift3;\nuniform float gomin3;\nuniform float gomax3;\n#endif\n#endif\n#endif\n\n// if you want to see the raw tiled\n// data in webgl1 uncomment the following line\n// #define debugtile\n\n// camera values\nuniform float camThick;\nuniform float camNear;\nuniform float camFar;\nuniform int cameraParallel;\n\n// values describing the volume geometry\nuniform vec3 vOriginVC;\nuniform vec3 vSpacing;\nuniform ivec3 volumeDimensions; // 3d texture dimensions\nuniform vec3 vPlaneNormal0;\nuniform float vPlaneDistance0;\nuniform vec3 vPlaneNormal1;\nuniform float vPlaneDistance1;\nuniform vec3 vPlaneNormal2;\nuniform float vPlaneDistance2;\nuniform vec3 vPlaneNormal3;\nuniform float vPlaneDistance3;\nuniform vec3 vPlaneNormal4;\nuniform float vPlaneDistance4;\nuniform vec3 vPlaneNormal5;\nuniform float vPlaneDistance5;\n\n//VTK::ClipPlane::Dec\n\n// opacity and color textures\nuniform sampler2D otexture;\nuniform float oshift0;\nuniform float oscale0;\nuniform sampler2D ctexture;\nuniform float cshift0;\nuniform float cscale0;\n\n// jitter texture\nuniform sampler2D jtexture;\n\n// some 3D texture values\nuniform float sampleDistance;\nuniform vec3 vVCToIJK;\n\n// the heights defined below are the locations\n// for the up to four components of the tfuns\n// the tfuns have a height of 2XnumComps pixels so the\n// values are computed to hit the middle of the two rows\n// for that component\n#ifdef vtkIndependentComponentsOn\n#if vtkNumComponents == 2\nuniform float mix0;\nuniform float mix1;\n#define height0 0.25\n#define height1 0.75\n#endif\n#if vtkNumComponents == 3\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\n#define height0 0.17\n#define height1 0.5\n#define height2 0.83\n#endif\n#if vtkNumComponents == 4\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\nuniform float mix3;\n#define height0 0.125\n#define height1 0.375\n#define height2 0.625\n#define height3 0.875\n#endif\n#endif\n\n#if vtkNumComponents >= 2\nuniform float oshift1;\nuniform float oscale1;\nuniform float cshift1;\nuniform float cscale1;\n#endif\n#if vtkNumComponents >= 3\nuniform float oshift2;\nuniform float oscale2;\nuniform float cshift2;\nuniform float cscale2;\n#endif\n#if vtkNumComponents >= 4\nuniform float oshift3;\nuniform float oscale3;\nuniform float cshift3;\nuniform float cscale3;\n#endif\n\n// declaration for intermixed geometry\n//VTK::ZBuffer::Dec\n\n// Lighting values\n//VTK::Light::Dec\n\n//=======================================================================\n// Webgl2 specific version of functions\n#if __VERSION__ == 300\n\nuniform highp sampler3D texture1;\n\nvec4 getTextureValue(vec3 pos)\n{\n vec4 tmp = texture(texture1, pos);\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.a = tmp.g;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n return tmp;\n}\n\n//=======================================================================\n// WebGL1 specific version of functions\n#else\n\nuniform sampler2D texture1;\n\nuniform float texWidth;\nuniform float texHeight;\nuniform int xreps;\nuniform int xstride;\nuniform int ystride;\n\n// if computing triliear values from multiple z slices\n#ifdef vtkTriliearOn\nvec4 getTextureValue(vec3 ijk)\n{\n float zoff = 1.0/float(volumeDimensions.z);\n vec4 val1 = getOneTextureValue(ijk);\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\n\n float indexZ = float(volumeDimensions)*ijk.z;\n float zmix = indexZ - floor(indexZ);\n\n return mix(val1, val2, zmix);\n}\n\nvec4 getOneTextureValue(vec3 ijk)\n#else // nearest or fast linear\nvec4 getTextureValue(vec3 ijk)\n#endif\n{\n vec3 tdims = vec3(volumeDimensions);\n\n#ifdef debugtile\n vec2 tpos = vec2(ijk.x, ijk.y);\n vec4 tmp = texture2D(texture1, tpos);\n tmp.a = 1.0;\n\n#else\n int z = int(ijk.z * tdims.z);\n int yz = z / xreps;\n int xz = z - yz*xreps;\n\n int tileWidth = volumeDimensions.x/xstride;\n int tileHeight = volumeDimensions.y/ystride;\n\n xz *= tileWidth;\n yz *= tileHeight;\n\n float ni = float(xz) + (ijk.x*float(tileWidth));\n float nj = float(yz) + (ijk.y*float(tileHeight));\n\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\n\n vec4 tmp = texture2D(texture1, tpos);\n\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.g = tmp.a;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n#endif\n\n return tmp;\n}\n\n// End of Webgl1 specific code\n//=======================================================================\n#endif\n\n//=======================================================================\n// compute the normal and gradient magnitude for a position\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\n{\n vec4 result;\n\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\n\n // divide by spacing\n result.xyz /= vSpacing;\n\n result.w = length(result.xyz);\n\n // rotate to View Coords\n result.xyz =\n result.x * vPlaneNormal0 +\n result.y * vPlaneNormal2 +\n result.z * vPlaneNormal4;\n\n if (result.w > 0.0)\n {\n result.xyz /= result.w;\n }\n return result;\n}\n\n#ifdef vtkImageLabelOutlineOn\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\n vec4 pcPos = vec4(\n (fragCoord.x / vpWidth - 0.5) * 2.0,\n (fragCoord.y / vpHeight - 0.5) * 2.0,\n (fragCoord.z - 0.5) * 2.0,\n 1.0);\n\n vec4 worldCoord = PCWCMatrix * pcPos;\n vec4 vertex = (worldCoord/worldCoord.w);\n\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\n}\n#endif\n\n//=======================================================================\n// compute the normals and gradient magnitudes for a position\n// for independent components\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\n{\n mat4 result;\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\n\n // divide by spacing\n distX /= vSpacing.x;\n distY /= vSpacing.y;\n distZ /= vSpacing.z;\n\n mat3 rot;\n rot[0] = vPlaneNormal0;\n rot[1] = vPlaneNormal2;\n rot[2] = vPlaneNormal4;\n\n#if !defined(vtkComponent0Proportional)\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\n result[0].a = length(result[0].xyz);\n result[0].xyz *= rot;\n if (result[0].w > 0.0)\n {\n result[0].xyz /= result[0].w;\n }\n#endif\n\n// optionally compute the 2nd component\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\n result[1].a = length(result[1].xyz);\n result[1].xyz *= rot;\n if (result[1].w > 0.0)\n {\n result[1].xyz /= result[1].w;\n }\n#endif\n\n// optionally compute the 3rd component\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\n result[2].a = length(result[2].xyz);\n result[2].xyz *= rot;\n if (result[2].w > 0.0)\n {\n result[2].xyz /= result[2].w;\n }\n#endif\n\n// optionally compute the 4th component\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\n result[3].a = length(result[3].xyz);\n result[3].xyz *= rot;\n if (result[3].w > 0.0)\n {\n result[3].xyz /= result[3].w;\n }\n#endif\n\n return result;\n}\n\n//=======================================================================\n// Given a normal compute the gradient opacity factors\n//\nfloat computeGradientOpacityFactor(\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\n{\n#if defined(vtkGradientOpacityOn)\n return clamp(normal.a*goscale + goshift, gomin, gomax);\n#else\n return 1.0;\n#endif\n}\n\n#if vtkLightComplexity > 0\nvoid applyLighting(inout vec3 tColor, vec4 normal)\n{\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n //VTK::Light::Impl\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\n}\n#endif\n\n//=======================================================================\n// Given a texture value compute the color and opacity\n//\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\n{\n#ifdef vtkImageLabelOutlineOn\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\n vec4 centerValue = getTextureValue(centerPosIS);\n bool pixelOnBorder = false;\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\n\n // Get alpha of segment from opacity function.\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\n\n // Only perform outline check on fragments rendering voxels that aren't invisible.\n // Saves a bunch of needless checks on the background.\n // TODO define epsilon when building shader?\n if (float(tColor.a) > 0.01) {\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\n if (i == 0 || j == 0) {\n continue;\n }\n\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\n gl_FragCoord.y + float(j),\n gl_FragCoord.z, gl_FragCoord.w);\n\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\n vec4 value = getTextureValue(neighborPosIS);\n\n // If any of my neighbours are not the same value as I\n // am, this means I am on the border of the segment.\n // We can break the loops\n if (any(notEqual(value, centerValue))) {\n pixelOnBorder = true;\n break;\n }\n }\n\n if (pixelOnBorder == true) {\n break;\n }\n }\n\n // If I am on the border, I am displayed at full opacity\n if (pixelOnBorder == true) {\n tColor.a = 1.0;\n }\n }\n\n#else\n // compute the normal and gradient magnitude if needed\n // We compute it as a vec4 if possible otherwise a mat4\n //\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\n\n // compute the normal vectors as needed\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\n #if !defined(vtkComponent0Proportional)\n vec4 normal0 = normalMat[0];\n #endif\n #if !defined(vtkComponent1Proportional)\n vec4 normal1 = normalMat[1];\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n vec4 normal2 = normalMat[2];\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n vec4 normal3 = normalMat[3];\n #endif\n #endif\n #endif\n #else\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\n #endif\n #endif\n\n // compute gradient opacity factors as needed\n #if defined(vtkGradientOpacityOn)\n #if !defined(vtkComponent0Proportional)\n goFactor.x =\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\n #endif\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n #if !defined(vtkComponent1Proportional)\n goFactor.y =\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n goFactor.z =\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n goFactor.w =\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\n #endif\n #endif\n #endif\n #endif\n #endif\n\n // single component is always independent\n #if vtkNumComponents == 1\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\n #endif\n\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\n #if !defined(vtkComponent0Proportional)\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n tColor *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\n #endif\n\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\n #if !defined(vtkComponent1Proportional)\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n tColor1 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\n #endif\n\n #if vtkNumComponents >= 3\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\n #if !defined(vtkComponent2Proportional)\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n tColor2 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\n #endif\n\n #if vtkNumComponents >= 4\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\n #if !defined(vtkComponent3Proportional)\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n tColor3 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\n #endif\n #endif\n #endif\n #else // then not independent\n\n #if vtkNumComponents == 2\n float lum = tValue.r * cscale0 + cshift0;\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\n vec4 tColor = vec4(lum, lum, lum, alpha);\n #endif\n #if vtkNumComponents == 3\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\n #endif\n #if vtkNumComponents == 4\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\n #endif\n #endif // dependent\n\n // apply lighting if requested as appropriate\n #if vtkLightComplexity > 0\n #if !defined(vtkComponent0Proportional)\n applyLighting(tColor.rgb, normal0);\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n #if !defined(vtkComponent1Proportional)\n applyLighting(tColor1, normal1);\n #endif\n #if vtkNumComponents >= 3\n #if !defined(vtkComponent2Proportional)\n applyLighting(tColor2, normal2);\n #endif\n #if vtkNumComponents >= 4\n #if !defined(vtkComponent3Proportional)\n applyLighting(tColor3, normal3);\n #endif\n #endif\n #endif\n #endif\n#endif\n\n// perform final independent blend as needed\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n tColor.rgb += tColor1;\n#if vtkNumComponents >= 3\n tColor.rgb += tColor2;\n#if vtkNumComponents >= 4\n tColor.rgb += tColor3;\n#endif\n#endif\n#endif\n\n#endif\n\n\n\n\n\n\n\nreturn tColor;\n}\n\n\n\n//=======================================================================\n// Apply the specified blend mode operation along the ray's path.\n//\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\n{\n vec3 tstep = 1.0/tdims;\n\n // start slightly inside and apply some jitter\n vec3 delta = endIS - posIS;\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\n float raySteps = length(delta)/sampleDistanceIS;\n\n // avoid 0.0 jitter\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\n float stepsTraveled = jitter;\n\n // local vars for the loop\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 tValue;\n vec4 tColor;\n\n // if we have less than one step then pick the middle point\n // as our value\n // if (raySteps <= 1.0)\n // {\n // posIS = (posIS + endIS)*0.5;\n // }\n\n // Perform initial step at the volume boundary\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n // handle very thin volumes\n if (raySteps <= 1.0)\n {\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\n gl_FragData[0] = tColor;\n return;\n }\n\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\n color = vec4(tColor.rgb*tColor.a, tColor.a);\n posIS += (jitter*stepIS);\n\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n float mix = (1.0 - color.a);\n\n // this line should not be needed but nvidia seems to not handle\n // the break correctly on windows/chrome 58 angle\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\n\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n stepsTraveled++;\n posIS += stepIS;\n if (color.a > 0.99) { color.a = 1.0; break; }\n }\n\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\n {\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\n\n float mix = (1.0 - color.a);\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n }\n\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\n #endif\n #if vtkBlendMode == 1 || vtkBlendMode == 2\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\n // Find maximum/minimum intensity along the ray.\n\n // Define the operation we will use (min or max)\n #if vtkBlendMode == 1\n #define OP max\n #else\n #define OP min\n #endif\n\n // If the clipping range is shorter than the sample distance\n // we can skip the sampling loop along the ray.\n if (raySteps <= 1.0)\n {\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\n return;\n }\n\n vec4 value = tValue;\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // Update the maximum value if necessary\n value = OP(tValue, value);\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n tValue = getTextureValue(posIS);\n value = OP(tValue, value);\n\n // Now map through opacity and color\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\n #endif\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\n vec4 averageIPScalarRangeMin = vec4 (\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n 1.0);\n vec4 averageIPScalarRangeMax = vec4(\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n 1.0);\n\n vec4 sum = vec4(0.);\n\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n }\n\n if (raySteps <= 1.0) {\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n return;\n }\n\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\n // Notes:\n // - We are comparing all values in the texture to see if any of them\n // are outside of the scalar range. In the future we might want to allow\n // scalar ranges for each component.\n // - We are setting the alpha channel for averageIPScalarRangeMin and\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\n // based on the alpha channel comparison.\n // - There might be a better way to do this. I'm not sure if there is an\n // equivalent of 'any' which only operates on RGB, though I suppose\n // we could write an 'anyRGB' function and see if that is faster.\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\n continue;\n }\n\n // Sum the values across each step in the path\n sum += tValue;\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n #endif\n}\n\n//=======================================================================\n// Compute a new start and end point for a given ray based\n// on the provided bounded clipping plane (aka a rectangle)\nvoid getRayPointIntersectionBounds(\n vec3 rayPos, vec3 rayDir,\n vec3 planeDir, float planeDist,\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\n float vSize1, float vSize2)\n{\n float result = dot(rayDir, planeDir);\n if (result == 0.0)\n {\n return;\n }\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\n vec3 xposVC = rayPos + rayDir*result;\n vec3 vxpos = xposVC - vOriginVC;\n vec2 vpos = vec2(\n dot(vxpos, vPlaneX),\n dot(vxpos, vPlaneY));\n\n // on some apple nvidia systems this does not work\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\n // vpos.y < 0.0 || vpos.y > vSize2)\n // even just\n // if (vpos.x < 0.0 || vpos.y < 0.0)\n // fails\n // so instead we compute a value that represents in and out\n //and then compute the return using this value\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\n\n tbounds = mix(\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\n tbounds, // out value\n check); // 0 in 1 out\n}\n\n//=======================================================================\n// given a\n// - ray direction (rayDir)\n// - starting point (vertexVCVSOutput)\n// - bounding planes of the volume\n// - optionally depth buffer values\n// - far clipping plane\n// compute the start/end distances of the ray we need to cast\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\n{\n vec2 dists = vec2(100.0*camFar, -1.0);\n\n vec3 vSize = vSpacing*(tdims - 1.0);\n\n // all this is in View Coordinates\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n\n //VTK::ClipPlane::Impl\n\n // do not go behind front clipping plane\n dists.x = max(0.0,dists.x);\n\n // do not go PAST far clipping plane\n float farDist = -camThick/rayDir.z;\n dists.y = min(farDist,dists.y);\n\n // Do not go past the zbuffer value if set\n // This is used for intermixing opaque geometry\n //VTK::ZBuffer::Impl\n\n return dists;\n}\n\n//=======================================================================\n// Compute the index space starting position (pos) and end\n// position\n//\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\n{\n // compute starting and ending values in volume space\n pos = vertexVCVSOutput + dists.x*rayDir;\n pos = pos - vOriginVC;\n // convert to volume basis and origin\n pos = vec3(\n dot(pos, vPlaneNormal0),\n dot(pos, vPlaneNormal2),\n dot(pos, vPlaneNormal4));\n\n endPos = vertexVCVSOutput + dists.y*rayDir;\n endPos = endPos - vOriginVC;\n endPos = vec3(\n dot(endPos, vPlaneNormal0),\n dot(endPos, vPlaneNormal2),\n dot(endPos, vPlaneNormal4));\n\n float delta = length(endPos - pos);\n\n pos *= vVCToIJK;\n endPos *= vVCToIJK;\n\n float delta2 = length(endPos - pos);\n sampleDistanceIS = sampleDistance*delta2/delta;\n}\n\nvoid main()\n{\n\n vec3 rayDirVC;\n\n if (cameraParallel == 1)\n {\n // Camera is parallel, so the rayDir is just the direction of the camera.\n rayDirVC = vec3(0.0, 0.0, -1.0);\n } else {\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\n rayDirVC = normalize(vertexVCVSOutput);\n }\n\n vec3 tdims = vec3(volumeDimensions);\n\n // compute the start and end points for the ray\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\n\n // do we need to composite? aka does the ray have any length\n // If not, bail out early\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\n {\n discard;\n }\n\n // IS = Index Space\n vec3 posIS;\n vec3 endIS;\n float sampleDistanceIS;\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\n\n // Perform the blending operation along the ray\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\n}\n",e.Geometry=""},e.replaceShaderValues=function(n,r,s){var a=n.Fragment;s.getProperty().getInterpolationType()===za.LINEAR&&(a=vr.substitute(a,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===s.getProperty().getUseLabelOutline()&&(a=vr.substitute(a,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();a=vr.substitute(a,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var Q=s.getProperty().getIndependentComponents();if(Q){a=vr.substitute(a,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var B=[],o=0;o0&&(a=vr.substitute(a,"//VTK::vtkProportionalComponents",B.join("\n")).result)}var l=t.currentInput.getExtent(),F=t.currentInput.getSpacing(),U=Object(G.a)();Object(G.p)(U,(l[1]-l[0])*F[0],(l[3]-l[2])*F[1],(l[5]-l[4])*F[2]);var c=Object(G.j)(U)/t.renderable.getSampleDistance();a=vr.substitute(a,"//VTK::MaximumSamplesValue","".concat(Math.ceil(c))).result,a=vr.substitute(a,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=s.getProperty().getUseGradientOpacity(0);for(var g=1;Q&&!t.gopacity&&g0&&(s=vr.substitute(s,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(a,";"),"uniform vec3 lightDirectionVC".concat(a,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(a,"; // normalized"),"//VTK::Light::Dec"],!1).result,s=vr.substitute(s,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(a,"));")," diffuse += ((df".concat("",") * lightColor").concat(a,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(a,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(a,");")," //VTK::Light::Impl"],!1).result,a++)}))}e.Fragment=s},e.replaceShaderClippingPlane=function(e,n,r){var s=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var a=t.renderable.getClippingPlanes().length;s=vr.substitute(s,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,s=vr.substitute(s,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(a,"; i++) {")," float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result}e.Fragment=s},e.getNeedToRebuildShaders=function(n,r,s){var a=0;s.getProperty().getShade()&&t.renderable.getBlendMode()===ja.COMPOSITE_BLEND&&(a=0,t.numberOfLights=0,r.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===a&&(a=1)),1===a&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(a=2),a<3&&e.getPositional()&&(a=3)})));var i=!1;t.lastLightComplexity!==a&&(t.lastLightComplexity=a,i=!0);var Q=t.scalarTexture.getComponents(),B=s.getProperty().getIndependentComponents(),o=!1,l=[];if(B){for(var F=0;F0&&(o=!0)}var U=t.currentInput.getExtent(),c=t.currentInput.getSpacing(),g=Object(G.a)();Object(G.p)(g,(U[1]-U[0])*c[0],(U[3]-U[2])*c[1],(U[5]-U[4])*c[2]);var d=Object(G.j)(g)/t.renderable.getSampleDistance(),u={interpolationType:s.getProperty().getInterpolationType(),useLabelOutline:s.getProperty().getUseLabelOutline(),numComp:Q,usesProportionalComponents:o,iComps:B,maxSamples:d,useGradientOpacity:s.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),averageIPScalarMode:t.renderable.getAverageIPScalarRange(),proportionalComponents:l};return t.previousState&&t.previousState.interpolationType===u.interpolationType&&t.previousState.useLabelOutline===u.useLabelOutline&&t.previousState.numComp===u.numComp&&t.previousState.usesProportionalComponents===u.usesProportionalComponents&&t.previousState.iComps===u.iComps&&t.previousState.maxSamples===u.maxSamples&&t.previousState.useGradientOpacity===u.useGradientOpacity&&t.previousState.blendMode===u.blendMode&&ti(t.previousState.averageIPScalarMode,u.averageIPScalarMode)&&ti(t.previousState.proportionalComponents,u.proportionalComponents)?!!(0===n.getProgram()||i||t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||!!t.lastZBufferTexture!=!!t.zBufferTexture||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(a.isAttributeUsed("vertexDC")&&(n.getVAO().addAttributeArray(a,n.getCABO(),"vertexDC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ei("Error setting vertexDC in shader VAO.")),n.getAttributeUpdateTime().modified()),a.setUniformi("texture1",t.scalarTexture.getTextureUnit()),a.setUniformf("sampleDistance",t.renderable.getSampleDistance()),null!==t.zBufferTexture){a.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var i=e.getRenderTargetSize();a.setUniformf("vpWidth",i[0]),a.setUniformf("vpHeight",i[1])}},e.setCameraShaderParameters=function(n,r,s){var a=t.openGLCamera.getKeyMatrices(r),i=t.openGLVolume.getKeyMatrices();Object(x.l)(t.modelToView,a.wcvc,i.mcwc);var Q=n.getProgram(),B=t.openGLCamera.getRenderable(),o=B.getClippingRange();Q.setUniformf("camThick",o[1]-o[0]),Q.setUniformf("camNear",o[0]),Q.setUniformf("camFar",o[1]);for(var l=t.currentInput.getBounds(),F=t.currentInput.getDimensions(),U=Object(G.a)(),c=Object(G.a)(),g=1,d=-1,u=1,I=-1,m=0;m<8;++m){if(Object(G.p)(U,l[m%2],l[2+Math.floor(m/2)%2],l[4+Math.floor(m/4)]),Object(G.q)(U,U,t.modelToView),!B.getParallelProjection()){Object(G.l)(c,U);var C=-o[0]/U[2];Object(G.g)(U,c,C)}Object(G.q)(U,U,a.vcpc),g=Math.min(U[0],g),d=Math.max(U[0],d),u=Math.min(U[1],u),I=Math.max(U[1],I)}Q.setUniformf("dcxmin",g),Q.setUniformf("dcxmax",d),Q.setUniformf("dcymin",u),Q.setUniformf("dcymax",I),Q.isUniformUsed("cameraParallel")&&Q.setUniformi("cameraParallel",B.getParallelProjection());var b=t.currentInput.getExtent(),y=t.currentInput.getSpacing(),S=Object(G.a)();Object(G.p)(S,(b[1]-b[0]+1)*y[0],(b[3]-b[2]+1)*y[1],(b[5]-b[4]+1)*y[2]),Q.setUniform3f("vSpacing",y[0],y[1],y[2]),Object(G.p)(U,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(U,U),Object(G.q)(U,U,t.modelToView),Q.setUniform3f("vOriginVC",U[0],U[1],U[2]);var Z=t.currentInput.getIndexToWorld();Object(x.l)(t.idxToView,t.modelToView,Z),we(t.idxNormalMatrix,a.normalMatrix,i.normalMatrix),we(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var h=Object(G.j)(S)/t.renderable.getSampleDistance();h>t.renderable.getMaximumSamplesPerRay()&&$a("The number of steps required ".concat(Math.ceil(h)," is larger than the\n specified maximum number of steps ").concat(t.renderable.getMaximumSamplesPerRay(),".\n Please either change the\n volumeMapper sampleDistance or its maximum number of samples."));var p=Object(G.a)();if(Object(G.p)(p,1,1,1),Object(G.n)(p,p,S),Q.setUniform3f("vVCToIJK",p[0],p[1],p[2]),Q.setUniform3i("volumeDimensions",F[0],F[1],F[2]),!t.openGLRenderWindow.getWebgl2()){var R=t.scalarTexture.getVolumeInfo();Q.setUniformf("texWidth",t.scalarTexture.getWidth()),Q.setUniformf("texHeight",t.scalarTexture.getHeight()),Q.setUniformi("xreps",R.xreps),Q.setUniformi("xstride",R.xstride),Q.setUniformi("ystride",R.ystride)}for(var V=Object(G.a)(),L=Object(G.a)(),A=0;A<6;++A){switch(A){default:case 0:Object(G.p)(V,1,0,0),Object(G.p)(L,b[1],b[3],b[5]);break;case 1:Object(G.p)(V,-1,0,0),Object(G.p)(L,b[0],b[2],b[4]);break;case 2:Object(G.p)(V,0,1,0),Object(G.p)(L,b[1],b[3],b[5]);break;case 3:Object(G.p)(V,0,-1,0),Object(G.p)(L,b[0],b[2],b[4]);break;case 4:Object(G.p)(V,0,0,1),Object(G.p)(L,b[1],b[3],b[5]);break;case 5:Object(G.p)(V,0,0,-1),Object(G.p)(L,b[0],b[2],b[4])}Object(G.o)(V,V,t.idxNormalMatrix),Object(G.q)(L,L,t.idxToView);var N=-1*Object(G.d)(L,V);if(Q.setUniform3f("vPlaneNormal".concat(A),V[0],V[1],V[2]),Q.setUniformf("vPlaneDistance".concat(A),N),s.getProperty().getUseLabelOutline()){var E=t.currentInput.getWorldToIndex();Q.setUniformMatrix("vWCtoIDX",E),Object(x.g)(t.projectionToWorld,a.wcpc),Q.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var f=e.getRenderTargetSize();Q.setUniformf("vpWidth",f[0]),Q.setUniformf("vpHeight",f[1])}}switch(Object(x.g)(t.projectionToView,a.vcpc),Q.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){default:case 0:break;case 1:case 2:case 3:var D=0,v=[];r.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),n=e.getIntensity();v[0]=t[0]*n,v[1]=t[1]*n,v[2]=t[2]*n,Q.setUniform3fArray("lightColor".concat(D),v);var r=e.getDirection();Object(G.p)(V,r[0],r[1],r[2]),Object(G.o)(V,V,a.normalMatrix),Q.setUniform3f("lightDirectionVC".concat(D),V[0],V[1],V[2]);var s=[-.5*V[0],-.5*V[1],-.5*(V[2]-1)];Q.setUniform3fArray("lightHalfAngleVC".concat(D),s),D++}}))}},e.setPropertyShaderParameters=function(e,n,r){var s=e.getProgram();s.setUniformi("ctexture",t.colorTexture.getTextureUnit()),s.setUniformi("otexture",t.opacityTexture.getTextureUnit()),s.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var a=t.scalarTexture.getVolumeInfo(),i=r.getProperty(),Q=t.scalarTexture.getComponents(),B=r.getProperty().getIndependentComponents();if(B&&Q>=2)for(var o=0;o0&&(s.setUniformf("vAmbient",i.getAmbient()),s.setUniformf("vDiffuse",i.getDiffuse()),s.setUniformf("vSpecular",i.getSpecular()),s.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,n,r){if(t.renderable.getClippingPlanes().length>0){for(var s=t.openGLCamera.getKeyMatrices(n),a=[],i=[],Q=t.renderable.getClippingPlanes(),B=Q.length,o=0;o1.43){var e=t.framebuffer.getSize();return[t.fvp[0]*e[0],t.fvp[1]*e[1]]}return t.openGLRenderWindow.getFramebufferSize()},e.renderPieceStart=function(n,r){if(t.renderable.getAutoAdjustSampleDistances()){var s=n.getVTKWindow().getInteractor(),a=s.getLastFrameTime();if(t.avgFrameTime=.97*t.avgFrameTime+.03*a,t.avgWindowArea=.97*t.avgWindowArea+.03/(t.lastXYF*t.lastXYF),n.getVTKWindow().getInteractor().isAnimating()){var i=Math.sqrt(t.avgFrameTime*s.getDesiredUpdateRate()/t.avgWindowArea);i>10&&(i=10),t.targetXYF=i}else t.targetXYF=Math.sqrt(t.avgFrameTime*s.getStillUpdateRate()/t.avgWindowArea);t.targetXYF<1.53&&t.targetXYF>1.33&&(t.targetXYF=t.lastXYF),Math.abs(1-t.targetXYF/t.lastXYF)<.1&&(t.targetXYF=t.lastXYF),t.lastXYF=t.targetXYF}else t.lastXYF=t.renderable.getImageSampleDistance();t.lastXYF<=1.43&&(t.lastXYF=1);var Q=t.lastXYF,B=t.openGLRenderWindow.getFramebufferSize();if(Q>1.43){if(t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(Math.floor(.7*B[0]),Math.floor(.7*B[1])),t.framebuffer.populateFramebuffer();else{var o=t.framebuffer.getSize();o[0]===Math.floor(.7*B[0])&&o[1]===Math.floor(.7*B[1])||(t.framebuffer.create(Math.floor(.7*B[0]),Math.floor(.7*B[1])),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var l=t.context;l.clearColor(0,0,0,0),l.colorMask(!0,!0,!0,!0),l.clear(l.COLOR_BUFFER_BIT),l.viewport(0,0,B[0]/Q,B[1]/Q),t.fvp=[Math.floor(B[0]/Q)/Math.floor(.7*B[0]),Math.floor(B[1]/Q)/Math.floor(.7*B[1])]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(n,r),r.getProperty().getInterpolationType()===za.NEAREST?(t.scalarTexture.setMinificationFilter(vt.NEAREST),t.scalarTexture.setMagnificationFilter(vt.NEAREST)):(t.scalarTexture.setMinificationFilter(vt.LINEAR),t.scalarTexture.setMagnificationFilter(vt.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(n,r){var s=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,n,r),s.drawArrays(s.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.scalarTexture.deactivate(),t.colorTexture.deactivate(),t.opacityTexture.deactivate(),t.jitterTexture.deactivate()},e.renderPieceFinish=function(e,n){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t.lastXYF>1.43){if(t.framebuffer.restorePreviousBindingsAndBuffers(),null===t.copyShader){t.copyShader=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join("\n"),["//VTK::System::Dec","//VTK::Output::Dec","uniform sampler2D texture1;","varying vec2 tcoord;","void main() { gl_FragData[0] = texture2D(texture1,tcoord); }"].join("\n"),"");var r=t.copyShader;t.copyVAO=Qs.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(r,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ei("Error setting vertexDC in copy shader VAO.")}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.copyShader);var s=t.openGLRenderWindow.getFramebufferSize();t.context.viewport(0,0,s[0],s[1]);var a=t.framebuffer.getColorTexture();a.activate(),t.copyShader.setUniformi("texture",a.getTextureUnit()),t.copyShader.setUniform2f("tfactor",t.fvp[0],t.fvp[1]);var i=t.context;i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),a.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(n,r){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(n,r),e.renderPieceDraw(n,r),e.renderPieceFinish(n,r)):ei("No input!")},e.computeBounds=function(n,r){e.getInput()?t.bounds=e.getInput().getBounds():Object(b.b)(t.Bounds)},e.updateBufferObjects=function(t,n){e.getNeedToRebuildBufferObjects(t,n)&&e.buildBufferObjects(t,n)},e.getNeedToRebuildBufferObjects=function(n,r){return t.VBOBuildTime.getMTime()1?1:-1,A[3*N+2]=-1;var E=new Uint16Array(8);E[0]=3,E[1]=0,E[2]=1,E[3]=3,E[4]=3,E[5]=0,E[6]=3,E[7]=2;var f=o.a.newInstance({numberOfComponents:3,values:A});f.setName("points");var D=o.a.newInstance({numberOfComponents:1,values:E});t.tris.getCABO().createVBO(D,"polys",yn.SURFACE,{points:f,cellOffset:0})}t.VBOBuildTime.modified()}}}}var ri={context:null,VBOBuildTime:null,scalarTexture:null,scalarTextureString:null,opacityTexture:null,opacityTextureString:null,colorTexture:null,colorTextureString:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,lastLightComplexity:0,fullViewportTime:1,idxToView:null,idxNormalMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function si(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ri,n),Lt.extend(e,t,n),t.VBOBuildTime={},B.b.obj(t.VBOBuildTime,{mtime:0}),t.tris=Fs.newInstance(),t.scalarTexture=Pt.newInstance(),t.opacityTexture=Pt.newInstance(),t.colorTexture=Pt.newInstance(),t.jitterTexture=Pt.newInstance(),t.jitterTexture.setWrapS(Dt.REPEAT),t.jitterTexture.setWrapT(Dt.REPEAT),t.framebuffer=qt.newInstance(),t.idxToView=Object(x.h)(),t.idxNormalMatrix=He(),t.modelToView=Object(x.h)(),t.projectionToView=Object(x.h)(),t.projectionToWorld=Object(x.h)(),B.b.setGet(e,t,["context"]),ni(e,t)}var ai={newInstance:B.b.newInstance(si,"vtkOpenGLVolumeMapper"),extend:si};function ii(e,t){t.overrides={},t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(n){if(n.isDeleted())return null;for(var r=0,s=n.getClassName(r++),a=!1,i=Object.keys(t.overrides);s&&!a;)-1!==i.indexOf(s)?a=!0:s=n.getClassName(r++);if(!a)return null;var Q=t.overrides[s]();return Q.setMyFactory(e),Q},e.registerOverride=function(e,n){t.overrides[e]=n}}var Qi={};function Bi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qi,n),B.b.obj(e,t),ii(e,t)}var oi={newInstance:B.b.newInstance(Bi,"vtkViewNodeFactory"),extend:Bi};function li(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Fi={};function Ui(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fi,n),oi.extend(e,t,n),li(0,t),e.registerOverride("vtkActor",Fn.newInstance),e.registerOverride("vtkActor2D",dn.newInstance),e.registerOverride("vtkCamera",Cn.newInstance),e.registerOverride("vtkGlyph3DMapper",ta.newInstance),e.registerOverride("vtkImageMapper",Fa.newInstance),e.registerOverride("vtkImageSlice",da.newInstance),e.registerOverride("vtkMapper",ps.newInstance),e.registerOverride("vtkPixelSpaceCallbackMapper",ba.newInstance),e.registerOverride("vtkRenderer",Ga.newInstance),e.registerOverride("vtkSkybox",La.newInstance),e.registerOverride("vtkSphereMapper",va.newInstance),e.registerOverride("vtkStickMapper",Ta.newInstance),e.registerOverride("vtkTexture",Pt.newInstance),e.registerOverride("vtkVolume",Oa.newInstance),e.registerOverride("vtkVolumeMapper",ai.newInstance),e.registerOverride("vtkWidgetRepresentation",Qn.newInstance)}var ci={newInstance:B.b.newInstance(Ui,"vtkOpenGLViewNodeFactory"),extend:Ui},gi=n(10),di=Object(gi.d)((function(e){!function(t){function n(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function r(e,t,r,s,a,i){return n((Q=n(n(t,e),n(s,i)))<<(B=a)|Q>>>32-B,r);var Q,B}function s(e,t,n,s,a,i,Q){return r(t&n|~t&s,e,t,a,i,Q)}function a(e,t,n,s,a,i,Q){return r(t&s|n&~s,e,t,a,i,Q)}function i(e,t,n,s,a,i,Q){return r(t^n^s,e,t,a,i,Q)}function Q(e,t,n,s,a,i,Q){return r(n^(t|~s),e,t,a,i,Q)}function B(e,t){var r,B,o,l,F;e[t>>5]|=128<>>9<<4)]=t;var U=1732584193,c=-271733879,g=-1732584194,d=271733878;for(r=0;r>5]>>>t%32&255);return n}function l(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+r.charAt(15&t);return s}function U(e){return unescape(encodeURIComponent(e))}function c(e){return function(e){return o(B(l(e),8*e.length))}(U(e))}function g(e,t){return function(e,t){var n,r,s=l(e),a=[],i=[];for(a[15]=i[15]=void 0,s.length>16&&(s=B(s,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^s[n],i[n]=1549556828^s[n];return r=B(a.concat(l(t)),512+8*t.length),o(B(i.concat(r),640))}(U(e),U(t))}function d(e,t,n){return t?n?g(t,e):F(g(t,e)):n?c(e):F(c(e))}e.exports?e.exports=d:t.md5=d}(gi.b)}),"/$$rollup_base$$/node_modules/blueimp-md5/js"),ui=["lastShaderBound","context","openGLRenderWindow"];function Ii(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,n,r){var s=n;r.length>0&&(s=vr.substitute(s,"VSOut","GSOut").result);var a=t.openGLRenderWindow.getWebgl2(),i="\n",Q="#version 100\n";a?Q="#version 300 es\n#define attribute in\n#define textureCube texture\n#define texture2D texture\n#define textureCubeLod textureLod\n#define texture2DLod textureLod\n":(t.context.getExtension("OES_standard_derivatives"),t.context.getExtension("EXT_frag_depth")&&(i="#extension GL_EXT_frag_depth : enable\n"),t.context.getExtension("EXT_shader_texture_lod")&&(i+="#extension GL_EXT_shader_texture_lod : enable\n#define textureCubeLod textureCubeLodEXT\n#define texture2DLod texture2DLodEXT")),s=vr.substitute(s,"//VTK::System::Dec",["".concat(Q,"\n"),a?"":"#extension GL_OES_standard_derivatives : enable\n",i,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;var B=vr.substitute(e,"//VTK::System::Dec",["".concat(Q,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return a&&(B=vr.substitute(B,"varying","out").result,s=vr.substitute(s,"varying","in").result,s=vr.substitute(s,"gl_FragData\\[0\\]","fragOutput0").result,s=vr.substitute(s,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:B,FSSource:s,GSSource:vr.substitute(r,"//VTK::System::Dec",Q).result}},e.readyShaderProgramArray=function(t,n,r){var s=e.replaceShaderValues(t,n,r),a=e.getShaderProgram(s.VSSource,s.FSSource,s.GSSource);return e.readyShaderProgram(a)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,n,r){var s="".concat(e).concat(n).concat(r),a=di(s);if(-1===Object.keys(t.shaderPrograms).indexOf(a)){var i=vr.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(n),r&&i.getGeometryShader().setSource(r),i.setMd5Hash(a),t.shaderPrograms[a]=i,i}return t.shaderPrograms[a]},e.releaseGraphicsResources=function(n){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(n)}))},e.releaseGraphicsResources=function(){t.astShaderBound&&(t.lastShaderBound.release(),t.lastShaderBound=null)},e.bindShader=function(e){return t.lastShaderBound===e||(t.lastShaderBound&&t.lastShaderBound.release(),e.bind(),t.lastShaderBound=e),1}}var mi={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function Ci(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.assign(t,mi,n),t.shaderPrograms={},B.b.obj(e,t),B.b.setGet(e,t,ui),Ii(e,t),Object.freeze(e)}var bi={newInstance:B.b.newInstance(Ci,"vtkShaderCache"),extend:Ci},yi=B.b.vtkErrorMacro;function Si(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zi,n),B.b.obj(e,t),t.textureUnits=[],B.b.get(e,t,["numberOfTextureUnits"]),B.b.setGet(e,t,["context"]),Si(e,t)}var Gi={newInstance:B.b.newInstance(xi,"vtkOpenGLTextureUnitManager"),extend:xi},hi=Object(gi.f)(Object(gi.d)((function(e,t){ +t.read=function(e,t,n,r,a){var s,i,o=8*a-r-1,l=(1<>1,Q=-7,c=n?a-1:0,F=n?-1:1,U=e[t+c];for(c+=F,s=U&(1<<-Q)-1,U>>=-Q,Q+=o;Q>0;s=256*s+e[t+c],c+=F,Q-=8);for(i=s&(1<<-Q)-1,s>>=-Q,Q+=r;Q>0;i=256*i+e[t+c],c+=F,Q-=8);if(0===s)s=1-B;else{if(s===l)return i?NaN:1/0*(U?-1:1);i+=Math.pow(2,r),s-=B}return(U?-1:1)*i*Math.pow(2,s-r)},t.write=function(e,t,n,r,a,s){var i,o,l,B=8*s-a-1,Q=(1<>1,F=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,U=r?0:s-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,i=Q):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),(t+=i+c>=1?F/l:F*Math.pow(2,1-c))*l>=2&&(i++,l/=2),i+c>=Q?(o=0,i=Q):i+c>=1?(o=(t*l-1)*Math.pow(2,a),i+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,a),i=0));a>=8;e[n+U]=255&o,U+=g,o/=256,a-=8);for(i=i<0;e[n+U]=255&i,U+=g,i/=256,B-=8);e[n+U-g]|=128*d}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new s(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(69),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(38))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,s,i,o,l=1,B={},Q=!1,c=e.document,F=Object.getPrototypeOf&&Object.getPrototypeOf(e);F=F&&F.setTimeout?F:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){g(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){g(e.data)},r=function(e){s.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,r=function(e){var t=c.createElement("script");t.onreadystatechange=function(){g(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(g,0,e)}:(i="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&g(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(i+t,"*")}),F.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},a=n.compression,s=n.progressCallback;return r.binary?n.dataAccessHelper.fetchBinary(e,{compression:a,progressCallback:s}):n.dataAccessHelper.fetchText(t,e,{compression:a,progressCallback:s})}n.classHierarchy.push("vtkSTLReader"),n.dataAccessHelper||(n.dataAccessHelper=o.a.get("http")),t.setUrl=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};n.url=e;var a=e.split("/");return a.pop(),n.baseURL=a.join("/"),n.compression=r.compression,t.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},t.loadData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=B(n.url,e);return r.then(t.parse),r},t.parse=function(e){"string"==typeof e?t.parseAsText(e):t.parseAsArrayBuffer(e)},t.parseAsArrayBuffer=function(o){if(o&&o!==n.parseData)if(t.modified(),n.parseData=o,84+50*new DataView(o,0,84).getUint32(80,!0)===o.byteLength){var B=o.slice(0,80),Q=function(e){for(var t=e.split(" ").filter((function(e){return e.indexOf("=")>-1})),n={},r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(n,F,r),t.c.obj(e,n),t.c.get(e,n,["url","baseURL"]),t.c.setGet(e,n,["dataAccessHelper"]),t.c.algo(e,n,0,1),c(e,n),n.compression||(n.compression=null),n.progressCallback||(n.progressCallback=null)}),"vtkSTLReader")}).call(this,n(38))},function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),s=n(1),i=n.n(s),o=n(7),l=(n(4),n(0)),B=n(10),Q=n(25),c=n(15);function F(e,t){function n(){for(;t.cellFields.length0&&void 0!==arguments[0]?arguments[0]:0;return t.radius[e]},e.setRadius=function(n,r){t.radius[n]=r,e.modified()},e.setCellField=function(n,r){t.cellFields[n]=r,e.modified()},e.removeMask=function(){t.mask=null,e.modified()},e.setMaskLayer=function(n,r){var a=!1;!t.mask&&r&&(a=!0,t.mask=[]),t.mask&&(!t.mask[n]!=!r&&(a=!0),t.mask[n]=r),a&&e.modified()},e.getMaskLayer=function(e){return void 0===e?t.mask:t.mask[e]},e.requestData=function(e,r){var a;if(!t.deleted&&t.radius.length){n();var s=r[0],i=t.radius.length,l=t.height/2,F=0,U=0,g=t.startThetat.startTheta?t.endTheta:t.startTheta;d*=Math.PI/180;var u=t.resolution,I=!1;d>=g+2*Math.PI?d=g+2*Math.PI:(++u,I=!0);var m=(d-g)/t.resolution,C=u*i*2+2;if(t.skipInnerFaces||t.mask)if(!t.skipInnerFaces&&t.mask){t.mask[0]||(F+=2*(u+1)+5*u+(I?10:0),U+=2+u+(I?2:0));for(var b=1;b2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,U,n),l.c.obj(e,t),l.c.setGet(e,t,["height","resolution","startTheta","endTheta","skipInnerFaces"]),l.c.setGetArray(e,t,["center","direction"],3),l.c.getArray(e,t,["cellFields"]),l.c.algo(e,t,0,1),F(e,t)}),"vtkConcentricCylinderSource");function g(e,t){t.classHierarchy.push("vtkConeSource"),e.requestData=function(e,n){var r;if(!t.deleted){var a=n[0],s=2*Math.PI/t.resolution,i=-t.height/2,l=t.resolution+1,B=4*t.resolution+1+t.resolution,F=0,U=new window[t.pointType](3*l),g=0,d=new Uint32Array(B);U[0]=t.height/2,U[1]=0,U[2]=0,t.capping&&(d[g++]=t.resolution);for(var u=0;ut.resolution?1:I+2;(r=Q.a.buildFromRadian()).translate.apply(r,Object(o.a)(t.center)).rotateFromDirections([1,0,0],t.direction).apply(U),(a=c.a.newInstance()).getPoints().setData(U,3),a.getPolys().setData(d,1),n[0]=a}}}var d={height:1,radius:.5,resolution:6,center:[0,0,0],direction:[1,0,0],capping:!0,pointType:"Float32Array"};l.c.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d,n),l.c.obj(e,t),l.c.setGet(e,t,["height","radius","resolution","capping"]),l.c.setGetArray(e,t,["center","direction"],3),l.c.algo(e,t,0,1),g(e,t)}),"vtkConeSource");function u(e,t){t.classHierarchy.push("vtkCubeSource"),e.setBounds=function(){var e=[];if(Array.isArray(arguments.length<=0?void 0:arguments[0]))e=arguments.length<=0?void 0:arguments[0];else for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,I,n),l.c.obj(e,t),l.c.setGet(e,t,["xLength","yLength","zLength","generate3DTextureCoordinates"]),l.c.setGetArray(e,t,["center","rotations"],3),l.c.algo(e,t,0,1),u(e,t)}),"vtkCubeSource");function m(e,t){t.classHierarchy.push("vtkCylinderSource"),e.requestData=function(e,n){var r,a;if(!t.deleted){var s=n[0],i=2*Math.PI/t.resolution,l=2*t.resolution,F=5*t.resolution;t.capping&&(l=4*t.resolution,F=7*t.resolution+2);for(var U=new window[t.pointType](3*l),g=0,d=new Uint32Array(F),u=new Float32Array(3*l),I=B.a.newInstance({numberOfComponents:3,values:u,name:"Normals"}),m=new Float32Array(2*l),C=B.a.newInstance({numberOfComponents:2,values:m,name:"TCoords"}),b=[0,0,0],y=[0,0,0],S=[0,0,0],x=[0,0,0],Z=[0,0],h=[0,0],p=0;p2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,C,n),l.c.obj(e,t),l.c.setGet(e,t,["height","radius","resolution","capping"]),l.c.setGetArray(e,t,["center","direction"],3),l.c.algo(e,t,0,1),m(e,t)}),"vtkCylinderSource");var b=n(2),y=l.c.vtkWarningMacro;function S(e,t){t.classHierarchy.push("vtkLineSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],a=r?r.getPoints().getDataType():"Float32Array",s=c.a.newInstance(),i=new Float32Array(3);if(Object(b.u)(t.point2,t.point1,i),Object(b.z)(i)<=0)y("Zero-length line definition");else{var o=t.resolution,l=o+1,B=new window[a](3*l);s.getPoints().setData(B,3);var Q=new Uint32Array(l+1);s.getLines().setData(Q,1);for(var F=0,U=0,g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,x,n),l.c.obj(e,t),l.c.setGet(e,t,["resolution"]),l.c.setGetArray(e,t,["point1","point2"],3),l.c.algo(e,t,0,1),S(e,t)}),"vtkLineSource");var Z=n(3),h=n(5),p=l.c.vtkWarningMacro;function G(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(n,r){if(!t.deleted){var a=r[0],s=a?a.getPoints().getDataType():"Float32Array",i=c.a.newInstance(),o=new Float32Array(3),l=new Float32Array(3);if(Object(b.u)(t.point1,t.origin,o),Object(b.u)(t.point2,t.origin,l),e.updatePlane(o,l)){var Q=t.xResolution,F=t.yResolution,U=(Q+1)*(F+1),g=Q*F,d=new window[s](3*U);i.getPoints().setData(d,3);var u=new Uint32Array(5*g);i.getPolys().setData(u,1);var I=new Float32Array(3*U),m=B.a.newInstance({numberOfComponents:3,values:I,name:"Normals"});i.getPointData().setNormals(m);var C=new Float32Array(2*U),y=B.a.newInstance({numberOfComponents:2,values:C,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var S=new Float32Array(2),x=0,Z=0;Z2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,R,n),t.normal=[0,0,1],t.center=[0,0,0],l.c.obj(e,t),l.c.setGet(e,t,["xResolution","yResolution"]),l.c.setGetArray(e,t,["origin"],3),l.c.getArray(e,t,["point1","point2","normal","center"],3),l.c.algo(e,t,0,1),G(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}),"vtkPlaneSource");function L(e,t){t.classHierarchy.push("vtkPointSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],a=r?r.getPoints().getDataType():"Float32Array",s=c.a.newInstance(),i=t.numberOfPoints,o=new window[a](3*i);s.getPoints().setData(o,3);var l,B,Q,F,U,g=new Uint32Array(i+1);s.getVerts().setData(g,1);for(var d=0;d2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,V,n),l.c.obj(e,t),l.c.setGet(e,t,["numberOfPoints","radius"]),l.c.setGetArray(e,t,["center"],3),l.c.algo(e,t,0,1),L(e,t)}),"vtkPointSource");function A(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],a=r?r.getPoints().getDataType():"Float32Array";r=c.a.newInstance();var s=0,i=t.thetaResolution,o=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var Q=t.startPhit.startPhi?t.endPhi:t.startPhi;F*=Math.PI/180,Math.abs(o-l)<2*Math.PI&&++i;var U=(l-o)/t.thetaResolution,g=t.startPhi<=0?1:0,d=t.phiResolution+(t.endPhi>=180?-1:0),u=t.phiResolution*i+2,I=2*t.phiResolution*t.thetaResolution,m=0,C=new window[a](3*u),b=new Float32Array(3*u),y=0,S=new Uint32Array(5*I);t.startPhi<=0&&(C[3*m+0]=t.center[0],C[3*m+1]=t.center[1],C[3*m+2]=t.center[2]+t.radius,b[3*m+0]=0,b[3*m+1]=0,b[3*m+2]=1,m++,s++),t.endPhi>=180&&(C[3*m+0]=t.center[0],C[3*m+1]=t.center[1],C[3*m+2]=t.center[2]-t.radius,b[3*m+0]=0,b[3*m+1]=0,b[3*m+2]=-1,m++,s++);for(var x=t.phiResolution-s,Z=(F-Q)/(t.phiResolution-1),h=0;h=180)for(var N=x-1+s,E=0;E2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,f,n),l.c.obj(e,t),l.c.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),l.c.setGetArray(e,t,["center"],3),l.c.algo(e,t,0,1),A(e,t)}),"vtkSphereSource");var N=n(21),E=n(28),D=l.c.vtkDebugMacro,v=l.c.vtkErrorMacro;function J(e,t){t.classHierarchy.push("vtkWarpScalar"),e.requestData=function(n,r){var a=n[0];if(!a)return v("Invalid or missing input"),1;var s=a.getPoints(),i=a.getPointData().getNormals(),o=e.getInputArrayToProcess(0);if(!s||!o)return D("No data to warp",!!s,!!o),r[0]=n[0],1;var l=s.getNumberOfPoints(),B=null,Q=[0,0,1];i&&!t.useNormal?(B=function(e,t){return[t.getData()[3*e],t.getData()[3*e+1],t.getData()[3*e+2]]},D("Using data normals")):e.getXyPlane()?(B=function(e,t){return Q},D("Using x-y plane normal")):(B=function(e,n){return t.normal},D("Using Normal instance variable"));for(var c=new Float32Array(3*l),F=s.getData(),U=0,g=[0,0,1],d=1,u=o.getData(),I=o.getNumberOfComponents(),m=0;m2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,W,n),l.c.obj(e,t),l.c.algo(e,t,1,1),l.c.setGet(e,t,["scaleFactor","useNormal","xyPlane"]),l.c.setGetArray(e,t,["normal"],3),J(e,t)}),"vtkWarpScalar");var X=n(16),H=n(39),T=n(31),k={VaryRadius:{VARY_RADIUS_OFF:0,VARY_RADIUS_BY_SCALAR:1,VARY_RADIUS_BY_VECTOR:2,VARY_RADIUS_BY_ABSOLUTE_SCALAR:3},GenerateTCoords:{TCOORDS_OFF:0,TCOORDS_FROM_NORMALIZED_LENGTH:1,TCOORDS_FROM_LENGTH:2,TCOORDS_FROM_SCALARS:3}},M=k.VaryRadius,w=k.GenerateTCoords,Y=l.c.vtkDebugMacro,O=l.c.vtkErrorMacro,z=l.c.vtkWarningMacro;function P(e,t){function n(e,n){var r=e;return t.sidesShareVertices?r+=t.numberOfSides*n:r+=2*t.numberOfSides*n,t.capping&&(r+=2*t.numberOfSides),r}function r(e,t,n){for(var r=t[n],a=e.slice(3*r,3*(r+1)),s=n+1;s3&&void 0!==arguments[3]?arguments[3]:null,s=[0,0,1],i=t,o=i[0],l=0;l1){var B=0,Q=[0,0,0],c=[0,0,0],F=i.slice(l+1,l+1+o);if((B=r(e,F,0))!==o)!function(){var t=F[B],i=e.slice(3*t,3*(t+1)),l=F[B+1],U=e.slice(3*l,3*(l+1));if(Q=U.map((function(e,t){return e-i[t]})),Object(b.x)(Q),a)s=a;else{for(;++B.001){s=d,Q=c;break}}if(B>=o)for(var u=0;u<3;++u)if(0!==Q[u]){s[(u+2)%3]=0,s[(u+1)%3]=1,s[u]=-Q[(u+1)%3]/Q[u];break}}Object(b.x)(s);for(var I=0;++B0?Math.sqrt(x):0;for(var Z=[0,0,0],h=0;h<3;++h)Z[h]=c[h]+Q[h];Object(b.x)(Z),Object(b.v)(Z,y,C),Object(b.v)(Q,y,Z),Object(b.r)(s,Z)*Object(b.r)(C,Z)<0&&(x*=-1);for(var p=I;pt.radiusFactor&&(G=t.radiusFactor);else if(B&&t.varyRadius===M.VARY_RADIUS_BY_ABSOLUTE_SCALAR&&(G=B.getComponent(r[L],0))<0)return z("Scalar value less than zero, skipping line"),0;if(t.sidesShareVertices)for(var v=0;v1&&f){var le=Z.slice(ie,ie+h+1);a(U.getData(),le,V)}s(ae,h,oe,U.getData(),C.getData(),F.getPointData(),ee,y,P,j,_,q,A,re)?(L=i(ae,h,se,L,F.getCellData(),$,R),te&&o(ae,h,oe,U.getData(),P,te.getData())):z("Could not generate points"),ae=n(ae,h),se++}Q.setPoints(C),Q.setStrips(R),Q.setPointData(ee),ee.setNormals(S),l[0]=Q}}}}}else O("Invalid or missing input")}}var K={outputPointsPrecision:T.b.DEFAULT,radius:.5,varyRadius:M.VARY_RADIUS_OFF,numberOfSides:3,radiusFactor:10,defaultNormal:[0,0,1],useDefaultNormal:!1,sidesShareVertices:!0,capping:!1,onRatio:1,offset:0,generateTCoords:w.TCOORDS_OFF,textureLength:1};l.c.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,K,n),l.c.setGet(e,t,["outputPointsPrecision","radius","varyRadius","numberOfSides","radiusFactor","defaultNormal","useDefaultNormal","sidesShareVertices","capping","onRatio","offset","generateTCoords","textureLength"]),l.c.obj(e,t),l.c.algo(e,t,1,1),P(e,t)}),"vtkTubeFilter");var j=n(36),_=n(27),q={diffuse_red:"red",diffuse_green:"green",diffuse_blue:"blue"},$={patternHeader:/ply([\s\S]*)end_header\r?\n/,patternBody:/end_header\s([\s\S]*)$/};function ee(e){var t="",n=0,r=$.patternHeader.exec(e);null!==r&&(t=r[1],n=r[0].length);for(var a,s,i,o={comments:[],elements:[],headerLength:n},l=t.split("\n"),B=0;B0,U=e.uvs.length>0,g=e.normals.length>0,d=e.faceVertexUvs.length>0,u=0;u0&&(e.indices.push(r.length),r.forEach((function(t,n){e.indices.push(t)}))),e.faceVertexUvs.push(a)}}function se(e,t,n,r){var a;switch(n){case"int8":case"char":a=[e.getInt8(t),1];break;case"uint8":case"uchar":a=[e.getUint8(t),1];break;case"int16":case"short":a=[e.getInt16(t,r),2];break;case"uint16":case"ushort":a=[e.getUint16(t,r),2];break;case"int32":case"int":a=[e.getInt32(t,r),4];break;case"uint32":case"uint":a=[e.getUint32(t,r),4];break;case"float32":case"float":a=[e.getFloat32(t,r),4];break;case"float64":case"double":a=[e.getFloat64(t,r),8];break;default:console.log("Unsupported type")}return a}function ie(e,t,n,r){for(var a,s={},i=0,o=0;o1&&void 0!==arguments[1]?arguments[1]:{},a=t.compression,s=t.progressCallback;return r.binary?t.dataAccessHelper.fetchBinary(n,{compression:a,progressCallback:s}):t.dataAccessHelper.fetchText(e,n,{compression:a,progressCallback:s})}t.classHierarchy.push("vtkPLYReader"),t.dataAccessHelper||(t.dataAccessHelper=_.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=n;var a=n.split("/");return a.pop(),t.baseURL=a.join("/"),t.compression=r.compression,e.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=n(t.url,r);return a.then(e.parse),a},e.parse=function(t){"string"==typeof t?e.parseAsText(t):e.parseAsArrayBuffer(t)},e.parseAsArrayBuffer=function(n){if(n&&n!==t.parseData){e.modified();var r=ee(j.a.arrayBufferToString(n));if("ascii"!==r.format){t.parseData=n;for(var a,s={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},i="binary_little_endian"===r.format,o=n instanceof ArrayBuffer?n:n.buffer,l=new DataView(o,r.headerLength),B=0,Q=0;Q=a.elements[B].count&&(B++,Q=0);var U=re(a.elements[B].properties,F);ae(s,a.elements[B].name,U),Q++}}var g=te(s,a.elements);t.output[0]=g}}},e.requestData=function(n,r){e.parse(t.parseData)}}var le={};l.c.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,le,n),l.c.obj(e,t),l.c.get(e,t,["url","baseURL"]),l.c.setGet(e,t,["dataAccessHelper"]),l.c.algo(e,t,0,1),oe(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}),"vtkPLYReader"),n(70);function Be(e,t){t.classHierarchy.push("vtkElevationReader"),t.dataAccessHelper||(t.dataAccessHelper=_.a.get("http")),e.setUrl=function(n,r){return t.url=n,e.loadData(r)},e.loadData=function(n){return function(n,r){return t.dataAccessHelper.fetchText(e,n,r)}(t.url,n).then((function(t){return e.parseAsText(t),!0}))},e.parseAsText=function(n){t.csv=n,t.elevation=[],t.csv.split("\n").forEach((function(e,n){t.elevation.push(e.split(",").map((function(e){return Number(e)})))})),e.modified()},e.requestData=function(e,n){var r=c.a.newInstance();if(r.getPoints().setData(new Float32Array(0,0,0,1,1,1),3),t.elevation){var a=t.elevation.length,s=t.elevation[0].length,i=r.getPoints();i.setNumberOfPoints(s*a,3);var o=i.getData(),l=H.a.newInstance({size:5*(s-1)*(a-1)});r.setPolys(l);var Q=l.getData(),F=0,U=new Float32Array(s*a*2),g=B.a.newInstance({numberOfComponents:2,values:U,name:"TextureCoordinates"});r.getPointData().setTCoords(g);for(var d=0;d0&&d>0&&(Q[F++]=4,Q[F++]=I,Q[F++]=I-1,Q[F++]=I-1-s,Q[F++]=I-s)}}t.output[0]=r},e.isBusy=function(){return!!t.requestCount}}var Qe={origin:[0,0,0],xSpacing:1,ySpacing:1,zScaling:1,xDirection:1,yDirection:-1,requestCount:0};l.c.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qe,n),l.c.obj(e,t),l.c.get(e,t,["url"]),l.c.setGet(e,t,["dataAccessHelper","xSpacing","ySpacing","zScaling","xDirection","yDirection"]),l.c.algo(e,t,0,1),l.c.event(e,t,"busy"),Be(e,t)}),"vtkElevationReader");var ce=n(14),Fe={};function Ue(e,t,n,r){for(var a=0;a0&&"\r"!==e})),i=s.length;a.push(i);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchText(e,n,r)}t.classHierarchy.push("vtkOBJReader"),t.dataAccessHelper||(t.dataAccessHelper=_.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(-1!==n.indexOf(".obj")||r.fullpath){t.url=n;var a=n.split("/");a.pop(),t.baseURL=a.join("/")}else t.baseURL=n,t.url="".concat(n,"/index.obj");return e.loadData(r)},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(t.url,r).then(e.parseAsText)},e.parseAsText=function(n){return!n||(n!==t.parseData&&e.modified(),t.parseData=n,t.numberOfOutputs=0,r=t.splitMode,Fe.splitOn=r,Fe.pieces=[],Fe.v=[],Fe.vt=[],Fe.vn=[],Fe.f=[[]],Fe.size=0,n.split("\n").forEach(ge),function(e){var t=!!Fe.vt.length,n=!!Fe.vn.length;if(e.splitMode){e.numberOfOutputs=Fe.size;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ue,n),l.c.obj(e,t),l.c.get(e,t,["url","baseURL"]),l.c.setGet(e,t,["dataAccessHelper","splitMode"]),l.c.algo(e,t,0,1),l.c.event(e,t,"busy"),de(e,t)}),"vtkOBJReader");var Ie=["chemical json","name","inchi","formula","atoms","bonds","properties"];function me(e,t){t.classHierarchy.push("vtkMolecule")}var Ce={"chemical json":0,name:"",inchi:"",formula:"",atoms:null,bonds:null,properties:null};function be(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ce,n),l.c.obj(e,t),t.atoms||(t.atoms={}),t.bonds||(t.bonds={}),t.properties||(t.properties={}),l.c.setGet(e,t,Ie),me(0,t)}var ye={newInstance:l.c.newInstance(be,"vtkMolecule"),extend:be},Se={H:[1],He:[2],Li:[3],Be:[4],B:[5],C:[6],N:[7],O:[8],F:[9],Ne:[10],Na:[11],Mg:[12],Al:[13],Si:[14],P:[15],S:[16],Cl:[17],Ar:[18],K:[19],Ca:[20],Sc:[21],Ti:[22],V:[23],Cr:[24],Mn:[25],Fe:[26],Co:[27],Ni:[28],Cu:[29],Zn:[30],Ga:[31],Ge:[32],As:[33],Se:[34],Br:[35],Kr:[36],Rb:[37],Sr:[38],Y:[39],Zr:[40],Nb:[41],Mo:[42],Tc:[43],Ru:[44],Rh:[45],Pd:[46],Ag:[47],Cd:[48],In:[49],Sn:[50],Sb:[51],Te:[52],I:[53],Xe:[54],Cs:[55],Ba:[56],La:[57],Ce:[58],Pr:[59],Nd:[60],Pm:[61],Sm:[62],Eu:[63],Gd:[64],Tb:[65],Dy:[66],Ho:[67],Er:[68],Tm:[69],Yb:[70],Lu:[71],Hf:[72],Ta:[73],W:[74],Re:[75],Os:[76],Ir:[77],Pt:[78],Au:[79],Hg:[80],Tl:[81],Pb:[82],Bi:[83],Po:[84],At:[85],Rn:[86],Fr:[87],Ra:[88],Ac:[89],Th:[90],Pa:[91],U:[92],Np:[93],Pu:[94],Am:[95],Cm:[96],Bk:[97],Cf:[98],Es:[99],Fm:[100],Md:[101],No:[102],Lr:[103],Rf:[104],Db:[105],Sg:[106],Bh:[107],Hs:[108],Mt:[109],Ds:[110],Rg:[111],Cn:[112],Uut:[113],Uuq:[114],Uup:[115],Uuh:[116],Uus:[117],Uuo:[118]};function xe(e,t){t.classHierarchy.push("vtkPDBReader"),t.dataAccessHelper||(t.dataAccessHelper=_.a.get("http")),e.setUrl=function(n,r){if(-1===n.indexOf(".pdb"))t.baseURL=n,t.url="".concat(n);else{t.url=n;var a=n.split("/");a.pop(),t.baseURL=a.join("/")}return e.loadData(r)},e.loadData=function(n){return function(n,r){return t.dataAccessHelper.fetchText(e,n,r)}(t.url,n).then(e.parseAsText)},e.parseAsText=function(n){return t.pdb=n,t.molecule=[],t.molecule=t.pdb.split("\n"),e.modified(),!0},e.requestData=function(e,n){var r=ye.newInstance();if(t.molecule){var a=t.molecule.length,s=[],i=[];t.numberOfAtoms=0;for(var o=0;o=78&&(d=B.substr(76,2).replace(/\s+/g,"")),""===d&&(d=c.substr(0,2).replace(/\d/g,"")),s.push(F),s.push(U),s.push(g);var u=Object(ce.a)(Se[d],1)[0];i.push(u),t.numberOfAtoms++}o++}r.getAtoms().elements={},r.getAtoms().elements.number=Int8Array.from(i),r.getAtoms().coords={},r.getAtoms().coords["3d"]=Float32Array.from(s)}t.output[0]=r},e.isBusy=function(){return!!t.requestCount}}var Ze={numberOfAtoms:0,requestCount:0};l.c.newInstance((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ze,n),l.c.obj(e,t),l.c.get(e,t,["url","baseURL","numberOfAtoms","requestCount"]),l.c.setGet(e,t,["dataAccessHelper"]),l.c.algo(e,t,0,1),l.c.event(e,t,"busy"),xe(e,t)}),"vtkPDBReader");var he=n(9),pe=n(17),Ge=n(18),Re=n(35);function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ve=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];function Ae(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function fe(e){return e[0]<=e[1]&&e[2]<=e[3]&&e[4]<=e[5]}function Ne(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ee(e){return Ne(e,Ve)}function De(e){var t=Object(ce.a)(e,6),n=t[0],r=t[1],a=t[2],s=t[3],i=t[4],o=t[5];e[0]=n<(arguments.length<=1?void 0:arguments[1])?n:arguments.length<=1?void 0:arguments[1],e[1]=r>(arguments.length<=1?void 0:arguments[1])?r:arguments.length<=1?void 0:arguments[1],e[2]=a<(arguments.length<=2?void 0:arguments[2])?a:arguments.length<=2?void 0:arguments[2],e[3]=s>(arguments.length<=2?void 0:arguments[2])?s:arguments.length<=2?void 0:arguments[2],e[4]=i<(arguments.length<=3?void 0:arguments[3])?i:arguments.length<=3?void 0:arguments[3],e[5]=o>(arguments.length<=3?void 0:arguments[3])?o:arguments.length<=3?void 0:arguments[3]}function ve(e,t,n,r,a,s,i){var o=Object(ce.a)(e,6),l=o[0],B=o[1],Q=o[2],c=o[3],F=o[4],U=o[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],B),e[2]=Math.min(t[2],Q),e[3]=Math.max(t[3],c),e[4]=Math.min(t[4],F),e[5]=Math.max(t[5],U)):(e[0]=Math.min(t,l),e[1]=Math.max(n,B),e[2]=Math.min(r,Q),e[3]=Math.max(a,c),e[4]=Math.min(s,F),e[5]=Math.max(i,U))}function Je(e,t,n,r){var a=Object(ce.a)(e,6),s=a[0],i=a[1],o=a[2],l=a[3],B=a[4],Q=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=n,e[3]=n>l?n:l,e[4]=r,e[5]=r>Q?r:Q,s!==t||o!==n||B!==r}function We(e,t,n,r){var a=Object(ce.a)(e,6),s=a[0],i=a[1],o=a[2],l=a[3],B=a[4],Q=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),n>=0?(e[2]*=n,e[3]*=n):(e[2]=n*e[3],e[3]=n*e[2]),r>=0?(e[4]*=r,e[5]*=r):(e[4]=r*e[5],e[5]=r*e[4]),!0)}function Te(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function ke(e,t){return e[2*t+1]-e[2*t]}function Me(e){return[ke(e,0),ke(e,1),ke(e,2)]}function we(e){return e.slice(0,2)}function Ye(e){return e.slice(2,4)}function Oe(e){return e.slice(4,6)}function ze(e){var t=Me(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function Pe(e){if(fe(e)){var t=Me(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Ke(e){return[e[0],e[2],e[4]]}function je(e){return[e[1],e[3],e[5]]}function _e(e,t){return e<=0&&t>=0||e>=0&&t<=0}function qe(e,t){for(var n=0,r=0;r<2;r++)for(var a=2;a<4;a++)for(var s=4;s<6;s++)t[n]=[e[r],e[a],e[s]],n++}function $e(e,t,n){t[0]=e[0],t[1]=e[2],t[2]=e[4],n[0]=e[1],n[1]=e[3],n[2]=e[5]}function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Te(e);return t[0]=e[1]-n[0],t[1]=e[3]-n[1],t[2]=e[5]-n[2],t}function tt(e,t,n,r){for(var a=[].concat(Ve),s=e.getData(),i=0;ie[2*Q+1]?(i[Q]=0,B[Q]=e[2*Q+1],s=!1):i[Q]=2;if(s)return r[0]=t[0],r[1]=t[1],r[2]=t[2],a[0]=0,1;for(var c=0;c<3;c++)2!==i[c]&&0!==n[c]?l[c]=(B[c]-t[c])/n[c]:l[c]=-1;for(var F=0;F<3;F++)l[o]1||l[o]<0)return 0;a[0]=l[o];for(var U=0;U<3;U++)if(o!==U){if(r[U]=t[U]+l[o]*n[U],r[U]e[2*U+1])return 0}else r[U]=B[U];return 1}function rt(e,t,n){for(var r=[],a=0,s=1,i=1,o=4;o<=5;++o){r[2]=e[o];for(var l=2;l<=3;++l){r[1]=e[l];for(var B=0;B<=1;++B)if(r[0]=e[B],a=Re.a.evaluate(n,t,r),i&&(s=a>=0?1:-1,i=0),0===a||s>0&&a<0||s<0&&a>0)return 1}}return 0}function at(e,t){if(!fe(e)||!fe(t))return!1;for(var n,r=[0,0,0,0,0,0],a=0;a<3;a++)if(n=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(n=!0,r[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(n=!0,r[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(n=!0,r[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(n=!0,r[2*a+1]=e[2*a+1]),!n)return!1;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],!0}function st(e,t){if(!fe(e)||!fe(t))return!1;for(var n=0;n<3;n++)if(!(t[2*n]>=e[2*n]&&t[2*n]<=e[2*n+1]||e[2*n]>=t[2*n]&&e[2*n]<=t[2*n+1]||t[2*n+1]>=e[2*n]&&t[2*n+1]<=e[2*n+1]||e[2*n+1]>=t[2*n]&&e[2*n+1]<=t[2*n+1]))return!1;return!0}function it(e,t,n,r){return!(te[1]||ne[3]||re[5])}function ot(e,t,n){for(var r=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],a=[0,0,0,0,0,0,0,0],s=0,i=0;i<2;i++)for(var o=2;o<4;o++)for(var l=4;l<6;l++){var B=[e[i],e[o],e[l]];a[s++]=Re.a.evaluate(n,t,B)}for(var Q=2;Q--&&!(_e(a[r[Q][0]],a[r[Q][4]])&&_e(a[r[Q][1]],a[r[Q][5]])&&_e(a[r[Q][2]],a[r[Q][6]])&&_e(a[r[Q][3]],a[r[Q][7]])););if(Q<0)return!1;for(var c=Math.sign(n[Q]),F=Math.abs((e[2*Q+1]-e[2*Q])*n[Q]),U=c>0?1:0,g=0;g<4;g++)if(0!==F){var d=Math.abs(a[r[Q][g]])/F;c>0&&dU&&(U=d)}var u=(1-U)*e[2*Q]+U*e[2*Q+1];return c>0?e[2*Q]=u:e[2*Q+1]=u,!0}var lt=function(){function e(t){Object(pe.a)(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),Ne(this.bounds,Ve))}return Object(Ge.a)(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return Ae(this.bounds,e)}},{key:"isValid",value:function(){return fe(this.bounds)}},{key:"setBounds",value:function(e){return Ne(this.bounds,e)}},{key:"reset",value:function(){return Ee(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne[1]||e[2]>e[3]||e[4]>e[5]?gt.EMPTY:3===t?gt.XYZ_GRID:2===t?e[0]===e[1]?gt.YZ_PLANE:e[2]===e[3]?gt.XZ_PLANE:gt.XY_PLANE:1===t?e[0]1&&(n*=t[r]-1)}return n},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(n){var r=e.getDimensions();if(0===r[0]||0===r[1]||0===r[2])return Gt("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case ct.EMPTY:return null;case ct.SINGLE_POINT:break;case ct.X_LINE:a[0]=n;break;case ct.Y_LINE:a[1]=n;break;case ct.Z_LINE:a[2]=n;break;case ct.XY_PLANE:a[0]=n%r[0],a[1]=n/r[0];break;case ct.YZ_PLANE:a[1]=n%r[1],a[2]=n/r[1];break;case ct.XZ_PLANE:a[0]=n%r[0],a[2]=n/r[0];break;case ct.XYZ_GRID:a[0]=n%r[0],a[1]=n/r[0]%r[1],a[2]=n/(r[0]*r[1]);break;default:Gt("Invalid dataDescription")}var s=[0,0,0];return e.indexToWorld(a,s),s},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var n=[t[0],t[2],t[4],t[1],t[2],t[4],t[0],t[3],t[4],t[1],t[3],t[4],t[0],t[2],t[5],t[1],t[2],t[5],t[0],t[3],t[5],t[1],t[3],t[5]],r=new Float64Array([n[0],n[1],n[2]]),a=new Float64Array(3);e.indexToWorld(r,a);for(var s=[a[0],a[0],a[1],a[1],a[2],a[2]],i=3;i<24;i+=3)Object(h.p)(r,n[i],n[i+1],n[i+2]),e.indexToWorld(r,a),a[0]s[1]&&(s[1]=a[0]),a[1]>s[3]&&(s[3]=a[1]),a[2]>s[5]&&(s[5]=a[2]);return s},e.computeTransforms=function(){Object(Z.e)(t.indexToWorld,t.origin),t.indexToWorld[0]=t.direction[0],t.indexToWorld[1]=t.direction[1],t.indexToWorld[2]=t.direction[2],t.indexToWorld[4]=t.direction[3],t.indexToWorld[5]=t.direction[4],t.indexToWorld[6]=t.direction[5],t.indexToWorld[8]=t.direction[6],t.indexToWorld[9]=t.direction[7],t.indexToWorld[10]=t.direction[8],Object(Z.r)(t.indexToWorld,t.indexToWorld,t.spacing),Object(Z.g)(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return Gt("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return Object(h.q)(n,e,t.indexToWorld),n},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(h.q)(n,e,t.worldToIndex),n},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];Bt.computeCornerPoints(e,r,a);var s=[0,0,0],i=[0,0,0];return Object(h.q)(s,r,t.indexToWorld),Object(h.q)(i,a,t.indexToWorld),Object(b.q)(s,i,n),n},e.worldToIndexBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];Bt.computeCornerPoints(e,r,a);var s=[0,0,0],i=[0,0,0];return Object(h.q)(s,r,t.worldToIndex),Object(h.q)(i,a,t.worldToIndex),Object(b.q)(s,i,n),n},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),n=[],r=0;r<3;r++)n[r]=(t[2*r+1]+t[2*r])/2;return n},e.computeHistogram=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[0,0,0,0,0,0];e.worldToIndexBounds(t,r);var a=[0,0,0],s=[0,0,0];Bt.computeCornerPoints(r,a,s),Object(b.p)(a,a),Object(b.p)(s,s);var i=e.getDimensions();Object(b.s)(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),Object(b.s)(s,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],s);for(var o=i[0],l=i[0]*i[1],B=e.getPointData().getScalars().getData(),Q=-1/0,c=1/0,F=0,U=0,g=0,d=a[2];d<=s[2];d++)for(var u=a[1];u<=s[1];u++)for(var I=a[0]+u*o+d*l,m=a[0];m<=s[0];m++){if(!n||n([m,u,d],r)){var C=B[I];C>Q&&(Q=C),C0?U/g:0,S=F-y*y,x=Math.sqrt(S);return{minimum:c,maximum:Q,average:y,variance:S,sigma:x}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=t,a=0;a<3;++a)n[a]=r,r*=e[2*a+1]-e[2*a]+1;return n},e.computeOffsetIndex=function(t){var n=Object(ce.a)(t,3),r=n[0],a=n[1],s=n[2],i=e.getExtent(),o=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,o);return Math.floor((Math.round(r)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(s)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var n=e.getExtent(),r=e.worldToIndex(t),a=0;a<3;++a)if(r[a]n[2*a+1])return Gt("GetScalarPointer: Pixel ".concat(r," is not in memory. Current extent = ").concat(n)),NaN;return e.computeOffsetIndex(r)},e.getScalarValueFromWorld=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.getPointData().getScalars().getNumberOfComponents();if(n<0||n>=r)return Gt("GetScalarPointer: Scalar Component ".concat(n," is not within bounds. Current Scalar numberOfComponents: ").concat(r)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,n)}}var Lt={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:ct.EMPTY};function Vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lt,n),Qt.a.extend(e,t,n),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=Ct(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),l.c.get(e,t,["direction","indexToWorld","worldToIndex"]),l.c.setGetArray(e,t,["origin","spacing"],3),l.c.getArray(e,t,["extent"],6),Rt(e,t)}var At={newInstance:l.c.newInstance(Vt,"vtkImageData"),extend:Vt},ft=n(40),Nt=n(22),Et={Int8:Int8Array,UInt8:Uint8Array,Int16:Int16Array,UInt16:Uint16Array,Int32:Int32Array,UInt32:Uint32Array,Int64:Int32Array,UInt64:Uint32Array,Float32:Float32Array,Float64:Float64Array},Dt={Int8:1,UInt8:1,Int16:2,UInt16:2,Int32:4,UInt32:4,Int64:8,UInt64:8,Float32:4,Float64:8};function vt(e){var t=e.length-1;return e.filter((function(e,n){return n1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchBinary(e,n)}t.classHierarchy.push("vtkXMLReader"),t.dataAccessHelper||(t.dataAccessHelper=_.a.get("http")),e.setUrl=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.url=n;var a=n.split("/");return a.pop(),t.baseURL=a.join("/"),e.loadData(r)},e.loadData=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(t.url,r).then(e.parseAsArrayBuffer)},e.parseAsArrayBuffer=function(n){if(!n)return!1;if(n===t.rawDataBuffer)return!0;e.modified();var r=function(e){return j.a.extractBinary(e,/^\s*\s*_/m,/\n\s*<\/AppendedData>/m)}(n),a=r.text,s=r.binaryBuffer;t.rawDataBuffer=n,t.binaryBuffer=s;var i=function(e){if(window.ActiveXObject){var t=new window.ActiveXObject("Microsoft.XMLDOM");return t.loadXML(e),t}return(new DOMParser).parseFromString(e,"application/xml")}(a).firstChild,o=i.getAttribute("type"),l=i.getAttribute("compressor"),B=i.getAttribute("byte_order"),Q=i.getAttribute("header_type")||"UInt32";if(l&&"vtkZLibDataCompressor"!==l)return console.error("Invalid compressor",l),!1;if(B&&"LittleEndian"!==B)return console.error("Only LittleEndian encoding is supported"),!1;if(o!==t.dataType)return console.error("Invalid data type",o,"expecting",t.dataType),!1;if(i.querySelector("AppendedData")){var c=i.querySelector("AppendedData"),F=c.getAttribute("encoding"),U=i.querySelectorAll("DataArray"),g=t.binaryBuffer;"base64"===F&&(g=c.textContent.trim().substr(1));for(var d=[],u=0;u0?0===S[3]?new ArrayBuffer(S[2]*x):new ArrayBuffer(S[2]*(x-1)+S[3]):new ArrayBuffer(0);for(var h=new Uint8Array(b),p={offset:0,uint8:h},G=0;G2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tt,n),l.c.obj(e,t),l.c.get(e,t,["url","baseURL"]),l.c.setGet(e,t,["dataAccessHelper"]),l.c.algo(e,t,0,1),Ht(e,t)},processDataArray:Xt,processFieldData:function(e,t,n,r,a,s,i){if(t){var o={};["Scalars","Vectors","Normals","Tensors","TCoords"].forEach((function(e){var r=t.getAttribute(e);r&&(o[r]=n["set".concat(e)])}));for(var l=t.getElementsByTagName("DataArray"),Q=l.length,c=0;c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wt,n),kt.extend(e,t,n),Mt(e,t)}),"vtkXMLImageDataReader");function Yt(e,t){t.classHierarchy.push("vtkXMLPolyDataReader"),e.parseXML=function(e,n,r,a,s){var i=e.getElementsByTagName(t.dataType)[0],l=i.getElementsByTagName("FieldData")[0],Q=i.getElementsByTagName("Piece"),F=Q.length,U=[];l&&(U=Object(o.a)(l.getElementsByTagName("DataArray")).map((function(e){return function(e,t,n,r,a){var s=Number(e.getAttribute("NumberOfTuples"));return B.a.newInstance(kt.processDataArray(s,e,t,n,r,a))}(e,r,a,s,t.binaryBuffer)})));for(var g=function(e){var n=c.a.newInstance(),i=Q[e],o=function(e,t,n,r,a,s,i){var o=Number(n.getAttribute("NumberOf".concat(t)));if(o>0){var l=n.getElementsByTagName(t)[0].getElementsByTagName("DataArray")[0],B=kt.processDataArray(o,l,r,a,s,i),Q=B.values,c=B.numberOfComponents;e["get".concat(t)]().setData(Q,c)}return o}(n,"Points",i,r,a,s,t.binaryBuffer),l=0;["Verts","Lines","Strips","Polys"].forEach((function(e){l+=function(e,t,n,r,a,s,i){var o=Number(n.getAttribute("NumberOf".concat(t)));if(o>0){var l=kt.processCells(o,n.getElementsByTagName(t)[0],r,a,s,i);e["get".concat(t)]().setData(l)}return o}(n,e,i,r,a,s,t.binaryBuffer)})),kt.processFieldData(o,i.getElementsByTagName("PointData")[0],n.getPointData(),r,a,s,t.binaryBuffer),kt.processFieldData(l,i.getElementsByTagName("CellData")[0],n.getCellData(),r,a,s,t.binaryBuffer);for(var B=n.getFieldData(),F=0;F2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ot,n),kt.extend(e,t,n),Yt(e,t)}),"vtkXMLPolyDataReader");var zt=n(43),Pt=Object(zt.a)((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t})),Kt=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pt(e,t)},jt=n(34),_t=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},qt=function(e,t){return!t||"object"!==Object(jt.a)(t)&&"function"!=typeof t?_t(e):t},$t=Object(zt.a)((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t})),en=l.c.vtkErrorMacro;function tn(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(n){var r=n.getTraverseOperation(),a=e[r];if(a)a(n);else{e.apply(n,!0);for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nn,n),l.c.obj(e,t),l.c.event(e,t,"event"),t.renderableChildMap=new Map,l.c.get(e,t,["visited"]),l.c.setGet(e,t,["parent","renderable","myFactory"]),l.c.getArray(e,t,["children"]),tn(e,t)}var an={newInstance:l.c.newInstance(rn,"vtkViewNode"),extend:rn,PASS_TYPES:["Build","Render"]},sn=navigator.gpu?"WebGPU":"WebGL",on=Object.create(null);function ln(e,t){on[e]=t}function Bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return on[e]&&on[e](t)}function Qn(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(n){e.hasRenderer(n)||(n.setRenderWindow(e),t.renderers.push(n),e.modified())},e.removeRenderer=function(n){t.renderers=t.renderers.filter((function(e){return e!==n})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Bn(e||t.defaultViewAPI,n)},e.addView=function(n){e.hasView(n)||(n.setRenderable(e),t.views.push(n),e.modified())},e.removeView=function(n){t.views=t.views.filter((function(e){return e!==n})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.render=function(){t.interactor?t.interactor.render():t.views.forEach((function(e){return e.traverseAllPasses()}))},e.getStatistics=function(){var e={propCount:0,invisiblePropCount:0};return t.renderers.forEach((function(t){t.getViewProps().forEach((function(t){if(t.getVisibility()){e.propCount+=1;var n=t.getMapper&&t.getMapper();if(n&&n.getPrimitiveCount){var r=n.getPrimitiveCount();Object.keys(r).forEach((function(t){e[t]||(e[t]=0),e[t]+=r[t]}))}}else e.invisiblePropCount+=1}))})),e.str=Object.keys(e).map((function(t){return"".concat(t,": ").concat(e[t])})).join("\n"),e},e.captureImages=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return l.c.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(n):void 0})).filter((function(e){return!!e}))}}var cn={defaultViewAPI:sn,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function Fn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cn,n),l.c.obj(e,t),l.c.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),l.c.get(e,t,["neverRendered"]),l.c.getArray(e,t,["renderers"]),l.c.event(e,t,"completion"),Qn(e,t)}var Un={newInstance:l.c.newInstance(Fn,"vtkRenderWindow"),extend:Fn,registerViewConstructor:ln,listViewAPIs:function(){return Object.keys(on)},newAPISpecificView:Bn};function gn(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(l.c.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=r,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),n.traverse(e)})),t.delegates.forEach((function(t){t.traverse(n,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),n.traverse(e)})))}}var dn={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function un(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dn,n),l.c.obj(e,t),l.c.get(e,t,["currentOperation"]),l.c.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),gn(e,t)}var In={newInstance:l.c.newInstance(un,"vtkRenderPass"),extend:un},mn={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Cn={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},bn={Wrap:mn,Filter:Cn};function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Sn=bn.Wrap,xn=bn.Filter,Zn=B.a.VtkDataTypes,hn=l.c.vtkDebugMacro,pn=l.c.vtkErrorMacro,Gn=l.c.vtkWarningMacro;function Rn(e,t){var n=this;function r(e,n){var r=[];if(e!==Zn.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var a=t.width*t.height*t.components,s=0;s=a&&(I=a-1);var m=d-u,C=1-m;u=u*r*s,I=I*r*s;for(var y=0;y=r&&(h=r-1);var p=x-Z;Z*=s,h*=s;for(var G=0;Ga[l]&&(a[l]=n[i]),i++;for(var B=[],Q=[],c=0;c0&&void 0!==arguments[0]?arguments[0]:null;if(n?t.openGLRenderWindow=n:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(xn.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(xn.LINEAR),e.setMagnificationFilter(xn.LINEAR)):(e.setMinificationFilter(xn.NEAREST),e.setMagnificationFilter(xn.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Sn.REPEAT),e.setWrapS(Sn.REPEAT),e.setWrapT(Sn.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(xn.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified()));var r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){for(var a=r.getExtent(),s=r.getPointData().getScalars(),i=[],o=0;ot.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var n=0;switch(t.target){case t.context.TEXTURE_2D:n=t.context.TEXTURE_BINDING_2D;break;default:Gn("impossible case")}e=t.context.getIntegerv(n)===t.handle}return e},e.sendParameters=function(){t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t.openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=function(n,r){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(n,r)),t.internalFormat||hn("Unable to find suitable internal format for T=".concat(n," NC= ").concat(r)),t.internalFormat},e.getDefaultInternalFormat=function(e,r){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!1))||(a=n.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!0))||(hn("Unsupported internal texture type!"),hn("Unable to find suitable internal format for T=".concat(e," NC= ").concat(r))),a},e.setInternalFormat=function(n){n!==t.internalFormat&&(t.internalFormat=n,e.modified())},e.getFormat=function(n,r){return t.format=e.getDefaultFormat(n,r),t.format},e.getDefaultFormat=function(e,n){if(t.openGLRenderWindow.getWebgl2())switch(n){case 1:return t.context.RED;case 2:return t.context.RG;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}else switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){if(t.openGLRenderWindow.getWebgl2())switch(e){case Zn.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case Zn.FLOAT:case Zn.VOID:default:return t.context.FLOAT}switch(e){case Zn.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case Zn.FLOAT:case Zn.VOID:default:return t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?t.context.FLOAT:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(n){return t.openGLDataType=e.getDefaultDataType(n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,n=1;switch(t.openGLDataType){case t.context.BYTE:e=(n=127.5)-128;break;case t.context.UNSIGNED_BYTE:n=255,e=0;break;case t.context.SHORT:e=(n=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:n=65536,e=0;break;case t.context.INT:e=(n=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:n=4294967295,e=0;break;case t.context.FLOAT:}return{shift:e,scale:n}},e.getOpenGLFilterMode=function(e){switch(e){case xn.NEAREST:return t.context.NEAREST;case xn.LINEAR:return t.context.LINEAR;case xn.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case xn.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case xn.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case xn.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Sn.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Sn.REPEAT:return t.context.REPEAT;case Sn.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(n,s,i,o,l){if(e.getOpenGLDataType(o),e.getInternalFormat(o,i),e.getFormat(o,i),!t.internalFormat||!t.format||!t.openGLDataType)return pn("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=n,t.height=s,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var B=a(r(o,[l]));return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,B[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.createCubeFromRaw=function(n,s,i,o,l){if(e.getOpenGLDataType(o),e.getInternalFormat(o,i),e.getFormat(o,i),!t.internalFormat||!t.format||!t.openGLDataType)return pn("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=n,t.height=s,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var B=a(r(o,l)),Q=[],c=t.width,F=t.height,U=0;U=1&&b>=1;){var y=null;m<=t.maxLevel&&(y=Q[6*m+I]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+I,m,t.internalFormat,C,b,0,t.format,t.openGLDataType,y),m++,C/=2,b/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(n,r,a,s){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===Zn.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=n,t.height=r,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,s),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(pn("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(n){if(e.getOpenGLDataType(Zn.UNSIGNED_CHAR),e.getInternalFormat(Zn.UNSIGNED_CHAR,4),e.getFormat(Zn.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return pn("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=n.width,t.height=n.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var r=!Object(b.n)(n.width)||!Object(b.n)(n.height),a=document.createElement("canvas");a.width=r?Object(b.i)(n.width):n.width,a.height=r?Object(b.i)(n.height):n.height;var s=a.getContext("2d");s.translate(0,a.height),s.scale(1,-1),s.drawImage(n,0,0,n.width,n.height,0,0,a.width,a.height),navigator.userAgent.indexOf("Chrome/69")>=0&&s.getImageData(0,0,1,1);var i=a;return t.context.texImage2D(t.target,0,t.internalFormat,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFromRaw=function(n,r,a,s,i,o){return e.getOpenGLDataType(i),e.getInternalFormat(i,s),e.getFormat(i,s),t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_3D,t.components=s,t.width=n,t.height=r,t.depth=a,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(pn("Failed to determine texture parameters."),!1)},e.create3DFilterableFromRaw=function(n,r,a,i,o,l){for(var B=n*r*a,Q=[],c=[],F=0;F4096&&(h===Zn.FLOAT||i>=3)&&(G=4096);var R=1,L=1;B>G*G&&(L=R=Math.ceil(Math.sqrt(B/(G*G))));var V=Math.sqrt(B)/R;V=Object(b.i)(V);var A,f=Math.floor(V*R/n),N=Math.ceil(a/f),E=Object(b.i)(r*N/L);t.width=V,t.height=E,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=f,t.volumeInfo.yreps=N,t.volumeInfo.xstride=R,t.volumeInfo.ystride=L,t.volumeInfo.offset=x.offset,t.volumeInfo.scale=x.scale;var D=V*E*i;A=h===Zn.FLOAT?new Float32Array(D):new Uint8Array(D);for(var v=0,J=Math.floor(n/R),W=Math.floor(r/L),X=0;X2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ln,n),an.extend(e,t,n),t.sendParametersTime={},l.c.obj(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},l.c.obj(t.textureBuildTime,{mtime:0}),l.c.set(e,t,["format","openGLDataType"]),l.c.setGet(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),l.c.get(e,t,["width","height","volumeInfo","components","handle","target"]),Rn(e,t)}var An=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0,r=t.context,a=r.COLOR_ATTACHMENT0;if(n>0){if(!t.openGLRenderWindow.getWebgl2())return void Object(l.l)("Using multiple framebuffer attachments requires WebGL 2");a+=n}t.colorTexture=e,r.framebufferTexture2D(r.FRAMEBUFFER,a,r.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.context,r=n.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void Object(l.l)("Using multiple framebuffer attachments requires WebGL 2");r+=e}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var n=t.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,e.getHandle(),0)}else Object(l.l)("Attaching depth buffer textures to fbo requires WebGL 2")},e.removeDepthBuffer=function(){if(t.openGLRenderWindow.getWebgl2()){var e=t.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,null,0)}else Object(l.l)("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.releaseGraphicsResources=function(){t.glFramebuffer&&t.context.deleteFramebuffer(t.glFramebuffer),t.colorTexture&&t.colorTexture.releaseGraphicsResources()},e.getSize=function(){var e=[0,0];return null!==t.glFramebuffer&&(e[0]=t.glFramebuffer.width,e[1]=t.glFramebuffer.height),e},e.populateFramebuffer=function(){e.bind();var n=t.context,r=An.newInstance();r.setOpenGLRenderWindow(t.openGLRenderWindow),r.setMinificationFilter(Cn.LINEAR),r.setMagnificationFilter(Cn.LINEAR),r.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,X.b.UNSIGNED_CHAR,null),e.setColorBuffer(r),t.depthTexture=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,t.depthTexture),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t.depthTexture)}}var Nn={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function En(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nn,n),Object(l.g)(e,t),Object(l.i)(e,t,["colorTexture"]),fn(e,t)}var Dn={newInstance:Object(l.f)(En,"vtkFramebuffer"),extend:En};function vn(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=r,e.setCurrentOperation("buildPass"),n.traverse(e);for(var a=n.getRenderable().getNumberOfLayers(),s=n.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var Q=n.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=Dn.newInstance()),t.framebuffer.setOpenGLRenderWindow(n),t.framebuffer.saveCurrentBindingsAndBuffers();var c=t.framebuffer.getSize();null!==c&&c[0]===Q[0]&&c[1]===Q[1]||(t.framebuffer.create(Q[0],Q[1]),t.framebuffer.populateFramebuffer()),t.framebuffer.bind(),e.setCurrentOperation("opaqueZBufferPass"),l.traverse(e),t.framebuffer.restorePreviousBindingsAndBuffers(),t.depthRequested=!1}e.setCurrentOperation("cameraPass"),l.traverse(e),t.opaqueActorCount>0&&(e.setCurrentOperation("opaquePass"),l.traverse(e)),t.translucentActorCount>0&&(e.setCurrentOperation("translucentPass"),l.traverse(e)),t.volumeCount>0&&(e.setCurrentOperation("volumePass"),l.traverse(e))}}}},e.getZBufferTexture=function(){return t.framebuffer?t.framebuffer.getColorTexture():null},e.requestDepth=function(){t.depthRequested=!0},e.incrementOpaqueActorCount=function(){return t.opaqueActorCount++},e.incrementTranslucentActorCount=function(){return t.translucentActorCount++},e.incrementVolumeCount=function(){return t.volumeCount++}}var Jn={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,framebuffer:null,depthRequested:!1};function Wn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jn,n),In.extend(e,t,n),l.c.get(e,t,["framebuffer"]),vn(e,t)}var Xn={newInstance:l.c.newInstance(Wn,"vtkForwardPass"),extend:Wn};function Hn(e,t){t.classHierarchy.push("vtkGenericWidgetRepresentation")}var Tn={};function kn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tn,n),an.extend(e,t,n),Hn(0,t)}var Mn={newInstance:l.c.newInstance(kn),extend:kn};function wn(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(n){if(n){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(var r=0;rt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Object(Z.d)(t.keyMatrices.mcwc,t.renderable.getMatrix()),Object(Z.i)(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?Ct(t.keyMatrices.normalMatrix):(mt(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),yt(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),bt(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}var Yn={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function On(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yn,n),an.extend(e,t,n),t.keyMatrixTime={},l.c.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:Ct(new Float64Array(9)),mcwc:Object(Z.h)(new Float64Array(16))},l.c.setGet(e,t,["context"]),l.c.get(e,t,["activeTextures"]),wn(e,t)}var zn={newInstance:l.c.newInstance(On),extend:On};function Pn(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach((function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)})),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach((function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)})),e.apply(n,!1))},e.activateTextures=function(){t.activeTextures=[],t.children.forEach((function(e){e.isA("vtkOpenGLTexture")&&(e.render(),e.getHandle()&&t.activeTextures.push(e))}))},e.opaquePass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0),e.activateTextures()):t.activeTextures.forEach((function(e){e.deactivate()}))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1),e.activateTextures()):(t.activeTextures.forEach((function(e){e.deactivate()})),t.context.depthMask(!0))}}var Kn={context:null,activeTextures:[]};function jn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kn,n),an.extend(e,t,n),Object(l.i)(e,t,["context"]),Object(l.d)(e,t,["activeTextures"]),Pn(e,t)}var _n={newInstance:Object(l.f)(jn),extend:jn};function qn(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(n){n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var n=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),t.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(n){if(n!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||n.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Object(Z.d)(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),mt(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),yt(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Object(Z.i)(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var r=t.openGLRenderer.getAspectRatio();Object(Z.d)(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(r,-1,1)),Object(Z.i)(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Object(Z.l)(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=n}return t.keyMatrices}}var $n={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function er(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$n,n),an.extend(e,t,n),t.keyMatrixTime={},Object(l.g)(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},Object(l.i)(e,t,["context","keyMatrixTime"]),qn(e,t)}var tr={newInstance:Object(l.f)(er),extend:er},nr={FLAT:0,GOURAUD:1,PHONG:2},rr={POINTS:0,WIREFRAME:1,SURFACE:2},ar={Shading:nr,Representation:rr,Interpolation:nr};function sr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ir=ar.Representation,or=ar.Interpolation;function lr(e){return function(){return l.c.vtkErrorMacro("vtkProperty::".concat(e," - NOT IMPLEMENTED"))}}function Br(e,t){t.classHierarchy.push("vtkProperty"),e.setColor=function(n,r,a){Array.isArray(n)?t.color[0]===n[0]&&t.color[1]===n[1]&&t.color[2]===n[2]||(t.color[0]=n[0],t.color[1]=n[1],t.color[2]=n[2],e.modified()):t.color[0]===n&&t.color[1]===r&&t.color[2]===a||(t.color[0]=n,t.color[1]=r,t.color[2]=a,e.modified()),e.setDiffuseColor(t.color),e.setAmbientColor(t.color),e.setSpecularColor(t.color)},e.computeCompositeColor=lr("ComputeCompositeColor"),e.getColor=function(){var e=0;t.ambient+t.diffuse+t.specular>0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var n=0;n<3;n++)t.color[n]=e*(t.ambient*t.ambientColor[n]+t.diffuse*t.diffuseColor[n]+t.specular*t.specularColor[n]);return[].concat(t.color)},e.addShaderVariable=lr("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(or.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(or.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(or.PHONG)},e.getInterpolationAsString=function(){return l.c.enumToString(or,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(ir.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(ir.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(ir.POINTS)},e.getRepresentationAsString=function(){return l.c.enumToString(ir,t.representation)}}var Qr={color:[1,1,1],ambientColor:[1,1,1],diffuseColor:[1,1,1],specularColor:[1,1,1],edgeColor:[0,0,0],ambient:0,diffuse:1,specular:0,specularPower:1,opacity:1,interpolation:or.GOURAUD,representation:ir.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function cr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qr,n),l.c.obj(e,t),l.c.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),l.c.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),Br(e,t)}var Fr=function(e){for(var t=1;t=0?t.annotationArray[a].annotation!==r&&(t.annotationArray[a].annotation=r,s=!0):(t.annotationArray.push({value:n,annotation:r}),a=t.annotationArray.length-1,s=!0),s&&(e.updateAnnotatedValueMap(),e.modified()),a},e.getNumberOfAnnotatedValues=function(){return t.annotationArray.length},e.getAnnotatedValue=function(e){return e<0||e>=t.annotationArray.length?null:t.annotationArray[e].value},e.getAnnotation=function(e){return void 0===t.annotationArray[e]?null:t.annotationArray[e].annotation},e.getAnnotatedValueIndex=function(n){return t.annotationArray.length?e.checkForAnnotatedValue(n):-1},e.removeAnnotation=function(n){var r=e.checkForAnnotatedValue(n),a=r>=0;return a&&(t.annotationArray.splice(r,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(n,r){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(n);e.getIndexedColor(a,r)}else e.getColor(parseFloat(n),r),r[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var n=t.annotationArray.length;return t.annotatedValueMap[e]%n}return-1},e.getIndexedColor=function(e,t){t[0]=0,t[1]=0,t[2]=0,t[3]=0},e.updateAnnotatedValueMap=function(){t.annotatedValueMap=[];for(var e=t.annotationArray.length,n=0;n1?e.mapVectorsThroughTable(t,s,Ir.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,s,Ir.RGBA,l))}return s},e.mapVectorsToMagnitude=function(e,t,n){for(var r=e.getNumberOfTuples(),a=e.getNumberOfComponents(),s=t.getData(),i=e.getData(),o=0;o=Q&&(l=Q-1)):(-1===o&&(o=e.getVectorSize()),o<=0?(l=0,o=Q):(l<0&&(l=0),l>=Q&&(l=Q-1),l+o>Q&&(o=Q-l)),i!==mr.MAGNITUDE||1!==Q&&1!==o||(i=mr.COMPONENT));var c=0;switch(l>0&&(c=l),i){case mr.COMPONENT:e.mapScalarsThroughTable(t,n,r,c);break;default:case mr.MAGNITUDE:var F=B.a.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,F,o),e.mapScalarsThroughTable(F,n,r,0);break;case mr.RGBCOLORS:}},e.luminanceToRGBA=function(e,t,n,r){for(var a=r(n),s=t.getData(),i=e.getData(),o=s.length,l=0,B=0;B=1&&n.getDataType()===Cr.UNSIGNED_CHAR)return n;var i=B.a.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Cr.UNSIGNED_CHAR});if(a<=0)return i;s=(s=s>0?s:0)<1?s:1;var o=Sr;switch(n.getDataType()!==Cr.FLOAT&&n.getDataType()!==Cr.DOUBLE||(o=xr),r){case 1:e.luminanceToRGBA(i,n,s,o);break;case 2:e.luminanceAlphaToRGBA(i,n,o);break;case 3:e.rGBToRGBA(i,n,s,o);break;case 4:e.rGBAToRGBA(i,n,s,o);break;default:return yr("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,n){return e.setMappingRange(t,n)},e.getRange=function(t,n){return e.getMappingRange()}}var hr={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:mr.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hr,n),l.c.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],l.c.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),l.c.setArray(e,t,["mappingRange"],2),l.c.getArray(e,t,["mappingRange"]),Zr(e,t)}var Gr=function(e){for(var t=1;tt.range[1]?t.maxIndex+1+1.5:(n=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(n,r,a,s){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var o=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:o,shift:0,scale:0};e.lookupShiftAndScale(o,l);var B=e.getAlpha(),Q=n.getNumberOfTuples(),c=n.getNumberOfComponents(),F=r.getData(),U=n.getData();if(B>=1){if(a===Ur.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Vr={numberOfColors:256,hueRange:[0,.66667],saturationRange:[1,1],valueRange:[1,1],alphaRange:[1,1],nanColor:[.5,0,0,1],belowRangeColor:[0,0,0,1],aboveRangeColor:[1,1,1,1],useAboveRangeColor:!1,useBelowRangeColor:!1,alpha:1};function Ar(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vr,n),Gr.extend(e,t,n),t.table||(t.table=[]),t.buildTime={},l.c.obj(t.buildTime),t.opaqueFlagBuildTime={},l.c.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},l.c.obj(t.insertTime,{mtime:0}),l.c.get(e,t,["buildTime"]),l.c.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),l.c.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),l.c.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),l.c.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),Lr(e,t)}var fr={newInstance:l.c.newInstance(Ar,"vtkLookupTable"),extend:Ar};function Nr(e,t){e.update=function(){e.getInputData()},e.addClippingPlane=function(e){"vtkPlane"===e.getClassName()&&t.clippingPlanes.push(e)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(e){e<0||e>=6||t.clippingPlanes.splice(e,1)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var n=t.length,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Er,n),l.c.obj(e,t),l.c.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),Nr(e,t)}};function vr(e,t){e.getBounds=function(){return 0},e.getBounds=function(n){e.getBounds();for(var r=0;r<6;r++)n[r]=t.bounds[r]},e.getCenter=function(){e.getBounds();for(var n=0;n<3;n++)t.center[n]=(t.bounds[2*n+1]+t.bounds[2*n])/2;return t.center.slice()},e.getLength=function(){var n=0,r=0;e.getBounds();for(var a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return Math.sqrt(r)},e.getClippingPlaneInDataCoords=function(e,n,r){var a=t.clippingPlanes,s=e;if(a){var i=a.length;if(n>=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jr,n),Dr.extend(e,t,n),t.bounds||Object(b.D)(t.bounds),t.center||(t.center=[0,0,0]),vr(e,t)}},Xr=1,Hr=0,Tr=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Hr=e}var Mr={getResolveCoincidentTopologyAsString:function(){return Tr[Hr]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Xr},getResolveCoincidentTopology:function(){return Hr},setResolveCoincidentTopology:kr,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Xr=e},setResolveCoincidentTopologyToDefault:function(){kr(0)},setResolveCoincidentTopologyToOff:function(){kr(0)},setResolveCoincidentTopologyToPolygonOffset:function(){kr(1)}};function wr(e,t,n){n.forEach((function(n){e["get".concat(n.method)]=function(){return t[n.key]},e["set".concat(n.method)]=function(e,r){t[n.key]={factor:e,offset:r}}}))}var Yr=["Polygon","Line","Point"],Or={};wr(Or,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},Yr.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var zr={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),l.c.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Mr).forEach((function(t){e[t]=Mr[t]})),Object.keys(Or).forEach((function(t){e[t]=Or[t]})),wr(e,t.topologyOffset,Yr.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Or.getResolveCoincidentTopologyPolygonOffsetParameters(),n=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Or.getResolveCoincidentTopologyLineOffsetParameters(),n=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Or.getResolveCoincidentTopologyPointOffsetParameters(),n=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}}},staticOffsetAPI:Or,otherStaticMethods:Mr,CATEGORIES:Yr};function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kr(e){for(var t=1;t1e3?r=1e3:r<-1e3&&(r=-1e3)),{texCoordS:r,texCoordT:a}},e.createColorTextureCoordinates=function(t,n,r,a,s,i,o,l,B){var Q=(i[1]-i[0])/l,c=[];c[0]=i[0]-Q,c[1]=i[1]+Q;var F=1/(c[1]-c[0]),U=n.getData(),g=t.getData(),d=0,u=0;if(s<0||s>=a)for(var I=0;It.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==r){t.lookupTable.setAlpha(r),t.colorTextureMap=null,t.lookupTable.build();var o=t.lookupTable.getNumberOfAvailableColors();o>4094&&(o=4094),o+=2;for(var l=(a[1]-a[0])/(o-1-2),Q=new Float64Array(2*o),c=0;ct.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var g=n.getNumberOfComponents(),d=n.getNumberOfTuples();t.colorCoordinates=B.a.newInstance({numberOfComponents:2,values:new Float32Array(2*d)});var u=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===ta.MAGNITUDE&&n.getNumberOfComponents()>1&&(u=-1),e.createColorTextureCoordinates(n,t.colorCoordinates,d,g,u,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,s)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(n){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var r=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=r.scalars;return!(!a||r.cellFlag||t.colorMode===qr.DEFAULT&&a.getDataType()===na.UNSIGNED_CHAR||t.colorMode===qr.DIRECT_SCALARS)},e.clearColorArrays=function(){t.colorMapColors=null,t.colorCoordinates=null,t.colorTextureMap=null},e.getLookupTable=function(){return t.lookupTable||e.createDefaultLookupTable(),t.lookupTable},e.getMTime=function(){var e=t.mtime;if(null!==t.lookupTable){var n=t.lookupTable.getMTime();e=n>e?n:e}return e},e.getPrimitiveCount=function(){var t=e.getInputData();return{points:t.getPoints().getNumberOfValues()/3,verts:t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells(),lines:t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells(),triangles:t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells()}},e.acquireInvertibleLookupTable=ra("AcquireInvertibleLookupTable"),e.valueToColor=ra("ValueToColor"),e.colorToValue=ra("ColorToValue"),e.useInvertibleColorFor=ra("UseInvertibleColorFor"),e.clearInvertibleColor=ra("ClearInvertibleColor")}var sa={colorMapColors:null,static:!1,lookupTable:null,scalarVisibility:!0,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,fieldDataTupleId:-1,interpolateScalarsBeforeMapping:!1,colorCoordinates:null,colorTextureMap:null,forceCompileOnly:0,useInvertibleColors:!1,invertibleScalars:null,viewSpecificProperties:null,customShaderAttributes:[]};function ia(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sa,n),Wr.extend(e,t,n),l.c.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),l.c.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),l.c.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),zr.implementCoincidentTopologyMethods(e,t),aa(e,t)}var oa=Kr(Kr(Kr({newInstance:l.c.newInstance(ia,"vtkMapper"),extend:ia},jr),_r),dr),la=l.c.vtkErrorMacro;function Ba(e,t){t.classHierarchy.push("vtkShader"),e.compile=function(){var e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;switch(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),t.shaderType){case"Fragment":e=t.context.FRAGMENT_SHADER;break;case"Vertex":default:e=t.context.VERTEX_SHADER}if(t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){var n=t.context.getShaderInfoLog(t.handle);return la("Error compiling shader '".concat(t.source,"': ").concat(n)),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}}var Qa={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function ca(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qa,n),l.c.obj(e,t),l.c.setGet(e,t,["shaderType","source","error","handle","context"]),Ba(e,t)}var Fa={newInstance:l.c.newInstance(ca,"vtkShader"),extend:ca},Ua=l.c.vtkErrorMacro;function ga(e,t){t.classHierarchy.push("vtkShaderProgram"),e.compileShader=function(){return t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(Ua("Links failed: ".concat(t.error)),0):(Ua(t.error),0):(Ua(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Ua(t.fragmentShader.getError()),0):(Ua(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Ua(t.vertexShader.getError()),0)},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0)},e.bind=function(){return!(!t.linked&&!e.link()||(t.context.useProgram(t.handle),e.setBound(!0),0))},e.isBound=function(){return!!t.bound},e.release=function(){t.context.useProgram(null),e.setBound(!1)},e.setContext=function(e){t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=function(){if(t.inked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){var n=t.context.getProgramInfoLog(t.handle);return Ua("Error linking shader ".concat(n)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var s=new Float32Array(r);return t.context.uniformMatrix4fv(a,!1,s),!0},e.setUniformMatrix3x3=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var s=new Float32Array(r);return t.context.uniformMatrix3fv(a,!1,s),!0},e.setUniformf=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1f(a,r),!0)},e.setUniformfv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1fv(a,r),!0)},e.setUniformi=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1i(a,r),!0)},e.setUniformiv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1iv(a,r),!0)},e.setUniform2f=function(n,r,a){var s=e.findUniform(n);if(-1===s)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(s,r,a),!0},e.setUniform2fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2fv(a,r),!0)},e.setUniform2i=function(n,r,a){var s=e.findUniform(n);if(-1===s)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(s,r,a),!0},e.setUniform2iv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2iv(a,r),!0)},e.setUniform3f=function(n,r,a,s){var i=e.findUniform(n);if(-1===i)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===s)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,r,a,s),!0},e.setUniform3fArray=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(!Array.isArray(r)||3!==r.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,r[0],r[1],r[2]),!0},e.setUniform3fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform3fv(a,r),!0)},e.setUniform3i=function(n){var r=e.findUniform(n);if(-1===r)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;for(var a=arguments.length,s=new Array(a>1?a-1:0),i=1;i1?a-1:0),i=1;i1?a-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,da,n),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Fa.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Fa.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Fa.newInstance(),t.geometryShader.setShaderType("Geometry"),l.c.obj(e,t),l.c.get(e,t,["lastCameraMTime"]),l.c.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),ga(e,t)}var Ia,ma={newInstance:l.c.newInstance(ua,"vtkShaderProgram"),extend:ua,substitute:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(n)?n.join("\n"):n,s=!1;-1!==e.search(t)&&(s=!0);var i="";r&&(i="g");var o=new RegExp(t,i),l=e.replace(o,a);return{replace:s,result:l}}};function Ca(e,t,n){var r=t[0],a=t[1],s=t[2],i=t[3];return e[0]=n[0]*r+n[4]*a+n[8]*s+n[12]*i,e[1]=n[1]*r+n[5]*a+n[9]*s+n[13]*i,e[2]=n[2]*r+n[6]*a+n[10]*s+n[14]*i,e[3]=n[3]*r+n[7]*a+n[11]*s+n[15]*i,e}function ba(){var e=new ut.a(4);return ut.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ya(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function Sa(e,t,n){var r=t[0],a=t[1],s=t[2],i=t[3],o=n[0],l=n[1],B=n[2],Q=n[3];return e[0]=r*Q+i*o+a*B-s*l,e[1]=a*Q+i*l+s*o-r*B,e[2]=s*Q+i*B+r*l-a*o,e[3]=i*Q-r*o-a*l-s*B,e}Ia=new ut.a(4),ut.a!=Float32Array&&(Ia[0]=0,Ia[1]=0,Ia[2]=0,Ia[3]=0);var xa=function(e,t,n,r){var a=new ut.a(4);return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a};Object(h.n)(),Object(h.o)(1,0,0),Object(h.o)(0,1,0),ba(),ba(),It();var Za={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},ha={ObjectType:Za};function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ga(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Va,n),l.c.obj(e,t),l.c.get(e,t,["openGLRenderWindow"]),La(e,t)}var fa=Ga(Ga({newInstance:l.c.newInstance(Aa),extend:Aa},{}),ha),Na=l.c.vtkErrorMacro;function Ea(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Za.ARRAY_BUFFER),e.createVBO=function(n,r,a,s){if(!n.getData()||!n.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];var i=s.points.getData(),o=null,l=null,B=null,Q=s.colors?s.colors.getNumberOfComponents():0,c=s.tcoords?s.tcoords.getNumberOfComponents():0;s.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,o=s.normals.getData()),s.customAttributes&&s.customAttributes.forEach((function(e){e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())})),s.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=c,t.blockSize+=c,l=s.tcoords.getData()),s.colors?(t.colorComponents=s.colors.getNumberOfComponents(),t.colorOffset=0,B=s.colors.getData(),t.colorBO||(t.colorBO=fa.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var F,U=0,g=0,d=0,u=0,I=0,m=0,C={anythingToPoints:function(e,t,n){for(var r=0;r2)for(var r=0;r2){for(var r=0;r1?2*(e-1):0},polysToWireframe:function(e,t){return e>2?2*e:0},stripsToWireframe:function(e,t){return e>2?4*e-6:0},polysToSurface:function(e,t){return e>2?3*(e-2):0},stripsToSurface:function(e,t,n){return e>2?3*(e-2):0}},y=null,S=null;a===rr.POINTS||"verts"===r?(y=C.anythingToPoints,S=b.anythingToPoints):a===rr.WIREFRAME||"lines"===r?(y=C["".concat(r,"ToWireframe")],S=b["".concat(r,"ToWireframe")]):(y=C["".concat(r,"ToSurface")],S=b["".concat(r,"ToSurface")]);for(var x=n.getData(),Z=x.length,h=0,p=0;p0&&(Math.abs(f)/A>1e6||Math.abs(Math.log10(A))>3||0===A&&f>1e6)){for(var J=new Float64Array(3),W=new Float64Array(3),X=0;X<3;++X){var H=s.points.getRange(X),T=H[1]-H[0];J[X]=.5*(H[1]+H[0]),W[X]=T>0?1/T:1}e.setCoordShiftAndScale(J,W)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);F=function(e){if(U=3*e,t.coordShiftAndScaleEnabled?(R[L++]=(i[U++]-t.coordShift[0])*t.coordScale[0],R[L++]=(i[U++]-t.coordShift[1])*t.coordScale[1],R[L++]=(i[U++]-t.coordShift[2])*t.coordScale[2]):(R[L++]=i[U++],R[L++]=i[U++],R[L++]=i[U++]),null!==o&&(g=s.haveCellNormals?3*(m+s.cellOffset):3*e,R[L++]=o[g++],R[L++]=o[g++],R[L++]=o[g++]),t.customData.forEach((function(t){I=e*t.components;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Da,n),fa.extend(e,t,n),l.c.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),l.c.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),Ea(e,t)}var Ja={newInstance:l.c.newInstance(va),extend:va};function Wa(e,t){t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=function(){},e.initialize=function(){t.instancingExtension=null,t.openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t.openGLRenderWindow&&t.openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=function(){return 0!==t.handleVAO||!1===t.supported},e.bind=function(){if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):n.vertexAttribDivisor(i.index+l,1))}},e.release=function(){if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):n.vertexAttribDivisor(i.index+l,0)),n.disableVertexAttribArray(i.index+l)}},e.shaderProgramChanged=function(){e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=function(){e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=function(t,n,r,a,s,i,o,l){return e.addAttributeArrayWithDivisor(t,n,r,a,s,i,o,l,0,!1)},e.addAttributeArrayWithDivisor=function(n,r,a,s,i,o,l,B,Q,c){if(!n)return!1;if(!n.isBound()||0===r.getHandle()||r.getType()!==Za.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=n.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==n.getHandle())return!1;var F=t.context,U={};if(U.name=a,U.index=F.getAttribLocation(t.handleProgram,a),U.offset=s,U.stride=i,U.type=o,U.size=l,U.normalize=B,U.isMatrix=c,U.divisor=Q,-1===U.Index)return!1;if(r.bind(),F.enableVertexAttribArray(U.index),F.vertexAttribPointer(U.index,U.size,U.type,U.normalize,U.stride,U.offset),Q>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(U.index,1):F.vertexAttribDivisor(U.index,1)),U.buffer=r.getHandle(),!t.supported){for(var g=!1,d=0;d0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(U+g,1):F.vertexAttribDivisor(U+g,1));return!0},e.removeAttributeArray=function(n){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xa,n),t.buffers=[],l.c.obj(e,t),l.c.get(e,t,["supported"]),l.c.setGet(e,t,["forceEmulation"]),Wa(e,t)}var Ta={newInstance:l.c.newInstance(Ha,"vtkOpenGLVertexArrayObject"),extend:Ha};function ka(e,t){t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=function(e){t.program.setContext(e.getContext()),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=function(e){t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)}}var Ma={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function wa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ma,n),l.c.obj(e,t),t.shaderSourceTime={},l.c.obj(t.shaderSourceTime),t.attributeUpdateTime={},l.c.obj(t.attributeUpdateTime),l.c.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=ma.newInstance(),t.VAO=Ta.newInstance(),t.CABO=Ja.newInstance(),ka(e,t)}var Ya={newInstance:l.c.newInstance(wa),extend:wa},Oa="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nattribute vec4 vertexMC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// optional normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// camera and actor matrix values\n//VTK::Camera::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// picking support\n//VTK::Picking::Dec\n\nvoid main()\n{\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Clip::Impl\n\n //VTK::PrimID::Impl\n\n //VTK::PositionVC::Impl\n\n //VTK::Light::Impl\n\n //VTK::Picking::Impl\n}\n",za="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n}\n",Pa={implementReplaceShaderCoincidentOffset:function(e,t){e.replaceShaderCoincidentOffset=function(n,r,a){var s=e.getCoincidentParameters(r,a);if(s&&(0!==s.factor||0!==s.offset)){var i=n.Fragment;i=ma.substitute(i,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,t.context.getExtension("EXT_frag_depth")&&(0!==s.factor?(i=ma.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=ma.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=ma.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),t.openGLRenderWindow.getWebgl2()&&(0!==s.factor?(i=ma.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=ma.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=ma.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),n.Fragment=i}}}},Ka={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},ja=Fr.Representation,_a=Fr.Shading,qa=oa.ScalarMode,$a=An.Filter,es=An.Wrap,ts=l.c.vtkErrorMacro,ns={type:"StartEvent"},rs={type:"EndEvent"};function as(e,t){function n(e,t,n){return t.identity(n),e.reduce((function(e,n,r){return 0===r?n?t.copy(e,n):t.identity(e):n?t.multiply(e,e,n):e}),n)}t.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(n){n&&(t.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),t.openGLRenderer=t.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.openGLCamera=t.openGLRenderer.getViewNodeFor(t.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var n=t.openGLRenderWindow.getContext();if(t.context!==n){t.context=n;for(var r=Ka.Start;r= cos(radians(lightConeAngle".concat(c,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(c,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(c,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(c,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(c,");")," }"]);o=o.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=ma.substitute(a,"//VTK::Light::Impl",o,!1).result;break;default:ts("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(n,r,a){if(t.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var s=n.Vertex,i=n.Geometry,o=n.Fragment;t.lastBoundBO.getCABO().getNormalOffset()?(s=ma.substitute(s,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,s=ma.substitute(s,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=ma.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=ma.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,o=ma.substitute(o,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,o=ma.substitute(o,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.haveCellNormals?(o=ma.substitute(o,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,o=ma.substitute(o,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.getOpenGLMode(a.getProperty().getRepresentation(),t.lastBoundBO.getPrimitiveType())===t.context.LINES?(o=ma.substitute(o,"//VTK::UniformFlow::Impl",[" vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));"," vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));"," //VTK::UniformFlow::Impl"]).result,o=ma.substitute(o,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," fdx = normalize(fdx);"," fdy = normalize(fdy);"," if (abs(fdx.x) > 0.0)"," { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(o=ma.substitute(o,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,o=ma.substitute(o,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,o=ma.substitute(o,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=s,n.Geometry=i,n.Fragment=o}},e.replaceShaderPositionVC=function(e,n,r){var a=e.Vertex,s=e.Geometry,i=e.Fragment;r.getProperty().getRepresentation()!==ja.POINTS&&t.lastBoundBO.getPrimitiveType()!==Ka.Points||(a=ma.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(r.getProperty().getPointSize(),".0;")],!1).result),t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=ma.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=ma.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=ma.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,s=ma.substitute(s,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,s=ma.substitute(s,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=ma.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=ma.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=ma.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=ma.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=s,e.Fragment=i},e.replaceShaderTCoord=function(e,n,r){if(t.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,s=e.Geometry,i=e.Fragment;if(t.drawingEdges)return;a=ma.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var o=t.openGLActor.getActiveTextures(),l=2,B=2;if(o&&o.length>0&&(l=o[0].getComponents(),o[0].getTarget()===t.context.TEXTURE_CUBE_MAP&&(B=3)),t.renderable.getColorTextureMap()&&(l=t.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),B=2),2===B){if(a=ma.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,s=ma.substitute(s,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,s=ma.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=ma.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,o&&o.length>=1)switch(l){case 1:i=ma.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=ma.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=ma.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);").result}}else switch(a=ma.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,s=ma.substitute(s,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,s=ma.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=ma.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=ma.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=ma.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=ma.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);").result}e.Vertex=a,e.Geometry=s,e.Fragment=i}},e.replaceShaderClip=function(e,n,r){var a=e.Vertex,s=e.Fragment;if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(l.c.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),i=6),a=ma.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=ma.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=ma.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,s=ma.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=s},e.getCoincidentParameters=function(e,n){var r=null,a=n.getProperty();if(t.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===ja.SURFACE){var s=t.lastBoundBO.getPrimitiveType();s===Ka.Points||a.getRepresentation()===ja.POINTS?r=t.renderable.getCoincidentTopologyPointOffsetParameter():s===Ka.Lines||a.getRepresentation()===ja.WIREFRAME?r=t.renderable.getCoincidentTopologyLineOffsetParameters():s!==Ka.Tris&&s!==Ka.TriStrips||(r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()),s!==Ka.TrisEdges&&s!==Ka.TriStripsEdges||((r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,r.offset/=2)}return r},e.replaceShaderPicking=function(e,t,n){var r=e.Fragment;r=ma.substitute(r,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,r=ma.substitute(r,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=r},e.replaceShaderValues=function(n,r,a){if(e.replaceShaderColor(n,r,a),e.replaceShaderNormal(n,r,a),e.replaceShaderLight(n,r,a),e.replaceShaderTCoord(n,r,a),e.replaceShaderPicking(n,r,a),e.replaceShaderClip(n,r,a),e.replaceShaderCoincidentOffset(n,r,a),e.replaceShaderPositionVC(n,r,a),t.haveSeenDepthRequest){var s=n.Fragment;s=ma.substitute(s,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,s=ma.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=s}},e.getNeedToRebuildShaders=function(n,r,a){var s=0,i=0,o=n.getPrimitiveType(),l=t.currentInput,B=!1,Q=l.getPointData().getNormals(),c=l.getCellData().getNormals(),F=a.getProperty().getInterpolation()===_a.FLAT,U=a.getProperty().getRepresentation(),g=e.getOpenGLMode(U,o);if(g===t.context.TRIANGLES||c&&!Q||!F&&Q?B=!0:F||g!==t.context.LINES||(B=!0),a.getProperty().getLighting()&&B){s=0;for(var d=r.getLightsByReference(),u=0;u0&&(i++,0===s&&(s=1)),1===s&&(i>1||1!==I.getIntensity()||!I.lightTypeIsHeadLight())&&(s=2),s<3&&I.getPositional()&&(s=3)}}var m=!1,C=t.lastBoundBO.getReferenceByName("lastLightComplexity"),b=t.lastBoundBO.getReferenceByName("lastLightCount");return C===s&&b===i||(t.lastBoundBO.set({lastLightComplexity:s},!0),t.lastBoundBO.set({lastLightCount:i},!0),m=!0),!!(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===n.getProgram()||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){var s=t.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||ts("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&s>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||ts("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),t.renderable.getCustomShaderAttributes().forEach((function(e,r){n.getProgram().isAttributeUsed("".concat(e,"MC"))&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"".concat(e,"MC"),n.getCABO().getCustomData()[r].offset,n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getCustomData()[r].components,!1)||ts("Error setting ".concat(e,"MC in shader VAO.")))})),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||ts("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||ts("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(l.c.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),i=6);for(var o=[],B=0;B0){var c=Q.getColorByReference(),F=Q.getIntensity();t.lightColor[0]=c[0]*F,t.lightColor[1]=c[1]*F,t.lightColor[2]=c[2]*F;var U=Q.getDirection(),g=n.getActiveCamera().getViewMatrix(),d=Object(o.a)(U);Q.lightTypeIsSceneLight()&&(d[0]=g[0]*U[0]+g[1]*U[1]+g[2]*U[2],d[1]=g[4]*U[0]+g[5]*U[1]+g[6]*U[2],d[2]=g[8]*U[0]+g[9]*U[1]+g[10]*U[2],Object(b.x)(d)),t.lightDirection[0]=d[0],t.lightDirection[1]=d[1],t.lightDirection[2]=d[2],t.lightHalfAngle[0]=-t.lightDirection[0],t.lightHalfAngle[1]=-t.lightDirection[1],t.lightHalfAngle[2]=1-t.lightDirection[2],Object(b.x)(t.lightDirection),s.setUniform3fArray("lightColor".concat(i),t.lightColor),s.setUniform3fArray("lightDirectionVC".concat(i),t.lightDirection),s.setUniform3fArray("lightHalfAngleVC".concat(i),t.lightHalfAngle),i++}}if(!(a<3)){var u=n.getActiveCamera().getViewMatrix();Object(Z.i)(u,u),i=0;for(var I=0;I0){var C=m.getTransformedPosition(),y=new Float64Array(3);Object(h.q)(y,C,u),s.setUniform3fArray("lightAttenuation".concat(i),m.getAttenuationValuesByReference()),s.setUniformi("lightPositional".concat(i),m.getPositional()),s.setUniformf("lightExponent".concat(i),m.getExponent()),s.setUniformf("lightConeAngle".concat(i),m.getConeAngle()),s.setUniform3fArray("lightPositionVC".concat(i),[y[0],y[1],y[2]]),i++}}}}},e.setCameraShaderParameters=function(e,r,a){var s=e.getProgram(),i=t.openGLCamera.getKeyMatrices(r),o=r.getActiveCamera(),l=t.openGLCamera.getKeyMatrixTime().getMTime(),B=s.getLastCameraMTime(),Q=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,c=a.getIsIdentity(),F=c?{mcwc:null,normalMatrix:null}:t.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([i.wcpc,F.mcwc,Q],Z.n,t.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([i.wcvc,F.mcwc,Q],Z.n,t.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([i.normalMatrix,F.normalMatrix],pt,t.tmpMat3)),B!==l&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",o.getParallelProjection()),s.setLastCameraMTime(l)),c||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram(),s=r.getProperty(),i=s.getOpacity(),o=t.drawingEdges?s.getEdgeColorByReference():s.getAmbientColorByReference(),l=t.drawingEdges?s.getEdgeColorByReference():s.getDiffuseColorByReference(),B=t.drawingEdges?1:s.getAmbient(),Q=t.drawingEdges?0:s.getDiffuse(),c=t.drawingEdges?0:s.getSpecular(),F=s.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",o),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",B),a.setUniformf("diffuse",Q);var U=t.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(U<1)){var g=s.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",F),a.isUniformUsed("ambientIntensityBF")){if(i=(s=r.getBackfaceProperty()).getOpacity(),o=s.getAmbientColor(),B=s.getAmbient(),l=s.getDiffuseColor(),Q=s.getDiffuse(),g=s.getSpecularColor(),c=s.getSpecular(),a.setUniformf("ambientIntensityBF",B),a.setUniformf("diffuseIntensityBF",Q),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",o),a.setUniform3fArray("diffuseColorUniformBF",l),U<1)return;a.setUniformf("specularIntensityBF",c),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",F)}}},e.renderPieceStart=function(n,r){t.primitiveIDOffset=0,t.openGLRenderer.getSelector()&&(t.openGLRenderer.getSelector().getCurrentPass(),t.openGLRenderer.getSelector().renderProp(r)),e.updateBufferObjects(n,r),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),t.lastBoundBO=null},e.renderPieceDraw=function(n,r){var a=r.getProperty().getRepresentation(),s=t.context,i=r.getProperty().getEdgeVisibility()&&a===ja.SURFACE;s.lineWidth(r.getProperty().getLineWidth());for(var o=Ka.Start;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ss,n),an.extend(e,t,n),Pa.implementReplaceShaderCoincidentOffset(e,t,n),t.primitives=[],t.primTypes=Ka,t.tmpMat3=Ct(new Float64Array(9)),t.tmpMat4=Object(Z.h)(new Float64Array(16));for(var r=Ka.Start;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cs,n),l.c.obj(e,t),t.properties={},l.c.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Qs(e,t)}var Us=function(e){for(var t=1;t0&&(--s in t.hitProps||(t.hitProps[s]=!0))}},e.renderProp=function(n){t.currentPass===us.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+t.idOffset),t.props.push(n))},e.renderCompositeIndex=function(n){t.currentPass===us.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(n+t.idOffset)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.getPropFromID=function(e){return e>=0&&et.area[2]||n[1]t.area[3])return null;var i=[n[0]-t.area[0],n[1]-t.area[1]],o=e.convert(i[0],i[1],t.pixBuffer[us.ACTOR_PASS]);if(o<=0)return null;var l={valid:!0};l.propID=o-t.idOffset,l.prop=e.getPropFromID(l.propID);var B=e.convert(i[0],i[1],t.pixBuffer[us.COMPOSITE_INDEX_PASS]);if((B<0||B>16777215)&&(B=0),l.compositeID=B-t.idOffset,t.captureZValues){var Q=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[Q]+t.zBuffer[Q+1])/65535,l.displayPosition=n}return l}var c=[n[0],n[1]],F=[0,0],U=e.getPixelInformation(n,0,a);if(U&&U.valid)return U;for(var g=1;gg?c[1]-g:0;d<=c[1]+g;++d){if(F[1]=d,c[0]>=g&&(F[0]=c[0]-g,(U=e.getPixelInformation(F,0,a))&&U.valid))return U;if(F[0]=c[0]+g,(U=e.getPixelInformation(F,0,a))&&U.valid)return U}for(var u=c[0]>=g?c[0]-(g-1):0;u<=c[0]+(g-1);++u){if(F[0]=u,c[1]>=g&&(F[1]=c[1]-g,(U=e.getPixelInformation(F,0,a))&&U.valid))return U;if(F[1]=c[1]+g,(U=e.getPixelInformation(F,0,a))&&U.valid)return U}}return a[0]=n[0],a[1]=n[1],null},e.convertSelection=function(e,n){var r=[],a=0;return n.forEach((function(n,s){var i=Us.newInstance();switch(i.setContentType(Is.INDICES),e){case Cs.FIELD_ASSOCIATION_CELLS:i.setFieldType(ms.CELL);break;case Cs.FIELD_ASSOCIATION_POINTS:i.setFieldType(ms.POINT);break;default:bs("Unknown field association")}i.getProperties().propID=n.info.propID,i.getProperties().prop=n.info.prop,i.getProperties().compositeID=n.info.compositeID,i.getProperties().pixelCount=n.pixelCount,t.captureZValues&&(i.getProperties().displayPosition=[n.info.displayPosition[0],n.info.displayPosition[1],n.info.zValue],i.getProperties().worldPosition=t.openGLRenderWindow.displayToWorld(n.info.displayPosition[0],n.info.displayPosition[1],n.info.zValue,t.renderer)),i.setSelectionList(n.attributeIDs),r[a]=i,a++})),r},e.getInfoHash=function(e){return"".concat(e.propID," ").concat(e.compositeID)},e.generateSelection=function(n,r,a,s){for(var i=Math.floor(n),o=Math.floor(r),l=Math.floor(a),B=Math.floor(s),Q=new Map,c=[0,0],F=o;F<=B;F++)for(var U=i;U<=l;U++){var g=[U,F],d=e.getPixelInformation(g,0,c);if(d&&d.valid){var u=e.getInfoHash(d);if(Q.has(u)){var I=Q.get(u);I.pixelCount++,t.captureZValues&&d.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ss,n),l.c.obj(e,t),t.area=[0,0,0,0],t.propColorValue=[0,0,0],t.props=[],l.c.setGet(e,t,["fieldAssociation","renderer","currentPass","captureZValues"]),l.c.setGetArray(e,t,["area"],4),l.c.setGetArray(e,t,["propColorValue"],3),l.c.event(e,t,"event"),ys(e,t)}var Zs=function(e){for(var t=1;t0){var s=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(s=ma.substitute(s,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,s=ma.substitute(s,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=s}n.replaceShaderNormal(e,r,a)},e.replaceShaderColor=function(e,r,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var s=e.Vertex,i=e.Geometry,o=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),B=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(B=B.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var Q=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(Q=Q.concat([" vec3 specularColor;"," float specularPower;"])),Q=Q.concat([" opacity = opacityUniform;"]),l&&(Q=Q.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(B=B.concat(["varying vec4 vertexColorVSOutput;"]),s=ma.substitute(s,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,s=ma.substitute(s,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=ma.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=ma.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,Q=Q.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),o=ma.substitute(o,"//VTK::Color::Impl",Q).result,o=ma.substitute(o,"//VTK::Color::Dec",B).result,e.Vertex=s,e.Geometry=i,e.Fragment=o}n.replaceShaderColor(e,r,a)},e.replaceShaderPositionVC=function(e,r,a){if(t.hardwareSupport){var s=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(s=ma.substitute(s,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,s=ma.substitute(s,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(s=ma.substitute(s,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,s=ma.substitute(s,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=s}n.replaceShaderPositionVC(e,r,a)},e.replaceShaderPicking=function(e,r,a){if(t.hardwareSupport){var s=e.Fragment,i=e.Vertex;i=ma.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=ma.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,s=ma.substitute(s,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,s=ma.substitute(s,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,e.Fragment=s}else n.replaceShaderPicking(e,r,a)},e.updateGlyphShaderParameters=function(n,r,a,s,i,o,l,B){var Q=a.getProgram();if(n){var c=t.normalMatrix,F=o,U=9*l,g=t.tmpMat3,d=c[0],u=c[1],I=c[2],m=c[3],C=c[4],b=c[5],y=c[6],S=c[7],x=c[8],Z=F[U],h=F[U+1],p=F[U+2],G=F[U+3],R=F[U+4],L=F[U+5],V=F[U+6],A=F[U+7],f=F[U+8];g[0]=Z*d+h*m+p*y,g[1]=Z*u+h*C+p*S,g[2]=Z*I+h*b+p*x,g[3]=G*d+R*m+L*y,g[4]=G*u+R*C+L*S,g[5]=G*I+R*b+L*x,g[6]=V*d+A*m+f*y,g[7]=V*u+A*C+f*S,g[8]=V*I+A*b+f*x,Q.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),Q.setUniformMatrix("MCPCMatrix",t.tmpMat4),r&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),Q.setUniformMatrix("MCVCMatrix",t.tmpMat4)),s){var N=s.getData();t.tmpColor[0]=N[4*l]/255,t.tmpColor[1]=N[4*l+1]/255,t.tmpColor[2]=N[4*l+2]/255,Q.setUniform3fArray("ambientColorUniform",t.tmpColor),Q.setUniform3fArray("diffuseColorUniform",t.tmpColor)}B&&Q.setUniform3fArray("mapperIndex",B.getPropColorValue())},e.renderPieceDraw=function(n,r){var a=r.getProperty().getRepresentation(),s=t.context,i=r.getProperty().getEdgeVisibility()&&a===Gs.SURFACE,o=t.openGLCamera.getKeyMatrices(n),l=t.openGLActor.getKeyMatrices();St(t.normalMatrix,o.normalMatrix,l.normalMatrix),Object(Z.l)(t.mcpcMatrix,o.wcpc,l.mcwc),Object(Z.l)(t.mcvcMatrix,o.wcvc,l.mcwc);var B=t.renderable.getMatrixArray(),Q=t.renderable.getNormalArray(),c=t.renderable.getColorArray(),F=B.length/16,U=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===Ls.COMPOSITE_INDEX_PASS&&(U=!0);for(var g=t.primTypes.Start;ge.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime()))return e.getProgram().isAttributeUsed("gMatrix")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.matrixBuffer,"gMatrix",0,64,t.context.FLOAT,4,!1,1)||ps("Error setting gMatrix in shader VAO."):e.getVAO().removeAttributeArray("gMatrix"),e.getProgram().isAttributeUsed("gNormal")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.normalBuffer,"gNormal",0,36,t.context.FLOAT,3,!1,1)||ps("Error setting gNormal in shader VAO."):e.getVAO().removeAttributeArray("gNormal"),e.getProgram().isAttributeUsed("gColor")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.colorBuffer,"gColor",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||ps("Error setting gColor in shader VAO."):e.getVAO().removeAttributeArray("gColor"),e.getProgram().isAttributeUsed("mapperIndexVS")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.pickBuffer,"mapperIndexVS",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||ps("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),n.setMapperShaderParameters(e,r,a),void e.getAttributeUpdateTime().modified();n.setMapperShaderParameters(e,r,a)},e.getNeedToRebuildBufferObjects=function(e,r){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,Rs.ARRAY_BUFFER),t.normalBuffer.upload(s,Rs.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),Rs.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var o=a.length/16,l=new Uint8Array(4*o),B=0;B2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ns,n),os.extend(e,t,n),t.tmpMat3=Ct(new Float64Array(9)),t.normalMatrix=Ct(new Float64Array(9)),t.mcpcMatrix=Object(Z.h)(new Float64Array(16)),t.mcvcMatrix=Object(Z.h)(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},l.c.obj(t.glyphBOBuildTime,{mtime:0}),fs(e,t)}var Ds={newInstance:l.c.newInstance(Es,"vtkOpenGLGlyph3DMapper"),extend:Es},vs={SlicingMode:{NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5}},Js={NEAREST:0,LINEAR:1},Ws={InterpolationType:Js},Xs=l.c.vtkErrorMacro,Hs=vs.SlicingMode;function Ts(e,t,n){if(t.apply(e)){var r=e.getIndependentComponents();return"".concat(e.getMTime(),"-").concat(r,"-").concat(n)}return"0"}function ks(e,t){t.classHierarchy.push("vtkOpenGLImageMapper"),e.buildPass=function(n){if(n){t.openGLImageSlice=e.getFirstAncestorOfType("vtkOpenGLImageSlice"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.pwfTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera()),t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(r.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.getCoincidentParameters=function(e,n){return t.renderable.getResolveCoincidentTopology()?t.renderable.getCoincidentTopologyPolygonOffsetParameters():null},e.render=function(){var n=t.openGLImageSlice.getRenderable(),r=t.openGLRenderer.getRenderable();e.renderPiece(r,n)},e.buildShaders=function(t,n,r){e.getShaderTemplate(t,n,r),e.replaceShaderValues(t,n,r)},e.getShaderTemplate=function(e,t,n){e.Vertex=Oa,e.Fragment=za,e.Geometry=""},e.replaceShaderValues=function(n,r,a){var s=n.Vertex,i=n.Fragment;s=ma.substitute(s,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,s=ma.substitute(s,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,s=ma.substitute(s,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,s=ma.substitute(s,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;var o=t.openGLTexture.getComponents(),l=a.getProperty().getIndependentComponents(),B=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(l){for(var Q=1;Qn.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Xs("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),t.context.FALSE)||Xs("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());var s=t.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",s);var i=t.openGLTexture.getComponents(),o=a.getProperty().getIndependentComponents();if(o)for(var l=0;l1?1:0;var Y=s.getData(),O=null;if(E===Hs.I){O=new Y.constructor(H[2]*H[1]*l);for(var z=0,P=0;P2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ms,n),an.extend(e,t,n),Pa.implementReplaceShaderCoincidentOffset(e,t,n),t.tris=Ya.newInstance(),t.openGLTexture=An.newInstance(),t.colorTexture=An.newInstance(),t.pwfTexture=An.newInstance(),t.imagemat=Object(Z.h)(new Float64Array(16)),l.c.setGet(e,t,[]),t.VBOBuildTime={},l.c.obj(t.VBOBuildTime),ks(e,t)}var Ys={newInstance:l.c.newInstance(ws,"vtkOpenGLImageMapper"),extend:ws};function Os(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(n){if(t.renderable&&t.renderable.getVisibility()&&n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach((function(e){e.traverse(n)})),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach((function(e){e.traverse(n)})),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,n){return e.opaquePass(t,n)},e.opaquePass=function(n,r){n&&(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Object(Z.d)(t.keyMatrices.mcwc,t.renderable.getMatrix()),Object(Z.i)(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}var zs={context:null,keyMatrixTime:null,keyMatrices:null};function Ps(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zs,n),an.extend(e,t,n),t.keyMatrixTime={},l.c.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Object(Z.h)(new Float64Array(16))},l.c.setGet(e,t,["context"]),Os(e,t)}var Ks={newInstance:l.c.newInstance(Ps,"vtkOpenGLImageSlice"),extend:Ps},js=l.c.vtkDebugMacro;function _s(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),s=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),o=null;if(t.renderable.getUseZValues()){var l=r.getZBufferTexture(),B=Math.floor(l.getWidth()),Q=Math.floor(l.getHeight()),c=t.openGLRenderWindow.getContext();l.bind();var F=r.getFramebuffer();F?F.saveCurrentBindingsAndBuffers():js("No framebuffer to save/restore");var U=c.createFramebuffer();c.bindFramebuffer(c.FRAMEBUFFER,U),c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,l.getHandle(),0),c.checkFramebufferStatus(c.FRAMEBUFFER)===c.FRAMEBUFFER_COMPLETE&&(o=new Uint8Array(B*Q*4),c.viewport(0,0,B,Q),c.readPixels(0,0,B,Q,c.RGBA,c.UNSIGNED_BYTE,o)),F&&F.restorePreviousBindingsAndBuffers(),c.deleteFramebuffer(U)}t.renderable.invokeCallback(t.renderable.getInputData(),s,a,i,o)},e.queryPass=function(e,n){e&&t.renderable.getUseZValues()&&n.requestDepth()}}var qs={};function $s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qs,n),an.extend(e,t,n),_s(e,t)}var ei={newInstance:l.c.newInstance($s,"vtkOpenGLPixelSpaceCallbackMapper"),extend:$s},ti=l.c.vtkDebugMacro;function ni(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(ti("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(n){if(n){var r=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),r|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),r|=a.DEPTH_BUFFER_BIT,a.depthMask(!0));var s=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize),a.viewport(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize),a.colorMask(!0,!0,!0,!0),a.clear(r),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),n=t.renderable.getViewportByReference();return e[0]*(n[2]-n[0])/((n[3]-n[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),n=[0,0,1,1],r=Object(b.F)(e[0]-n[0],0,1),a=Object(b.F)(e[1]-n[1],0,1),s=t.parent.normalizedDisplayToDisplay(r,a),i=Math.round(s[0]),o=Math.round(s[1]),l=Object(b.F)(e[2]-n[0],0,1),B=Object(b.F)(e[3]-n[1],0,1);l>n[2]-n[0]&&(l=n[2]-n[0]),B>n[3]-n[1]&&(B=n[3]-n[1]);var Q=t.parent.normalizedDisplayToDisplay(l,B),c=Math.round(Q[0])-i,F=Math.round(Q[1])-o;return c<0&&(c=0),F<0&&(F=0),{usize:c,vsize:F,lowerLeftU:i,lowerLeftV:o}},e.clear=function(){var n=0,r=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),n|=r.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,r.depthMask(!0)),r.colorMask(!0,!0,!0,!0);var s=e.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize),r.viewport(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize),r.clear(n),r.enable(r.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))}}var ri={context:null,openGLRenderWindow:null,selector:null};function ai(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ri,n),an.extend(e,t,n),l.c.get(e,t,["shaderCache"]),l.c.setGet(e,t,["selector"]),ni(e,t)}var si={newInstance:l.c.newInstance(ai,"vtkOpenGLRenderer"),extend:ai},ii=l.c.vtkErrorMacro;function oi(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(n){if(n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera())}},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},e.opaquePass=function(n,r){if(n&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.openGLRenderWindow.enableDepthMask(),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var s=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(s),o=new Float64Array(16);if(Object(Z.g)(o,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",o),"box"===t.lastFormat){var l=s.getActiveCamera().getPosition();t.tris.getProgram().setUniform3f("camPos",l[0],l[1],l[2])}t.tris.getVAO().bind(),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.openGLTexture.deactivate()}},e.updateBufferObjects=function(){if(!t.tris.getCABO().getElementCount()){for(var e=new Float32Array(12),n=0;n<4;n++)e[3*n]=n%2*2-1,e[3*n+1]=n>1?1:-1,e[3*n+2]=1;var r=B.a.newInstance({numberOfComponents:3,values:e});r.setName("points");var a=new Uint16Array(8);a[0]=3,a[1]=0,a[2]=1,a[3]=3,a[4]=3,a[5]=0,a[6]=3,a[7]=2;var s=B.a.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(s,"polys",rr.SURFACE,{points:r,cellOffset:0})}t.renderable.getFormat()!==t.lastFormat&&(t.lastFormat=t.renderable.getFormat(),"box"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec3 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = wpos.xyz/wpos.w;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec3 TexCoords;\n uniform samplerCube sbtexture;\n uniform vec3 camPos;\n void main () {\n // skybox looks from inside out\n // which means we have to adjust\n // our tcoords. Otherwise text would\n // be flipped\n vec3 tc = normalize(TexCoords - camPos);\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\n {\n tc = vec3(1.0, 1.0, -1.0) * tc;\n }\n else\n {\n tc = vec3(-1.0, 1.0, 1.0) * tc;\n }\n gl_FragData[0] = textureCube(sbtexture, tc);\n }","")),"background"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec2 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec2 TexCoords;\n uniform sampler2D sbtexture;\n void main () {\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\n }","")),t.tris.getShaderSourceTime().modified(),t.tris.getVAO().bind(),t.tris.getVAO().addAttributeArray(t.tris.getProgram(),t.tris.getCABO(),"vertexMC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ii("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||ii("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var li={context:null};function Bi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,li,n),an.extend(e,t,n),t.openGLTexture=An.newInstance(),t.tris=Ya.newInstance(),t.keyMatrixTime={},l.c.obj(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:Ct(new Float64Array(9)),mcwc:Object(Z.h)(new Float64Array(16))},l.c.setGet(e,t,["context"]),l.c.get(e,t,["activeTextures"]),oi(e,t)}var Qi={newInstance:l.c.newInstance(Bi),extend:Bi};function ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Fi=l.c.vtkErrorMacro;function Ui(e,t){t.classHierarchy.push("vtkOpenGLSphereMapper");var n=function(e){for(var t=1;t radiusVCVSOutput*3.0) {\n"," EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"," }\n"," EyePos = EyePos - centerVCVSOutput;\n"," EyePos = EyePos/radiusVCVSOutput;\n"," float b = 2.0*dot(EyePos,EyeDir);\n"," float c = dot(EyePos,EyePos) - 1.0;\n"," float d = b*b - 4.0*c;\n"," vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"," if (d < 0.0) { discard; }\n"," else {\n"," float t = (-b - invertedDepth*sqrt(d))*0.5;\n"," normalVCVSOutput = invertedDepth*normalize(EyePos + t*EyeDir);\n"," vertexVC.xyz = normalVCVSOutput*radiusVCVSOutput + centerVCVSOutput;\n"," }\n"," vec4 pos = VCPCMatrix * vertexVC;\n",o]).result,i=ma.substitute(i,"//VTK::Normal::Impl","").result,t.haveSeenDepthRequest&&(i=ma.substitute(i,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),e.Vertex=s,e.Fragment=i,n.replaceShaderValues(e,r,a)},e.setMapperShaderParameters=function(e,r,a){e.getCABO().getElementCount()&&(t.VBOBuildTime>e.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime())&&e.getProgram().isAttributeUsed("offsetMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"offsetMC",12,e.getCABO().getStride(),t.context.FLOAT,2,!1)||Fi("Error setting 'offsetMC' in shader VAO.")),e.getProgram().isUniformUsed("invertedDepth")&&e.getProgram().setUniformf("invertedDepth",t.invert?-1:1),n.setMapperShaderParameters(e,r,a)},e.setCameraShaderParameters=function(e,n,r){var a=e.getProgram(),s=n.getActiveCamera(),i=t.openGLCamera.getKeyMatrices(n);if(a.isUniformUsed("VCPCMatrix")&&a.setUniformMatrix("VCPCMatrix",i.vcpc),a.isUniformUsed("MCVCMatrix"))if(r.getIsIdentity())a.setUniformMatrix("MCVCMatrix",i.wcvc);else{var o=t.openGLActor.getKeyMatrices(),l=new Float64Array(16);Object(Z.l)(l,i.wcvc,o.mcwc),a.setUniformMatrix("MCVCMatrix",l)}a.isUniformUsed("cameraParallel")&&e.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},e.getOpenGLMode=function(e,n){return t.context.TRIANGLES},e.buildBufferObjects=function(e,n){var r=t.currentInput;if(null!==r){t.renderable.mapScalars(r,1);var a=t.renderable.getColorMapColors(),s=t.primitives[t.primTypes.Tris].getCABO(),i=r.getPointData(),o=r.getPoints(),l=o.getNumberOfPoints(),B=o.getData(),Q=null;null!=t.renderable.getScaleArray()&&i.hasArray(t.renderable.getScaleArray())&&(Q=i.getArray(t.renderable.getScaleArray()).getData());var c=null,F=0,U=null;a?(F=a.getNumberOfComponents(),s.setColorOffset(0),s.setColorBOStride(4),c=a.getData(),U=new Uint8Array(3*l*4),s.getColorBO()||s.setColorBO(fa.newInstance()),s.getColorBO().setOpenGLRenderWindow(t.openGLRenderWindow)):s.getColorBO()&&s.setColorBO(null),s.setColorComponents(F);var g=new Float32Array(5*l*3);s.setStride(20);for(var d=Math.cos(Object(b.B)(30)),u=0,I=0,m=0,C=0,y=0;y2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gi,n),os.extend(e,t,n),Ui(e,t)}var ui={newInstance:l.c.newInstance(di,"vtkOpenGLSphereMapper"),extend:di};function Ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var mi=l.l;function Ci(e,t){t.classHierarchy.push("vtkOpenGLStickMapper");var n=function(e){for(var t=1;t radiusVCVSOutput*3.0) {\n"," EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"," }\n"," EyePos = EyePos - centerVCVSOutput;\n"," vec3 base1;\n"," if (abs(orientVCVSOutput.z) < 0.99) {\n"," base1 = normalize(cross(orientVCVSOutput,vec3(0.0,0.0,1.0))); }\n"," else {\n"," base1 = normalize(cross(orientVCVSOutput,vec3(0.0,1.0,0.0))); }\n"," vec3 base2 = cross(orientVCVSOutput,base1);\n"," EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVCVSOutput));\n"," EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVCVSOutput));\n"," EyePos = EyePos/radiusVCVSOutput;\n"," float a = EyeDir.x*EyeDir.x + EyeDir.y*EyeDir.y;\n"," float b = 2.0*(EyePos.x*EyeDir.x + EyePos.y*EyeDir.y);\n"," float c = EyePos.x*EyePos.x + EyePos.y*EyePos.y - 1.0;\n"," float d = b*b - 4.0*a*c;\n"," vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"," if (d < 0.0) { discard; }\n"," else {\n"," float t = (-b - sqrt(d))/(2.0*a);\n"," float tz = EyePos.z + t*EyeDir.z;\n"," vec3 iPoint = EyePos + t*EyeDir;\n"," if (abs(iPoint.z)*radiusVCVSOutput > lengthVCVSOutput*0.5) {\n"," float t2 = (-b + sqrt(d))/(2.0*a);\n"," float tz2 = EyePos.z + t2*EyeDir.z;\n"," if (tz2*radiusVCVSOutput > lengthVCVSOutput*0.5 || tz*radiusVCVSOutput < -0.5*lengthVCVSOutput) { discard; }\n"," else {\n"," normalVCVSOutput = orientVCVSOutput;\n"," float t3 = (lengthVCVSOutput*0.5/radiusVCVSOutput - EyePos.z)/EyeDir.z;\n"," iPoint = EyePos + t3*EyeDir;\n"," vertexVC.xyz = radiusVCVSOutput*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"," }\n"," }\n"," else {\n"," normalVCVSOutput = iPoint.x*base1 + iPoint.y*base2;\n"," vertexVC.xyz = radiusVCVSOutput*(normalVCVSOutput + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"," }\n"," }\n"," vec4 pos = VCPCMatrix * vertexVC;\n",o]).result,i=ma.substitute(i,"//VTK::Normal::Impl","").result,t.haveSeenDepthRequest&&(i=ma.substitute(i,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),e.Vertex=s,e.Fragment=i,n.replaceShaderValues(e,r,a)},e.setMapperShaderParameters=function(e,r,a){e.getCABO().getElementCount()&&(t.VBOBuildTime>e.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime())&&(e.getProgram().isAttributeUsed("orientMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"orientMC",12,e.getCABO().getStride(),t.context.FLOAT,3,!1)||mi("Error setting 'orientMC' in shader VAO.")),e.getProgram().isAttributeUsed("offsetMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO().getColorBO(),"offsetMC",0,e.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,3,!0)||mi("Error setting 'offsetMC' in shader VAO.")),e.getProgram().isAttributeUsed("radiusMC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"radiusMC",24,e.getCABO().getStride(),t.context.FLOAT,1,!1)||mi("Error setting 'radiusMC' in shader VAO."))),n.setMapperShaderParameters(e,r,a)},e.setCameraShaderParameters=function(e,n,r){var a=e.getProgram(),s=n.getActiveCamera(),i=t.openGLCamera.getKeyMatrices(n);if(a.isUniformUsed("VCPCMatrix")&&a.setUniformMatrix("VCPCMatrix",i.vcpc),r.getIsIdentity())a.isUniformUsed("MCVCMatrix")&&a.setUniformMatrix("MCVCMatrix",i.wcvc),a.isUniformUsed("normalMatrix")&&a.setUniformMatrix3x3("normalMatrix",i.normalMatrix);else{var o=t.openGLActor.getKeyMatrices();if(a.isUniformUsed("MCVCMatrix")){var l=new Float64Array(16);Object(Z.l)(l,i.wcvc,o.mcwc),a.setUniformMatrix("MCVCMatrix",l)}if(a.isUniformUsed("normalMatrix")){var B=new Float64Array(9);St(B,i.normalMatrix,o.normalMatrix),a.setUniformMatrix3x3("normalMatrix",B)}}a.isUniformUsed("cameraParallel")&&e.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},e.getOpenGLMode=function(e,n){return t.context.TRIANGLES},e.buildBufferObjects=function(e,n){var r=t.currentInput;if(null!==r){t.renderable.mapScalars(r,1);var a=t.renderable.getColorMapColors(),s=t.primitives[t.primTypes.Tris].getCABO(),i=r.getPointData(),o=r.getPoints(),l=o.getNumberOfPoints(),B=o.getData(),Q=null,c=0;s.setColorBOStride(4),s.getColorBO()||s.setColorBO(fa.newInstance()),s.getColorBO().setOpenGLRenderWindow(t.openGLRenderWindow),a&&(c=a.getNumberOfComponents(),s.setColorOffset(4),Q=a.getData(),s.setColorBOStride(8)),s.setColorComponents(c),s.setStride(28);var F=new Float32Array(7*l*12),U=new Uint8Array(12*l*(Q?8:4)),g=null,d=null;null!=t.renderable.getScaleArray()&&i.hasArray(t.renderable.getScaleArray())&&(g=i.getArray(t.renderable.getScaleArray()).getData()),null!=t.renderable.getOrientationArray()&&i.hasArray(t.renderable.getOrientationArray())?d=i.getArray(t.renderable.getOrientationArray()).getData():mi(["Error setting orientationArray.\n","You have to specify the stick orientation"]);for(var u=[0,1,3,0,3,2,2,3,5,2,5,4],I=0,m=0,C=0,b=0,y=0;y=4?255:0,U[b++]=u[Z]>=2?255:0,U[b++]=255,m=y*c,Q&&(U[b++]=Q[m],U[b++]=Q[m+1],U[b++]=Q[m+2],U[b++]=Q[m+3])}s.setElementCount(C/7),s.upload(F,Za.ARRAY_BUFFER),s.getColorBO().upload(U,Za.ARRAY_BUFFER),t.VBOBuildTime.modified()}}}var bi={};function yi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bi,n),os.extend(e,t,n),Ci(e,t)}var Si={newInstance:Object(l.f)(yi,"vtkOpenGLStickMapper"),extend:yi},xi=1,Zi=2,hi=3,pi=0,Gi=1;function Ri(e,t){t.classHierarchy.push("vtkSurfaceLICInterface")}var Li={enableLIC:!1,nuberOfSteps:40,stepSize:.25,transformVectors:!0,normalizeVectors:!0,maskOnSurface:!1,maskThreshold:0,maskColor:[0,0,0],maskIntensity:0,enhancedLIC:!0,enhanceContrast:0,lowLICContrastEnhancementFactor:0,highLICContrastEnhancementFactor:0,lowColorContrastEnhancementFactor:0,highColorContrastEnhancementFactor:0,antiAlias:0,colorMode:0,LICIntensity:1,mapModeBias:0,noiseTextureSize:200,noiseTextureType:Gi,noiseGrainSize:8,noiseImpulseProbability:.1,noiseImpulseBackgroundValue:0,noiseGeneratorSeed:0,minNoiseValue:0,maxNoiseValue:1,numberOfNoiseLevels:2,shadersNeedBuilding:!0,reallocateTextures:!0,rebuildNoiseTexture:!1,viewPortScale:1};function Vi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Li,n),l.c.obj(e,t),l.c.setGet(e,t,["enableLIC","numberOfSteps","stepSize","normalizeVectors","transformVectors","maskOnSurface","maskThreshold","maskColor","maskIntensity","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor","antiAlias","colorMode","LICIntensity","mapModeBias","noiseTextureSize","noiseTextureType","noiseGrainSize","minNoiseValue","maxNoiseValue","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","noiseGeneratorSeed","viewPortScale","rebuildNoiseTexture"]),Ri(0,t)}var Ai={newInstance:l.c.newInstance(Vi,"vtkSurfaceLICInterface"),extend:Vi},fi=n(55),Ni="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtktextureObjectVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nattribute vec4 vertexDC;\nattribute vec2 tcoordDC;\nvarying vec2 tcoordVC;\n\nvoid main()\n{\n tcoordVC = tcoordDC;\n gl_Position = vertexDC;\n}\n",Ei=Fr.Representation;function Di(e,t,n,r){var a=Object(ce.a)(t,2),s=a[0],i=a[1],o=e.getContext(),l=An.newInstance({autoParameters:!1,wrapS:r,wrapT:r,minificationFilter:n,magnificationFilter:n,generateMipmap:!1,openGLDataType:o.FLOAT,baseLevel:0,maxLevel:0});return l.setOpenGLRenderWindow(e),l.setInternalFormat(o.RGBA32F),l.create2DFromRaw(s,i,4,"Float32Array",null),l.activate(),l.sendParameters(),l.deactivate(),l}function vi(e,t){return Di(e,t,An.Filter.NEAREST,An.Wrap.CLAMP_TO_EDGE)}function Ji(e,t){t.classHierarchy.push("vtkLICPingPongBufferManager"),t.openGLRenderWindow?(t.quad=function(e){var t=Ya.newInstance();t.setOpenGLRenderWindow(e);for(var n=new Float32Array(12),r=0;r<4;r++)n[3*r]=r%2*2-1,n[3*r+1]=r>1?1:-1,n[3*r+2]=0;var a=new Float32Array([0,0,1,0,0,1,1,1]),s=new Uint16Array(8);s[0]=3,s[1]=0,s[2]=1,s[3]=3,s[4]=3,s[5]=0,s[6]=3,s[7]=2;var i=B.a.newInstance({numberOfComponents:3,values:n});i.setName("points");var o=B.a.newInstance({numberOfComponents:1,values:s}),l=B.a.newInstance({numberOfComponents:2,values:a});return t.getCABO().createVBO(o,"polys",Ei.SURFACE,{points:i,cellOffset:0,tcoords:l}),t}(t.openGLRenderWindow),t.context=t.openGLRenderWindow.getContext(),t.licTexture0=vi(t.openGLRenderWindow,t.size),t.seedTexture0=vi(t.openGLRenderWindow,t.size),t.licTexture1=vi(t.openGLRenderWindow,t.size),t.seedTexture1=vi(t.openGLRenderWindow,t.size),t.eeTexture=t.doEEPass?Di(t.openGLRenderWindow,t.size,An.Filter.NEAREST,An.Wrap.CLAMP_TO_EDGE):null,t.imageVectorTexture=t.doVTPass?function(e,t){return Di(e,t,An.Filter.LINEAR,An.Wrap.CLAMP_TO_EDGE)}(t.openGLRenderWindow,t.size):null,t.pingTextures[0]=t.licTexture0,t.pingTextures[1]=t.seedTexture0,t.pongTextures[0]=t.licTexture1,t.pongTextures[1]=t.seedTexture1,t.textures[0]=t.pingTextures,t.textures[1]=t.pongTextures,e.swap=function(){t.readIndex=1-t.readIndex},e.renderQuad=function(e,n){var r=t.quad,a=t.context,s=t.quadVAO;s||((s=Ta.newInstance()).setOpenGLRenderWindow(t.openGLRenderWindow),t.quadVAO=s),t.previousProgramHash!==n.getMd5Hash()&&(s.shaderProgramChanged(),r.getCABO().bind(),s.addAttributeArray(n,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE),s.addAttributeArray(n,r.getCABO(),"tcoordDC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,2,t.context.FALSE),t.previousProgramHash=n.getMd5Hash()),a.drawArrays(a.TRIANGLES,0,r.getCABO().getElementCount()),s.release()},e.getLastLICBuffer=function(){return 0===t.readIndex?t.licTexture0:t.licTexture1},e.getLastSeedBuffer=function(){return 0===t.readIndex?t.seedTexture0:t.seedTexture1},e.getLICBuffer=function(){return 1-t.readIndex==0?t.licTexture0:t.licTexture1},e.getSeedBuffer=function(){return 1-t.readIndex==0?t.seedTexture0:t.seedTexture1},e.getLICTextureUnit=function(){var e=t.textures[t.readIndex][0];return e.activate(),e.getTextureUnit()},e.getSeedTextureUnit=function(){var e=t.textures[t.readIndex][1];return e.activate(),e.getTextureUnit()},e.getNoiseTextureUnit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0===e?(t.noiseTexture.activate(),t.noiseTexture.getTextureUnit()):(t.eeTexture.activate(),t.eeTexture.getTextureUnit())},e.getVectorTextureUnit=function(){return t.vectorTexture.activate(),t.vectorTexture.getTextureUnit()},e.getImageVectorTextureUnit=function(){return t.imageVectorTexture?(t.imageVectorTexture.activate(),t.imageVectorTexture.getTextureUnit()):e.getVectorTextureUnit()},e.getMaskVectorTextureUnit=function(){return t.maskVectorTexture?(t.maskVectorTexture.activate(),t.maskVectorTexture.getTextureUnit()):e.getImageVectorTextureUnit()},e.clearBuffers=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.framebuffer,r=t.context;n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),n.setColorBuffer(t.licTexture0,0),n.setColorBuffer(t.seedTexture0,1),n.setColorBuffer(t.licTexture1,2),n.setColorBuffer(t.seedTexture1,3);var a=[r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1,r.COLOR_ATTACHMENT2,r.COLOR_ATTACHMENT3];e&&(n.removeColorBuffer(4),n.setColorBuffer(t.eeTexture,4),a.push(r.COLOR_ATTACHMENT4)),r.drawBuffers(a),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),e&&n.removeColorBuffer(4),r.drawBuffers([r.NONE])},e.clearBuffer=function(e){var n=t.framebuffer,r=t.context;n.removeColorBuffer(0),n.setColorBuffer(e,0),r.drawBuffers([r.COLOR_ATTACHMENT0]),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(e,0),r.drawBuffers([r.NONE])},e.activateVectorTextures=function(){t.imageVectorTexture?t.imageVectorTexture.activate():t.vectorTexture.activate(),t.maskVectorTexture&&t.maskVectorTexture.activate()},e.deactivateVectorTextures=function(){t.imageVectorTexture?t.imageVectorTexture.deactivate():t.vectorTexture.deactivate(),t.maskVectorTexture&&t.maskVectorTexture.deactivate()},e.activateNoiseTexture=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(e){case 0:t.noiseTexture.activate();break;case 1:t.eeTexture.activate();break;default:console.error("Wrong LIC pass number")}},e.deactivateNoiseTexture=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(e){case 0:t.noiseTexture.deactivate();break;case 1:t.eeTexture.deactivate();break;default:console.error("Wrong LIC pass number")}},e.attachLICBuffers=function(){var e=t.textures[t.readIndex],n=t.textures[1-t.readIndex],r=t.framebuffer,a=t.context;e[0].activate(),e[1].activate(),r.removeColorBuffer(0),r.removeColorBuffer(1),r.setColorBuffer(n[0],0),r.setColorBuffer(n[1],1),a.drawBuffers([a.COLOR_ATTACHMENT0,a.COLOR_ATTACHMENT1])},e.detachLICBuffers=function(){var e=t.textures[t.readIndex],n=t.context,r=t.framebuffer;e[0].deactivate(),e[1].deactivate(),r.removeColorBuffer(0),r.removeColorBuffer(1),n.drawBuffers([n.NONE])},e.attachImageVectorBuffer=function(){var e=t.framebuffer,n=t.context;t.vectorTexture.activate(),e.removeColorBuffer(0),e.setColorBuffer(t.imageVectorTexture,0),n.drawBuffers([n.COLOR_ATTACHMENT0])},e.detachImageVectorBuffer=function(){var e=t.context,n=t.framebuffer;t.vectorTexture.deactivate(),n.removeColorBuffer(0),e.drawBuffers([e.NONE])},e.attachEEBuffer=function(){t.textures[t.readIndex][0].activate(),t.framebuffer.removeColorBuffer(0),t.framebuffer.setColorBuffer(t.eeTexture,0);var e=t.context;e.drawBuffers([e.COLOR_ATTACHMENT0])},e.detachEEBuffer=function(){var e=t.context;t.framebuffer.removeColorBuffer(0),e.drawBuffers([e.NONE]),t.textures[t.readIndex][0].deactivate()},e.detachBuffers=function(){var e=t.context,n=t.framebuffer;n.removeColorBuffer(0),n.removeColorBuffer(1),e.drawBuffers([e.NONE]);var r=t.textures[t.readIndex],a=t.textures[1-t.readIndex];r[0]&&r[0].deactivate(),r[1]&&r[1].deactivate(),a[0]&&a[0].deactivate(),a[1]&&a[1].deactivate(),t.eeTexture&&t.eeTexture.deactivate(),t.noiseTexture&&t.noiseTexture.deactivate()},e.getWriteIndex=function(){return 1-t.readIndex},e.detachBuffers()):console.error("Pass renderwindow to ping pong manager")}var Wi={openGLRenderWindow:null,vectorTexture:null,maskVectorTexture:null,noiseTexture:null,doEEPass:!1,doVTPass:!1,readIndex:0,quad:null,lastProgramHash:null,framebuffer:null,size:null,pingTextures:[],pongTextures:[],textures:[]};function Xi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wi,n),l.c.obj(e,t),l.c.get(e,t,["readIndex"]),l.c.setGet(e,t,["doEEPass","doVTPass","openGLRenderWindow","vectorTexture","maskVectorTexture","noiseTexture","framebuffer","size"]),Ji(e,t)}var Hi={newInstance:l.c.newInstance(Xi,"vtkLICPingPongBufferManager"),extend:Xi};function Ti(e,t){function n(e,t){e.setUniformi("texLIC",t.getLICTextureUnit()),e.setUniformi("texSeedPts",t.getSeedTextureUnit())}function r(e,t,n){e.attachLICBuffers(),e.renderQuad(t,n),e.detachLICBuffers(),e.swap()}t.classHierarchy.push("vtkLineIntegralConvolution2D"),e.buildAShader=function(e){return t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(Ni,e,"")},e.dumpTextureValues=function(e,n){var r=Object(ce.a)(n,2),a=r[0],s=r[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.context,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.openGLRenderWindow,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,B=Dn.newInstance(),Q=i,c=null;return B.setOpenGLRenderWindow(o),B.saveCurrentBindingsAndBuffers(),B.create(a,s),B.populateFramebuffer(),B.setColorBuffer(e),c=new Float32Array(a*s*l),Q.readPixels(0,0,a,s,4===l?Q.RGBA:Q.RGB,Q.FLOAT,c),B.restorePreviousBindingsAndBuffers(),c},e.getTextureMinMax=function(n,r){for(var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.context,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.openGLRenderWindow,i=e.dumpTextureValues(n,r,a,s,4),o=Number.MAX_VALUE,l=Number.MIN_VALUE,B=0;Bl&&(l=Q)}return{min:o,max:l}},e.getComponentSelectionProgram=function(e){var t="xyzw";return".".concat(t[e[0]]).concat(t[e[1]])},e.buildShaders=function(){t.LIC0ShaderProgram=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_LIC0.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n/**\nThis shader initializes the convolution for the LIC computation.\n*/\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\nuniform sampler2D texMaskVectors;\nuniform sampler2D texNoise;\nuniform sampler2D texLIC;\n\nuniform int uStepNo; // in step 0 initialize lic and seeds, else just seeds\nuniform int uPassNo; // in pass 1 hpf of pass 0 is convolved.\nuniform float uMaskThreshold; // if |V| < uMaskThreshold render transparent\nuniform vec2 uNoiseBoundsPt1; // tc of upper right pt of noise texture\n\nin vec2 tcoordVC;\n\n// convert from vector coordinate space to noise coordinate space.\n// the noise texture is tiled across the *whole* domain\nvec2 VectorTCToNoiseTC(vec2 vectc)\n{\n return vectc/uNoiseBoundsPt1;\n}\n\n// get the texture coordidnate to lookup noise value. this\n// depends on the pass number.\nvec2 getNoiseTC(vec2 vectc)\n{\n // in pass 1 : convert from vector tc to noise tc\n // in pass 2 : use vector tc\n if (uPassNo == 0)\n {\n return VectorTCToNoiseTC(vectc);\n }\n else\n {\n return vectc;\n }\n}\n\n// look up noise value at the given location. The location\n// is supplied in vector texture coordinates, hence the\n// need to convert to noise texture coordinates.\nfloat getNoise(vec2 vectc)\n{\n return texture2D(texNoise, getNoiseTC(vectc)).r;\n}\n\nvoid main(void)\n{\n vec2 vectc = tcoordVC.st;\n\n // lic => (convolution, mask, 0, step count)\n if (uStepNo == 0)\n {\n float maskCriteria = length(texture2D(texMaskVectors, vectc).xyz);\n float maskFlag;\n if (maskCriteria <= uMaskThreshold)\n {\n maskFlag = 1.0;\n }\n else\n {\n maskFlag = 0.0;\n }\n float noise = getNoise(vectc);\n LICOutput = vec4(noise, maskFlag, 0.0, 1.0);\n }\n else\n {\n LICOutput = texture2D(texLIC, vectc);\n }\n\n // initial seed\n SeedOutput = vec4(vectc, 0.0, 1.0);\n}\n");var n=ma.substitute("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_VT.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// move vector field to normalized image space\n// pre-processing for vtkLineIntegralConvolution2D\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Fragment shader used by the gaussian blur filter render pass.\n\nuniform sampler2D texVectors; // input texture\nuniform vec2 uTexSize; // size of texture\n\nin vec2 tcoordVC;\n\nvoid main(void)\n{\n //VTK::LICComponentSelection::Impl\n V = V/uTexSize;\n gl_FragData[0] = vec4(V, 0.0, 1.0);\n}\n","//VTK::LICComponentSelection::Impl","vec2 V = texture2D(texVectors, tcoordVC.st)".concat(e.getComponentSelectionProgram(t.componentIds),";")).result;t.VTProgram=e.buildAShader(n);var r=ma.substitute("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_fs1.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\nuniform sampler2D texVectors;\nuniform sampler2D texNoise;\nuniform sampler2D texLIC;\nuniform sampler2D texSeedPts;\n\nuniform int uPassNo; // in pass 1 hpf of pass 0 is convolved.\nuniform float uStepSize; // step size in parametric space\n\nuniform vec2 uNoiseBoundsPt1; // tc of upper right pt of noise texture\n\nin vec2 tcoordVC;\n\n//VTK::LICVectorLookup::Impl\n\n// We need to do this manually since CLAMP_TO_BORDER and and borderColor\n// are very poorly supported in webgl\nvec2 clampToBorder(vec2 uv){\n if(uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0)\n {\n return vec2(0.0, 0.0);\n }\n return getVector(uv);\n}\n\n// convert from vector coordinate space to noise coordinate space.\n// the noise texture is tiled across the whole domain\nvec2 VectorTCToNoiseTC(vec2 vectc)\n{\n return vectc/uNoiseBoundsPt1;\n}\n\n// get the texture coordidnate to lookup noise value.\n// in pass 1 repeatedly tile the noise texture across\n// the computational domain.\nvec2 getNoiseTC(vec2 tc)\n{\n if (uPassNo == 0)\n {\n return VectorTCToNoiseTC(tc);\n }\n else\n {\n return tc;\n }\n}\n\n// look up noise value at the given location. The location\n// is supplied in vector texture coordinates, hence the need\n// to convert to either noise or lic texture coordinates in\n// pass 1 and 2 respectively.\nfloat getNoise(vec2 vectc)\n{\n return texture2D(texNoise, getNoiseTC(vectc)).r;\n}\n\n// fourth-order Runge-Kutta streamline integration\n// no bounds checks are made, therefore it's essential\n// to have the entire texture initialized to 0\n// and set clamp to border and have border color 0\n// an integer is set if the step was taken, keeping\n// an accurate step count is necessary to prevent\n// boundary artifacts. Don't count the step if\n// all vector lookups are identically 0. This is\n// a proxy for \"stepped outside valid domain\"\nvec2 rk4(vec2 pt0, float dt, out bool count)\n{\n count=true;\n float dtHalf = dt * 0.5;\n vec2 pt1;\n\n vec2 v0 = clampToBorder(pt0);\n pt1 = pt0 + v0 * dtHalf;\n\n vec2 v1 = clampToBorder(pt1);\n pt1 = pt0 + v1 * dtHalf;\n\n vec2 v2 = clampToBorder(pt1);\n pt1 = pt0 + v2 * dt;\n\n vec2 v3 = clampToBorder(pt1);\n vec2 vSum = v0 + v1 + v1 + v2 + v2 + v3;\n\n if (vSum == vec2(0.0, 0.0))\n {\n count = false;\n }\n\n pt1 = pt0 + (vSum) * (dt * (1.0/6.0));\n\n return pt1;\n}\n\nvoid main(void)\n{\n vec2 lictc = tcoordVC.st;\n vec4 lic = texture2D(texLIC, lictc);\n vec2 pt0 = texture2D(texSeedPts, lictc).st;\n\n bool count;\n vec2 pt1 = rk4(pt0, uStepSize, count);\n\n if (count)\n {\n // accumulate lic step\n // (lic, mask, 0, step count)\n float noise = getNoise(pt1);\n LICOutput = vec4(lic.r + noise, lic.g, 0.0, lic.a + 1.0);\n SeedOutput = vec4(pt1, 0.0, 1.0);\n }\n else\n {\n // keep existing values\n LICOutput = lic;\n SeedOutput = vec4(pt0, 0.0, 1.0);\n }\n}\n","//VTK::LICVectorLookup::Impl",function(){var e="\n vec2 getVector( vec2 vectc )\n\n {\n\n vec2 V = texture2D( texVectors, vectc ).xy;\n\n // normalize if |V| not 0\n\n float lenV = length( V );\n\n if ( lenV > 1.0e-8 )\n\n {\n\n return V/lenV;\n\n }\n\n else\n\n {\n\n return vec2( 0.0, 0.0 );\n\n }\n\n }\n\n ",t="\n vec2 getVector( vec2 vectc )\n\n {\n\n return texture2D( texVectors, vectc ).xy;\n\n }\n\n ";return arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?t:e}(t.normalizeVectors),!0).result;t.LICIShaderProgram=e.buildAShader(r),t.LICNShaderProgram=e.buildAShader(" //VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_LICN.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\n/**\nThis shader finalizes the convolution for the LIC computation\napplying the normalization. eg. if box kernel is used the this\nis the number of steps taken.\n*/\n\nuniform sampler2D texLIC;\n\nin vec2 tcoordVC;\n\nvoid main(void)\n{\n vec4 conv = texture2D(texLIC, tcoordVC.st);\n conv.r = conv.r/conv.a;\n // lic => (convolution, mask, 0, 1)\n LICOutput = vec4(conv.rg , 0.0, 1.0);\n SeedOutput = vec4(0.0, 0.0, 0.0, 0.0);\n}\n"),t.CEProgram=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_CE.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// gray scale contrast enhance stage implemented via histogram stretching\n// if the min and max are tweaked it can generate out-of-range values\n// these will be clamped in 0 to 1\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\n\nuniform sampler2D texLIC; // most recent lic pass\nuniform float uMin; // min gray scale color value\nuniform float uMaxMinDiff; // max-min\n\nin vec2 tcoordVC;\n\nvoid main( void )\n{\n vec4 lic = texture2D(texLIC, tcoordVC.st);\n if (lic.g!=0.0)\n {\n LICOutput = lic;\n }\n else\n {\n float CElic = clamp((lic.r - uMin)/uMaxMinDiff, 0.0, 1.0);\n LICOutput = vec4(CElic, lic.gb, 1.0);\n }\n SeedOutput = vec4(0.0, 0.0, 0.0, 0.0);\n}\n"),t.EEProgram=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_fs2.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// high-pass filter stage employed by vtkLineIntegralConvolution2D\n// between LIC pass 1 and LIC pass 2. filtered LIC pass 1, becomes\n// noise for pass2.\n\n// the output of this shader\nlayout(location = 0) out vec4 EEOutput;\n\nuniform sampler2D texLIC; // most recent lic pass\nuniform float uDx; // fragment size\nuniform float uDy; // fragment size\n\nin vec2 tcoordVC;\n\n// kernel for simple laplace edge enhancement.\n// p=Laplace(p)+p\nfloat K[9] = float[9](\n -1.0, -1.0, -1.0,\n -1.0, 9.0, -1.0,\n -1.0, -1.0, -1.0\n );\n\n// determine if the fragment was masked\nbool Masked(float val) { return val != 0.0; }\n\nvoid main(void)\n{\n // tex coord neighbor offsets\n vec2 fragDx[9] = vec2[9](\n vec2(-uDx, uDy), vec2(0.0, uDy), vec2(uDx, uDy),\n vec2(-uDx, 0.0), vec2(0.0, 0.0), vec2(uDx, 0.0),\n vec2(-uDx,-uDy), vec2(0.0,-uDy), vec2(uDx,-uDy)\n );\n\n vec2 lictc = tcoordVC.st;\n\n // compute the convolution but don't use convovled values if\n // any masked fragments on the stencil. Fragments outside\n // the valid domain are masked during initialization, and\n // texture wrap parameters are clamp to border with border\n // color that contains masked flag\n float conv = 0.0;\n bool dontUse = false;\n for (int i=0; i<9; ++i)\n {\n vec2 tc = lictc + fragDx[i];\n vec4 lic = texture2D(texLIC, tc);\n dontUse = dontUse || Masked(lic.g);\n conv = conv + K[i] * lic.r;\n }\n\n if (dontUse)\n {\n EEOutput = vec4(texture2D(texLIC, lictc).rg, 0.0, 1.0);\n }\n else\n {\n conv = clamp(conv, 0.0, 1.0);\n EEOutput = vec4(conv,texture2D(texLIC, lictc).g, 0.0, 1.0);\n }\n\n}\n"),t.AAHProgram=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_AAH.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// Anti-alias stage in vtkLineIntegralConvolution2D\n// horizontal pass of a Gaussian convolution\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\nuniform sampler2D texLIC; // input texture\nuniform float uDx; // fragment size\n\nin vec2 tcoordVC;\n\n// factored 3x3 Gaussian kernel\n// K^T*K = G\nfloat K[3] = float[3](0.141421356, 0.707106781, 0.141421356);\n\n// determine if the fragment was masked\nbool Masked(float val){ return val != 0.0; }\n\nvoid main(void)\n{\n// neighbor offsets\nvec2 fragDx[3] = vec2[3](vec2(-uDx,0.0), vec2(0.0,0.0), vec2(uDx,0.0));\n\n vec2 lictc = tcoordVC.st;\n vec4 lic[3];\n bool dontUse = false;\n float conv = 0.0;\n for (int i=0; i<3; ++i)\n {\n vec2 tc = lictc + fragDx[i];\n lic[i] = texture2D(texLIC, tc);\n dontUse = dontUse || Masked(lic[i].g);\n conv = conv + K[i] * lic[i].r;\n }\n // output is (conv, mask, skip, 1)\n if (dontUse)\n {\n LICOutput = vec4(lic[1].rg, 1.0, 1.0);\n }\n else\n {\n LICOutput = vec4(conv, lic[1].gb, 1.0);\n }\n SeedOutput = vec4(0.0, 0.0, 0.0, 0.0);\n}\n"),t.AAVProgram=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkLineIntegralConvolution2D_AAV.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// Anti-alias stage in vtkLineIntegralConvolution2D\n// vertical pass of a Gaussian convolution\n\n// the output of this shader\nlayout(location = 0) out vec4 LICOutput;\nlayout(location = 1) out vec4 SeedOutput;\n\nuniform sampler2D texLIC; // input texture\nuniform float uDy; // fragment size\n\nin vec2 tcoordVC;\n\n\n// factored 3x3 Gaussian kernel\n// K^T*K = G\nfloat K[3] = float[3](0.141421356, 0.707106781, 0.141421356);\n\n// determine if the fragment was masked\nbool Masked(float val){ return val != 0.0; }\n\nvoid main(void)\n{\n// neighbor offsets\nvec2 fragDy[3] = vec2[3](vec2(0.0,-uDy), vec2(0.0,0.0), vec2(0.0,uDy));\n\n\n vec2 lictc = tcoordVC.st;\n vec4 lic[3];\n bool dontUse = false;\n float conv = 0.0;\n for (int i=0; i<3; ++i)\n {\n vec2 tc = lictc + fragDy[i];\n lic[i] = texture2D(texLIC, tc);\n dontUse = dontUse || Masked(lic[i].g);\n conv = conv + K[i] * lic[i].r;\n }\n // output is (conv, mask, skip, 1)\n if (dontUse)\n {\n LICOutput = vec4(lic[1].rg, 1.0, 1.0);\n }\n else\n {\n LICOutput = vec4(conv, lic[1].gb, 1.0);\n }\n SeedOutput = vec4(0.0, 0.0, 0.0, 0.0);\n}\n")},e.executeLIC=function(a,s,i,l,B,Q){if(t.openGLRenderWindow=B,t.context=B.getContext(),Object.assign(t,Q),a[0]<=0||a[1]<=0)return null;var c=[1/a[0],1/a[1]],F=t.stepSize*Math.sqrt(c[0]*c[0]+c[1]*c[1]);F<=0&&(F=1e-10);var U,g=t.context,d=t.framebuffer;d&&a[0]===d.getSize()[0]&&a[1]===d.getSize()[1]||((d=Dn.newInstance()).setOpenGLRenderWindow(t.openGLRenderWindow),d.saveCurrentBindingsAndBuffers(),(U=d).create.apply(U,Object(o.a)(a)),d.populateFramebuffer(),d.restorePreviousBindingsAndBuffers(),t.framebuffer=d),d.saveCurrentBindingsAndBuffers(),d.bind(),g.viewport.apply(g,[0,0].concat(Object(o.a)(a))),g.scissor.apply(g,[0,0].concat(Object(o.a)(a))),t.shadersNeedBuild&&(e.buildShaders(),t.shadersNeedBuild=!1),t.bufs?(t.bufs.setVectorTexture(s),t.bufs.setMaskVectorTexture(i),t.bufs.setNoiseTexture(l)):t.bufs=Hi.newInstance({openGLRenderWindow:B,doEEPass:t.enhancedLIC,doVTPass:t.transformVectors,vectorTexture:s,maskVectorTexture:i,noiseTexture:l,framebuffer:d,size:a});var u=[(l.getWidth()+1)/a[0],(l.getHeight()+1)/a[1]],I=1/a[0],m=1/a[1],C=t.openGLRenderWindow.getShaderCache();if(t.transformVectors){var b=t.VTProgram;C.readyShaderProgram(b),t.bufs.attachImageVectorBuffer(),b.setUniform2f.apply(b,["uTexSize"].concat(Object(o.a)(a))),b.setUniformi("texVectors",t.bufs.getVectorTextureUnit()),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),t.bufs.renderQuad(a,b),t.bufs.detachImageVectorBuffer()}t.bufs.clearBuffers(t.enhancedLIC),t.bufs.activateVectorTextures(),t.bufs.activateNoiseTexture(0);var y=t.LIC0ShaderProgram;C.readyShaderProgram(y),y.setUniformi("uStepNo",0),y.setUniformi("uPassNo",0),y.setUniformf("uMaskThreshold",t.maskThreshold),y.setUniform2f.apply(y,["uNoiseBoundsPt1"].concat(u)),y.setUniformi("texMaskVectors",t.bufs.getMaskVectorTextureUnit()),y.setUniformi("texLIC",t.bufs.getLICTextureUnit()),y.setUniformi("texNoise",t.bufs.getNoiseTextureUnit(0)),r(t.bufs,a,y);var S=t.LICIShaderProgram;C.readyShaderProgram(S),S.setUniformi("uPassNo",0),S.setUniformf("uStepSize",-F),S.setUniform2f.apply(S,["uNoiseBoundsPt1"].concat(u)),S.setUniformi("texVectors",t.bufs.getImageVectorTextureUnit()),S.setUniformi("texNoise",t.bufs.getNoiseTextureUnit(0));for(var x=0;x1||o<0)&&(console.error("Invalid color range: ",o,l),o=0,l=1);var B=l-o;n&&(o+=B*t.lowLICContrastEnhancementFactor,B=(l-=B*t.highLICContrastEnhancementFactor)-o);var Q=t.CEProgram;s.readyShaderProgram(Q),Q.setUniformi("texLIC",t.bufs.getLICTextureUnit()),Q.setUniformf("uMin",o),Q.setUniformf("uMaxMinDiff",B),r(t.bufs,a,Q)}}var ki={shadersNeedBuild:!0,stepSize:1,numberOfSteps:10,enhancedLIC:!0,enhanceContrast:!1,lowContrastEnhancementFactor:0,highContrastEnhancementFactor:0,antiAlias:0,componentIds:[0,1],normalizeVectors:!0,maskThreshold:0,transformVectors:!0,bufs:null,isComposite:!0};function Mi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ki,n),l.c.obj(e,t),l.c.setGet(e,t,["context","openGLRenderWindow","nuberOfSteps","stepSize","normalizeVectors","maskThreshold","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","componentIds","isComposite"]),Ti(e,t)}var wi={newInstance:l.c.newInstance(Mi,"vtkLineIntegralConvolution2D"),extend:Mi},Yi=Fr.Representation;function Oi(e,t){t.classHierarchy.push("vtkOpenGLSurfaceLICInterface"),e.renderQuad=function(e,n){var r=t.licQuad,a=t.context,s=t.licQuadVAO;s||((s=Ta.newInstance()).setOpenGLRenderWindow(t.openGLRenderWindow),t.licQuadVAO=s),t.previousProgramHash!==n.getMd5Hash()&&(s.shaderProgramChanged(),r.getCABO().bind(),s.addAttributeArray(n,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE),s.addAttributeArray(n,r.getCABO(),"tcoordDC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,2,t.context.FALSE),t.previousProgramHash=n.getMd5Hash()),a.drawArrays(a.TRIANGLES,0,r.getCABO().getElementCount()),s.release()},e.generateNoiseTexture=function(e){if(!t.noiseTexture||t.licInterface.getRebuildNoiseTexture()){t.licInterface.setRebuildNoiseTexture(!1),t.noiseTexture&&t.noiseTexture.releaseGraphicsResources(),Object(fi.a)(t.noiseGeneratorSeed,{global:!0});var n=[],r=t.licInterface.get("noiseTextureType","noiseGrainSize","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","minNoiseValue","maxNoiseValue"),a=r.noiseTextureType,s=r.noiseGrainSize,i=r.numberOfNoiseLevels,o=r.noiseImpulseProbability,l=r.noiseImpulseBackgroundValue,B=r.minNoiseValue,Q=r.maxNoiseValue;switch(a){case Gi:n=function(e,t,n,r,a,s){var i=Math.max(0,Math.min(1,n)),o=Float32Array.from({length:e*e},(function(){var e=0;if(1===i||Math.random()>1-i)for(var t=0;t<2048;++t)e+=Math.random();return e})),l=0,B=2049;o.forEach((function(e){B=1===i?e0?e:B,l=e>l?e:l}));var Q=l-B;0===Q&&(B=0,Q=0===l?1:l);var c=t-1,F=0!==c?1/c:0,U=s-a;return o.map((function(e){var n=e=B?1===t?s:a+(i>c?c:i)*F*U:r}))}(Math.floor(e/s),i,o,l,B,Q);break;case pi:default:n=function(e,t,n,r){var a=Object(ce.a)(e,2),s=a[0],i=a[1],o=r-n;return Float32Array.from({length:s*i},(function(){var e=Math.random();return(e=(e=Math.floor(e*t)/t)*o+n)>1?1:e<0?0:e}))}([Math.ceil(e/s),Math.ceil(e/s)],i,B,Q)}var c=1/s,F=Float32Array.from({length:e*e*4},(function(t,r){var a=r/4;if(r%4==0){var i=Math.floor(a%e*c),o=Math.floor(a/e*c);return n[o*(e/s)+i]}return r%4==1||r%4==3?1:0})),U=An.newInstance({wrapS:An.Wrap.REPEAT,wrapT:An.Wrap.REPEAT,minificationFilter:An.Filter.NEAREST,magnificationFilter:An.Filter.NEAREST,generateMipMap:!1,openGLDataType:t.context.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});U.setOpenGLRenderWindow(t.openGLRenderWindow),U.create2DFromRaw(e,e,4,"Float32Array",F),U.activate(),U.sendParameters(),U.deactivate(),t.noiseTexture=U}},e.buildAShader=function(e){return t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(Ni,e,"")},e.allocateTextures=function(){var n=An.Filter.NEAREST,r=An.Filter.LINEAR,a=t.openGLRenderWindow;t.geometryImage||(t.geometryImage=e.allocateTexture(a,n)),t.vectorImage||(t.vectorImage=e.allocateTexture(a,r)),t.maskVectorImage||(t.maskVectorImage=e.allocateTexture(a,r)),t.LICImage||(t.LICImage=e.allocateTexture(a,n)),t.RGBColorImage||(t.RGBColorImage=e.allocateTexture(a,n)),t.HSLColorImage||(t.HSLColorImage=e.allocateTexture(a,n)),t.depthTexture||(t.depthTexture=e.allocateDepthTexture(a))},e.allocateTexture=function(e,n){var r=t.context,a=An.newInstance({wrapS:An.Wrap.CLAMP_TO_EDGE,wrapT:An.Wrap.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:n,generateMipmap:!1,openGLDataType:r.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});return a.setOpenGLRenderWindow(e),a.setInternalFormat(r.RGBA32F),a.create2DFromRaw.apply(a,Object(o.a)(t.size).concat([4,"Float32Array",null])),a.activate(),a.sendParameters(),a.deactivate(),a},e.allocateDepthTexture=function(e){var n=t.context,r=An.newInstance({generateMipmap:!1,openGLDataType:n.FLOAT,autoParameters:!1});return r.setOpenGLRenderWindow(e),r.createDepthFromRaw.apply(r,Object(o.a)(t.size).concat(["Float32Array",null])),r.activate(),r.sendParameters(),r.deactivate(),r},e.createFBO=function(){if(!t.framebuffer){t.licHelper=null;var e=Dn.newInstance();e.setOpenGLRenderWindow(t.openGLRenderWindow),e.saveCurrentBindingsAndBuffers(),e.create.apply(e,Object(o.a)(t.size)),e.populateFramebuffer(),t.framebuffer=e,e.restorePreviousBindingsAndBuffers()}},e.completedGeometry=function(){var e=t.context,n=t.framebuffer;n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeDepthBuffer(),e.drawBuffers([e.NONE]),n.restorePreviousBindingsAndBuffers()},e.buildAllShaders=function(){t.shadersNeedBuilding&&(t.licColorPass=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkSurfaceLICMapper_fs2.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// This shader combines surface geometry, LIC, and scalar colors.\n\n// the output of this shader\nlayout(location = 0) out vec4 RGBOutput;\nlayout(location = 1) out vec4 HSLOutput;\n\nuniform sampler2D texVectors; // vectors, depth\nuniform sampler2D texGeomColors; // scalar colors + lighting\nuniform sampler2D texLIC; // image lic\nuniform int uScalarColorMode; // select between blend, and map shader\nuniform float uLICIntensity; // blend shader: blending factor for lic'd colors\nuniform float uMapBias; // map shader: adjust the brightness of the result\nuniform float uMaskIntensity; // blending factor for mask color\nuniform vec3 uMaskColor; // color for the masked out fragments\n\nin vec2 tcoordVC;\n\n/**\nConvert from RGB color space into HSL colorspace.\n*/\nvec3 RGBToHSL(vec3 RGB)\n{\n vec3 HSL = vec3(0.0, 0.0, 0.0);\n\n float RGBMin = min(min(RGB.r, RGB.g), RGB.b);\n float RGBMax = max(max(RGB.r, RGB.g), RGB.b);\n float RGBMaxMinDiff = RGBMax - RGBMin;\n\n HSL.z = (RGBMax + RGBMin) / 2.0;\n\n if (RGBMaxMinDiff == 0.0)\n {\n // Gray scale\n HSL.x = 0.0;\n HSL.y = 0.0;\n }\n else\n {\n // Color\n if (HSL.z < 0.5)\n HSL.y = RGBMaxMinDiff / (RGBMax + RGBMin);\n else\n HSL.y = RGBMaxMinDiff / (2.0 - RGBMax - RGBMin);\n\n float dR\n = (((RGBMax - RGB.r) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;\n float dG\n = (((RGBMax - RGB.g) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;\n float dB\n = (((RGBMax - RGB.b) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;\n\n if (RGB.r == RGBMax)\n HSL.x = dB - dG;\n else\n if (RGB.g == RGBMax)\n HSL.x = (1.0 / 3.0) + dR - dB;\n else\n if (RGB.b == RGBMax)\n HSL.x = (2.0 / 3.0) + dG - dR;\n\n if (HSL.x < 0.0)\n HSL.x += 1.0;\n\n if (HSL.x > 1.0)\n HSL.x -= 1.0;\n }\n\n return HSL;\n}\n\n/**\nHelper for HSL to RGB conversion.\n*/\nfloat Util(float v1, float v2, float vH)\n{\n if (vH < 0.0)\n vH += 1.0;\n\n if (vH > 1.0)\n vH -= 1.0;\n\n if ((6.0 * vH) < 1.0)\n return (v1 + (v2 - v1) * 6.0 * vH);\n\n if ((2.0 * vH) < 1.0)\n return (v2);\n\n if ((3.0 * vH) < 2.0)\n return (v1 + (v2 - v1) * ((2.0 / 3.0) - vH) * 6.0);\n\n return v1;\n}\n\n/**\nConvert from HSL space into RGB space.\n*/\nvec3 HSLToRGB(vec3 HSL)\n{\n vec3 RGB;\n if (HSL.y == 0.0)\n {\n // Gray\n RGB.r = HSL.z;\n RGB.g = HSL.z;\n RGB.b = HSL.z;\n }\n else\n {\n // Chromatic\n float v2;\n if (HSL.z < 0.5)\n v2 = HSL.z * (1.0 + HSL.y);\n else\n v2 = (HSL.z + HSL.y) - (HSL.y * HSL.z);\n\n float v1 = 2.0 * HSL.z - v2;\n\n RGB.r = Util(v1, v2, HSL.x + (1.0 / 3.0));\n RGB.g = Util(v1, v2, HSL.x);\n RGB.b = Util(v1, v2, HSL.x - (1.0 / 3.0));\n }\n\n return RGB.rgb;\n}\n\nvoid main()\n{\n vec4 lic = texture2D(texLIC, tcoordVC.st);\n vec4 geomColor = texture2D(texGeomColors, tcoordVC.st);\n\n // depth is used to determine which fragment belong to us\n // and we can change\n float depth = texture2D(texVectors, tcoordVC.st).a;\n\n vec3 fragColorRGB;\n float valid;\n if (depth > 1.0e-3)\n {\n // we own it\n // shade LIC'ed geometry, or apply mask\n if (lic.g!=0.0)\n {\n // it's masked\n // apply fragment mask\n fragColorRGB = uMaskIntensity * uMaskColor + (1.0 - uMaskIntensity) * geomColor.rgb;\n valid = 0.0;\n }\n else\n {\n if (uScalarColorMode==0)\n {\n // blend with scalars\n fragColorRGB = lic.rrr * uLICIntensity + geomColor.rgb * (1.0 - uLICIntensity);\n }\n else\n {\n // multiply with scalars\n fragColorRGB = geomColor.rgb * clamp((uMapBias + lic.r), 0.0, 1.0);\n }\n if (lic.b != 0.0)\n {\n // didn't have the required guard pixels\n // don't consider it in min max estimation\n // for histpgram stretching\n valid = 0.0;\n }\n else\n {\n // ok to use in min/max estimates for histogram\n // stretching\n valid = 1.0;\n }\n }\n }\n else\n {\n // we don't own it\n // pass through scalars\n fragColorRGB = geomColor.rgb;\n valid = 0.0;\n }\n\n // if no further stages this texture is\n // copied to the screen\n RGBOutput = vec4(fragColorRGB, geomColor.a);\n\n // if further stages, move to hsl space for contrast\n // enhancement. encoding validity saves moving a texture to the cpu\n vec3 fragColorHSL = RGBToHSL(fragColorRGB);\n HSLOutput = vec4(fragColorHSL, valid);\n}\n"),t.licCopyPass=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkSurfaceLICMapper_DCpy.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// This shader copies fragments and depths to the output buffer\n\n// the output of this shader\n//VTK::Output::Dec\n\nuniform sampler2D texDepth; // z values from vertex shader\nuniform sampler2D texRGBColors; // final rgb LIC colors\n\nin vec2 tcoordVC;\n\nvoid main()\n{\n gl_FragDepth = texture2D(texDepth, tcoordVC).x;\n gl_FragData[0] = texture2D(texRGBColors, tcoordVC);\n\n // since we render a screen aligned quad\n // we're going to be writing fragments\n // not touched by the original geometry\n // it's critical not to modify those\n // fragments.\n if (gl_FragDepth == 1.0)\n {\n discard;\n }\n}\n"),t.enhanceContrastPass=e.buildAShader("//VTK::System::Dec\n\n//=========================================================================\n//\n// Program: Visualization Toolkit\n// Module: vtkSurfaceLICMapper_CE.glsl\n//\n// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n// All rights reserved.\n// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n//\n// This software is distributed WITHOUT ANY WARRANTY; without even\n// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n// PURPOSE. See the above copyright notice for more information.\n//\n//=========================================================================\n\n// color contrast enhance stage implemented via histogram stretching\n// on lightness channel. if the min and max are tweaked it can generate\n// out-of-range values these will be clamped in 0 to 1\n\n// the output of this shader\n//VTK::Output::Dec\n\nuniform sampler2D texGeomColors; // scalars + lighting\nuniform sampler2D texLIC; // image lic, mask\nuniform sampler2D texHSLColors; // hsla colors\n\nuniform float uLMin; // min lightness over all fragments\nuniform float uLMaxMinDiff; // max - min lightness over all fragments\n\nin vec2 tcoordVC;\n\nvec3 HSLToRGB(vec3 HSL)\n{\n vec3 RGB;\n float v;\n float h = HSL.x;\n float sl = HSL.y;\n float l = HSL.z;\n\n v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl);\n if (v <= 0.0) {\n RGB = vec3(0.0,0.0,0.0);\n } else {\n float m;\n int sextant;\n float fract, vsf, mid1, mid2;\n\n m = l + l - v;\n h *= 6.0;\n sextant = int(h);\n fract = h - float(sextant);\n\n vsf = (v - m) * fract;\n mid1 = m + vsf;\n mid2 = v - vsf;\n switch (sextant) {\n case 0: RGB.r = v; RGB.g = mid1; RGB.b = m; break;\n case 1: RGB.r = mid2; RGB.g = v; RGB.b = m; break;\n case 2: RGB.r = m; RGB.g = v; RGB.b = mid1; break;\n case 3: RGB.r = m; RGB.g = mid2; RGB.b = v; break;\n case 4: RGB.r = mid1; RGB.g = m; RGB.b = v; break;\n case 5: RGB.r = v; RGB.g = m; RGB.b = mid2; break;\n }\n }\n return RGB;\n}\n\nvoid main()\n{\n // lookup hsl color , mask\n vec4 fragColor = texture2D(texHSLColors, tcoordVC.st);\n\n // don't modify masked fragments (masked => lic.g==1)\n vec4 lic = texture2D(texLIC, tcoordVC.st);\n if (lic.g==0.0)\n {\n // normalize lightness channel\n fragColor.z = clamp((fragColor.z - uLMin)/uLMaxMinDiff, 0.0, 1.0);\n }\n\n // back into rgb space\n fragColor.rgb = HSLToRGB(fragColor.xyz);\n\n // add alpha\n vec4 geomColor = texture2D(texGeomColors, tcoordVC.st);\n fragColor.a = geomColor.a;\n\n gl_FragData[0] = fragColor;\n}\n"),t.shadersNeedBuilding=!1)},e.initializeResources=function(){e.createFBO(),e.generateNoiseTexture(t.licInterface.getNoiseTextureSize()),e.allocateTextures(),e.buildAllShaders(),t.licQuad||(t.licQuad=function(e){var t=Ya.newInstance();t.setOpenGLRenderWindow(e);for(var n=new Float32Array(12),r=0;r<4;r++)n[3*r]=r%2*2-1,n[3*r+1]=r>1?1:-1,n[3*r+2]=0;var a=new Float32Array([0,0,1,0,0,1,1,1]),s=new Uint16Array(8);s[0]=3,s[1]=0,s[2]=1,s[3]=3,s[4]=3,s[5]=0,s[6]=3,s[7]=2;var i=B.a.newInstance({numberOfComponents:3,values:n});i.setName("points");var o=B.a.newInstance({numberOfComponents:1,values:s}),l=B.a.newInstance({numberOfComponents:2,values:a});return t.getCABO().createVBO(o,"polys",Yi.SURFACE,{points:i,cellOffset:0,tcoords:l}),t}(t.openGLRenderWindow)),t.licHelper||(t.licHelper=wi.newInstance())},e.prepareForGeometry=function(){var e=t.framebuffer;e.saveCurrentBindingsAndBuffers(),e.bind(),t.geometryImage.activate(),t.vectorImage.activate(),t.maskVectorImage.activate(),e.removeColorBuffer(0),e.removeColorBuffer(1),e.removeColorBuffer(2),e.setColorBuffer(t.geometryImage,0),e.setColorBuffer(t.vectorImage,1),e.setColorBuffer(t.maskVectorImage,2),e.setDepthBuffer(t.depthTexture);var n=t.context;n.drawBuffers([n.COLOR_ATTACHMENT0,n.COLOR_ATTACHMENT1,n.COLOR_ATTACHMENT2]),n.viewport.apply(n,[0,0].concat(Object(o.a)(t.size))),n.scissor.apply(n,[0,0].concat(Object(o.a)(t.size))),n.disable(n.BLEND),n.disable(n.DEPTH_TEST),n.disable(n.SCISSOR_TEST),n.clearColor(0,0,0,0),n.clear(n.DEPTH_BUFFER_BIT|n.COLOR_BUFFER_BIT)},e.copyToScreen=function(n){t.RGBColorImage.activate(),t.depthTexture.activate(),t.licCopyPass||e.initializeResources();var r=t.licCopyPass;t.openGLRenderWindow.getShaderCache().readyShaderProgram(r);var a=t.context;a.viewport.apply(a,[0,0].concat(Object(o.a)(n))),a.scissor.apply(a,[0,0].concat(Object(o.a)(n))),a.disable(a.BLEND),a.enable(a.DEPTH_TEST),a.disable(a.SCISSOR_TEST),r.setUniformi("texDepth",t.depthTexture.getTextureUnit()),r.setUniformi("texRGBColors",t.RGBColorImage.getTextureUnit()),e.renderQuad(n,r),t.RGBColorImage.deactivate(),t.depthTexture.deactivate()},e.combineColorsAndLIC=function(){var n=t.context,r=t.framebuffer;r.saveCurrentBindingsAndBuffers(),r.bind(),r.create.apply(r,Object(o.a)(t.size)),r.removeColorBuffer(0),r.removeColorBuffer(1),r.setColorBuffer(t.RGBColorImage,0),r.setColorBuffer(t.HSLColorImage,1),n.drawBuffers([n.COLOR_ATTACHMENT0,n.COLOR_ATTACHMENT1]),n.disable(n.DEPTH_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),t.vectorImage.activate(),t.geometryImage.activate(),t.LICImage.activate(),t.licColorPass||e.initializeResources();var a=t.licColorPass;t.openGLRenderWindow.getShaderCache().readyShaderProgram(a),a.setUniformi("texVectors",t.vectorImage.getTextureUnit()),a.setUniformi("texGeomColors",t.geometryImage.getTextureUnit());var s=t.licInterface.get("colorMode","LICIntensity","mapModeBias","maskIntensity","maskColor","enhanceContrast","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor"),i=s.colorMode,l=s.LICIntensity,B=s.mapModeBias,Q=s.maskIntensity,c=s.maskColor,F=s.enhanceContrast,U=s.lowColorContrastEnhancementFactor,g=s.highColorContrastEnhancementFactor;if(a.setUniformi("texLIC",t.LICImage.getTextureUnit()),a.setUniformi("uScalarColorMode",i),a.setUniformf("uLICIntensity",l),a.setUniformf("uMapBias",B),a.setUniformf("uMaskIntensity",Q),a.setUniform3f.apply(a,["uMaskColor"].concat(Object(o.a)(c))),e.renderQuad(t.size,a),t.vectorImage.deactivate(),t.geometryImage.deactivate(),t.LICImage.deactivate(),r.removeColorBuffer(0),r.removeColorBuffer(1),n.drawBuffers([n.NONE]),F===Zi||F===hi){var d=0,u=1,I=u-d;I=(u-=I*g)-(d+=I*U),r.setColorBuffer(t.RGBColorImage),n.drawBuffers([n.COLOR_ATTACHMENT0]),t.geometryImage.activate(),t.HSLColorImage.activate(),t.LICImage.activate(),t.enhanceContrastPass||e.initializeResources();var m=t.enhanceContrastPass;t.openGLRenderWindow.getShaderCache().readyShaderProgram(m),m.setUniformi("texGeomColors",t.geometryImage.getTextureUnit()),m.setUniformi("texHSLColors",t.HSLColorImage.getTextureUnit()),m.setUniformi("texLIC",t.LICImage.getTextureUnit()),m.setUniformf("uLMin",d),m.setUniformf("uLMaxMinDiff",I),e.renderQuad(t.size,m),t.geometryImage.deactivate(),t.HSLColorImage.deactivate(),t.LICImage.deactivate(),r.removeColorBuffer(0),n.drawBuffers([n.NONE])}r.restorePreviousBindingsAndBuffers()},e.applyLIC=function(){var e=t.licInterface.get("stepSize","numberOfSteps","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","normalizeVectors","maskThreshold","transformVectors"),n=t.licHelper.executeLIC(t.size,t.vectorImage,t.maskVectorImage,t.noiseTexture,t.openGLRenderWindow,e);if(!n)return console.error("Failed to compute image LIC"),void(t.LICImage=null);t.LICImage=n},e.setSize=function(n){Array.isArray(n)&&2===n.length&&(t.size&&t.size[0]===n[0]&&t.size[1]===n[1]||(t.size=n,e.releaseGraphicsResources()))},e.releaseGraphicsResources=function(){t.geometryImage&&(t.geometryImage.releaseGraphicsResources(),t.geometryImage=null),t.vectorImage&&(t.vectorImage.releaseGraphicsResources(),t.vectorImage=null),t.maskVectorImage&&(t.maskVectorImage.releaseGraphicsResources(),t.maskVectorImage=null),t.LICImage&&(t.LICImage.releaseGraphicsResources(),t.LICImage=null),t.RGBColorImage&&(t.RGBColorImage.releaseGraphicsResources(),t.RGBColorImage=null),t.HSLColorImage&&(t.HSLColorImage.releaseGraphicsResources(),t.HSLColorImage=null),t.depthTexture&&(t.depthTexture.releaseGraphicsResources(),t.depthTexture=null),t.framebuffer&&(t.framebuffer.releaseGraphicsResources(),t.framebuffer=null)}}var zi={context:null,openGLRenderWindow:null,shadersNeedBuilding:!0,reallocateTextures:!0,size:null,licInterface:null};function Pi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zi,n),Ai.extend(e,t,n),l.c.obj(e,t),l.c.setGet(e,t,["context","openGLRenderWindow","reallocateTextures","licInterface","size"]),Oi(e,t)}var Ki={newInstance:l.c.newInstance(Pi,"vtkSurfaceLICInterface"),extend:Pi};function ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var _i=l.c.vtkErrorMacro;function qi(e,t){t.classHierarchy.push("vtkOpenGLSurfaceLICMapper");var n=function(e){for(var t=1;t1&&t.renderable.setCustomShaderAttributes([a.getName()])}t.rebuildLICBuffers=!1,n.buildBufferObjects(e,r)},e.pushState=function(e){var n;t.stateCache=(Object(he.a)(n={},e.BLEND,e.isEnabled(e.BLEND)),Object(he.a)(n,e.DEPTH_TEST,e.isEnabled(e.DEPTH_TEST)),Object(he.a)(n,e.SCISSOR_TEST,e.isEnabled(e.SCISSOR_TEST)),n)},e.popState=function(e){var n=function(n){return t.stateCache[n]?e.enable(n):e.disable(n)};n(e.BLEND),n(e.DEPTH_TEST),n(e.SCISSOR_TEST)},e.renderPiece=function(r,a){var s=!0;t.openGLRenderWindow.getWebgl2()||(_i("SurfaceLICMapper Requires WebGL 2"),s=!1),t.context.getExtension("EXT_color_buffer_float")&&t.context.getExtension("OES_texture_float_linear")||(_i("SurfaceLICMapper requires the EXT_color_buffer_float and OES_texture_float_linear WebGL2 extensions."),s=!1),t.currentInput=t.renderable.getInputData(),t.currentInput||(_i("No input"),s=!1);var i=t.renderable.getLicInterface();i||(i=Ai.newInstance(),t.renderable.setLicInterface(i)),t.openGLLicInterface||(t.openGLLicInterface=Ki.newInstance()),i!==t.openGLLicInterface.getLicInterface()&&t.openGLLicInterface.setLicInterface(i);var o=t.renderable.getInputArrayToProcess(0);if(i.getEnableLIC()&&(!o||o.getNumberOfComponents()<2)&&(_i("No vector input array"),s=!1),i.getEnableLIC()||(s=!1),t.canDrawLIC!==s&&(t.rebuildLICShaders=!0,t.rebuildLICBuffers=!0),t.canDrawLIC=s,s&&i.getEnableLIC()){var l=t.openGLRenderWindow.getSize(),B=l.map((function(e){return Math.round(e*i.getViewPortScale())}));t.openGLLicInterface.setSize(B),t.openGLLicInterface.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLLicInterface.setContext(t.context),e.pushState(t.context),t.openGLLicInterface.initializeResources(),t.openGLLicInterface.prepareForGeometry(),e.popState(t.context),n.renderPieceStart(r,a),n.renderPieceDraw(r,a),n.renderPieceFinish(r,a),e.pushState(t.context),t.VBOBuildTime.modified(),t.openGLLicInterface.completedGeometry(),t.openGLLicInterface.applyLIC(),t.openGLLicInterface.combineColorsAndLIC(),t.openGLLicInterface.copyToScreen(l),e.popState(t.context)}else n.renderPiece(r,a)}}var $i={canDrawLIC:!1,rebuildLICShaders:!1,rebuildLICBuffers:!1,openGLLicInterface:null};function eo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$i,n),os.extend(e,t,n),qi(e,t),l.c.setGet(e,t,["openGLLicInterface"])}var to={newInstance:l.c.newInstance(eo,"vtkOpenGLSurfaceLICMapper"),extend:eo};function no(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementVolumeCount()}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.volumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0))},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Object(Z.d)(t.MCWCMatrix,t.renderable.getMatrix()),Object(Z.i)(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?Ct(t.normalMatrix):(mt(t.normalMatrix,t.MCWCMatrix),yt(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}var ro={};function ao(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ro,n),an.extend(e,t,n),t.keyMatrixTime={},l.c.obj(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),l.c.setGet(e,t,["context"]),no(e,t)}var so={newInstance:l.c.newInstance(ao,"vtkOpenGLVolume"),extend:ao},io={NEAREST:0,LINEAR:1,FAST_LINEAR:2},oo={FRACTIONAL:0,PROPORTIONAL:1},lo={InterpolationType:io,OpacityMode:oo},Bo={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3},Qo={BlendMode:Bo};function co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Fo=l.c.vtkWarningMacro,Uo=l.c.vtkErrorMacro;function go(e,t){if(e.length!==t.length)return!1;for(var n=0;n 0\nuniform float vSpecularPower;\nuniform float vAmbient;\nuniform float vDiffuse;\nuniform float vSpecular;\n//VTK::Light::Dec\n#endif\n\n// possibly define vtkGradientOpacityOn\n//VTK::GradientOpacityOn\n#ifdef vtkGradientOpacityOn\nuniform float goscale0;\nuniform float goshift0;\nuniform float gomin0;\nuniform float gomax0;\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\nuniform float goscale1;\nuniform float goshift1;\nuniform float gomin1;\nuniform float gomax1;\n#if vtkNumComponents >= 3\nuniform float goscale2;\nuniform float goshift2;\nuniform float gomin2;\nuniform float gomax2;\n#endif\n#if vtkNumComponents >= 4\nuniform float goscale3;\nuniform float goshift3;\nuniform float gomin3;\nuniform float gomax3;\n#endif\n#endif\n#endif\n\n// if you want to see the raw tiled\n// data in webgl1 uncomment the following line\n// #define debugtile\n\n// camera values\nuniform float camThick;\nuniform float camNear;\nuniform float camFar;\nuniform int cameraParallel;\n\n// values describing the volume geometry\nuniform vec3 vOriginVC;\nuniform vec3 vSpacing;\nuniform ivec3 volumeDimensions; // 3d texture dimensions\nuniform vec3 vPlaneNormal0;\nuniform float vPlaneDistance0;\nuniform vec3 vPlaneNormal1;\nuniform float vPlaneDistance1;\nuniform vec3 vPlaneNormal2;\nuniform float vPlaneDistance2;\nuniform vec3 vPlaneNormal3;\nuniform float vPlaneDistance3;\nuniform vec3 vPlaneNormal4;\nuniform float vPlaneDistance4;\nuniform vec3 vPlaneNormal5;\nuniform float vPlaneDistance5;\n\n//VTK::ClipPlane::Dec\n\n// opacity and color textures\nuniform sampler2D otexture;\nuniform float oshift0;\nuniform float oscale0;\nuniform sampler2D ctexture;\nuniform float cshift0;\nuniform float cscale0;\n\n// jitter texture\nuniform sampler2D jtexture;\n\n// some 3D texture values\nuniform float sampleDistance;\nuniform vec3 vVCToIJK;\n\n// the heights defined below are the locations\n// for the up to four components of the tfuns\n// the tfuns have a height of 2XnumComps pixels so the\n// values are computed to hit the middle of the two rows\n// for that component\n#ifdef vtkIndependentComponentsOn\n#if vtkNumComponents == 2\nuniform float mix0;\nuniform float mix1;\n#define height0 0.25\n#define height1 0.75\n#endif\n#if vtkNumComponents == 3\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\n#define height0 0.17\n#define height1 0.5\n#define height2 0.83\n#endif\n#if vtkNumComponents == 4\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\nuniform float mix3;\n#define height0 0.125\n#define height1 0.375\n#define height2 0.625\n#define height3 0.875\n#endif\n#endif\n\n#if vtkNumComponents >= 2\nuniform float oshift1;\nuniform float oscale1;\nuniform float cshift1;\nuniform float cscale1;\n#endif\n#if vtkNumComponents >= 3\nuniform float oshift2;\nuniform float oscale2;\nuniform float cshift2;\nuniform float cscale2;\n#endif\n#if vtkNumComponents >= 4\nuniform float oshift3;\nuniform float oscale3;\nuniform float cshift3;\nuniform float cscale3;\n#endif\n\n// declaration for intermixed geometry\n//VTK::ZBuffer::Dec\n\n// Lighting values\n//VTK::Light::Dec\n\n//=======================================================================\n// Webgl2 specific version of functions\n#if __VERSION__ == 300\n\nuniform highp sampler3D texture1;\n\nvec4 getTextureValue(vec3 pos)\n{\n vec4 tmp = texture(texture1, pos);\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.a = tmp.g;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n return tmp;\n}\n\n//=======================================================================\n// WebGL1 specific version of functions\n#else\n\nuniform sampler2D texture1;\n\nuniform float texWidth;\nuniform float texHeight;\nuniform int xreps;\nuniform int xstride;\nuniform int ystride;\n\n// if computing triliear values from multiple z slices\n#ifdef vtkTriliearOn\nvec4 getTextureValue(vec3 ijk)\n{\n float zoff = 1.0/float(volumeDimensions.z);\n vec4 val1 = getOneTextureValue(ijk);\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\n\n float indexZ = float(volumeDimensions)*ijk.z;\n float zmix = indexZ - floor(indexZ);\n\n return mix(val1, val2, zmix);\n}\n\nvec4 getOneTextureValue(vec3 ijk)\n#else // nearest or fast linear\nvec4 getTextureValue(vec3 ijk)\n#endif\n{\n vec3 tdims = vec3(volumeDimensions);\n\n#ifdef debugtile\n vec2 tpos = vec2(ijk.x, ijk.y);\n vec4 tmp = texture2D(texture1, tpos);\n tmp.a = 1.0;\n\n#else\n int z = int(ijk.z * tdims.z);\n int yz = z / xreps;\n int xz = z - yz*xreps;\n\n int tileWidth = volumeDimensions.x/xstride;\n int tileHeight = volumeDimensions.y/ystride;\n\n xz *= tileWidth;\n yz *= tileHeight;\n\n float ni = float(xz) + (ijk.x*float(tileWidth));\n float nj = float(yz) + (ijk.y*float(tileHeight));\n\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\n\n vec4 tmp = texture2D(texture1, tpos);\n\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.g = tmp.a;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n#endif\n\n return tmp;\n}\n\n// End of Webgl1 specific code\n//=======================================================================\n#endif\n\n//=======================================================================\n// compute the normal and gradient magnitude for a position\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\n{\n vec4 result;\n\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\n\n // divide by spacing\n result.xyz /= vSpacing;\n\n result.w = length(result.xyz);\n\n // rotate to View Coords\n result.xyz =\n result.x * vPlaneNormal0 +\n result.y * vPlaneNormal2 +\n result.z * vPlaneNormal4;\n\n if (result.w > 0.0)\n {\n result.xyz /= result.w;\n }\n return result;\n}\n\n#ifdef vtkImageLabelOutlineOn\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\n vec4 pcPos = vec4(\n (fragCoord.x / vpWidth - 0.5) * 2.0,\n (fragCoord.y / vpHeight - 0.5) * 2.0,\n (fragCoord.z - 0.5) * 2.0,\n 1.0);\n\n vec4 worldCoord = PCWCMatrix * pcPos;\n vec4 vertex = (worldCoord/worldCoord.w);\n\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\n}\n#endif\n\n//=======================================================================\n// compute the normals and gradient magnitudes for a position\n// for independent components\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\n{\n mat4 result;\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\n\n // divide by spacing\n distX /= vSpacing.x;\n distY /= vSpacing.y;\n distZ /= vSpacing.z;\n\n mat3 rot;\n rot[0] = vPlaneNormal0;\n rot[1] = vPlaneNormal2;\n rot[2] = vPlaneNormal4;\n\n#if !defined(vtkComponent0Proportional)\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\n result[0].a = length(result[0].xyz);\n result[0].xyz *= rot;\n if (result[0].w > 0.0)\n {\n result[0].xyz /= result[0].w;\n }\n#endif\n\n// optionally compute the 2nd component\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\n result[1].a = length(result[1].xyz);\n result[1].xyz *= rot;\n if (result[1].w > 0.0)\n {\n result[1].xyz /= result[1].w;\n }\n#endif\n\n// optionally compute the 3rd component\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\n result[2].a = length(result[2].xyz);\n result[2].xyz *= rot;\n if (result[2].w > 0.0)\n {\n result[2].xyz /= result[2].w;\n }\n#endif\n\n// optionally compute the 4th component\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\n result[3].a = length(result[3].xyz);\n result[3].xyz *= rot;\n if (result[3].w > 0.0)\n {\n result[3].xyz /= result[3].w;\n }\n#endif\n\n return result;\n}\n\n//=======================================================================\n// Given a normal compute the gradient opacity factors\n//\nfloat computeGradientOpacityFactor(\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\n{\n#if defined(vtkGradientOpacityOn)\n return clamp(normal.a*goscale + goshift, gomin, gomax);\n#else\n return 1.0;\n#endif\n}\n\n#if vtkLightComplexity > 0\nvoid applyLighting(inout vec3 tColor, vec4 normal)\n{\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n //VTK::Light::Impl\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\n}\n#endif\n\n//=======================================================================\n// Given a texture value compute the color and opacity\n//\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\n{\n#ifdef vtkImageLabelOutlineOn\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\n vec4 centerValue = getTextureValue(centerPosIS);\n bool pixelOnBorder = false;\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\n\n // Get alpha of segment from opacity function.\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\n\n // Only perform outline check on fragments rendering voxels that aren't invisible.\n // Saves a bunch of needless checks on the background.\n // TODO define epsilon when building shader?\n if (float(tColor.a) > 0.01) {\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\n if (i == 0 || j == 0) {\n continue;\n }\n\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\n gl_FragCoord.y + float(j),\n gl_FragCoord.z, gl_FragCoord.w);\n\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\n vec4 value = getTextureValue(neighborPosIS);\n\n // If any of my neighbours are not the same value as I\n // am, this means I am on the border of the segment.\n // We can break the loops\n if (any(notEqual(value, centerValue))) {\n pixelOnBorder = true;\n break;\n }\n }\n\n if (pixelOnBorder == true) {\n break;\n }\n }\n\n // If I am on the border, I am displayed at full opacity\n if (pixelOnBorder == true) {\n tColor.a = 1.0;\n }\n }\n\n#else\n // compute the normal and gradient magnitude if needed\n // We compute it as a vec4 if possible otherwise a mat4\n //\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\n\n // compute the normal vectors as needed\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\n #if !defined(vtkComponent0Proportional)\n vec4 normal0 = normalMat[0];\n #endif\n #if !defined(vtkComponent1Proportional)\n vec4 normal1 = normalMat[1];\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n vec4 normal2 = normalMat[2];\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n vec4 normal3 = normalMat[3];\n #endif\n #endif\n #endif\n #else\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\n #endif\n #endif\n\n // compute gradient opacity factors as needed\n #if defined(vtkGradientOpacityOn)\n #if !defined(vtkComponent0Proportional)\n goFactor.x =\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\n #endif\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n #if !defined(vtkComponent1Proportional)\n goFactor.y =\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n goFactor.z =\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n goFactor.w =\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\n #endif\n #endif\n #endif\n #endif\n #endif\n\n // single component is always independent\n #if vtkNumComponents == 1\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\n #endif\n\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\n #if !defined(vtkComponent0Proportional)\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n tColor *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\n #endif\n\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\n #if !defined(vtkComponent1Proportional)\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n tColor1 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\n #endif\n\n #if vtkNumComponents >= 3\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\n #if !defined(vtkComponent2Proportional)\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n tColor2 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\n #endif\n\n #if vtkNumComponents >= 4\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\n #if !defined(vtkComponent3Proportional)\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n tColor3 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\n #endif\n #endif\n #endif\n #else // then not independent\n\n #if vtkNumComponents == 2\n float lum = tValue.r * cscale0 + cshift0;\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\n vec4 tColor = vec4(lum, lum, lum, alpha);\n #endif\n #if vtkNumComponents == 3\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\n #endif\n #if vtkNumComponents == 4\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\n #endif\n #endif // dependent\n\n // apply lighting if requested as appropriate\n #if vtkLightComplexity > 0\n #if !defined(vtkComponent0Proportional)\n applyLighting(tColor.rgb, normal0);\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n #if !defined(vtkComponent1Proportional)\n applyLighting(tColor1, normal1);\n #endif\n #if vtkNumComponents >= 3\n #if !defined(vtkComponent2Proportional)\n applyLighting(tColor2, normal2);\n #endif\n #if vtkNumComponents >= 4\n #if !defined(vtkComponent3Proportional)\n applyLighting(tColor3, normal3);\n #endif\n #endif\n #endif\n #endif\n#endif\n\n// perform final independent blend as needed\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n tColor.rgb += tColor1;\n#if vtkNumComponents >= 3\n tColor.rgb += tColor2;\n#if vtkNumComponents >= 4\n tColor.rgb += tColor3;\n#endif\n#endif\n#endif\n\n#endif\n\n\n\n\n\n\n\nreturn tColor;\n}\n\n\n\n//=======================================================================\n// Apply the specified blend mode operation along the ray's path.\n//\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\n{\n vec3 tstep = 1.0/tdims;\n\n // start slightly inside and apply some jitter\n vec3 delta = endIS - posIS;\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\n float raySteps = length(delta)/sampleDistanceIS;\n\n // avoid 0.0 jitter\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\n float stepsTraveled = jitter;\n\n // local vars for the loop\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 tValue;\n vec4 tColor;\n\n // if we have less than one step then pick the middle point\n // as our value\n // if (raySteps <= 1.0)\n // {\n // posIS = (posIS + endIS)*0.5;\n // }\n\n // Perform initial step at the volume boundary\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n // handle very thin volumes\n if (raySteps <= 1.0)\n {\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\n gl_FragData[0] = tColor;\n return;\n }\n\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\n color = vec4(tColor.rgb*tColor.a, tColor.a);\n posIS += (jitter*stepIS);\n\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n float mix = (1.0 - color.a);\n\n // this line should not be needed but nvidia seems to not handle\n // the break correctly on windows/chrome 58 angle\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\n\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n stepsTraveled++;\n posIS += stepIS;\n if (color.a > 0.99) { color.a = 1.0; break; }\n }\n\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\n {\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\n\n float mix = (1.0 - color.a);\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n }\n\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\n #endif\n #if vtkBlendMode == 1 || vtkBlendMode == 2\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\n // Find maximum/minimum intensity along the ray.\n\n // Define the operation we will use (min or max)\n #if vtkBlendMode == 1\n #define OP max\n #else\n #define OP min\n #endif\n\n // If the clipping range is shorter than the sample distance\n // we can skip the sampling loop along the ray.\n if (raySteps <= 1.0)\n {\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\n return;\n }\n\n vec4 value = tValue;\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // Update the maximum value if necessary\n value = OP(tValue, value);\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n tValue = getTextureValue(posIS);\n value = OP(tValue, value);\n\n // Now map through opacity and color\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\n #endif\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\n vec4 averageIPScalarRangeMin = vec4 (\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n 1.0);\n vec4 averageIPScalarRangeMax = vec4(\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n 1.0);\n\n vec4 sum = vec4(0.);\n\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n }\n\n if (raySteps <= 1.0) {\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n return;\n }\n\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\n // Notes:\n // - We are comparing all values in the texture to see if any of them\n // are outside of the scalar range. In the future we might want to allow\n // scalar ranges for each component.\n // - We are setting the alpha channel for averageIPScalarRangeMin and\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\n // based on the alpha channel comparison.\n // - There might be a better way to do this. I'm not sure if there is an\n // equivalent of 'any' which only operates on RGB, though I suppose\n // we could write an 'anyRGB' function and see if that is faster.\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\n continue;\n }\n\n // Sum the values across each step in the path\n sum += tValue;\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n #endif\n}\n\n//=======================================================================\n// Compute a new start and end point for a given ray based\n// on the provided bounded clipping plane (aka a rectangle)\nvoid getRayPointIntersectionBounds(\n vec3 rayPos, vec3 rayDir,\n vec3 planeDir, float planeDist,\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\n float vSize1, float vSize2)\n{\n float result = dot(rayDir, planeDir);\n if (result == 0.0)\n {\n return;\n }\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\n vec3 xposVC = rayPos + rayDir*result;\n vec3 vxpos = xposVC - vOriginVC;\n vec2 vpos = vec2(\n dot(vxpos, vPlaneX),\n dot(vxpos, vPlaneY));\n\n // on some apple nvidia systems this does not work\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\n // vpos.y < 0.0 || vpos.y > vSize2)\n // even just\n // if (vpos.x < 0.0 || vpos.y < 0.0)\n // fails\n // so instead we compute a value that represents in and out\n //and then compute the return using this value\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\n\n tbounds = mix(\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\n tbounds, // out value\n check); // 0 in 1 out\n}\n\n//=======================================================================\n// given a\n// - ray direction (rayDir)\n// - starting point (vertexVCVSOutput)\n// - bounding planes of the volume\n// - optionally depth buffer values\n// - far clipping plane\n// compute the start/end distances of the ray we need to cast\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\n{\n vec2 dists = vec2(100.0*camFar, -1.0);\n\n vec3 vSize = vSpacing*(tdims - 1.0);\n\n // all this is in View Coordinates\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n\n //VTK::ClipPlane::Impl\n\n // do not go behind front clipping plane\n dists.x = max(0.0,dists.x);\n\n // do not go PAST far clipping plane\n float farDist = -camThick/rayDir.z;\n dists.y = min(farDist,dists.y);\n\n // Do not go past the zbuffer value if set\n // This is used for intermixing opaque geometry\n //VTK::ZBuffer::Impl\n\n return dists;\n}\n\n//=======================================================================\n// Compute the index space starting position (pos) and end\n// position\n//\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\n{\n // compute starting and ending values in volume space\n pos = vertexVCVSOutput + dists.x*rayDir;\n pos = pos - vOriginVC;\n // convert to volume basis and origin\n pos = vec3(\n dot(pos, vPlaneNormal0),\n dot(pos, vPlaneNormal2),\n dot(pos, vPlaneNormal4));\n\n endPos = vertexVCVSOutput + dists.y*rayDir;\n endPos = endPos - vOriginVC;\n endPos = vec3(\n dot(endPos, vPlaneNormal0),\n dot(endPos, vPlaneNormal2),\n dot(endPos, vPlaneNormal4));\n\n float delta = length(endPos - pos);\n\n pos *= vVCToIJK;\n endPos *= vVCToIJK;\n\n float delta2 = length(endPos - pos);\n sampleDistanceIS = sampleDistance*delta2/delta;\n}\n\nvoid main()\n{\n\n vec3 rayDirVC;\n\n if (cameraParallel == 1)\n {\n // Camera is parallel, so the rayDir is just the direction of the camera.\n rayDirVC = vec3(0.0, 0.0, -1.0);\n } else {\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\n rayDirVC = normalize(vertexVCVSOutput);\n }\n\n vec3 tdims = vec3(volumeDimensions);\n\n // compute the start and end points for the ray\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\n\n // do we need to composite? aka does the ray have any length\n // If not, bail out early\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\n {\n discard;\n }\n\n // IS = Index Space\n vec3 posIS;\n vec3 endIS;\n float sampleDistanceIS;\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\n\n // Perform the blending operation along the ray\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\n}\n",e.Geometry=""},e.replaceShaderValues=function(n,r,a){var s=n.Fragment;a.getProperty().getInterpolationType()===io.LINEAR&&(s=ma.substitute(s,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===a.getProperty().getUseLabelOutline()&&(s=ma.substitute(s,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();s=ma.substitute(s,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var o=a.getProperty().getIndependentComponents();if(o){s=ma.substitute(s,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var l=[],B=0;B0&&(s=ma.substitute(s,"//VTK::vtkProportionalComponents",l.join("\n")).result)}var Q=t.currentInput.getExtent(),c=t.currentInput.getSpacing(),F=new Float64Array(3);Object(h.p)(F,(Q[1]-Q[0])*c[0],(Q[3]-Q[2])*c[1],(Q[5]-Q[4])*c[2]);var U=Object(h.j)(F)/t.renderable.getSampleDistance();s=ma.substitute(s,"//VTK::MaximumSamplesValue","".concat(Math.ceil(U))).result,s=ma.substitute(s,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var g=1;o&&!t.gopacity&&g0&&(a=ma.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(s,";"),"uniform vec3 lightDirectionVC".concat(s,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(s,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=ma.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(s,"));")," diffuse += ((df".concat("",") * lightColor").concat(s,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(s,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(s,");")," //VTK::Light::Impl"],!1).result,s++)}))}e.Fragment=a},e.replaceShaderClippingPlane=function(e,n,r){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var s=t.renderable.getClippingPlanes().length;a=ma.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=ma.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(s,"; i++) {")," float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result}e.Fragment=a},e.getNeedToRebuildShaders=function(n,r,a){var s=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===Bo.COMPOSITE_BLEND&&(s=0,t.numberOfLights=0,r.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===s&&(s=1)),1===s&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(s=2),s<3&&e.getPositional()&&(s=3)})));var i=!1;t.lastLightComplexity!==s&&(t.lastLightComplexity=s,i=!0);var o=t.scalarTexture.getComponents(),l=a.getProperty().getIndependentComponents(),B=!1,Q=[];if(l){for(var c=0;c0&&(B=!0)}var F=t.currentInput.getExtent(),U=t.currentInput.getSpacing(),g=new Float64Array(3);Object(h.p)(g,(F[1]-F[0])*U[0],(F[3]-F[2])*U[1],(F[5]-F[4])*U[2]);var d=Object(h.j)(g)/t.renderable.getSampleDistance(),u={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:o,usesProportionalComponents:B,iComps:l,maxSamples:d,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),averageIPScalarMode:t.renderable.getAverageIPScalarRange(),proportionalComponents:Q};return t.previousState&&t.previousState.interpolationType===u.interpolationType&&t.previousState.useLabelOutline===u.useLabelOutline&&t.previousState.numComp===u.numComp&&t.previousState.usesProportionalComponents===u.usesProportionalComponents&&t.previousState.iComps===u.iComps&&t.previousState.maxSamples===u.maxSamples&&t.previousState.useGradientOpacity===u.useGradientOpacity&&t.previousState.blendMode===u.blendMode&&go(t.previousState.averageIPScalarMode,u.averageIPScalarMode)&&go(t.previousState.proportionalComponents,u.proportionalComponents)?!!(0===n.getProgram()||i||t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||!!t.lastZBufferTexture!=!!t.zBufferTexture||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(s.isAttributeUsed("vertexDC")&&(n.getVAO().addAttributeArray(s,n.getCABO(),"vertexDC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Uo("Error setting vertexDC in shader VAO.")),n.getAttributeUpdateTime().modified()),s.setUniformi("texture1",t.scalarTexture.getTextureUnit()),s.setUniformf("sampleDistance",t.renderable.getSampleDistance()),null!==t.zBufferTexture){s.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var i=e.getRenderTargetSize();s.setUniformf("vpWidth",i[0]),s.setUniformf("vpHeight",i[1])}},e.setCameraShaderParameters=function(n,r,a){var s=t.openGLCamera.getKeyMatrices(r),i=t.openGLVolume.getKeyMatrices();Object(Z.l)(t.modelToView,s.wcvc,i.mcwc);var o=n.getProgram(),l=t.openGLCamera.getRenderable(),B=l.getClippingRange();o.setUniformf("camThick",B[1]-B[0]),o.setUniformf("camNear",B[0]),o.setUniformf("camFar",B[1]);for(var Q=t.currentInput.getBounds(),c=t.currentInput.getDimensions(),F=new Float64Array(3),U=new Float64Array(3),g=1,d=-1,u=1,I=-1,m=0;m<8;++m){if(Object(h.p)(F,Q[m%2],Q[2+Math.floor(m/2)%2],Q[4+Math.floor(m/4)]),Object(h.q)(F,F,t.modelToView),!l.getParallelProjection()){Object(h.l)(U,F);var C=-B[0]/F[2];Object(h.b)(F,U,C)}Object(h.q)(F,F,s.vcpc),g=Math.min(F[0],g),d=Math.max(F[0],d),u=Math.min(F[1],u),I=Math.max(F[1],I)}o.setUniformf("dcxmin",g),o.setUniformf("dcxmax",d),o.setUniformf("dcymin",u),o.setUniformf("dcymax",I),o.isUniformUsed("cameraParallel")&&o.setUniformi("cameraParallel",l.getParallelProjection());var b=t.currentInput.getExtent(),y=t.currentInput.getSpacing(),S=new Float64Array(3);Object(h.p)(S,(b[1]-b[0]+1)*y[0],(b[3]-b[2]+1)*y[1],(b[5]-b[4]+1)*y[2]),o.setUniform3f("vSpacing",y[0],y[1],y[2]),Object(h.p)(F,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(F,F),Object(h.q)(F,F,t.modelToView),o.setUniform3f("vOriginVC",F[0],F[1],F[2]);var x=t.currentInput.getIndexToWorld();Object(Z.l)(t.idxToView,t.modelToView,x),St(t.idxNormalMatrix,s.normalMatrix,i.normalMatrix),St(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var p=Object(h.j)(S)/t.renderable.getSampleDistance();p>t.renderable.getMaximumSamplesPerRay()&&Fo("The number of steps required ".concat(Math.ceil(p)," is larger than the\n specified maximum number of steps ").concat(t.renderable.getMaximumSamplesPerRay(),".\n Please either change the\n volumeMapper sampleDistance or its maximum number of samples."));var G=new Float64Array(3);if(Object(h.p)(G,1,1,1),Object(h.k)(G,G,S),o.setUniform3f("vVCToIJK",G[0],G[1],G[2]),o.setUniform3i("volumeDimensions",c[0],c[1],c[2]),!t.openGLRenderWindow.getWebgl2()){var R=t.scalarTexture.getVolumeInfo();o.setUniformf("texWidth",t.scalarTexture.getWidth()),o.setUniformf("texHeight",t.scalarTexture.getHeight()),o.setUniformi("xreps",R.xreps),o.setUniformi("xstride",R.xstride),o.setUniformi("ystride",R.ystride)}for(var L=new Float64Array(3),V=new Float64Array(3),A=0;A<6;++A){switch(A){default:case 0:Object(h.p)(L,1,0,0),Object(h.p)(V,b[1],b[3],b[5]);break;case 1:Object(h.p)(L,-1,0,0),Object(h.p)(V,b[0],b[2],b[4]);break;case 2:Object(h.p)(L,0,1,0),Object(h.p)(V,b[1],b[3],b[5]);break;case 3:Object(h.p)(L,0,-1,0),Object(h.p)(V,b[0],b[2],b[4]);break;case 4:Object(h.p)(L,0,0,1),Object(h.p)(V,b[1],b[3],b[5]);break;case 5:Object(h.p)(L,0,0,-1),Object(h.p)(V,b[0],b[2],b[4])}Object(h.m)(L,L,t.idxNormalMatrix),Object(h.q)(V,V,t.idxToView);var f=-1*Object(h.d)(V,L);if(o.setUniform3f("vPlaneNormal".concat(A),L[0],L[1],L[2]),o.setUniformf("vPlaneDistance".concat(A),f),a.getProperty().getUseLabelOutline()){var N=t.currentInput.getWorldToIndex();o.setUniformMatrix("vWCtoIDX",N),Object(Z.g)(t.projectionToWorld,s.wcpc),o.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var E=e.getRenderTargetSize();o.setUniformf("vpWidth",E[0]),o.setUniformf("vpHeight",E[1])}}switch(Object(Z.g)(t.projectionToView,s.vcpc),o.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){default:case 0:break;case 1:case 2:case 3:var D=0,v=[];r.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),n=e.getIntensity();v[0]=t[0]*n,v[1]=t[1]*n,v[2]=t[2]*n,o.setUniform3fArray("lightColor".concat(D),v);var r=e.getDirection();Object(h.p)(L,r[0],r[1],r[2]),Object(h.m)(L,L,s.normalMatrix),o.setUniform3f("lightDirectionVC".concat(D),L[0],L[1],L[2]);var a=[-.5*L[0],-.5*L[1],-.5*(L[2]-1)];o.setUniform3fArray("lightHalfAngleVC".concat(D),a),D++}}))}},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var s=t.scalarTexture.getVolumeInfo(),i=r.getProperty(),o=t.scalarTexture.getComponents(),l=r.getProperty().getIndependentComponents();if(l&&o>=2)for(var B=0;B0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,n,r){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(n),s=[],i=[],o=t.renderable.getClippingPlanes(),l=o.length,B=0;B1.43){var e=t.framebuffer.getSize();return[t.fvp[0]*e[0],t.fvp[1]*e[1]]}return t.openGLRenderWindow.getFramebufferSize()},e.renderPieceStart=function(n,r){if(t.renderable.getAutoAdjustSampleDistances()){var a=n.getVTKWindow().getInteractor(),s=a.getLastFrameTime();if(t.avgFrameTime=.97*t.avgFrameTime+.03*s,t.avgWindowArea=.97*t.avgWindowArea+.03/(t.lastXYF*t.lastXYF),n.getVTKWindow().getInteractor().isAnimating()){var i=Math.sqrt(t.avgFrameTime*a.getDesiredUpdateRate()/t.avgWindowArea);i>10&&(i=10),t.targetXYF=i}else t.targetXYF=Math.sqrt(t.avgFrameTime*a.getStillUpdateRate()/t.avgWindowArea);t.targetXYF<1.53&&t.targetXYF>1.33&&(t.targetXYF=t.lastXYF),Math.abs(1-t.targetXYF/t.lastXYF)<.1&&(t.targetXYF=t.lastXYF),t.lastXYF=t.targetXYF}else t.lastXYF=t.renderable.getImageSampleDistance();t.lastXYF<=1.43&&(t.lastXYF=1);var o=t.lastXYF,l=t.openGLRenderWindow.getFramebufferSize();if(o>1.43){if(t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer();else{var B=t.framebuffer.getSize();B[0]===Math.floor(.7*l[0])&&B[1]===Math.floor(.7*l[1])||(t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var Q=t.context;Q.clearColor(0,0,0,0),Q.colorMask(!0,!0,!0,!0),Q.clear(Q.COLOR_BUFFER_BIT),Q.viewport(0,0,l[0]/o,l[1]/o),t.fvp=[Math.floor(l[0]/o)/Math.floor(.7*l[0]),Math.floor(l[1]/o)/Math.floor(.7*l[1])]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(n,r),r.getProperty().getInterpolationType()===io.NEAREST?(t.scalarTexture.setMinificationFilter(Cn.NEAREST),t.scalarTexture.setMagnificationFilter(Cn.NEAREST)):(t.scalarTexture.setMinificationFilter(Cn.LINEAR),t.scalarTexture.setMagnificationFilter(Cn.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(n,r){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,n,r),a.drawArrays(a.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.scalarTexture.deactivate(),t.colorTexture.deactivate(),t.opacityTexture.deactivate(),t.jitterTexture.deactivate()},e.renderPieceFinish=function(e,n){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t.lastXYF>1.43){if(t.framebuffer.restorePreviousBindingsAndBuffers(),null===t.copyShader){t.copyShader=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join("\n"),["//VTK::System::Dec","//VTK::Output::Dec","uniform sampler2D texture1;","varying vec2 tcoord;","void main() { gl_FragData[0] = texture2D(texture1,tcoord); }"].join("\n"),"");var r=t.copyShader;t.copyVAO=Ta.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(r,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Uo("Error setting vertexDC in copy shader VAO.")}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.copyShader);var a=t.openGLRenderWindow.getFramebufferSize();t.context.viewport(0,0,a[0],a[1]);var s=t.framebuffer.getColorTexture();s.activate(),t.copyShader.setUniformi("texture",s.getTextureUnit()),t.copyShader.setUniform2f("tfactor",t.fvp[0],t.fvp[1]);var i=t.context;i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),s.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(n,r){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(n,r),e.renderPieceDraw(n,r),e.renderPieceFinish(n,r)):Uo("No input!")},e.computeBounds=function(n,r){e.getInput()?t.bounds=e.getInput().getBounds():Object(b.D)(t.Bounds)},e.updateBufferObjects=function(t,n){e.getNeedToRebuildBufferObjects(t,n)&&e.buildBufferObjects(t,n)},e.getNeedToRebuildBufferObjects=function(n,r){return t.VBOBuildTime.getMTime()1?1:-1,A[3*f+2]=-1;var N=new Uint16Array(8);N[0]=3,N[1]=0,N[2]=1,N[3]=3,N[4]=3,N[5]=0,N[6]=3,N[7]=2;var E=B.a.newInstance({numberOfComponents:3,values:A});E.setName("points");var D=B.a.newInstance({numberOfComponents:1,values:N});t.tris.getCABO().createVBO(D,"polys",rr.SURFACE,{points:E,cellOffset:0})}t.VBOBuildTime.modified()}}}}var Io={context:null,VBOBuildTime:null,scalarTexture:null,scalarTextureString:null,opacityTexture:null,opacityTextureString:null,colorTexture:null,colorTextureString:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,lastLightComplexity:0,fullViewportTime:1,idxToView:null,idxNormalMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function mo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Io,n),an.extend(e,t,n),t.VBOBuildTime={},l.c.obj(t.VBOBuildTime,{mtime:0}),t.tris=Ya.newInstance(),t.scalarTexture=An.newInstance(),t.opacityTexture=An.newInstance(),t.colorTexture=An.newInstance(),t.jitterTexture=An.newInstance(),t.jitterTexture.setWrapS(mn.REPEAT),t.jitterTexture.setWrapT(mn.REPEAT),t.framebuffer=Dn.newInstance(),t.idxToView=Object(Z.h)(new Float64Array(16)),t.idxNormalMatrix=Ct(new Float64Array(9)),t.modelToView=Object(Z.h)(new Float64Array(16)),t.projectionToView=Object(Z.h)(new Float64Array(16)),t.projectionToWorld=Object(Z.h)(new Float64Array(16)),l.c.setGet(e,t,["context"]),uo(e,t)}var Co={newInstance:l.c.newInstance(mo,"vtkOpenGLVolumeMapper"),extend:mo};function bo(e,t){t.overrides={},t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(n){if(n.isDeleted())return null;for(var r=0,a=n.getClassName(r++),s=!1,i=Object.keys(t.overrides);a&&!s;)-1!==i.indexOf(a)?s=!0:a=n.getClassName(r++);if(!s)return null;var o=t.overrides[a]();return o.setMyFactory(e),o},e.registerOverride=function(e,n){t.overrides[e]=n}}var yo={};function So(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yo,n),l.c.obj(e,t),bo(e,t)}var xo={newInstance:l.c.newInstance(So,"vtkViewNodeFactory"),extend:So};function Zo(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var ho={};function po(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ho,n),xo.extend(e,t,n),Zo(0,t),e.registerOverride("vtkActor",zn.newInstance),e.registerOverride("vtkActor2D",_n.newInstance),e.registerOverride("vtkCamera",tr.newInstance),e.registerOverride("vtkGlyph3DMapper",Ds.newInstance),e.registerOverride("vtkImageMapper",Ys.newInstance),e.registerOverride("vtkImageSlice",Ks.newInstance),e.registerOverride("vtkMapper",os.newInstance),e.registerOverride("vtkPixelSpaceCallbackMapper",ei.newInstance),e.registerOverride("vtkRenderer",si.newInstance),e.registerOverride("vtkSkybox",Qi.newInstance),e.registerOverride("vtkSphereMapper",ui.newInstance),e.registerOverride("vtkStickMapper",Si.newInstance),e.registerOverride("vtkTexture",An.newInstance),e.registerOverride("vtkSurfaceLICMapper",to.newInstance),e.registerOverride("vtkVolume",so.newInstance),e.registerOverride("vtkVolumeMapper",Co.newInstance),e.registerOverride("vtkWidgetRepresentation",Mn.newInstance)}var Go={newInstance:l.c.newInstance(po,"vtkOpenGLViewNodeFactory"),extend:po},Ro=n(11),Lo=Object(Ro.d)((function(e){!function(t){function n(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function r(e,t,r,a,s,i){return n((o=n(n(t,e),n(a,i)))<<(l=s)|o>>>32-l,r);var o,l}function a(e,t,n,a,s,i,o){return r(t&n|~t&a,e,t,s,i,o)}function s(e,t,n,a,s,i,o){return r(t&a|n&~a,e,t,s,i,o)}function i(e,t,n,a,s,i,o){return r(t^n^a,e,t,s,i,o)}function o(e,t,n,a,s,i,o){return r(n^(t|~a),e,t,s,i,o)}function l(e,t){var r,l,B,Q,c;e[t>>5]|=128<>>9<<4)]=t;var F=1732584193,U=-271733879,g=-1732584194,d=271733878;for(r=0;r>5]>>>t%32&255);return n}function Q(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+r.charAt(15&t);return a}function F(e){return unescape(encodeURIComponent(e))}function U(e){return function(e){return B(l(Q(e),8*e.length))}(F(e))}function g(e,t){return function(e,t){var n,r,a=Q(e),s=[],i=[];for(s[15]=i[15]=void 0,a.length>16&&(a=l(a,8*e.length)),n=0;n<16;n+=1)s[n]=909522486^a[n],i[n]=1549556828^a[n];return r=l(s.concat(Q(t)),512+8*t.length),B(l(i.concat(r),640))}(F(e),F(t))}function d(e,t,n){return t?n?g(t,e):c(g(t,e)):n?U(e):c(U(e))}e.exports?e.exports=d:t.md5=d}(Ro.b)}),"/$$rollup_base$$/node_modules/blueimp-md5/js"),Vo=["lastShaderBound","context","openGLRenderWindow"];function Ao(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,n,r){var a=n;r.length>0&&(a=ma.substitute(a,"VSOut","GSOut").result);var s=t.openGLRenderWindow.getWebgl2(),i="\n",o="#version 100\n";s?o="#version 300 es\n#define attribute in\n#define textureCube texture\n#define texture2D texture\n#define textureCubeLod textureLod\n#define texture2DLod textureLod\n":(t.context.getExtension("OES_standard_derivatives"),t.context.getExtension("EXT_frag_depth")&&(i="#extension GL_EXT_frag_depth : enable\n"),t.context.getExtension("EXT_shader_texture_lod")&&(i+="#extension GL_EXT_shader_texture_lod : enable\n#define textureCubeLod textureCubeLodEXT\n#define texture2DLod texture2DLodEXT")),a=ma.substitute(a,"//VTK::System::Dec",["".concat(o,"\n"),s?"":"#extension GL_OES_standard_derivatives : enable\n",i,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;var l=ma.substitute(e,"//VTK::System::Dec",["".concat(o,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return s&&(l=ma.substitute(l,"varying","out").result,a=ma.substitute(a,"varying","in").result,a=ma.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=ma.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:ma.substitute(r,"//VTK::System::Dec",o).result}},e.readyShaderProgramArray=function(t,n,r){var a=e.replaceShaderValues(t,n,r),s=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(s)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,n,r){var a="".concat(e).concat(n).concat(r),s=Lo(a);if(-1===Object.keys(t.shaderPrograms).indexOf(s)){var i=ma.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(n),r&&i.getGeometryShader().setSource(r),i.setMd5Hash(s),t.shaderPrograms[s]=i,i}return t.shaderPrograms[s]},e.releaseGraphicsResources=function(n){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(n)}))},e.releaseGraphicsResources=function(){t.astShaderBound&&(t.lastShaderBound.release(),t.lastShaderBound=null)},e.bindShader=function(e){return t.lastShaderBound===e||(t.lastShaderBound&&t.lastShaderBound.release(),e.bind(),t.lastShaderBound=e),1}}var fo={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function No(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.assign(t,fo,n),t.shaderPrograms={},l.c.obj(e,t),l.c.setGet(e,t,Vo),Ao(e,t),Object.freeze(e)}var Eo={newInstance:l.c.newInstance(No,"vtkShaderCache"),extend:No},Do=l.c.vtkErrorMacro;function vo(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jo,n),l.c.obj(e,t),t.textureUnits=[],l.c.get(e,t,["numberOfTextureUnits"]),l.c.setGet(e,t,["context"]),vo(e,t)}var Xo={newInstance:l.c.newInstance(Wo,"vtkOpenGLTextureUnitManager"),extend:Wo},Ho=Object(Ro.f)(Object(Ro.d)((function(e,t){ /** * @license * cardboard-vr-display @@ -96,7 +96,7 @@ t.read=function(e,t,n,r,s){var a,i,Q=8*s-r-1,B=(1<>1,l=-7,F=n?s-1:0,U= * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -e.exports=function(){var e="undefined"!=typeof window?window:void 0!==gi.b?gi.b:"undefined"!=typeof self?self:{};var t=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},n=function(e,t){for(var n=0,r=e.length;ne.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}s||(s=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(B),r.push(e.getParameter(i),null);break;case e.ACTIVE_TEXTURE:s=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(i))}for(n(e),a=0;ae.TEXTURE31)break;e.activeTexture(B),e.bindTexture(e.TEXTURE_2D,Q);break;case e.TEXTURE_BINDING_CUBE_MAP:var B;if((B=t[++a])e.TEXTURE31)break;e.activeTexture(B),e.bindTexture(e.TEXTURE_CUBE_MAP,Q);break;case e.VIEWPORT:e.viewport(Q[0],Q[1],Q[2],Q[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:Q?e.enable(i):e.disable(i);break;default:console.log("No GL restore behavior for 0x"+i.toString(16))}s&&e.activeTexture(s)}}else n(e)},V=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),L=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function A(e,t,n,r){this.gl=e,this.cardboardUI=t,this.bufferScale=n,this.dirtySubmitFrameBindings=r,this.ctxAttribs=e.getContextAttributes(),this.instanceExt=e.getExtension("ANGLE_instanced_arrays"),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,Q()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=C(e,V,L,this.attribs),this.uniforms=b(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}A.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},A.prototype.onResize=function(){var e=this.gl,t=this,n=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];R(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)})),this.cardboardUI&&this.cardboardUI.onResize()},A.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,n=this.gl;Q()||(t.width=u()*this.bufferScale,t.height=I()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(n){e.bufferWidth=n,e.realCanvasWidth.set.call(t,n),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(n){e.bufferHeight=n,e.realCanvasHeight.set.call(t,n),e.onResize()}})),this.lastBoundFramebuffer=n.getParameter(n.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r||e.framebuffer,e.realBindFramebuffer.call(n,t,e.lastBoundFramebuffer)},this.cullFace=n.getParameter(n.CULL_FACE),this.depthTest=n.getParameter(n.DEPTH_TEST),this.blend=n.getParameter(n.BLEND),this.scissorTest=n.getParameter(n.SCISSOR_TEST),this.stencilTest=n.getParameter(n.STENCIL_TEST),n.enable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!0;break;case n.DEPTH_TEST:e.depthTest=!0;break;case n.BLEND:e.blend=!0;break;case n.SCISSOR_TEST:e.scissorTest=!0;break;case n.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(n,t)},n.disable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!1;break;case n.DEPTH_TEST:e.depthTest=!1;break;case n.BLEND:e.blend=!1;break;case n.SCISSOR_TEST:e.scissorTest=!1;break;case n.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(n,t)},this.colorMask=n.getParameter(n.COLOR_WRITEMASK),n.colorMask=function(t,r,s,a){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=s,e.colorMask[3]=a,e.realColorMask.call(n,t,r,s,a)},this.clearColor=n.getParameter(n.COLOR_CLEAR_VALUE),n.clearColor=function(t,r,s,a){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=s,e.clearColor[3]=a,e.realClearColor.call(n,t,r,s,a)},this.viewport=n.getParameter(n.VIEWPORT),n.viewport=function(t,r,s,a){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=s,e.viewport[3]=a,e.realViewport.call(n,t,r,s,a)},this.isPatched=!0,Z(t)}},A.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;Q()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout((function(){Z(t)}),1)}},A.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},A.prototype.submitFrame=function(){var e=this.gl,t=this,n=[];if(this.dirtySubmitFrameBindings||n.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),R(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null);var n=0,r=0;t.instanceExt&&(n=e.getVertexAttrib(t.attribs.position,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),r=e.getVertexAttrib(t.attribs.texCoord,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||Q())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,0),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,0)),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,n),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,r))})),Q()){var r=e.canvas;r.width==t.bufferWidth&&r.height==t.bufferHeight||(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},A.prototype.updateDeviceInfo=function(e){var t=this.gl,n=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];R(t,r,(function(t){var r=n.computeMeshVertices_(n.meshWidth,n.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,n.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!n.indexCount){var s=n.computeMeshIndices_(n.meshWidth,n.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,s,t.STATIC_DRAW),n.indexCount=s.length}}))},A.prototype.computeMeshVertices_=function(e,t,n){for(var r=new Float32Array(2*e*t*5),s=n.getLeftEyeVisibleTanAngles(),a=n.getLeftEyeNoLensTanAngles(),Q=n.getLeftEyeVisibleScreenRect(a),B=0,o=0;o<2;o++){for(var l=0;ls-42&&r.clientXn.clientHeight-42?e(r):r.clientX<42&&r.clientY<42&&t(r)},n.addEventListener("click",this.listener,!1)},J.prototype.onResize=function(){var e=this.gl,t=this,n=[e.ARRAY_BUFFER_BINDING];R(e,n,(function(e){var n=[],r=e.drawingBufferWidth/2,s=Math.max(screen.width,screen.height)*window.devicePixelRatio,a=e.drawingBufferWidth/s*window.devicePixelRatio,i=4*a/2,Q=42*a,B=v*a/2,o=14*a;function l(e,t){var s=(90-e)*f,a=Math.cos(s),i=Math.sin(s);n.push(D*a*B+r,D*i*B+B),n.push(t*a*B+r,t*i*B+B)}n.push(r-i,Q),n.push(r-i,e.drawingBufferHeight),n.push(r+i,Q),n.push(r+i,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var F=0;F<=6;F++){var U=60*F;l(U,1),l(U+12,1),l(U+20,.75),l(U+40,.75),l(U+48,1)}function c(t,r){n.push(o+t,e.drawingBufferHeight-o-r)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var g=i/Math.sin(45*f);c(0,B),c(B,0),c(B+g,g),c(g,B+g),c(g,B-g),c(0,B),c(B,2*B),c(B+g,2*B-g),c(g,B-g),c(0,B),c(g,B-i),c(v*a,B-i),c(g,B+i),c(v*a,B+i),t.arrowVertexCount=n.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW)}))},J.prototype.render=function(){var e=this.gl,t=this,n=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];R(e,n,(function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()}))},J.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),function(e,t,n,r,s,a,i){var Q=1/(t-n),B=1/(r-s),o=1/(a-i);e[0]=-2*Q,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*B,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*o,e[11]=0,e[12]=(t+n)*Q,e[13]=(s+r)*B,e[14]=(i+a)*o,e[15]=1}(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},W.prototype.distortInverse=function(e){for(var t=0,n=1,r=e-this.distort(t);Math.abs(n-t)>1e-4;){var s=e-this.distort(n),a=n-s*((n-t)/(s-r));t=n,n=a,r=s}return n},W.prototype.distort=function(e){for(var t=e*e,n=0,r=0;r=1)return this.w=a,this.x=n,this.y=r,this.z=s,this;var Q=Math.acos(i),B=Math.sqrt(1-i*i);if(Math.abs(B)<.001)return this.w=.5*(a+this.w),this.x=.5*(n+this.x),this.y=.5*(r+this.y),this.z=.5*(s+this.z),this;var o=Math.sin((1-t)*Q)/B,l=Math.sin(t*Q)/B;return this.w=a*o+this.w*l,this.x=n*o+this.x*l,this.y=r*o+this.y*l,this.z=s*o+this.z*l,this},setFromUnitVectors:(1e-6,function(e,t){return void 0===T&&(T=new k),(M=e.dot(t)+1)<1e-6?(M=0,Math.abs(e.x)>Math.abs(e.z)?T.set(-e.y,e.x,0):T.set(0,-e.z,e.y)):T.crossVectors(e,t),this.x=T.x,this.y=T.y,this.z=T.z,this.w=M,this.normalize(),this})};var O=new w({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),z=new w({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),P={CardboardV1:new j({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new j({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function K(e,t){this.viewer=P.CardboardV2,this.updateDeviceParams(e),this.distortion=new W(this.viewer.distortionCoefficients);for(var n=0;n=200&&n.status<=299?(r.dpdb=JSON.parse(n.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")})),n.send()}}function $(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function ee(e,t){this.set(e,t)}function te(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new ee,this.currentGyroMeasurement=new ee,this.previousGyroMeasurement=new ee,Q()?this.filterQ=new Y(-1,0,0,1):this.filterQ=new Y(1,0,0,1),this.previousFilterQ=new Y,this.previousFilterQ.copy(this.filterQ),this.accelQ=new Y,this.isOrientationInitialized=!1,this.estimatedGravity=new k,this.measuredGravity=new k,this.gyroIntegralQ=new Y}function ne(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new Y,this.previousTimestampS=null,this.deltaQ=new Y,this.outQ=new Y}function re(e,t,n,r){this.yawOnly=n,this.accelerometer=new k,this.gyroscope=new k,this.filter=new te(e,r),this.posePredictor=new ne(t,r),this.isFirefoxAndroid=l(),this.isIOS=Q();var s=F();this.isDeviceMotionInRadians=!this.isIOS&&s&&s<66,this.isWithoutDeviceMotion=c()||U(),this.filterToWorldQ=new Y,Q()?this.filterToWorldQ.setFromAxisAngle(new k(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new k(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new Y,this.worldToScreenQ=new Y,this.originalPoseAdjustQ=new Y,this.originalPoseAdjustQ.setFromAxisAngle(new k(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),d()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new Y,this.orientationOut_=new Float32Array(4),this.start()}q.prototype.getDeviceParams=function(){return this.deviceParams},q.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},q.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,n=u(),r=I();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var s=0;s1)}(t-this.previousGyroMeasurement.timestampS)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},te.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var n=new Y;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new Y;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",H*function(e){return e.w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(e.w)}(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new Y;s.copy(this.filterQ),s.multiply(r),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},te.prototype.getOrientation=function(){return this.filterQ},te.prototype.accelToQuaternion_=function(e){var t=new k;t.copy(e),t.normalize();var n=new Y;return n.setFromUnitVectors(new k(0,0,-1),t),n.inverse(),n},te.prototype.gyroToQuaternionDelta_=function(e,t){var n=new Y,r=new k;return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*t),n},ne.prototype.getPrediction=function(e,t,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new k;r.copy(t),r.normalize();var s=t.length();if(s<20*X)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(H*s).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var a=s*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,a),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=n,this.outQ},re.prototype.getPosition=function(){return null},re.prototype.getOrientation=function(){var e=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||(n=(new Y).setFromAxisAngle(new k(0,0,-1),0),r=new Y,-90===window.orientation?r.setFromAxisAngle(new k(0,1,0),Math.PI/-2):r.setFromAxisAngle(new k(0,1,0),Math.PI/2),n.multiply(r)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((t=new Y).setFromAxisAngle(new k(1,0,0),-Math.PI/2),t),e=this._deviceOrientationQ,(s=new Y).copy(e),s.multiply(this.deviceOrientationFilterToWorldQ),s.multiply(this.resetQ),s.multiply(this.worldToScreenQ),s.multiplyQuaternions(this.deviceOrientationFixQ,s),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_;var t,n,r,s,a=this.filter.getOrientation();return e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS),(s=new Y).copy(this.filterToWorldQ),s.multiply(this.resetQ),s.multiply(e),s.multiply(this.worldToScreenQ),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_},re.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),d()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},re.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new Y;var t=e.alpha,n=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(n,t,-r)},re.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},re.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,n=e.rotationRate,r=e.timeStamp/1e3,s=r-this.previousTimestampS;return s<0?(h("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=r)):s<=.001||s>1?(h("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),n&&(g()?this.gyroscope.set(-n.beta,n.alpha,n.gamma):this.gyroscope.set(n.alpha,n.beta,n.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,r)),this.filter.addAccelMeasurement(this.accelerometer,r),void(this.previousTimestampS=r))},re.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},re.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},re.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new k(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new k(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},re.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),Q()&&function(){var e=window.self!==window.top,t=G(document.referrer),n=G(window.location.href);return e&&t!==n}()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},re.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)};var se=new k(1,0,0),ae=new k(0,0,1),ie=new Y;ie.setFromAxisAngle(se,-Math.PI/2),ie.multiply((new Y).setFromAxisAngle(ae,Math.PI/2));var Qe=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new Y,this._outQ=new Y,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return s(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:60,referenceFrame:"screen"})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new re(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(ie),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}();function Be(){this.loadIcon_();var e=document.createElement("div");(a=e.style).position="fixed",a.top=0,a.right=0,a.bottom=0,a.left=0,a.backgroundColor="gray",a.fontFamily="sans-serif",a.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(a=t.style).marginLeft="25%",a.marginTop="25%",a.width="50%",e.appendChild(t);var n=document.createElement("div");(a=n.style).textAlign="center",a.fontSize="16px",a.lineHeight="24px",a.margin="24px 25%",a.width="50%",n.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(n);var r=document.createElement("div");(a=r.style).backgroundColor="#CFD8DC",a.position="fixed",a.bottom=0,a.width="100%",a.height="48px",a.padding="14px 24px",a.boxSizing="border-box",a.color="#656A6B",e.appendChild(r);var s=document.createElement("div");s.style.float="left",s.innerHTML="No Cardboard viewer?";var a,i=document.createElement("a");i.href="https://www.google.com/get/cardboard/get-cardboard/",i.innerHTML="get one",i.target="_blank",(a=i.style).float="right",a.fontWeight=600,a.textTransform="uppercase",a.borderLeft="1px solid gray",a.paddingLeft="24px",a.textDecoration="none",a.color="#656A6B",r.appendChild(s),r.appendChild(i),this.overlay=e,this.text=n,this.hide()}Be.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;d()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},Be.prototype.hide=function(){this.overlay.style.display="none"},Be.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},Be.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},Be.prototype.update=function(){this.disableShowTemporarily(),!d()&&y()?this.show():this.hide()},Be.prototype.loadIcon_=function(){this.icon=function(e,t){return"data:"+e+","+encodeURIComponent(t)}("image/svg+xml","")};var oe="WEBVR_CARDBOARD_VIEWER";function le(e){try{this.selectedKey=localStorage.getItem(oe)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||"CardboardV1"),this.dialog=this.createDialog_(K.Viewers),this.root=null,this.onChangeCallbacks_=[]}le.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},le.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},le.prototype.getCurrentViewer=function(){return K.Viewers[this.selectedKey]},le.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},le.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},le.prototype.fireOnChange_=function(e){for(var t=0;t.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return r(e,[{key:"enable",value:function(){a?(this.disable(),this.noSleepTimer=window.setInterval((function(){window.location.href="/",window.setTimeout(window.stop,0)}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){a?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=i},function(e,t,n){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}))),Ue=1e3,ce=[0,0,.5,1],ge=[.5,0,.5,1],de=window.requestAnimationFrame,ue=window.cancelAnimationFrame;function Ie(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return p("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function me(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=Ue++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return p("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new Ie({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&y()&&(this.wakelock_=new Fe)}me.prototype.getFrameData=function(e){return x(e,this._getPose(),this)},me.prototype.getPose=function(){return p("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},me.prototype.resetPose=function(){return p("VRDisplay.prototype.resetPose"),this._resetPose()},me.prototype.getImmediatePose=function(){return p("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},me.prototype.requestAnimationFrame=function(e){return de(e)},me.prototype.cancelAnimationFrame=function(e){return ue(e)},me.prototype.wrapForFullscreen=function(e){if(Q())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var n=this.fullscreenElement_.parentElement;n.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),n.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var r=this;return function(){if(r.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];r.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},me.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},me.prototype.requestPresent=function(e){var t=this.isPresenting,n=this;return e instanceof Array||(p("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise((function(r,s){if(n.capabilities.canPresent)if(0==e.length||e.length>n.capabilities.maxLayers)s(new Error("Invalid number of layers."));else{var a=e[0];if(a.source){var i=a.leftBounds||ce,o=a.rightBounds||ge;if(t){var l=n.layer_;l.source!==a.source&&(l.source=a.source);for(var F=0;F<4;F++)l.leftBounds[F]=i[F],l.rightBounds[F]=o[F];return n.wrapForFullscreen(n.layer_.source),n.updatePresent_(),void r()}if(n.layer_={predistorted:a.predistorted,source:a.source,leftBounds:i.slice(0),rightBounds:o.slice(0)},n.waitingForPresent_=!1,n.layer_&&n.layer_.source){var U=n.wrapForFullscreen(n.layer_.source);n.addFullscreenListeners_(U,(function(){var e=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;n.isPresenting=U===e,n.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch((function(e){console.error("screen.orientation.lock() failed due to",e.message)})),n.waitingForPresent_=!1,n.beginPresent_(),r()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),n.removeFullscreenWrapper(),n.disableWakeLock(),n.endPresent_(),n.removeFullscreenListeners_()),n.fireVRDisplayPresentChange_()}),(function(){n.waitingForPresent_&&(n.removeFullscreenWrapper(),n.removeFullscreenListeners_(),n.disableWakeLock(),n.waitingForPresent_=!1,n.isPresenting=!1,s(new Error("Unable to present.")))})),function(e){if(B())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0}(U)?(n.enableWakeLock(),n.waitingForPresent_=!0):(Q()||B())&&(n.enableWakeLock(),n.isPresenting=!0,n.beginPresent_(),n.fireVRDisplayPresentChange_(),r())}n.waitingForPresent_||Q()||(m(),s(new Error("Unable to present.")))}else r()}else s(new Error("VRDisplay is not capable of presenting."))}))},me.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(n,r){e?(!m()&&Q()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),B()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),n()):r(new Error("Was not presenting to VRDisplay."))}))},me.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},me.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},me.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},me.prototype.addFullscreenListeners_=function(e,t,n){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=n,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),n&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",n,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",n,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",n,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",n,!1))},me.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var n=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",n,!1),e.removeEventListener("webkitfullscreenerror",n,!1),document.removeEventListener("mozfullscreenerror",n,!1),e.removeEventListener("msfullscreenerror",n,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},me.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},me.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},me.prototype.beginPresent_=function(){},me.prototype.endPresent_=function(){},me.prototype.submitFrame=function(e){},me.prototype.getEyeParameters=function(e){return null};var Ce={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},be="left",ye="right";function Se(e){var t=S({},Ce);e=S(t,e||{}),me.call(this,{wakelock:e.MOBILE_WAKE_LOCK}),this.config=e,this.displayName="Cardboard VRDisplay",this.capabilities=new Ie({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new Qe(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new q(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new K(this.dpdb_.getDeviceParams(),e.ADDITIONAL_VIEWERS),this.viewerSelector_=new le(e.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new Be),Q()&&window.addEventListener("resize",this.onResize_.bind(this))}return Se.prototype=Object.create(me.prototype),Se.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Se.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Se.prototype._getFieldOfView=function(e){var t;if(e==be)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=ye)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Se.prototype._getEyeOffset=function(e){var t;if(e==be)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=ye)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Se.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),n=this._getFieldOfView(e),r={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(r,"fieldOfView",{enumerable:!0,get:function(){return p("VRFieldOfView","VRFrameData's projection matrices"),n}}),r},Se.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Se.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Se.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(e.canvas.width=u()*this.bufferScale_,e.canvas.height=I()*this.bufferScale_,this.cardboardUI_=new J(e)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new J(e)),this.distorter_=new A(e,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(d()&&y()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Se.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Se.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Se.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var n=t.canvas;n.width==this.lastWidth&&n.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=n.width,this.lastHeight=n.height,this.cardboardUI_.render()}},Se.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Se.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));t.canvas.setAttribute("style",["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"].join("; ")+";"),Z(t.canvas)}},Se.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Se.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},Se.VRFrameData=function(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null},Se.VRDisplay=me,Se}))}))),a={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function i(e){this.config=r(r({},a),e),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in navigator,this.native={},this.native.getVRDisplays=navigator.getVRDisplays,this.native.VRFrameData=window.VRFrameData,this.native.VRDisplay=window.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&t())&&(this.enable(),this.getVRDisplays().then((function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()})))}i.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(t()){var e=new s({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},i.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var e=this.native.VRFrameData,t=new this.native.VRFrameData,r=this.native.VRDisplay.prototype.getFrameData;window.VRDisplay.prototype.getFrameData=function(s){s instanceof e?r.call(this,s):(r.call(this,t),s.pose=t.pose,n(t.leftProjectionMatrix,s.leftProjectionMatrix),n(t.rightProjectionMatrix,s.rightProjectionMatrix),n(t.leftViewMatrix,s.leftViewMatrix),n(t.rightViewMatrix,s.rightViewMatrix))}}navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=s.VRDisplay,window.VRFrameData=s.VRFrameData},i.prototype.getVRDisplays=function(){var e=this;return this.config,this.hasNative?this.native.getVRDisplays.call(navigator).then((function(t){return t.length>0?t:e.getPolyfillDisplays()})):Promise.resolve(this.getPolyfillDisplays())},i.version="0.10.12",i.VRFrameData=s.VRFrameData,i.VRDisplay=s.VRDisplay;var Q=Object.freeze({default:i}),B=Q&&i||Q;return void 0!==e&&e.window&&(e.document||(e.document=e.window.document),e.navigator||(e.navigator=e.window.navigator)),B}()}),"/$$rollup_base$$/node_modules/webvr-polyfill/build")),pi=B.b.vtkDebugMacro,Ri=B.b.vtkErrorMacro,Vi=-1!==navigator.userAgent.indexOf("Chrome");function Li(e,t,n){var r=e.createFramebuffer(),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,n,null),e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);var a=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),a===e.FRAMEBUFFER_COMPLETE}var Ai=0,Ni=[];function Ei(){Ai++,Ni.forEach((function(e){return e(Ai)}))}function fi(){Ai--,Ni.forEach((function(e){return e(Ai)}))}function Di(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow");var n=[0,0];e.onModified((function(){t.renderable&&(t.size[0]===n[0]&&t.size[1]===n[1]||(n[0]=t.size[0],n[1]=t.size[1],t.canvas.setAttribute("width",t.size[0]),t.canvas.setAttribute("height",t.size[1]))),t.viewStream&&t.viewStream.setSize(t.size[0],t.size[1]),t.canvas.style.display=t.useOffScreen?"none":"block",t.el&&(t.el.style.cursor=t.cursorVisibility?t.cursor:"none"),t.containerSize=null})),e.buildPass=function(n){if(n){if(!t.renderable)return;e.prepareNodes(),e.addMissingNodes(t.renderable.getRenderersByReference()),e.removeUnusedNodes(),e.initialize(),t.children.forEach((function(t){t.setOpenGLRenderWindow(e)}))}},e.initialize=function(){if(!t.initialized){t.context=e.get3DContext(),t.textureUnitManager=Gi.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var n=t.context;n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA),n.depthFunc(n.LEQUAL),n.enable(n.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(n){t.el&&t.el!==n&&(t.canvas.parentNode!==t.el&&Ri("Error: canvas parent node does not match container"),t.el.removeChild(t.canvas),t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)),t.el!==n&&(t.el=n,t.el&&(t.el.appendChild(t.canvas),t.useBackgroundImage&&t.el.appendChild(t.bgImage)),e.modified())},e.getContainer=function(){return t.el},e.getContainerSize=function(){if(!t.containerSize&&t.el){var e=t.el.getBoundingClientRect(),n=e.width,r=e.height;t.containerSize=[n,r]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.isInViewport=function(t,n,r){var s=r.getViewportByReference(),a=e.getFramebufferSize();return s[0]*a[0]<=t&&s[2]*a[0]>=t&&s[1]*a[1]<=n&&s[3]*a[1]>=n},e.getViewportSize=function(t){var n=t.getViewportByReference(),r=e.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},e.getViewportCenter=function(t){var n=e.getViewportSize(t);return[.5*n[0],.5*n[1]]},e.displayToNormalizedDisplay=function(t,n,r){var s=e.getFramebufferSize();return[t/s[0],n/s[1],r]},e.normalizedDisplayToDisplay=function(t,n,r){var s=e.getFramebufferSize();return[t*s[0],n*s[1],r]},e.worldToView=function(e,t,n,r){return r.worldToView(e,t,n)},e.viewToWorld=function(e,t,n,r){return r.viewToWorld(e,t,n)},e.worldToDisplay=function(t,n,r,s){var a=s.worldToView(t,n,r),i=e.getViewportSize(s),Q=s.viewToProjection(a[0],a[1],a[2],i[0]/i[1]),B=s.projectionToNormalizedDisplay(Q[0],Q[1],Q[2]);return e.normalizedDisplayToDisplay(B[0],B[1],B[2])},e.displayToWorld=function(t,n,r,s){var a=e.displayToNormalizedDisplay(t,n,r),i=s.normalizedDisplayToProjection(a[0],a[1],a[2]),Q=e.getViewportSize(s),B=s.projectionToView(i[0],i[1],i[2],Q[0]/Q[1]);return s.viewToWorld(B[0],B[1],B[2])},e.normalizedDisplayToViewport=function(t,n,r,s){var a=s.getViewportByReference();a=e.normalizedDisplayToDisplay(a[0],a[1],0);var i=e.normalizedDisplayToDisplay(t,n,r);return[i[0]-a[0]-.5,i[1]-a[1]-.5,r]},e.viewportToNormalizedViewport=function(t,n,r,s){var a=e.getViewportSize(s);return a&&0!==a[0]&&0!==a[1]?[t/(a[0]-1),n/(a[1]-1),r]:[t,n,r]},e.normalizedViewportToViewport=function(t,n,r){var s=e.getFramebufferSize();return[t*(s[0]-1),n*(s[1]-1),r]},e.displayToLocalDisplay=function(t,n,r){return[t,e.getFramebufferSize()[1]-n-1,r]},e.viewportToNormalizedDisplay=function(t,n,r,s){var a=s.getViewportByReference(),i=t+(a=e.normalizedDisplayToDisplay(a[0],a[1],0))[0]+.5,Q=n+a[1]+.5;return e.displayToNormalizedDisplay(i,Q,r)},e.getPixelData=function(e,n,r,s){var a=new Uint8Array((r-e+1)*(s-n+1)*4);return t.context.readPixels(e,n,r-e+1,s-n+1,t.context.RGBA,t.context.UNSIGNED_BYTE,a),a},e.get3DContext=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},r=null,s="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&s&&(r=t.canvas.getContext("webgl2",n))&&(t.webgl2=!0,pi("using webgl2")),r||(pi("using webgl1"),r=t.canvas.getContext("webgl",n)||t.canvas.getContext("experimental-webgl",n)),new hi({PROVIDE_MOBILE_VRDISPLAY:!0,DIRTY_SUBMIT_FRAME_BINDINGS:!1,BUFFER_SCALE:.75}),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(n){n.length>0&&(t.vrDisplay=n[0],t.vrDisplay.depthNear=.01,t.vrDisplay.depthFar=100,e.invokeHaveVRDisplay())})),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),r},e.startVR=function(){t.oldCanvasSize=t.size.slice(),t.vrDisplay.capabilities.canPresent?t.vrDisplay.requestPresent([{source:t.canvas}]).then((function(){if(t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&t.hideCanvasInVR&&(t.el.style.display="none"),t.queryVRSize){var n=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right"),s=Math.floor(n.renderWidth+r.renderWidth),a=Math.floor(Math.max(n.renderHeight,r.renderHeight));e.setSize(s,a)}else e.setSize(t.vrResolution);t.renderable.getRenderers()[0].resetCamera(),t.vrFrameData=new VRFrameData,t.renderable.getInteractor().switchToVRAnimation(),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),Vi&&(t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender))})).catch((function(){console.error("failed to requestPresent")})):Ri("vrDisplay is not connected")},e.stopVR=function(){t.renderable.getInteractor().returnFromVRAnimation(),t.vrDisplay.exitPresent(),t.vrDisplay.cancelAnimationFrame(t.vrSceneFrame),e.setSize.apply(e,Object(Q.a)(t.oldCanvasSize)),t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&(t.el.style.display="block");var n=t.renderable.getRenderers()[0];n.getActiveCamera().setProjectionMatrix(null),n.setViewport(0,0,1,1),e.traverseAllPasses()},e.vrRender=function(){if(t.vrDisplay.isPresenting){t.renderable.getInteractor().updateGamepads(t.vrDisplay.displayId),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),t.vrDisplay.getFrameData(t.vrFrameData);var n=t.renderable.getRenderers()[0];n.setViewport(0,0,.5,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.leftViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.leftProjectionMatrix),e.traverseAllPasses(),n.setViewport(.5,0,1,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.rightViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.rightProjectionMatrix),e.traverseAllPasses(),t.vrDisplay.submitFrame()}},e.restoreContext=function(){var t=ft.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(n){var r=t.textureResourceIds.get(n);if(void 0===r){var s=e.getTextureUnitManager().allocate();s<0?Ri("Hardware does not support the number of textures defined."):(t.textureResourceIds.set(n,s),t.context.activeTexture(t.context.TEXTURE0+s))}else t.context.activeTexture(t.context.TEXTURE0+r)},e.deactivateTexture=function(n){var r=t.textureResourceIds.get(n);void 0!==r&&(e.getTextureUnitManager().free(r),t.textureResourceIds.delete(n))},e.getTextureUnitForTexture=function(e){var n=t.textureResourceIds.get(e);return void 0!==n?n:-1},e.getDefaultTextureInternalFormat=function(e,n,r){if(t.webgl2)switch(e){case Gt.b.UNSIGNED_CHAR:switch(n){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;case 4:default:return t.context.RGBA8}default:case Gt.b.FLOAT:switch(n){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;case 4:default:return t.context.RGBA16F}}switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:default:return t.context.RGBA}},e.setBackgroundImage=function(e){t.bgImage.src=e.src},e.setUseBackgroundImage=function(e){t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if(t.deleted)return null;t.imageFormat=n;var r=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,new Promise((function(n,s){var a=e.onImageReady((function(e){t.notifyStartCaptureImage=r,a.unsubscribe(),n(e)}))}))},e.getGLInformations=function(){for(var n=e.get3DContext(),r=n.getExtension("OES_texture_float"),s=n.getExtension("OES_texture_half_float"),a=n.getExtension("WEBGL_debug_renderer_info"),i=n.getExtension("WEBGL_draw_buffers"),Q=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),B=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",n.getParameter(n.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",n.getParameter(n.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",n.getParameter(n.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",Q&&n.getParameter(Q.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",n.getParameter(n.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",n.getParameter(n.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",n.getParameter(n.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",n.getParameter(n.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",n.getParameter(n.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",n.getParameter(n.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",n.getParameter(n.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",n.getParameter(n.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",n.getParameter(n.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",n.getParameter(n.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",n.getParameter(n.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",n.getParameter(n.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",n.getParameter(n.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[r&&Li(n,n.RGBA,n.UNSIGNED_BYTE)?"RGBA":"",r&&Li(n,n.RGB,n.UNSIGNED_BYTE)?"RGB":"",r&&Li(n,n.LUMINANCE,n.UNSIGNED_BYTE)?"LUMINANCE":"",r&&Li(n,n.ALPHA,n.UNSIGNED_BYTE)?"ALPHA":"",r&&Li(n,n.LUMINANCE_ALPHA,n.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[s&&Li(n,n.RGBA,s.HALF_FLOAT_OES)?"RGBA":"",s&&Li(n,n.RGB,s.HALF_FLOAT_OES)?"RGB":"",s&&Li(n,n.LUMINANCE,s.HALF_FLOAT_OES)?"LUMINANCE":"",s&&Li(n,n.ALPHA,s.HALF_FLOAT_OES)?"ALPHA":"",s&&Li(n,n.LUMINANCE_ALPHA,s.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[r&&Li(n,n.RGBA,n.FLOAT)?"RGBA":"",r&&Li(n,n.RGB,n.FLOAT)?"RGB":"",r&&Li(n,n.LUMINANCE,n.FLOAT)?"LUMINANCE":"",r&&Li(n,n.ALPHA,n.FLOAT)?"ALPHA":"",r&&Li(n,n.LUMINANCE_ALPHA,n.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?n.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",n.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",n.getParameter(n.RENDERER)],["WebGL Vendor","VENDOR",n.getParameter(n.VENDOR)],["WebGL Version","VERSION",n.getParameter(n.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",n.getParameter(n.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",a&&n.getParameter(a.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",a&&n.getParameter(a.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],o={};B.length;){var l=B.pop(),F=Object(te.a)(l,3),U=F[0],c=F[1],g=F[2];c&&(o[c]={label:U,value:g})}return o},e.traverseAllPasses=function(){if(t.renderPasses)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,r=document.createElement("canvas"),s=r.getContext("2d");r.width=t.canvas.width,r.height=t.canvas.height,s.drawImage(t.canvas,0,0);var a=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vi,n),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",Ei(),t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",t.textureResourceIds=new Map,Lt.extend(e,t,n),t.myFactory=ci.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",Wi),t.shaderCache=bi.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=nn.newInstance(),B.b.event(e,t,"imageReady"),B.b.event(e,t,"haveVRDisplay"),B.b.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage"]),B.b.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","queryVRSize","hideCanvasInVR","useOffScreen","activeFramebuffer"]),B.b.setGetArray(e,t,["size","vrResolution"],2),Di(e,t)}var Wi=B.b.newInstance(Ji,"vtkOpenGLRenderWindow"),Xi={newInstance:Wi,extend:Ji,pushMonitorGLContextCount:function(e){Ni.push(e)},popMonitorGLContextCount:function(e){return Ni.pop()}};function Hi(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(n){e.hasRenderer(n)||(n.setRenderWindow(e),t.renderers.push(n),e.modified())},e.removeRenderer=function(n){t.renderers=t.renderers.filter((function(e){return e!==n})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.addView=function(n){e.hasView(n)||(n.setRenderable(e),t.views.push(n),e.modified())},e.removeView=function(n){t.views=t.views.filter((function(e){return e!==n})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.render=function(){t.interactor?t.interactor.render():t.views.forEach((function(e){return e.traverseAllPasses()}))},e.getStatistics=function(){var e={propCount:0,invisiblePropCount:0};return t.renderers.forEach((function(t){t.getViewProps().forEach((function(t){if(t.getVisibility()){e.propCount+=1;var n=t.getMapper&&t.getMapper();if(n&&n.getPrimitiveCount){var r=n.getPrimitiveCount();Object.keys(r).forEach((function(t){e[t]||(e[t]=0),e[t]+=r[t]}))}}else e.invisiblePropCount+=1}))})),e.str=Object.keys(e).map((function(t){return"".concat(t,": ").concat(e[t])})).join("\n"),e},e.captureImages=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return B.b.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(n):void 0})).filter((function(e){return!!e}))}}var ki={renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function Ti(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ki,n),B.b.obj(e,t),B.b.setGet(e,t,["interactor","numberOfLayers","views"]),B.b.get(e,t,["neverRendered"]),B.b.getArray(e,t,["renderers"]),B.b.event(e,t,"completion"),Hi(e,t)}var Mi={newInstance:B.b.newInstance(Ti,"vtkRenderWindow"),extend:Ti},Yi={Device:{Unknown:0,LeftController:1,RightController:2},Input:{Unknown:0,Trigger:1,TrackPad:2,Grip:3,ApplicationMenu:4}};function wi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Oi=Yi.Device,zi=Yi.Input,Pi=B.b.vtkWarningMacro,Ki=B.b.vtkErrorMacro,ji=B.b.normalizeWheel,_i=B.b.vtkOnceErrorMacro,qi={"OpenVR Gamepad":[zi.TrackPad,zi.Trigger,zi.Grip,zi.ApplicationMenu]},$i=["StartAnimation","Animation","EndAnimation","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteractionEvent","InteractionEvent","EndInteractionEvent"];function eQ(e){return e.stopPropagation(),e.preventDefault(),!1}function tQ(e,t){t.classHierarchy.push("vtkRenderWindowInteractor");var n=new Set,r=0;function s(n,r){t.currentRenderer=e.findPokedRenderer(n,r)}function a(e){var n=t.container.getBoundingClientRect(),r=t.view.getCanvas(),a=r.width/n.width,i=r.height/n.height,Q={x:a*(e.clientX-n.left),y:i*(n.height-e.clientY+n.top),z:0};return s(Q.x,Q.y),Q}function i(e){for(var t={},n=0;n1&&void 0!==arguments[1]&&arguments[1],a=document,i=n?"addEventListener":"removeEventListener",Q=n?"removeEventListener":"addEventListener";!s&&!n&&r>0&&--r,r&&!s||(r=0,t.container&&t.container[Q]("mousemove",e.handleMouseMove),a[i]("mouseup",e.handleMouseUp),a[i]("mousemove",e.handleMouseMove),a[i]("touchend",e.handleTouchEnd,!1),a[i]("touchcancel",e.handleTouchEnd,!1),a[i]("touchmove",e.handleTouchMove,!1)),!s&&n&&++r}function l(){t.view&&t.enabled&&t.enableRender&&(t.inRender=!0,t.view.traverseAllPasses(),t.inRender=!1),e.invokeRenderEvent()}e.start=function(){(t.initialized||(e.initialize(),t.initialized))&&e.startEventLoop()},e.setRenderWindow=function(e){Ki("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(n){t.interactorStyle!==n&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=n,null!=t.interactorStyle&&t.interactorStyle.getInteractor()!==e&&t.interactorStyle.setInteractor(e))},e.initialize=function(){t.initialized=!0,e.enable(),e.render()},e.enable=function(){return e.setEnabled(!0)},e.disable=function(){return e.setEnabled(!1)},e.startEventLoop=function(){return Pi("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||s(0,0),t.currentRenderer},e.bindEvents=function(n){t.container=n,n.addEventListener("contextmenu",eQ),n.addEventListener("wheel",e.handleWheel),n.addEventListener("DOMMouseScroll",e.handleWheel),n.addEventListener("mouseenter",e.handleMouseEnter),n.addEventListener("mouseleave",e.handleMouseLeave),n.addEventListener("mousemove",e.handleMouseMove),n.addEventListener("mousedown",e.handleMouseDown),document.querySelector("body").addEventListener("keypress",e.handleKeyPress),document.querySelector("body").addEventListener("keydown",e.handleKeyDown),document.querySelector("body").addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),n.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){o(!1,!0),t.container.removeEventListener("contextmenu",eQ),t.container.removeEventListener("wheel",e.handleWheel),t.container.removeEventListener("DOMMouseScroll",e.handleWheel),t.container.removeEventListener("mouseenter",e.handleMouseEnter),t.container.removeEventListener("mouseleave",e.handleMouseLeave),t.container.removeEventListener("mousemove",e.handleMouseMove),t.container.removeEventListener("mousedown",e.handleMouseDown),document.querySelector("body").removeEventListener("keypress",e.handleKeyPress),document.querySelector("body").removeEventListener("keydown",e.handleKeyDown),document.querySelector("body").removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var n=B(t);e.keyPressEvent(n)},e.handleKeyDown=function(t){var n=B(t);e.keyDownEvent(n)},e.handleKeyUp=function(t){var n=B(t);e.keyUpEvent(n)},e.handleMouseDown=function(t){if(!(t.button>2)){o(!0),t.stopPropagation(),t.preventDefault();var n={position:a(t)},r=Q(t);switch(Object.assign(n,r),t.button){case 0:e.leftButtonPressEvent(n);break;case 1:e.middleButtonPressEvent(n);break;case 2:e.rightButtonPressEvent(n);break;default:Ki("Unknown mouse button pressed: ".concat(t.button))}}},e.requestPointerLock=function(){e.getView().getCanvas().requestPointerLock()},e.exitPointerLock=function(){return document.exitPointerLock()},e.isPointerLocked=function(){return!!document.pointerLockElement},e.handlePointerLockChange=function(){e.isPointerLocked()?e.startPointerLockEvent():e.endPointerLockEvent()},e.requestAnimation=function(r){void 0!==r?n.has(r)?Pi("requester is already registered for animating"):(n.add(r),1===n.size&&(t.lastFrameTime=.1,t.lastFrameStart=Date.now(),t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Ki("undefined requester, can not start animating")},e.isAnimating=function(){return t.vrAnimation||null!==t.animationRequest},e.cancelAnimation=function(r){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.has(r))n.delete(r),t.animationRequest&&0===n.size&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!s){var a=r&&r.getClassName?r.getClassName():r;Pi("".concat(a," did not request an animation"))}},e.switchToVRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.vrAnimation=!0},e.returnFromVRAnimation=function(){t.vrAnimation=!1,0!==n.size&&(t.FrameTime=-1,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateGamepads=function(n){for(var r=navigator.getGamepads(),s=0;s1){var r=i(n.touches);if(2===n.touches.length){var s={position:a(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(s)}e.recognizeGesture("TouchStart",r)}else{var Q={position:a(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(Q)}},e.handleTouchMove=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures&&n.touches.length>1){var r=i(n.touches);e.recognizeGesture("TouchMove",r)}else{var s={position:a(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(s)}},e.handleTouchEnd=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures)if(0===n.touches.length)if(1===n.changedTouches.length){var r={position:a(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(r),o(!1)}else{var s=i(n.changedTouches);e.recognizeGesture("TouchEnd",s),o(!1)}else if(1===n.touches.length){var Q=i(n.changedTouches);e.recognizeGesture("TouchEnd",Q);var B={position:a(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(B)}else{var l=i(n.touches);e.recognizeGesture("TouchMove",l)}else{var F={position:a(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(F),o(!1)}},e.setView=function(n){t.view!==n&&(t.view=n,t.view.getRenderable().setInteractor(e),e.modified())},e.findPokedRenderer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var r=t.view.getRenderable().getRenderersByReference();r.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var s=null,a=null,i=null,Q=r.length;Q--;){var B=r[Q];if(t.view.isInViewport(e,n,B)&&B.getInteractive()){i=B;break}null===s&&B.getInteractive()&&(s=B),null===a&&t.view.isInViewport(e,n,B)&&(a=B)}return null===i&&(i=s),null===i&&(i=a),null==i&&(i=r[0]),i},e.render=function(){null!==t.animationRequest||t.inRender||l()},$i.forEach((function(n){var r=n.charAt(0).toLowerCase()+n.slice(1);e["".concat(r,"Event")]=function(r){if(t.enabled)if(e.getCurrentRenderer()){var s={type:n,pokedRenderer:t.currentRenderer};Object.assign(s,r),e["invoke".concat(n)](s)}else _i("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(n,r){if(!(Object.keys(r).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===n)return Object.keys(r).forEach((function(e){t.startingEventPositions[e]=r[e]})),void(t.currentGesture="Start");if("TouchEnd"===n)return"Pinch"===t.currentGesture&&(e.render(),e.endPinchEvent()),"Rotate"===t.currentGesture&&(e.render(),e.endRotateEvent()),"Pan"===t.currentGesture&&(e.render(),e.endPanEvent()),t.currentGesture="Start",void(t.startingEventPositions={});var s=0,a=[],i=[];Object.keys(r).forEach((function(e){a[s]=r[e],i[s]=t.startingEventPositions[e],s++}));var Q=Math.sqrt((i[0].x-i[1].x)*(i[0].x-i[1].x)+(i[0].y-i[1].y)*(i[0].y-i[1].y)),B=Math.sqrt((a[0].x-a[1].x)*(a[0].x-a[1].x)+(a[0].y-a[1].y)*(a[0].y-a[1].y)),o=Object(b.C)(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),l=Object(b.C)(Math.atan2(a[1].y-a[0].y,a[1].x-a[0].x)),F=l-o;l=l+180>=360?l-180:l+180,o=o+180>=360?o-180:o+180,Math.abs(l-o)c&&g>d&&g>u){t.currentGesture="Pinch";var I={scale:1,touches:r};e.startPinchEvent(I)}else if(d>c&&d>u){t.currentGesture="Rotate";var m={rotation:0,touches:r};e.startRotateEvent(m)}else if(u>c){t.currentGesture="Pan";var C={translation:[0,0],touches:r};e.startPanEvent(C)}}else{if("Rotate"===t.currentGesture){var y={rotation:F,touches:r};e.rotateEvent(y)}if("Pinch"===t.currentGesture){var S={scale:B/Q,touches:r};e.pinchEvent(S)}if("Pan"===t.currentGesture){var Z={translation:U,touches:r};e.panEvent(Z)}}}},e.handleVisibilityChange=function(){t.lastFrameStart=Date.now()};var F=e.delete;e.delete=function(){for(;n.size;)e.cancelAnimation(n.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),F()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var nQ={renderWindow:null,interactorStyle:null,picker:null,pickingManager:null,initialized:!1,enabled:!1,enableRender:!0,currentRenderer:null,lightFollowCamera:!0,desiredUpdateRate:30,stillUpdateRate:2,container:null,view:null,recognizeGestures:!0,currentGesture:"Start",animationRequest:null,lastFrameTime:.1,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function rQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nQ,n),B.b.obj(e,t),B.b.event(e,t,"RenderEvent"),$i.forEach((function(n){return B.b.event(e,t,n)})),B.b.get(e,t,["initialized","container","enabled","enableRender","interactorStyle","lastFrameTime","view"]),B.b.setGet(e,t,["lightFollowCamera","enabled","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),tQ(e,t)}var sQ=function(e){for(var t=1;tB[1]?U:B[1]}return B}}var QQ={position:[0,0,1],focalPoint:[0,0,0],viewUp:[0,1,0],directionOfProjection:[0,0,-1],parallelProjection:!1,useHorizontalViewAngle:!1,viewAngle:30,parallelScale:1,clippingRange:[.01,1000.01],windowCenter:[0,0],viewPlaneNormal:[0,0,1],useOffAxisProjection:!1,screenBottomLeft:[-.5,-.5,-.5],screenBottomRight:[.5,-.5,-.5],screenTopRight:[.5,.5,-.5],freezeFocalPoint:!1,projectionMatrix:null,viewMatrix:null,physicalTranslation:[0,0,0],physicalScale:1,physicalViewUp:[0,1,0],physicalViewNorth:[0,0,-1]};function BQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,QQ,n),B.b.obj(e,t),B.b.get(e,t,["distance"]),B.b.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),B.b.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),B.b.setGetArray(e,t,["clippingRange","windowCenter"],2),B.b.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),iQ(e,t)}var oQ={newInstance:B.b.newInstance(BQ,"vtkCamera"),extend:BQ};function lQ(e,t){t.classHierarchy.push("vtkLight"),e.getTransformedPosition=function(){return t.transformMatrix?[]:[].concat(t.position)},e.getTransformedFocalPoint=function(){return t.transformMatrix?[]:[].concat(t.focalPoint)},e.getDirection=function(){return t.directionMTime2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,FQ,n),B.b.obj(e,t),B.b.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),B.b.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),lQ(e,t)}var cQ={newInstance:B.b.newInstance(UQ,"vtkLight"),extend:UQ,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},gQ=B.b.vtkErrorMacro;function dQ(e,t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var r=e.getNestedProps();if(r&&r.length)for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uQ,n),B.b.obj(e,t),B.b.event(e,t,"event"),B.b.setGetArray(e,t,["viewport"],4),B.b.setGetArray(e,t,["background","background2"],3),dQ(e,t)}var mQ={newInstance:B.b.newInstance(IQ,"vtkViewport"),extend:IQ},CQ=B.j,bQ=B.k,yQ=B.l;function SQ(e){return function(){return bQ("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function ZQ(e,t){for(t.classHierarchy.push("vtkRenderer"),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1);var n={type:"ComputeVisiblePropBoundsEvent",renderer:e},r={type:"ResetCameraClippingRangeEvent",renderer:e},s={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(CQ("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var n=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(n.getPositionByReference()),e.setFocalPointFrom(n.getFocalPointByReference()),e.modified(n.getMTime())):bQ("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=SQ("allocateTime"),e.updateGeometry=SQ("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(n){CQ(e.getClassName(),e,"setting Layer to ",n),t.layer!==n&&(t.layer=n,e.modified()),e.setPreserveColorBuffer(!!n)},e.setActiveCamera=function(n){return t.activeCamera!==n&&(t.activeCamera=n,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:n}),!0)},e.makeCamera=function(){var t=oQ.newInstance();return e.invokeEvent({type:"CreateCameraEvent",camera:t}),t},e.getActiveCamera=function(){return t.activeCamera||(t.activeCamera=e.makeCamera()),t.activeCamera},e.getActiveCameraAndResetIfCreated=function(){return t.activeCamera||(e.getActiveCamera(),e.resetCamera()),t.activeCamera},e.getActors=function(){return t.actors=[],t.props.forEach((function(e){t.actors=t.actors.concat(e.getActors())})),t.actors},e.addActor=e.addViewProp,e.removeActor=function(n){t.actors=t.actors.filter((function(e){return e!==n})),e.removeViewProp(n),e.modified()},e.removeAllActors=function(){t.actors.forEach((function(t){e.removeViewProp(t)})),t.actors=[],e.modified()},e.getVolumes=function(){return t.volumes=[],t.props.forEach((function(e){t.volumes=t.volumes.concat(e.getVolumes())})),t.volumes},e.addVolume=e.addViewProp,e.removeVolume=function(n){t.volumes=t.volumes.filter((function(e){return e!==n})),e.removeViewProp(n),e.modified()},e.removeAllVolumes=function(){t.volumes.forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(n){t.lights=[].concat(t.lights,n),e.modified()},e.removeLight=function(n){t.lights=t.lights.filter((function(e){return e!==n})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(n){t.lights=n,e.modified()},e.makeLight=cQ.newInstance,e.createLight=function(){t.automaticLightCreation&&(t.createdLight&&(e.removeLight(t.createdLight),t.createdLight.delete(),t.createdLight=null),t.createdLight=e.makeLight(),e.addLight(t.createdLight),t.createdLight.setLightTypeToHeadLight(),t.createdLight.setPosition(e.getActiveCamera().getPosition()),t.createdLight.setFocalPoint(e.getActiveCamera().getFocalPoint()))},e.normalizedDisplayToWorld=function(t,n,r,s){var a=e.normalizedDisplayToProjection(t,n,r);return a=e.projectionToView(a[0],a[1],a[2],s),e.viewToWorld(a[0],a[1],a[2])},e.worldToNormalizedDisplay=function(t,n,r,s){var a=e.worldToView(t,n,r);return a=e.viewToProjection(a[0],a[1],a[2],s),e.projectionToNormalizedDisplay(a[0],a[1],a[2])},e.viewToWorld=function(e,n,r){if(null===t.activeCamera)return bQ("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getViewMatrix();Object(x.g)(s,s),Object(x.j)(s,s);var a=Object(G.f)(e,n,r);return Object(G.q)(a,a,s),[a[0],a[1],a[2]]},e.projectionToView=function(e,n,r,s){if(null===t.activeCamera)return bQ("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getProjectionMatrix(s,-1,1);Object(x.g)(a,a),Object(x.j)(a,a);var i=Object(G.f)(e,n,r);return Object(G.q)(i,i,a),[i[0],i[1],i[2]]},e.worldToView=function(e,n,r){if(null===t.activeCamera)return bQ("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getViewMatrix();Object(x.j)(s,s);var a=Object(G.f)(e,n,r);return Object(G.q)(a,a,s),[a[0],a[1],a[2]]},e.viewToProjection=function(e,n,r,s){if(null===t.activeCamera)return bQ("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getProjectionMatrix(s,-1,1);Object(x.j)(a,a);var i=Object(G.f)(e,n,r);return Object(G.q)(i,i,a),[i[0],i[1],i[2]]},e.computeVisiblePropBounds=function(){t.allBounds[0]=Ne.INIT_BOUNDS[0],t.allBounds[1]=Ne.INIT_BOUNDS[1],t.allBounds[2]=Ne.INIT_BOUNDS[2],t.allBounds[3]=Ne.INIT_BOUNDS[3],t.allBounds[4]=Ne.INIT_BOUNDS[4],t.allBounds[5]=Ne.INIT_BOUNDS[5];var r=!0;e.invokeEvent(n);for(var s=0;st.allBounds[1]&&(t.allBounds[1]=i[1]),i[2]t.allBounds[3]&&(t.allBounds[3]=i[3]),i[4]t.allBounds[5]&&(t.allBounds[5]=i[5]))}}return r&&(Object(b.b)(t.allBounds),CQ("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=n||e.computeVisiblePropBounds(),a=[0,0,0];if(!Object(b.j)(r))return CQ("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return bQ("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),a[0]=(r[0]+r[1])/2,a[1]=(r[2]+r[3])/2,a[2]=(r[4]+r[5])/2;var Q=r[1]-r[0],B=r[3]-r[2],o=r[5]-r[4],l=(Q*=Q)+(B*=B)+(o*=o);l=0===l?1:l,l=.5*Math.sqrt(l);var F=Object(b.A)(t.activeCamera.getViewAngle()),U=l,c=l/Math.sin(.5*F),g=t.activeCamera.getViewUp();return Math.abs(Object(b.p)(g,i))>.999&&(yQ("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(a[0],a[1],a[2]),t.activeCamera.setPosition(a[0]+c*i[0],a[1]+c*i[1],a[2]+c*i[2]),e.resetCameraClippingRange(r),t.activeCamera.setParallelScale(U),t.activeCamera.setPhysicalScale(l),t.activeCamera.setPhysicalTranslation(-a[0],-a[1],-a[2]),e.invokeEvent(s),!0},e.resetCameraClippingRange=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=n||e.computeVisiblePropBounds();if(!Object(b.j)(s))return CQ("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return bQ("Trying to reset clipping range of non-existent camera"),!1;var a=t.activeCamera.computeClippingRange(s),i=0;if(t.activeCamera.getParallelProjection())i=.1*t.activeCamera.getParallelScale();else{var Q=Object(b.A)(t.activeCamera.getViewAngle());i=.2*Math.tan(Q/2)*a[1]}return a[1]-a[0]=a[1]?.01*a[1]:a[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),a[0]e&&(e=n);var r=t.createdLight?t.createdLight.getMTime():0;return r>e&&(e=r),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var xQ={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,createdLight:null,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Object(b.h)(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,pass:0};function GQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xQ,n),mQ.extend(e,t,n),Object(B.c)(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),Object(B.h)(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),Object(B.d)(e,t,["actors","volumes","lights"]),Object(B.i)(e,t,["background"],4,1),ZQ(e,t)}var hQ={newInstance:Object(B.e)(GQ,"vtkRenderer"),extend:GQ};function pQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function RQ(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,NQ,n),B.b.obj(e,t),B.b.event(e,t,"InteractionEvent"),B.b.event(e,t,"StartInteractionEvent"),B.b.event(e,t,"EndInteractionEvent"),B.b.get(e,t,["interactor","enabled"]),B.b.setGet(e,t,["priority","processEvents"]),AQ(e,t)}var fQ=RQ({newInstance:B.b.newInstance(EQ,"vtkInteractorObserver"),extend:EQ},{computeWorldToDisplay:function(e,t,n,r){return e.getRenderWindow().getViews()[0].worldToDisplay(t,n,r,e)},computeDisplayToWorld:function(e,t,n,r){return e.getRenderWindow().getViews()[0].displayToWorld(t,n,r,e)}}),DQ={States:{IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025}};function vQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var JQ=DQ.States,WQ={Rotate:JQ.IS_ROTATE,Pan:JQ.IS_PAN,Spin:JQ.IS_SPIN,Dolly:JQ.IS_DOLLY,CameraPose:JQ.IS_CAMERA_POSE,WindowLevel:JQ.IS_WINDOW_LEVEL,Slice:JQ.IS_SLICE};function XQ(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(WQ).forEach((function(n){B.b.event(e,t,"Start".concat(n,"Event")),e["start".concat(n)]=function(){t.state===JQ.IS_NONE&&(t.state=WQ[n],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(n,"Event")]({type:"Start".concat(n,"Event")}))},B.b.event(e,t,"End".concat(n,"Event")),e["end".concat(n)]=function(){t.state===WQ[n]&&(t.state=JQ.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(n,"Event")]({type:"End".concat(n,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var n=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),n.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),n.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),n.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),n.render()}}}var HQ={state:JQ.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function kQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,HQ,n),fQ.extend(e,t,n),XQ(e,t)}var TQ=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qQ,n),TQ.extend(e,t,n),B.b.setGet(e,t,["rotationFactor"]),B.b.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),B.b.setGetArray(e,t,["centerOfRotation"],3),_Q(e,t)}var eB=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nB,n),B.b.setGet(e,t,["rotationFactor"]),B.b.setGetArray(e,t,["displayCenter"],2),B.b.setGetArray(e,t,["center"],3),tB(e,t)}};function sB(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,n){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,n){},e.onStartScroll=function(e,t,n){},e.onScroll=function(e,t,n){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var aB={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};var iB={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,aB,n),B.b.setGet(e,t,["button","shift","control","alt"]),B.b.set(e,t,["dragEnabled","scrollEnabled"]),sB(e,t)}};function QB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var n=new Float64Array(3),r=new Float64Array(3),s=new Float64Array(3),a=new Float64Array(16),i=new Float64Array(3),Q=new Float64Array(3),B=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,o,l){if(l){var F=o.getActiveCamera(),U=F.getPosition(),c=F.getFocalPoint();Object(x.i)(a);var g=t.center,d=t.rotationFactor;Object(x.s)(a,a,g);var u=t.previousPosition.x-l.x,I=t.previousPosition.y-l.y,m=e.getView().getSize(),C=F.getViewUp();Object(x.q)(a,a,Object(b.A)(360*u/m[0]*d),C),Object(b.v)(F.getDirectionOfProjection(),C,i),Object(x.q)(a,a,Object(b.A)(-360*I/m[1]*d),i),Q[0]=-g[0],Q[1]=-g[1],Q[2]=-g[2],Object(x.s)(a,a,Q),Object(G.q)(n,U,a),Object(G.q)(r,c,a),B[0]=C[0]+U[0],B[1]=C[1]+U[1],B[2]=C[2]+U[2],Object(G.q)(s,B,a),F.setPosition(n[0],n[1],n[2]),F.setFocalPoint(r[0],r[1],r[2]),F.setViewUp(s[0]-n[0],s[1]-n[1],s[2]-n[2]),F.orthogonalizeViewUp(),o.resetCameraClippingRange(),e.getLightFollowCamera()&&o.updateLightsGeometryToFollowCamera(),t.previousPosition=l}}}var BB={};function oB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BB,n),B.b.obj(e,t),iB.extend(e,t,n),rB.extend(e,t,n),QB(e,t)}var lB={newInstance:B.b.newInstance(oB,"vtkMouseCameraTrackballRotateManipulator"),extend:oB};function FB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRollManipulator");var n=new Float64Array(3),r=new Float64Array(3),s=new Float64Array(3),a=new Float64Array(16),i=new Float64Array(3),Q=new Float64Array(3),B=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(o,l,F){if(F){var U=l.getActiveCamera(),c=U.getPosition(),g=U.getFocalPoint(),d=U.getViewUp();n[0]=g[0]-c[0],n[1]=g[1]-c[1],n[2]=g[2]-c[2],e.computeDisplayCenter(o.getInteractorStyle(),l);var u=t.previousPosition.x-t.displayCenter[0],I=F.x-t.displayCenter[0],m=t.previousPosition.y-t.displayCenter[1],C=F.y-t.displayCenter[1];if(!(0===I&&0===C||0===u&&0===m)){var y=Object(b.C)((u*C-m*I)/(Math.sqrt(u*u+m*m)*Math.sqrt(I*I+C*C))),S=t.center;Object(x.i)(a),s[0]=-S[0],s[1]=-S[1],s[2]=-S[2],Object(x.s)(a,a,S),Object(x.q)(a,a,Object(b.A)(y),n),Object(x.s)(a,a,s),Object(G.q)(i,c,a),Object(G.q)(Q,g,a),r[0]=d[0]+c[0],r[1]=d[1]+c[1],r[2]=d[2]+c[2],Object(G.q)(B,r,a),U.setPosition(i[0],i[1],i[2]),U.setFocalPoint(Q[0],Q[1],Q[2]),U.setViewUp(B[0]-i[0],B[1]-i[1],B[2]-i[2]),U.orthogonalizeViewUp(),l.resetCameraClippingRange(),o.getLightFollowCamera()&&l.updateLightsGeometryToFollowCamera(),t.previousPosition=F}}}}var UB={};function cB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,UB,n),B.b.obj(e,t),rB.extend(e,t,n),iB.extend(e,t,n),FB(e,t)}var gB={newInstance:B.b.newInstance(cB,"vtkMouseCameraTrackballRollManipulator"),extend:cB};function dB(e){return e*e}function uB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballMultiRotateManipulator");var n=lB.newInstance(),r=gB.newInstance(),s=null;e.onButtonDown=function(t,a,i){var Q,B,o=t.getView().getSize(),l=[.5*o[0],.5*o[1]],F=.9*((Q=l[0])<(B=l[1])?B:Q),U=dB(l[0]-i.x)+dB(l[1]-i.y);(s=F*F>U?n:r).setButton(e.getButton()),s.setShift(e.getShift()),s.setControl(e.getControl()),s.setCenter(e.getCenter()),s.onButtonDown(t,i)},e.onButtonUp=function(e){s&&s.onButtonUp(e)},e.onMouseMove=function(e,t,n){s&&s.onMouseMove(e,t,n)}}var IB={};function mB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,IB,n),B.b.obj(e,t),iB.extend(e,t,n),rB.extend(e,t,n),uB(e,t)}var CB={newInstance:B.b.newInstance(mB,"vtkMouseCameraTrackballMultiRotateManipulator"),extend:mB};function bB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,n,r){if(r){var s=r,a=t.previousPosition;t.previousPosition=r;var i=n.getActiveCamera(),Q=i.getPosition(),B=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var o=i.getViewUp(),l=i.getViewPlaneNormal(),F=[0,0,0];Object(b.v)(l,o,F);var U=e.getView().getSize()[1],c=(s.x-a.x)/U,g=(a.y-s.y)/U,d=i.getParallelScale();g*=2*d;var u=F[0]*(c*=2*d)+o[0]*g;Q[0]+=u,B[0]+=u,u=F[1]*c+o[1]*g,Q[1]+=u,B[1]+=u,u=F[2]*c+o[2]*g,Q[2]+=u,B[2]+=u,i.setPosition(Q[0],Q[1],Q[2]),i.setFocalPoint(B[0],B[1],B[2])}else{var I=t.center,m=e.getInteractorStyle(),C=m.computeWorldToDisplay(n,I[0],I[1],I[2])[2],y=m.computeDisplayToWorld(n,s.x,s.y,C),S=m.computeDisplayToWorld(n,a.x,a.y,C),Z=[Q[0]+(S[0]-y[0]),Q[1]+(S[1]-y[1]),Q[2]+(S[2]-y[2])],x=[B[0]+(S[0]-y[0]),B[1]+(S[1]-y[1]),B[2]+(S[2]-y[2])];i.setPosition(Z[0],Z[1],Z[2]),i.setFocalPoint(x[0],x[1],x[2])}n.resetCameraClippingRange(),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}}var yB={};function SB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yB,n),B.b.obj(e,t),rB.extend(e,t,n),iB.extend(e,t,n),bB(e,t)}var ZB={newInstance:B.b.newInstance(SB,"vtkMouseCameraTrackballPanManipulator"),extend:SB};function xB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r;var s=e.getView().getSize(),a=n.getActiveCamera(),i=t.flipDirection?-1:1;if(a.getParallelProjection())t.zoomScale=1.5/s[1]*i;else{var Q=a.getClippingRange();t.zoomScale=Q[1]/s[1]*1.5*i}},e.onMouseMove=function(e,n,r){if(r){var s=t.previousPosition.y-r.y,a=n.getActiveCamera();if(a.getParallelProjection()){var i=s*t.zoomScale;a.setParallelScale((1-i)*a.getParallelScale())}else{var Q=a.getPosition(),B=a.getFocalPoint(),o=a.getDirectionOfProjection(),l=s*t.zoomScale,F=l*o[0];Q[0]+=F,B[0]+=F,F=l*o[1],Q[1]+=F,B[1]+=F,F=l*o[2],Q[2]+=F,B[2]+=F,a.getFreezeFocalPoint()||a.setFocalPoint(B[0],B[1],B[2]),a.setPosition(Q[0],Q[1],Q[2]),n.resetCameraClippingRange()}e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n){if(n){var r=t.getActiveCamera(),s=1-n/10;r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/s):(r.dolly(s),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var GB={zoomScale:0,flipDirection:!1};function hB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,GB,n),B.b.obj(e,t),iB.extend(e,t,n),rB.extend(e,t,n),B.b.setGet(e,t,["flipDirection"]),xB(e,t)}var pB={newInstance:B.b.newInstance(hB,"vtkMouseCameraTrackballZoomManipulator"),extend:hB};function RB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomToMouseManipulator");var n=e.onButtonDown;e.onButtonDown=function(e,r,s){n(e,r,s),t.zoomPosition=s},e.onMouseMove=function(e,n,r){if(r){var s=(t.previousPosition.y-r.y)*t.zoomScale;eB.dollyToPosition(1-s,t.zoomPosition,n,e),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n,r){if(n&&r){var s=1-.1*n;eB.dollyToPosition(s,r,t,e),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var VB={zoomPosition:null};function LB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VB,n),pB.extend(e,t,n),RB(e,t)}var AB={newInstance:B.b.newInstance(LB,"vtkMouseCameraTrackballZoomToMouseManipulator"),extend:LB};function NB(e,t){t.classHierarchy.push("vtkCompositeGestureManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onStartPinch=function(e,t){},e.onStartRotate=function(e,t){},e.onStartPan=function(e,t){},e.onPinch=function(e,t,n){},e.onRotate=function(e,t,n){},e.onPan=function(e,t,n){},e.onEndPinch=function(e){},e.onEndRotate=function(e){},e.onEndPan=function(e){},e.isPinchEnabled=function(){return t.pinchEnabled},e.isPanEnabled=function(){return t.panEnabled},e.isRotateEnabled=function(){return t.rotateEnabled}}var EB={pinchEnabled:!0,panEnabled:!0,rotateEnabled:!0};var fB={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EB,n),B.b.set(e,t,["pinchEnabled","panEnabled","rotateEnabled"]),B.b.setGet(e,t,["interactorStyle"]),NB(e,t)}};function DB(e,t){t.classHierarchy.push("vtkGestureCameraManipulator"),e.onStartPinch=function(e,n){t.previousScale=n},e.onStartRotate=function(e,n){t.previousRotation=n},e.onStartPan=function(e,n){t.previousTranslation=n},e.onPinch=function(e,n,r){eB.dollyByFactor(e,n,r/t.previousScale),t.previousScale=r},e.onPan=function(e,n,r){var s=n.getActiveCamera(),a=e.getInteractorStyle(),i=s.getFocalPoint(),Q=(i=a.computeWorldToDisplay(n,i[0],i[1],i[2]))[2],B=r,o=t.previousTranslation,l=a.computeDisplayToWorld(n,i[0]+B[0]-o[0],i[1]+B[1]-o[1],Q),F=a.computeDisplayToWorld(n,i[0],i[1],Q),U=[];U[0]=F[0]-l[0],U[1]=F[1]-l[1],U[2]=F[2]-l[2],i=s.getFocalPoint();var c=s.getPosition();s.setFocalPoint(U[0]+i[0],U[1]+i[1],U[2]+i[2]),s.setPosition(U[0]+c[0],U[1]+c[1],U[2]+c[2]),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),s.orthogonalizeViewUp(),t.previousTranslation=r},e.onRotate=function(e,n,r){var s=n.getActiveCamera();s.roll(r-t.previousRotation),s.orthogonalizeViewUp(),t.previousRotation=r}}var vB={};function JB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vB,n),B.b.obj(e,t),fB.extend(e,t,n),rB.extend(e,t,n),DB(e,t)}var WB={newInstance:B.b.newInstance(JB,"vtkGestureCameraManipulator"),extend:JB};function XB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function HB(e){for(var t=1;te&&(e=r)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=jB("pick"),e.hasKey=jB("hasKey"),e.getRedrawMTime=function(){return t.mtime},e.setEstimatedRenderTime=function(e){t.estimatedRenderTime=e,t.savedEstimatedRenderTime=e},e.restoreEstimatedRenderTime=function(){t.estimatedRenderTime=t.savedEstimatedRenderTime},e.addEstimatedRenderTime=function(e){t.estimatedRenderTime+=e},e.setAllocatedRenderTime=function(e){t.allocatedRenderTime=e,t.savedEstimatedRenderTime=t.estimatedRenderTime,t.estimatedRenderTime=0},e.getSupportsSelection=function(){return!1},e.getTextures=function(){return t.textures},e.hasTexture=function(e){return-1!==t.textures.indexOf(e)},e.addTexture=function(n){n&&!e.hasTexture(n)&&(t.textures=t.textures.concat(n),e.modified())},e.removeTexture=function(n){var r=t.textures.filter((function(e){return e!==n}));t.textures.length!==r.length&&(t.textures=r,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}var qB={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function $B(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qB,n),B.b.obj(e,t),B.b.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),B.b.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier"]),_B(e,t)}var eo={newInstance:B.b.newInstance($B,"vtkProp"),extend:$B};function to(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(n){t.position=t.position.map((function(e,t){return e+n[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=Xr();Object(x.o)(e,t.rotation);var n=Object(G.a)(),r=function(e,t){var n=2*Math.acos(t[3]),r=Math.sin(n/2);return r>Xe.b?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}(n,e);return[Object(b.C)(r),n[0],n[1],n[2]]},e.rotateX=function(n){0!==n&&(Object(x.a)(t.rotation,t.rotation,Object(b.A)(n)),e.modified())},e.rotateY=function(n){0!==n&&(Object(x.b)(t.rotation,t.rotation,Object(b.A)(n)),e.modified())},e.rotateZ=function(n){0!==n&&(Object(x.c)(t.rotation,t.rotation,Object(b.A)(n)),e.modified())},e.rotateWXYZ=function(n,r,s,a){if(0!==n&&(0!==r||0!==s||0!==a)){var i=Object(b.A)(n),Q=Xr();Hr(Q,[r,s,a],i);var B=Object(x.h)();Object(x.m)(B,Q),Object(x.l)(t.rotation,t.rotation,B),e.modified()}},e.setOrientation=function(n,r,s){return(n!==t.orientation[0]||r!==t.orientation[1]||s!==t.orientation[2])&&(t.orientation=[n,r,s],Object(x.i)(t.rotation),e.rotateZ(s),e.rotateX(n),e.rotateY(r),e.modified(),!0)},e.setUserMatrix=function(n){Object(x.d)(t.userMatrix,n),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Object(x.i)(t.matrix),t.userMatrix&&Object(x.l)(t.matrix,t.matrix,t.userMatrix),Object(x.s)(t.matrix,t.matrix,t.origin),Object(x.s)(t.matrix,t.matrix,t.position),Object(x.l)(t.matrix,t.matrix,t.rotation),Object(x.r)(t.matrix,t.matrix,t.scale),Object(x.s)(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),Object(x.j)(t.matrix,t.matrix),t.isIdentity=!0;for(var n=0;n<4;++n)for(var r=0;r<4;++r)(n===r?1:0)!==t.matrix[n+4*r]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Ne.getCenter(t.bounds)},e.getLength=function(){return Ne.getLength(t.bounds)},e.getXRange=function(){return Ne.getXRange(t.bounds)},e.getYRange=function(){return Ne.getYRange(t.bounds)},e.getZRange=function(){return Ne.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var no={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[1,-1,1,-1,1,-1],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function ro(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,no,n),eo.extend(e,t,n),t.matrixMTime={},B.b.obj(t.matrixMTime),B.b.get(e,t,["bounds","isIdentity"]),B.b.getArray(e,t,["orientation"]),B.b.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Object(x.h)(),t.rotation=Object(x.h)(),t.userMatrix=Object(x.h)(),t.transform=null,to(e,t)}var so={newInstance:B.b.newInstance(ro,"vtkProp3D"),extend:ro},ao=B.b.vtkErrorMacro;function io(e,t){t.classHierarchy.push("vtkPiecewiseFunction"),e.getSize=function(){return t.nodes.length},e.getType=function(){var e,n=0,r=0;t.nodes.length>0&&(n=t.nodes[0].y);for(var s=1;sn)switch(r){case 0:case 1:r=1;break;default:case 2:r=3}else switch(r){case 0:case 2:r=2;break;default:case 1:r=3}if(n=e,3===r)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:case 3:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var n=0;n0?t.nodes[n-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,n){var r=t.nodes.length;return e<0||e>=r?(ao("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].y,n[2]=t.nodes[e].midpoint,n[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){var s=t.nodes.length;if(n<0||n>=s)return ao("Index out of range!"),-1;var a=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].y=r[1],t.nodes[n].midpoint=r[2],t.nodes[n].sharpness=r[3],a!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,n){return e.addPointLong(t,n,.5,0)},e.addPointLong=function(n,r,s,a){if(s<0||s>1)return ao("Midpoint outside range [0.0, 1.0]"),-1;if(a<0||a>1)return ao("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var i,Q={x:n,y:r,midpoint:s,sharpness:a};for(t.nodes.push(Q),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var s=r,a=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(a=e.updateRange()),a||e.modified(),s},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(n,r,s,a){e.sortAndUpdateRange();for(var i=0;i=n&&t.nodes[i].x<=s?t.nodes.splice(i,1):i++;e.addPoint(n,r,.5,0),e.addPoint(s,a,.5,0)},e.getValue=function(t){var n=[];return e.getTable(t,t,1,n),n[0]},e.adjustRange=function(n){if(n.length<2)return 0;var r=e.getRange();r[0]n[1]?e.addPoint(n[1],e.getValue(n[1])):e.addPoint(n[1],e.getValue(r[1])),e.sortAndUpdateRange();for(var s=0;s=n[0]&&t.nodes[s].x<=n[1]?t.nodes.splice(s,1):++s;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var n=t.nodes[1].x-t.nodes[0].x,r=0;r4&&void 0!==arguments[4]?arguments[4]:1,Q=0,B=t.nodes.length,o=0;0!==B&&(o=t.nodes[B-1].y);var l=0,F=0,U=0,c=0,g=0,d=0,u=0;for(a=0;a1?e+a/(r-1)*(n-e):.5*(e+n);Qt.nodes[Q].x;)++Q.99999&&(d=.99999));if(Q>=B)s[I]=t.clamping?o:0;else if(0===Q)s[I]=t.clamping?t.nodes[0].y:0;else{var m=(l-F)/(U-F);if(m=m.99){if(m<.5){s[I]=c;continue}s[I]=g;continue}if(u<.01){s[I]=(1-m)*c+m*g;continue}m<.5?m=.5*Math.pow(2*m,1+10*u):m>.5&&(m=1-.5*Math.pow(2*(1-m),1+10*u));var C=m*m,b=C*m,y=2*b-3*C+1,S=-2*b+3*C,Z=b-2*C+m,x=b-C,G=g-c,h=(1-u)*G;s[I]=y*c+S*g+Z*h+x*h;var p=cg?c:g;s[I]=s[I]R?R:s[I]}}}}var Qo={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function Bo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qo,n),B.b.obj(e,t),t.nodes=[],B.b.setGet(e,t,["allowDuplicateScalars","clamping"]),B.b.setArray(e,t,["range"],2),B.b.getArray(e,t,["range"]),io(e,t)}var oo={newInstance:B.b.newInstance(Bo,"vtkPiecewiseFunction"),extend:Bo},lo=Object.create(null);[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,7.54296e-7,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,1.11641e-7,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,3.63578e-7,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,4.05298e-7,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4.264e-8,0,6.20844e-7,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,3.3216e-7,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,4.05432e-7,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,4.55569e-8]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,4.55569e-8,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}].filter((function(e){return e.RGBPoints})).filter((function(e){return"CIELAB"!==e.ColorSpace})).forEach((function(e){lo[e.Name]=e}));var Fo=Object.keys(lo);Fo.sort();var Uo={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(lo[e.Name]||(Fo.push(e.Name),Fo.sort()),lo[e.Name]=e)},removePresetByName:function(e){var t=Fo.indexOf(e);t>-1&&Fo.splice(t,1),delete lo[e]},getPresetByName:function(e){return lo[e]},rgbPresetNames:Fo},co={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};function go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var uo=co.ColorSpace,Io=co.Scale,mo=wn.ScalarMappingTarget,Co=B.b.vtkDebugMacro,bo=B.b.vtkErrorMacro,yo=B.b.vtkWarningMacro;function So(e,t){var n=e[0],r=e[1],s=e[2],a=Math.sqrt(n*n+r*r+s*s),i=a>.001?Math.acos(n/a):0,Q=i>.001?Math.atan2(s,r):0;t[0]=a,t[1]=i,t[2]=Q}function Zo(e,t){if(e[0]>=t-.1)return e[2];var n=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+n:e[2]-n}function xo(e,t,n,r){var s=[],a=[];Object(b.e)(t,s),Object(b.e)(n,a);var i=[],Q=[];So(s,i),So(a,Q);var B=e;if(i[1]>.05&&Q[1]>.05&&function(e,t){var n=e-t;for(n<0&&(n=-n);n>=2*Math.PI;)n-=2*Math.PI;return n>Math.PI&&(n=2*Math.PI-n),n}(i[2],Q[2])>.33*Math.PI){var o=Math.max(i[0],Q[0]);o=Math.max(88,o),e<.5?(Q[0]=o,Q[1]=0,Q[2]=0,B*=2):(i[0]=o,i[1]=0,i[2]=0,B=2*B-1)}i[1]<.05&&Q[1]>.05?i[2]=Zo(Q,i[0]):Q[1]<.05&&i[1]>.05&&(Q[2]=Zo(i,Q[0]));var l=[];l[0]=(1-B)*i[0]+B*Q[0],l[1]=(1-B)*i[1]+B*Q[1],l[2]=(1-B)*i[2]+B*Q[2];var F=[];!function(e,t){var n=e[0],r=e[1],s=e[2];t[0]=n*Math.cos(r),t[1]=n*Math.sin(r)*Math.cos(s),t[2]=n*Math.sin(r)*Math.sin(s)}(l,F),Object(b.f)(F,r)}function Go(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,n,r,s){return e.addRGBPointLong(t,n,r,s,.5,0)},e.addRGBPointLong=function(n,r,s,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,Q=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return bo("Midpoint outside range [0.0, 1.0]"),-1;if(Q<0||Q>1)return bo("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var B={x:n,r:r,g:s,b:a,midpoint:i,sharpness:Q};t.nodes.push(B),e.sortAndUpdateRange();for(var o=0;o4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,Q=[],B=[n,r,s];return Object(b.t)(B,Q),e.addRGBPoint(t,Q[0],Q[1],Q[2],a,i)},e.setNodes=function(n){t.nodes!==n&&(t.nodes=n,e.sortAndUpdateRange())},e.sortAndUpdateRange=function(){t.nodes.sort((function(e,t){return e.x-t.x})),e.updateRange()||e.modified()},e.updateRange=function(){var n=[2];n[0]=t.mappingRange[0],n[1]=t.mappingRange[1];var r=t.nodes.length;return r?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[r-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(n[0]!==t.mappingRange[0]||n[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(n){for(var r=0;r=t.nodes.length)return-1;var a=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(a=e.updateRange()),a||e.modified(),s},e.movePoint=function(n,r){if(n!==r){e.removePoint(r);for(var s=0;s=n&&t.nodes[l].x<=i?t.nodes.splice(l,1):l++;e.addRGBPointLong(n,r,s,a,.5,0),e.addRGBPointLong(i,Q,B,o,.5,0),e.modified()},e.addHSVSegment=function(t,n,r,s,a,i,Q,B){var o=[i,Q,B],l=[],F=[];Object(b.t)([n,r,s],l),Object(b.t)(o,F),e.addRGBSegment(t,l[0],l[1],l[2],a,F[0],F[1],F[2])},e.mapValue=function(t){var n=[];return e.getColor(t,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},e.getColor=function(n,r){if(t.indexedLookup){var s=e.getSize(),a=e.getAnnotatedValueIndexInternal(n);if(a<0||0===s)e.getNanColor(r);else{var i=[];e.getNodeValue(a%s,i),r[0]=i.r,r[1]=i.g,r[2]=i.b}}else e.getTable(n,n,1,r)},e.getRedValue=function(t){var n=[];return e.getColor(t,n),n[0]},e.getGreenValue=function(t){var n=[];return e.getColor(t,n),n[1]},e.getBlueValue=function(t){var n=[];return e.getColor(t,n),n[2]},e.getTable=function(n,r,s,a){if(Object(b.u)(n)||Object(b.u)(r))for(var i=0;i0);var S=0,Z=0,x=0;y&&(S=Math.log10(n),Z=Math.log10(r));for(var G=0;G1?y?(x=S+G/(s-1)*(Z-S),U=Math.pow(10,x)):U=n+G/(s-1)*(r-n):y?(x=.5*(S+Z),U=Math.pow(10,x)):U=.5*(n+r),t.discretize){var p=t.mappingRange;if(U>=p[0]&&U<=p[1]){var R=t.numberOfValues,V=p[1]-p[0];if(R<=1)U=p[0]+V/2;else{var L=(U-p[0])/V,A=Object(b.g)(R*L);U=p[0]+A/(R-1)*V}}}for(;Qt.nodes[Q].x;)++Q.99999&&(I=.99999));if(U>t.mappingRange[1])a[h]=0,a[h+1]=0,a[h+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(a[h]=t.aboveRangeColor[0],a[h+1]=t.aboveRangeColor[1],a[h+2]=t.aboveRangeColor[2]):(a[h]=o,a[h+1]=l,a[h+2]=F));else if(U0&&(a[h]=t.nodes[0].r,a[h+1]=t.nodes[0].g,a[h+2]=t.nodes[0].b));else if(0===Q&&(Math.abs(U-n)<1e-6||t.discretize))B>0?(a[h]=t.nodes[0].r,a[h+1]=t.nodes[0].g,a[h+2]=t.nodes[0].b):(a[h]=0,a[h+1]=0,a[h+2]=0);else{var N=0;if(N=(N=y?(x-c)/(g-c):(U-c)/(g-c)).99){if(N<.5){a[h]=d[0],a[h+1]=d[1],a[h+2]=d[2];continue}a[h]=u[0],a[h+1]=u[1],a[h+2]=u[2];continue}if(m<.01){if(t.colorSpace===uo.RGB)a[h]=(1-N)*d[0]+N*u[0],a[h+1]=(1-N)*d[1]+N*u[1],a[h+2]=(1-N)*d[2]+N*u[2];else if(t.colorSpace===uo.HSV){var E=[],f=[];Object(b.d)(d,E),Object(b.d)(u,f),t.hSVWrap&&(E[0]-f[0]>.5||f[0]-E[0]>.5)&&(E[0]>f[0]?E[0]-=1:f[0]-=1);var D=[];D[0]=(1-N)*E[0]+N*f[0],D[0]<0&&(D[0]+=1),D[1]=(1-N)*E[1]+N*f[1],D[2]=(1-N)*E[2]+N*f[2],Object(b.t)(D,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]}else if(t.colorSpace===uo.LAB){var v=[],J=[];Object(b.e)(d,v),Object(b.e)(u,J);var W=[];W[0]=(1-N)*v[0]+N*J[0],W[1]=(1-N)*v[1]+N*J[1],W[2]=(1-N)*v[2]+N*J[2],Object(b.f)(W,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]}else t.colorSpace===uo.DIVERGING?(xo(N,d,u,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]):bo("ColorSpace set to invalid value.",t.colorSpace);continue}N<.5?N=.5*Math.pow(2*N,1+10*m):N>.5&&(N=1-.5*Math.pow(2*(1-N),1+10*m));var X=N*N,H=X*N,k=2*H-3*X+1,T=-2*H+3*X,M=H-2*X+N,Y=H-X,w=void 0;if(t.colorSpace===uo.RGB)for(var O=0;O<3;O++)w=(1-m)*(u[O]-d[O]),a[h+O]=k*d[O]+T*u[O]+M*w+Y*w;else if(t.colorSpace===uo.HSV){var z=[],P=[];Object(b.d)(d,z),Object(b.d)(u,P),t.hSVWrap&&(z[0]-P[0]>.5||P[0]-z[0]>.5)&&(z[0]>P[0]?z[0]-=1:P[0]-=1);for(var K=[],j=0;j<3;j++)w=(1-m)*(P[j]-z[j]),K[j]=k*z[j]+T*P[j]+M*w+Y*w,0===j&&K[j]<0&&(K[j]+=1);Object(b.t)(K,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]}else if(t.colorSpace===uo.LAB){var _=[],q=[];Object(b.e)(d,_),Object(b.e)(u,q);for(var $=[],ee=0;ee<3;ee++)w=(1-m)*(q[ee]-_[ee]),$[ee]=k*_[ee]+T*q[ee]+M*w+Y*w;Object(b.f)($,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]}else t.colorSpace===uo.DIVERGING?(xo(N,d,u,C),a[h]=C[0],a[h+1]=C[1],a[h+2]=C[2]):bo("ColorSpace set to invalid value.");for(var te=0;te<3;te++)a[h+te]=a[h+te]<0?0:a[h+te],a[h+te]=a[h+te]>1?1:a[h+te]}}}},e.getUint8Table=function(n,r,s){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===s&&t.tableWithAlpha!==a)return t.table;if(0===t.nodes.length)return bo("Attempting to lookup a value with no points in the function"),t.table;var i=a?4:3;t.tableSize===s&&t.tableWithAlpha===a||(t.table=new Uint8Array(s*i),t.tableSize=s,t.tableWithAlpha=a);var Q=[];e.getTable(n,r,s,Q);for(var B=0;B1&&(i=(r-n)/(s-1));for(var Q=0;Q=t.nodes.length?(bo("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].r,n[2]=t.nodes[e].g,n[3]=t.nodes[e].b,n[4]=t.nodes[e].midpoint,n[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){if(n<0||n>=t.nodes.length)return bo("Index out of range!"),-1;var s=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].r=r[1],t.nodes[n].g=r[2],t.nodes[n].b=r[3],t.nodes[n].midpoint=r[4],t.nodes[n].sharpness=r[5],s!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.getNumberOfAvailableColors=function(){return t.indexedLookup&&e.getSize()?e.getSize():t.tableSize?t.tableSize:16777216},e.getIndexedColor=function(t,n){var r=e.getSize();if(r>0&&t>=0){var s=[];e.getNodeValue(t%r,s);for(var a=0;a<3;++a)n[a]=s[a+1];n[3]=1}else e.getNanColor(n),n[3]=1},e.fillFromDataPointer=function(t,n){if(!(t<=0)&&n){e.removeAllPoints();for(var r=0;rn[1]?(e.getColor(n[1],s),e.addRGBPoint(n[1],s[0],s[1],s[2])):(e.getColor(r[1],s),e.addRGBPoint(n[1],s[0],s[1],s[2])),e.sortAndUpdateRange();for(var a=0;a=n[0]&&t.nodes[a].x<=n[1]?t.nodes.splice(a,1):++a;return 1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ho,n),wn.extend(e,t,n),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},B.b.obj(t.buildTime),B.b.get(e,t,["buildTime","mappingRange"]),B.b.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),B.b.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),B.b.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),Go(e,t)}var Ro=function(e){for(var t=1;t(e=t.componentData[r].grayTransferFunction.getMTime())?n:e):3===t.componentData[r].colorChannels&&t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].scalarOpacity&&(n=n>(e=t.componentData[r].scalarOpacity.getMTime())?n:e),t.componentData[r].gradientOpacity&&(t.componentData[r].disableGradientOpacity||(n=n>(e=t.componentData[r].gradientOpacity.getMTime())?n:e));return n},e.getColorChannels=function(e){return e<0||e>3?(No("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(n,r){var s=!1;return t.componentData[n].grayTransferFunction!==r&&(t.componentData[n].grayTransferFunction=r,s=!0),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1,s=!0),s&&e.modified(),s},e.getGrayTransferFunction=function(n){return null===t.componentData[n].grayTransferFunction&&(t.componentData[n].grayTransferFunction=oo.newInstance(),t.componentData[n].grayTransferFunction.addPoint(0,0),t.componentData[n].grayTransferFunction.addPoint(1024,1),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1),e.modified()),t.componentData[n].grayTransferFunction},e.setRGBTransferFunction=function(n,r){var s=!1;return t.componentData[n].rGBTransferFunction!==r&&(t.componentData[n].rGBTransferFunction=r,s=!0),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3,s=!0),s&&e.modified(),s},e.getRGBTransferFunction=function(n){return null===t.componentData[n].rGBTransferFunction&&(t.componentData[n].rGBTransferFunction=Ro.newInstance(),t.componentData[n].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[n].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3),e.modified()),t.componentData[n].rGBTransferFunction},e.setScalarOpacity=function(n,r){return t.componentData[n].scalarOpacity!==r&&(t.componentData[n].scalarOpacity=r,e.modified(),!0)},e.getScalarOpacity=function(n){return null===t.componentData[n].scalarOpacity&&(t.componentData[n].scalarOpacity=oo.newInstance(),t.componentData[n].scalarOpacity.addPoint(0,1),t.componentData[n].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[n].scalarOpacity},e.setComponentWeight=function(n,r){if(n<0||n>=4)return No("Invalid index"),!1;var s=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==s&&(t.componentData[n].componentWeight=s,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(No("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(Lo.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(Lo.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(Lo.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return B.b.enumToString(Lo,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(n){var r=B.b.capitalize(n);e["set".concat(r)]=function(r,s){return t.componentData[r]["".concat(n)]!==s&&(t.componentData[r]["".concat(n)]=s,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(n){var r=B.b.capitalize(n);e["get".concat(r)]=function(e){return t.componentData[e]["".concat(n)]}}))}var fo={independentComponents:!0,interpolationType:Lo.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function Do(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,fo,n),B.b.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r<4;++r)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:Ao.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}B.b.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),Eo(e,t)}var vo=function(e){for(var t=1;tr[1])return t.mapperBounds=r.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),r;if(!t.mapperBounds||!(n=[r,t.mapperBounds],n[0].map((function(e,t){return n.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){Jo("Recomputing bounds..."),t.mapperBounds=r.map((function(e){return e}));var s=[Object(G.f)(r[1],r[3],r[5]),Object(G.f)(r[1],r[2],r[5]),Object(G.f)(r[0],r[2],r[5]),Object(G.f)(r[0],r[3],r[5]),Object(G.f)(r[1],r[3],r[4]),Object(G.f)(r[1],r[2],r[4]),Object(G.f)(r[0],r[2],r[4]),Object(G.f)(r[0],r[3],r[4])];e.computeMatrix();var a=Object(x.h)();Object(x.j)(a,t.matrix),s.forEach((function(e){return Object(G.q)(e,e,a)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?s.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):s.reduce((function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e}}var Xo={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function Ho(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xo,n),so.extend(e,t,n),t.boundsMTime={},B.b.obj(t.boundsMTime),B.b.set(e,t,["property"]),B.b.setGet(e,t,["mapper"]),B.b.getArray(e,t,["bounds"],6),Wo(e,t)}var ko={newInstance:B.b.newInstance(Ho,"vtkVolume"),extend:Ho},To=_a.BlendMode;function Mo(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Object(b.h)(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(To.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(To.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(To.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(To.AVERAGE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return B.b.enumToString(To,t.blendMode)}}var Yo={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:To.COMPOSITE_BLEND,averageIPScalarRange:[-1e6,1e6]};function wo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yo,n),$n.extend(e,t,n),B.b.obj(e,t),B.b.algo(e,t,1,0),B.b.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode"]),B.b.setGetArray(e,t,["averageIPScalarRange"],2),B.b.event(e,t,"lightingActivated"),Mo(e,t)}var Oo={newInstance:B.b.newInstance(wo,"vtkVolumeMapper"),extend:wo};var zo=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;return Object(ut.a)(this,i),(t=a.call(this,e)).lookupTable=Ro.newInstance(),t.piecewiseFunction=oo.newInstance(),t.volume=ko.newInstance(),t.mapper=Oo.newInstance(),t.volume.setMapper(t.mapper),t.volume.getProperty().setRGBTransferFunction(0,t.lookupTable),t.volume.getProperty().setScalarOpacity(0,t.piecewiseFunction),t.volume.getProperty().setInterpolationTypeToLinear(),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this;return s.a.createElement(kB.Consumer,null,(function(t){return e.view||(t.renderer.addVolume(e.volume),e.view=t),s.a.createElement(TB.Provider,{value:e},s.a.createElement(wB.Provider,{value:e.mapper},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children)))}))}},{key:"componentDidMount",value:function(){this.update(this.props)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.view&&(this.view.renderer.removeVolume(this.volume),this.view=null),this.volume.delete(),this.volume=null,this.mapper.delete(),this.mapper=null}},{key:"update",value:function(e,t){var n,r=e.volume,s=e.property,a=e.mapper,i=e.colorMapPreset,B=e.colorDataRange;if(!r||t&&r===t.volume||this.volume.set(r),!s||t&&s===t.property||this.volume.getProperty().set(s),!a||t&&a===t.mapper||this.mapper.set(a),i&&(!t||i!==t.colorMapPreset)){var o,l=Uo.getPresetByName(i);this.lookupTable.applyColorMap(l),(o=this.lookupTable).setMappingRange.apply(o,Object(Q.a)(B)),this.lookupTable.updateRange()}!B||t&&B===t.colorDataRange||("string"==typeof B?t?(console.log("from update"),this.dataChanged()):(this.lookupTable.setMappingRange(0,1),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:0,y:0,midpoint:.5,sharpness:0},{x:1,y:1,midpoint:.5,sharpness:0}])):((n=this.lookupTable).setMappingRange.apply(n,Object(Q.a)(B)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:B[0],y:0,midpoint:.5,sharpness:0},{x:B[1],y:1,midpoint:.5,sharpness:0}])))}},{key:"dataChanged",value:function(){if("auto"===this.props.colorDataRange){this.mapper.update();var e,t=this.mapper.getInputData(),n=t&&t.getPointData().getScalars(),r=n&&n.getRange();r&&((e=this.lookupTable).setMappingRange.apply(e,Object(Q.a)(r)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:r[0],y:0,midpoint:.5,sharpness:0},{x:r[1],y:1,midpoint:.5,sharpness:0}])),this.view&&this.view.renderView()}}}]),i}();zo.defaultProps={colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto"},zo.propTypes={id:i.a.string,mapper:i.a.object,volume:i.a.object,property:i.a.object,colorMapPreset:i.a.string,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string]),children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var Po=zo,Ko=sa.InterpolationType,jo=B.b.vtkErrorMacro;function _o(e,t){t.classHierarchy.push("vtkImageProperty"),e.getMTime=function(){for(var e,n=t.mtime,r=0;r<4;r++)t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].piecewiseFunction&&(n=n>(e=t.componentData[r].piecewiseFunction.getMTime())?n:e);return n},e.setRGBTransferFunction=function(n,r){var s=n,a=r;return Number.isInteger(n)||(a=n,s=0),t.componentData[s].rGBTransferFunction!==a&&(t.componentData[s].rGBTransferFunction=a,e.modified(),!0)},e.getRGBTransferFunction=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.componentData[e].rGBTransferFunction},e.setPiecewiseFunction=function(n,r){var s=n,a=r;return Number.isInteger(n)||(a=n,s=0),t.componentData[s].piecewiseFunction!==a&&(t.componentData[s].piecewiseFunction=a,e.modified(),!0)},e.getPiecewiseFunction=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.componentData[e].piecewiseFunction},e.setScalarOpacity=function(t,n){var r=t,s=n;return Number.isInteger(t)||(s=t,r=0),e.setPiecewiseFunction(r,s)},e.getScalarOpacity=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e.getPiecewiseFunction(t)},e.setComponentWeight=function(n,r){if(n<0||n>=4)return jo("Invalid index"),!1;var s=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==s&&(t.componentData[n].componentWeight=s,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(jo("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(Ko.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(Ko.LINEAR)},e.getInterpolationTypeAsString=function(){return B.b.enumToString(Ko,t.interpolationType)}}var qo={independentComponents:!1,interpolationType:Ko.LINEAR,colorWindow:255,colorLevel:127.5,ambient:1,diffuse:0,opacity:1};function $o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,qo,n),B.b.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r<4;r++)t.componentData.push({rGBTransferFunction:null,piecewiseFunction:null,componentWeight:1})}B.b.setGet(e,t,["independentComponents","interpolationType","colorWindow","colorLevel","ambient","diffuse","opacity"]),_o(e,t)}var el={newInstance:B.b.newInstance($o,"vtkImageProperty"),extend:$o},tl=B.b.vtkDebugMacro;function nl(e,t){t.classHierarchy.push("vtkImageSlice"),e.getActors=function(){return e},e.getImages=function(){return e},e.getIsOpaque=function(){if(t.forceOpaque)return!0;if(t.forceTranslucent)return!1;t.property||e.getProperty();var n=t.property.getOpacity()>=1;return n&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return!1},e.makeProperty=el.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n,r=t.mapper.getBounds();if(!r||6!==r.length)return r;if(r[0]>r[1])return t.mapperBounds=r.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),r;if(!t.mapperBounds||!(n=[r,t.mapperBounds],n[0].map((function(e,t){return n.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){tl("Recomputing bounds..."),t.mapperBounds=r.map((function(e){return e}));var s=[Object(G.f)(r[1],r[3],r[5]),Object(G.f)(r[1],r[2],r[5]),Object(G.f)(r[0],r[2],r[5]),Object(G.f)(r[0],r[3],r[5]),Object(G.f)(r[1],r[3],r[4]),Object(G.f)(r[1],r[2],r[4]),Object(G.f)(r[0],r[2],r[4]),Object(G.f)(r[0],r[3],r[4])];e.computeMatrix();var a=Object(x.h)();Object(x.j)(a,t.matrix),s.forEach((function(e){return Object(G.q)(e,e,a)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?s.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):s.reduce((function(e,n){return e1&&void 0!==arguments[1]?arguments[1]:0,s=t.mapper.getBoundsForSlice(n,r);if(!s||6!==s.length)return s;if(s[0]>s[1])return s;var a=[Object(G.f)(s[1],s[3],s[5]),Object(G.f)(s[1],s[2],s[5]),Object(G.f)(s[0],s[2],s[5]),Object(G.f)(s[0],s[3],s[5]),Object(G.f)(s[1],s[3],s[4]),Object(G.f)(s[1],s[2],s[4]),Object(G.f)(s[0],s[2],s[4]),Object(G.f)(s[0],s[3],s[4])];e.computeMatrix();var i=Object(x.h)();Object(x.j)(i,t.matrix),a.forEach((function(e){return Object(G.q)(e,e,i)}));var Q=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];return Q.map((function(e,t){return t%2==0?a.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):a.reduce((function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}if(null!==t.property){var r=t.property.getMTime();e=r>e?r:e,null!==t.property.getRGBTransferFunction()&&(e=(r=t.property.getRGBTransferFunction().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var rl={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function sl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rl,n),so.extend(e,t,n),t.boundsMTime={},B.b.obj(t.boundsMTime),B.b.set(e,t,["property"]),B.b.setGet(e,t,["mapper"]),B.b.getArray(e,t,["bounds"],6),nl(e,t)}var al={newInstance:B.b.newInstance(sl,"vtkImageSlice"),extend:sl};function il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ql(e){for(var t=1;ti&&(i=l,B=r[o]<0,Q=o)}if(1!==i){var F="IJKXYZ"[t.slicingMode],U="IJKXYZ"[Q];ll("Unaccurate slicing along ".concat(F," axis which ")+"is not aligned with any IJK axis of the image data. "+"Using ".concat(U," axis as a fallback (").concat(i,"% aligned). ")+"Necessitates slice reformat that is not yet implemented. You can switch the slicing mode on your mapper to do IJK slicing instead.")}t.closestIJKAxis={ijkMode:Q,flip:B}}function r(n,r){var s=e.getInputData(),a=s.getExtent(),i=[a[0],a[2],a[4]],Q=e.getClosestIJKAxis().ijkMode,B=t.slice;Q!==t.slicingMode&&(B=e.getSliceAtPosition(B)),i[Q]+=B;var o=[0,0,0];s.indexToWorld(i,o),i[Q]+=1;var l=[0,0,0];s.indexToWorld(i,l),l[0]-=o[0],l[1]-=o[1],l[2]-=o[2],Object(G.l)(l,l);var F=ue.a.intersectWithLine(n,r,o,l);if(F.intersection){var U=F.x,c=[0,0,0];return s.worldToIndex(U,c),{t:F.t,absoluteIJK:c}}return null}t.classHierarchy.push("vtkImageMapper"),e.getSliceAtPosition=function(n){var r,s=e.getInputData();if(3===n.length)r=n;else if(Number.isFinite(n)){var a=s.getBounds();switch(t.slicingMode){case Fl.X:r=[n,(a[3]+a[2])/2,(a[5]+a[4])/2];break;case Fl.Y:r=[(a[1]+a[0])/2,n,(a[5]+a[4])/2];break;case Fl.Z:r=[(a[1]+a[0])/2,(a[3]+a[2])/2,n]}}var i=[0,0,0];s.worldToIndex(r,i);var Q=s.getExtent(),B=0;switch(e.getClosestIJKAxis().ijkMode){case Fl.I:B=Object(b.E)(i[0],Q[0],Q[1]),B=Math.round(B);break;case Fl.J:B=Object(b.E)(i[1],Q[2],Q[3]),B=Math.round(B);break;case Fl.K:B=Object(b.E)(i[2],Q[4],Q[5]),B=Math.round(B);break;default:return 0}return B},e.setSliceFromCamera=function(n){var r=n.getFocalPoint();switch(t.slicingMode){case Fl.I:case Fl.J:case Fl.K:var s=e.getSliceAtPosition(r);e.setSlice(s);break;case Fl.X:e.setSlice(r[0]);break;case Fl.Y:e.setSlice(r[1]);break;case Fl.Z:e.setSlice(r[2])}},e.setXSlice=function(t){e.setSlicingMode(Fl.X),e.setSlice(t)},e.setYSlice=function(t){e.setSlicingMode(Fl.Y),e.setSlice(t)},e.setZSlice=function(t){e.setSlicingMode(Fl.Z),e.setSlice(t)},e.setISlice=function(t){e.setSlicingMode(Fl.I),e.setSlice(t)},e.setJSlice=function(t){e.setSlicingMode(Fl.J),e.setSlice(t)},e.setKSlice=function(t){e.setSlicingMode(Fl.K),e.setSlice(t)},e.getSlicingModeNormal=function(){var n=[0,0,0],r=e.getInputData().getDirection(),s=[[r[0],r[1],r[2]],[r[3],r[4],r[5]],[r[6],r[7],r[8]]];switch(t.slicingMode){case Fl.X:n[0]=1;break;case Fl.Y:n[1]=1;break;case Fl.Z:n[2]=1;break;case Fl.I:Object(b.i)(s,[1,0,0],n);break;case Fl.J:Object(b.i)(s,[0,1,0],n);break;case Fl.K:Object(b.i)(s,[0,0,1],n)}return n},e.setSlicingMode=function(r){t.slicingMode!==r&&(t.slicingMode=r,e.getInputData()&&n(),e.modified())},e.getClosestIJKAxis=function(){return void 0!==t.closestIJKAxis&&t.closestIJKAxis.ijkMode!==Fl.NONE||!e.getInputData()||n(),t.closestIJKAxis},e.getBounds=function(){var n=e.getInputData();if(!n)return Object(b.h)();if(!t.useCustomExtents)return n.getBounds();var r=t.customDisplayExtent.slice(),s=e.getClosestIJKAxis().ijkMode,a=t.slice;switch(s!==t.slicingMode&&(a=e.getSliceAtPosition(t.slice)),s){case Fl.I:r[0]=a,r[1]=a;break;case Fl.J:r[2]=a,r[3]=a;break;case Fl.K:r[4]=a,r[5]=a}return n.extentToBounds(r)},e.getBoundsForSlice=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.slice,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=e.getInputData();if(!s)return Object(b.h)();var a=s.getExtent(),i=e.getClosestIJKAxis(),Q=i.ijkMode,B=n;switch(Q!==t.slicingMode&&(B=e.getSliceAtPosition(n)),Q){case Fl.I:a[0]=B-r,a[1]=B+r;break;case Fl.J:a[2]=B-r,a[3]=B+r;break;case Fl.K:a[4]=B-r,a[5]=B+r}return s.extentToBounds(a)},e.getIsOpaque=function(){return!0},e.intersectWithLineForPointPicking=function(t,n){var s=r(t,n);if(s){var a=e.getInputData().getExtent(),i=[Math.round(s.absoluteIJK[0]),Math.round(s.absoluteIJK[1]),Math.round(s.absoluteIJK[2])];return i[0]a[1]||i[1]a[3]||i[2]a[5]?null:{t:s.t,ijk:i}}return null},e.intersectWithLineForCellPicking=function(t,n){var s=r(t,n);if(s){var a=e.getInputData().getExtent(),i=s.absoluteIJK,Q=[Math.floor(i[0]),Math.floor(i[1]),Math.floor(i[2])];if(Q[0]a[1]-1||Q[1]a[3]-1||Q[2]a[5]-1)return null;var B=[i[0]-Q[0],i[1]-Q[1],i[2]-Q[2]];return{t:s.t,ijk:Q,pCoords:B}}return null}}var cl={displayExtent:[0,0,0,0,0,0],customDisplayExtent:[0,0,0,0],useCustomExtents:!1,slice:0,slicingMode:Fl.NONE,closestIJKAxis:{ijkMode:Fl.NONE,flip:!1},renderToRectangle:!1,sliceAtFocalPoint:!1};function gl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cl,n),$n.extend(e,t,n),B.b.get(e,t,["slicingMode"]),B.b.setGet(e,t,["slice","closestIJKAxis","useCustomExtents","renderToRectangle","sliceAtFocalPoint"]),B.b.setGetArray(e,t,["customDisplayExtent"],4),Fr.implementCoincidentTopologyMethods(e,t),Ul(e,t)}var dl=Ql(Ql(Ql({newInstance:B.b.newInstance(gl,"vtkImageMapper"),extend:gl},Bl),ol),na);var ul=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;return Object(ut.a)(this,i),(t=a.call(this,e)).lookupTable=Ro.newInstance(),t.piecewiseFunction=oo.newInstance(),t.actor=al.newInstance(),t.mapper=dl.newInstance(),t.actor.setMapper(t.mapper),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this;return s.a.createElement(kB.Consumer,null,(function(t){return e.view||(t.renderer.addActor(e.actor),e.view=t),s.a.createElement(TB.Provider,{value:e},s.a.createElement(wB.Provider,{value:e.mapper},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children)))}))}},{key:"componentDidMount",value:function(){this.update(this.props)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.view&&this.view.renderer.removeActor(this.actor),this.actor.delete(),this.actor=null,this.mapper.delete(),this.mapper=null}},{key:"update",value:function(e,t){var n,r=e.actor,s=e.property,a=e.mapper,i=e.colorMapPreset,B=e.colorDataRange,o=e.iSlice,l=e.jSlice,F=e.kSlice,U=e.xSlice,c=e.ySlice,g=e.zSlice;if(!r||t&&r===t.actor||this.actor.set(r),!s||t&&s===t.property||this.actor.getProperty().set(s),!a||t&&a===t.mapper||this.mapper.set(a),i&&(!t||i!==t.colorMapPreset)){var d,u=Uo.getPresetByName(i);this.lookupTable.applyColorMap(u),(d=this.lookupTable).setMappingRange.apply(d,Object(Q.a)(B)),this.lookupTable.updateRange()}!B||t&&B===t.colorDataRange||("string"==typeof B?t?this.dataChanged():(this.lookupTable.setMappingRange(0,1),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:0,y:0,midpoint:.5,sharpness:0},{x:1,y:1,midpoint:.5,sharpness:0}])):((n=this.lookupTable).setMappingRange.apply(n,Object(Q.a)(B)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:B[0],y:0,midpoint:.5,sharpness:0},{x:B[1],y:1,midpoint:.5,sharpness:0}]))),!o||t&&o===t.iSlice||this.mapper.setISlice(o),!l||t&&l===t.jSlice||this.mapper.setJSlice(l),!F||t&&F===t.kSlice||this.mapper.setKSlice(F),!U||t&&U===t.xSlice||this.mapper.setXSlice(U),!c||t&&c===t.ySlice||this.mapper.setYSlice(c),!g||t&&g===t.zSlice||this.mapper.setZSlice(g)}},{key:"dataChanged",value:function(){if("auto"===this.props.colorDataRange){this.mapper.update();var e,t=this.mapper.getInputData(),n=t&&t.getPointData().getScalars(),r=n&&n.getRange();r&&((e=this.lookupTable).setMappingRange.apply(e,Object(Q.a)(r)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:r[0],y:0,midpoint:.5,sharpness:0},{x:r[1],y:1,midpoint:.5,sharpness:0}])),this.view&&this.view.renderView()}}}]),i}();ul.defaultProps={colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto"},ul.propTypes={id:i.a.string,mapper:i.a.object,actor:i.a.object,property:i.a.object,colorMapPreset:i.a.string,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string]),iSlice:i.a.number,jSlice:i.a.number,kSlice:i.a.number,xSlice:i.a.number,ySlice:i.a.number,zSlice:i.a.number,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var Il=ul,ml='',Cl='',bl='',yl=function(){function e(e,t){for(var n=0;n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:null,n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments[3];return new Promise((function(a,i){var Q=n._messageId++;n._messages.set(Q,[a,i,s]),n._worker.postMessage([Q,t,e],r||[])}))}},{key:"postMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];return new Promise((function(s,a){var i=t._messageId++;t._messages.set(i,[s,a,r]),t._worker.postMessage([i,e],n||[])}))}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:256,n=[];n.lengtha+Q||Fa+B?U===B?a:a+U/(U-B)*(F-a-B):-U===B?a:a-U/(U+B)*(F-a-B))-a)/U,g=Math.exp(-4*c*c),d=1-c*c,u=1,I=i*(o<1?o*d+(1-o)*g:(2-o)*d+(o-1)*u);I>n[l]&&(n[l]=I)}}return n}function fl(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},s=t[3],a=t[2]/(n.length-1),i=!!r.fillStyle,Q=s+t[1];e.lineWidth=r.lineWidth,e.strokeStyle=r.strokeStyle,e.beginPath(),e.moveTo(t[0],t[1]+t[3]);for(var B=0;B3&&void 0!==arguments[3]?arguments[3]:[0,1];return[r[0]+(e-n[0])/n[2]*(r[1]-r[0]),(t-n[1])/n[3]]}function vl(e,t){var n=t.map((function(t){return Math.abs(t.position-e)})),r=Math.min.apply(Math,Object(Q.a)(n));return n.indexOf(r)}function Jl(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var r=n.offsetX,s=n.offsetY;t&&n.preventDefault(),e(r,s)}}function Wl(){Al.filter((function(e){return e.ready})).forEach((function(e){e.callbacks.forEach((function(t){t.touches===e.touches&&t.clicks===e.count&&t.action.apply(t,Object(Q.a)(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function Xl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(s){var a=s.target.getBoundingClientRect(),i=Array.prototype.map.call(s.touches,(function(e){return[e.pageX-a.left,e.pageY-a.top]})).reduce((function(e,t){return[e[0]+t[0],e[1]+t[1]]}),[0,0]).map((function(e){return e/s.touches.length}));"touchstart"===s.type?(clearTimeout(Al[e].timeout),Al[e].ts=s.timeStamp,Al[e].singleTouche=i,Al[e].touches=s.touches.length):"touchmove"===s.type?(Al[e].ts=0,Al[e].count=0,Al[e].ready=!1):"touchend"===s.type&&(s.timeStamp-Al[e].ts1&&void 0!==arguments[1]?arguments[1]:{},s=r.numberOfBinToConsiders,a=void 0===s?1:s,i=r.numberOfBinsToSkip,Q=void 0===i?1:i,B=r.numberOfComponents,o=void 0===B?1:B,l=r.component,F=void 0===l?0:l;t.histogram=null,t.histogramArray=n,t.dataRange=Object(b.a)(n,F,o);var U=Object(te.a)(t.dataRange,2),c=U[0],g=U[1],d=4,u=Math.floor(n.length/d)||1;u+=u%o;for(var I=0,m=[];Ir;)s.shift();for(var B=s.reduce((function(e,t){return e+t}),0)/r,o=0,l=t.histogram.length;o1){for(var o=t.style.iconSize+t.style.padding,l=o,F=0;r>l;)F+=1,l+=o;switch(F){case 0:var U=e.addGaussian(0,1,.1,0,0),c=t.gaussians[U],g=Vl({},c),d=Nl.adjustPosition;t.activeGaussian=U,t.selectedGaussian=U,B.b.setImmediate((function(){e.onDown(n,r),t.dragAction={originalXY:[0,0],action:d,gaussian:c,originalGaussian:g}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(i<0||i>1||Q<0||Q>1)t.selectedGaussian=-1,t.dragAction=null;else{var u=vl(i,t.gaussians);u!==t.selectedGaussian&&(t.selectedGaussian=u,e.modified())}return!0},e.onHover=function(n,r){var s=20/t.canvas.height,a=Dl(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),i=Object(te.a)(a,2),Q=i[0],B=i[1],o=Dl(n,r,t.graphArea),l=Object(te.a)(o,1)[0],F=Q<0?t.selectedGaussian:vl(Q,t.gaussians);t.canvas.style.cursor="default";var U=t.gaussians[F];if(t.enableRangeZoom&&l>=0&&rt.rangeZoom[1]-c?t.canvas.style.cursor=Ll.adjustZoom:t.canvas.style.cursor=Ll.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:Nl.adjustZoom}}else if(U&&l>=0){var g,d=1-B;g=d>U.height+s?"adjustPosition":d>U.height-s?Math.abs(Q-U.position).5*U.height+s?"adjustPosition":d>.5*U.height-s?Math.abs(Q-U.position)s?"adjustPosition":"adjustWidth",t.canvas.style.cursor=Ll[g];var u=Nl[g],I=Vl({},U);t.dragAction={originalXY:[Q,B],action:u,gaussian:U,originalGaussian:I}}return F!==t.activeGaussian&&(t.activeGaussian=F,e.modified()),!0},e.onDown=function(n,r){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var s=Dl(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],a=vl(s,t.gaussians);t.gaussianSide=0;var i=t.gaussians[a];return i&&(t.gaussianSide=i.position-s),a!==t.selectedGaussian&&s>0&&(t.selectedGaussian=a,e.modified()),!0},e.onDrag=function(n,r){if(t.dragAction){var s=Dl(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),a=Object(te.a)(s,2),i=a[0],Q=a[1];(0,t.dragAction.action)(i,Q,Vl({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=El(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(n,r){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(n,r){return e.onUp(n,r),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(n,r){var s=Dl(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),a=Object(te.a)(s,2),i=a[0],Q=a[1];return i>=0&&e.addGaussian(i,1-Q,.1,0,0),!0},e.onRemoveGaussian=function(n,r){var s=Dl(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],a=vl(s,t.gaussians);return s>=0&&-1!==a&&e.removeGaussian(a),!0},e.bindMouseListeners=function(){if(!t.listeners){var n=function(){return!!t.mouseIsDown},r=function(){for(var e=Al.length,t=arguments.length,n=new Array(t),r=0;r1){var B=Math.round(t.style.iconSize/2-t.style.strokeWidth),o=Math.round(B+a+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(o-a/2,o,B,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(o-B+t.style.strokeWidth+2-a/2,o),e.lineTo(o+B-t.style.strokeWidth-2-a/2,o),e.stroke(),e.moveTo(o-a/2,o-B+t.style.strokeWidth+2),e.lineTo(o-a/2,o+B-t.style.strokeWidth-2),e.stroke(),-1===t.selectedGaussian?(e.fillStyle=t.style.buttonDisableFillColor,e.lineWidth=t.style.buttonDisableStrokeWidth,e.strokeStyle=t.style.buttonDisableStrokeColor):(e.fillStyle=t.style.buttonFillColor,e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor),e.beginPath(),e.arc(o-a/2,o+a/2+t.style.iconSize,B,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(o-B+t.style.strokeWidth+2-a/2,o+a/2+t.style.iconSize),e.lineTo(o+B-t.style.strokeWidth-2-a/2,o+a/2+t.style.iconSize),e.stroke()}if(t.histogram&&fl(e,i,kl(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),fl(e,i,kl(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var l=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,n,r){var s=r||document.createElement("canvas");s.setAttribute("width",t),s.setAttribute("height",256);for(var a=s.getContext("2d"),i=e.getUint8Table(n[0],n[1],t,4),Q=a.getImageData(0,0,t,256),B=0;B<256;B++)Q.data.set(i,4*B*t);for(var o=256*t*4,l=4*t,F=3;F0&&(s=Math.min(s,i)),t.opacities[i]>0&&(a=Math.max(a,i));return[n[0]+s*r,n[0]+a*r]};var n=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var r=n(e);return r&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),r};var r=e.setRangeZoom;e.setRangeZoom=function(){var e=r.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,Object(Q.a)(t.size))}var Yl={histogram:[],numberOfBins:256,histogramArray:null,dataRange:[0,1],gaussians:[],opacities:[],size:[600,300],piecewiseSize:256,colorCanvasMTime:0,gaussianMinimumHeight:.05,style:{backgroundColor:"rgba(255, 255, 255, 1)",histogramColor:"rgba(200, 200, 200, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(0, 0, 150)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",handleColor:"rgb(0, 150, 0)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:20,padding:10,zoomControlHeight:10,zoomControlColor:"#999"},activeGaussian:-1,selectedGaussian:-1,enableRangeZoom:!0,rangeZoom:[0,1]};function wl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yl,n),B.b.obj(e,t),B.b.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),B.b.setGetArray(e,t,["rangeZoom"],2),B.b.get(e,t,["size","canvas","gaussians"]),B.b.event(e,t,"opacityChange"),B.b.event(e,t,"animation"),B.b.event(e,t,"zoomChange"),Ml(e,t)}var Ol=Vl({newInstance:B.b.newInstance(wl,"vtkPiecewiseGaussianWidget"),extend:wl},Tl);var zl={container:"VolumeController-module_container__2HNSO",line:"VolumeController-module_line__3rtqL",button:"VolumeController-module_button__2T-xL",sliderEntry:"VolumeController-module_sliderEntry__27XSC",sliderIcon:"VolumeController-module_sliderIcon__U8YAZ VolumeController-module_button__2T-xL",slider:"VolumeController-module_slider__3PS68",piecewiseEditor:"VolumeController-module_piecewiseEditor__2_jav",select:"VolumeController-module_select__7mbfS",presets:"VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadow:"VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS",buttonDarkBG:"VolumeController-module_buttonDarkBG__3W1zO VolumeController-module_button__2T-xL",presetsDarkBG:"VolumeController-module_presetsDarkBG__2ZI2W VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadowDarkBG:"VolumeController-module_shadowDarkBG__WHYZ- VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS",buttonBrightBG:"VolumeController-module_buttonBrightBG__2dstz VolumeController-module_button__2T-xL",presetsBrightBG:"VolumeController-module_presetsBrightBG__3_VRC VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadowBrightBG:"VolumeController-module_shadowBrightBG__YCHpe VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(".VolumeController-module_container__2HNSO {\n display: flex;\n align-items: stretch;\n flex-direction: column;\n justify-content: space-between;\n position: absolute;\n top: 5px;\n left: 5px;\n background: rgba(128, 128, 128, 0.5);\n border-radius: 5px;\n padding: 2px;\n border: 0.5px solid black;\n box-sizing: border-box;\n}\n\n.VolumeController-module_line__3rtqL {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n}\n\n.VolumeController-module_button__2T-xL {\n cursor: pointer;\n width: 1rem;\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.VolumeController-module_button__2T-xL svg {\n width: 1rem;\n height: 1rem;\n}\n\n.VolumeController-module_sliderEntry__27XSC {\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.VolumeController-module_sliderIcon__U8YAZ {\n height: 1rem;\n}\n\n.VolumeController-module_slider__3PS68 {\n flex: 1;\n min-height: 1rem;\n width: 5px;\n}\n\n.VolumeController-module_piecewiseEditor__2_jav {\n flex: 1;\n}\n\n.VolumeController-module_select__7mbfS {\n flex: 1;\n border: none;\n background: transparent;\n color: white;\n border: none;\n -moz-appearance: none;\n width: 5px;\n}\n\n.VolumeController-module_select__7mbfS select:focus {\n outline: none;\n border: none;\n}\n\n.VolumeController-module_presets__1h4j5 {\n}\n\n.VolumeController-module_shadow__29K9t {\n}\n\n.VolumeController-module_buttonDarkBG__3W1zO {\n}\n\n.VolumeController-module_presetsDarkBG__2ZI2W {\n color: white;\n}\n\n.VolumeController-module_presetsDarkBG__2ZI2W option {\n color: black;\n}\n\n.VolumeController-module_shadowDarkBG__WHYZ- {\n color: white;\n}\n\n.VolumeController-module_shadowDarkBG__WHYZ- option {\n color: black;\n}\n\n.VolumeController-module_buttonBrightBG__2dstz {\n}\n\n.VolumeController-module_presetsBrightBG__3_VRC {\n color: black;\n}\n\n.VolumeController-module_presetsBrightBG__3_VRC option {\n color: white;\n}\n\n.VolumeController-module_shadowBrightBG__YCHpe {\n color: black;\n}\n\n.VolumeController-module_shadowBrightBG__YCHpe option {\n color: white;\n}\n");var Pl=Uo.rgbPresetNames.map((function(e){return'")}));function Kl(e,t){function n(){var e=!!Number(t.el.querySelector(".js-shadow").value);t.actor.getProperty().setShade(e),t.renderWindow.render()}function r(){var e=t.actor.getMapper().getInputData();if(e){var n=e.getPointData().getScalars()||e.getPointData().getArrays()[0],r=t.rescaleColorMap?t.colorDataRange:n.getRange(),s=Uo.getPresetByName(t.el.querySelector(".js-color-preset").value),a=t.actor.getProperty().getRGBTransferFunction(0);a.applyColorMap(s),a.setMappingRange.apply(a,Object(Q.a)(r)),a.updateRange(),t.renderWindow.render()}}function s(){var e=Number(t.el.querySelector(".js-spacing").value),n=t.actor.getMapper().getInputData(),r=.7*Math.sqrt(n.getSpacing().map((function(e){return e*e})).reduce((function(e,t){return e+t}),0));t.actor.getMapper().setSampleDistance(r*Math.pow(2,3*e-1.5)),t.renderWindow.render()}function a(){var e=Number(t.el.querySelector(".js-edge").value);if(0===e)t.actor.getProperty().setUseGradientOpacity(0,!1);else{var n=t.actor.getMapper().getInputData(),r=(n.getPointData().getScalars()||n.getPointData().getArrays()[0]).getRange();t.actor.getProperty().setUseGradientOpacity(0,!0);var s=Math.max(0,e-.3)/.7;t.actor.getProperty().setGradientOpacityMinimumValue(0,.2*(r[1]-r[0])*s*s),t.actor.getProperty().setGradientOpacityMaximumValue(0,1*(r[1]-r[0])*e*e)}t.renderWindow.render()}t.classHierarchy.push("vtkVolumeController"),t.el=document.createElement("div"),t.el.setAttribute("class",zl.container),t.widget=Ol.newInstance({numberOfBins:256,size:t.size}),e.setupContent=function(i,Q,B){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"1",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"erdc_rainbow_bright";e.setActor(Q),e.setRenderWindow(i);var F=t.actor.getMapper().getInputData(),U=F.getPointData().getScalars()||F.getPointData().getArrays()[0],c=t.actor.getProperty().getRGBTransferFunction(0),g=t.actor.getProperty().getScalarOpacity(0),d=B?"DarkBG":"BrightBG",u={};["button","presets","shadow"].forEach((function(e){u[e]=zl["".concat(e).concat(d)]})),t.el.innerHTML='\n
\n
').concat(Cl,'
\n \n \n
\n
\n
\n
').concat(bl,'
\n \n
\n
\n
').concat(ml,'
\n \n
\n
\n
\n ');var I=t.el.querySelector(".js-button"),m=t.el.querySelector(".js-shadow"),C=t.el.querySelector(".js-color-preset"),b=t.el.querySelector(".js-spacing"),y=t.el.querySelector(".js-edge"),S=t.el.querySelector(".js-pwf");t.widget.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(100, 100, 100, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(255, 255, 255)",handleColor:"rgb(50, 150, 50)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:0,padding:10}),t.widget.addGaussian(.5,1,.5,.5,.4),t.widget.setDataArray(U.getData()),t.widget.setColorTransferFunction(c),t.widget.applyOpacity(g),t.widget.setContainer(S),t.widget.bindMouseListeners(),t.colorDataRange=t.widget.getOpacityRange(),I.addEventListener("click",e.toggleVisibility),m.addEventListener("change",n),C.addEventListener("change",r),b.addEventListener("input",s),y.addEventListener("input",a),t.widget.onOpacityChange((function(){t.widget.applyOpacity(g),t.colorDataRange=t.widget.getOpacityRange(),t.rescaleColorMap&&r(),t.renderWindow.getInteractor().isAnimating()||t.renderWindow.render()})),t.widget.onAnimation((function(e){e?t.renderWindow.getInteractor().requestAnimation(t.widget):(t.renderWindow.getInteractor().cancelAnimation(t.widget),t.renderWindow.render())})),c.onModified((function(){t.widget.render(),t.renderWindow.getInteractor().isAnimating()||t.renderWindow.render()})),m.value=Number(o)?"1":"0",C.value=l,n(),r(),s(),a()},e.setContainer=function(n){t.container&&t.container!==n&&t.container.removeChild(t.el),t.container!==n&&(t.container=n,t.container&&t.container.appendChild(t.el),e.modified())};var i=e.setRescaleColorMap;e.setRescaleColorMap=function(e){return!!i(e)&&(r(),!0)},e.toggleVisibility=function(){e.setExpanded(!e.getExpanded())},e.setExpanded=function(e){var n=t.el.querySelectorAll(".js-toggle"),r=n.length;if(t.expanded=e,t.expanded)for(;r--;)n[r].style.display="flex";else for(;r--;)n[r].style.display="none"},e.getExpanded=function(){return t.expanded},e.setSize=t.widget.setSize,e.render=t.widget.render,e.onAnimation=t.widget.onAnimation,e.onModified(e.render),e.setSize.apply(e,Object(Q.a)(t.size))}var jl={size:[600,300],expanded:!0,rescaleColorMap:!1};function _l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jl,n),B.b.obj(e,t),B.b.setGet(e,t,["actor","renderWindow","rescaleColorMap"]),B.b.get(e,t,["widget"]),Kl(e,t)}var ql={newInstance:B.b.newInstance(_l,"vtkVolumeController"),extend:_l};var $l=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;Object(ut.a)(this,i),(t=a.call(this,e)).subscriptions=[],t.containerRef=s.a.createRef();var n=e.size,r=e.rescaleColorMap;return t.controller=ql.newInstance({size:n,rescaleColorMap:r}),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this;return s.a.createElement(kB.Consumer,null,(function(t){return s.a.createElement(TB.Consumer,null,(function(n){return e.view=t,e.representation=n,s.a.createElement("div",{ref:e.containerRef})}))}))}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(e,t,n){var r;(r=this.controller).setSize.apply(r,Object(Q.a)(this.props.size)),this.controller.render()}},{key:"componentWillUnmount",value:function(){for(;this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.controller.setContainer(null),this.controller.delete(),this.controller=null}},{key:"init",value:function(){var e=this,t=this.containerRef.current,n=this.view,r=n.renderWindow,s=n.props,a=this.representation.volume,i=s.background[0]+s.background[1]+s.background[2]<1.5;if(a&&a.getMapper()&&a.getMapper().getInputData()){var Q=a.getMapper().getInputData();this.controller.setContainer(t),this.controller.setupContent(r,a,i),this.controller.render(),this.view.resetCamera(),this.view.renderView(),this.subscriptions.push(Q.onModified((function(){return e.onDataChange()}),-1))}else setTimeout((function(){return e.init()}),100)}},{key:"onDataChange",value:function(){var e=this.controller.getWidget();if(this.representation&&this.representation.volume){var t=this.representation.volume.getMapper().getInputData(),n=t.getPointData().getScalars()||t.getPointData().getArrays()[0];e.setDataArray(n.getData())}}}]),i}();$l.defaultProps={size:[400,150],rescaleColorMap:!0},$l.propTypes={id:i.a.string,size:i.a.arrayOf(i.a.number),rescaleColorMap:i.a.bool};var eF=$l;function tF(e){return s.a.createElement(MB.Consumer,null,(function(t){return s.a.createElement(YB.Provider,{value:t.getPointData()},e.children)}))}tF.defaultProps={},tF.propTypes={children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var nF=tF;var rF=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;return Object(ut.a)(this,i),(t=a.call(this,e)).polydata=F.a.newInstance(),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this;return s.a.createElement(TB.Consumer,null,(function(t){return s.a.createElement(wB.Consumer,null,(function(n){return e.representation=t,e.downstream||(e.downstream=n),s.a.createElement(MB.Provider,{value:e.polydata},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}))}},{key:"componentDidMount",value:function(){this.update(this.props),this.downstream.setInputData(this.polydata,this.props.port)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.polydata.delete(),this.polydata=null}},{key:"update",value:function(e,t){var n=e.connectivity,r=e.points,s=e.verts,a=e.lines,i=e.polys,Q=e.strips,B=!1,o=r&&r.length>196608?Uint32Array:Uint16Array;if(!r||t&&r===t.points||(this.polydata.getPoints().setData(Float64Array.from(r),3),B=!0),!s||t&&s===t.verts||(this.polydata.getVerts().setData(o.from(s)),B=!0),!a||t&&a===t.lines||(this.polydata.getLines().setData(o.from(a)),B=!0),!i||t&&i===t.polys||(this.polydata.getPolys().setData(o.from(i)),B=!0),!Q||t&&Q===t.strips||(this.polydata.getStrips().setData(o.from(Q)),B=!0),n&&(n||!t||n!==t.connectivity)){var l=r.length/3;switch(n){case"points":var F=new Uint32Array(l+1);F[0]=l;for(var U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,n),B.b.obj(e,t),B.b.algo(e,t,1,1),QF(e,t)}),"vtkTrivialProducer"),oF={},lF=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(){return Object(ut.a)(this,i),a.apply(this,arguments)}return Object(It.a)(i,[{key:"getTrivialProducer",value:function(){var e=oF[this.props.name];return e||(e=BF(),oF[this.props.name]=e),e}},{key:"render",value:function(){var e=this;return s.a.createElement(wB.Consumer,null,(function(t){return e.downstream||(e.downstream=t),s.a.createElement(wB.Provider,{value:e.getTrivialProducer()},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}},{key:"componentDidMount",value:function(){this.downstream&&this.downstream.setInputConnection(this.getTrivialProducer().getOutputPort(),this.props.port)}}]),i}();lF.defaultProps={port:0,name:"shared"},lF.propTypes={id:i.a.string,port:i.a.number,name:i.a.string,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var FF=lF;function UF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var cF=B.b.vtkDebugMacro;function gF(e,t){t.classHierarchy.push("vtkActor");var n=function(e){for(var t=1;t=1;return(n=n&&(!t.texture||!t.texture.isTranslucent()))&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return null!==t.mapper&&(null===t.property&&e.setProperty(e.makeProperty()),!e.getIsOpaque())},e.makeProperty=Ln.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||n[0]!==t.mapperBounds[0]||n[1]!==t.mapperBounds[1]||n[2]!==t.mapperBounds[2]||n[3]!==t.mapperBounds[3]||n[4]!==t.mapperBounds[4]||n[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){cF("Recomputing bounds..."),t.mapperBounds=n.concat();var r=[Object(G.f)(n[1],n[3],n[5]),Object(G.f)(n[1],n[2],n[5]),Object(G.f)(n[0],n[2],n[5]),Object(G.f)(n[0],n[3],n[5]),Object(G.f)(n[1],n[3],n[4]),Object(G.f)(n[1],n[2],n[4]),Object(G.f)(n[0],n[2],n[4]),Object(G.f)(n[0],n[3],n[4])];e.computeMatrix();var s=Object(x.h)();Object(x.j)(s,t.matrix),r.forEach((function(e){return Object(G.q)(e,e,s)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?r.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):r.reduce((function(e,n){return ee?r:e}if(null!==t.backfaceProperty){var s=t.backfaceProperty.getMTime();e=s>e?s:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var dF={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function uF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dF,n),so.extend(e,t,n),t.boundsMTime={},B.b.obj(t.boundsMTime),B.b.set(e,t,["property"]),B.b.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),gF(e,t)}var IF={newInstance:B.b.newInstance(uF,"vtkActor"),extend:uF};var mF=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;return Object(ut.a)(this,i),(t=a.call(this,e)).actor=IF.newInstance(),t.lookupTable=Ro.newInstance(),t.mapper=Gr.newInstance({lookupTable:t.lookupTable,useLookupTableScalarRange:!0}),t.actor.setMapper(t.mapper),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this;return s.a.createElement(kB.Consumer,null,(function(t){return e.view||(t.renderer.addActor(e.actor),e.view=t),s.a.createElement(TB.Provider,{value:e},s.a.createElement(wB.Provider,{value:e.mapper},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children)))}))}},{key:"componentDidMount",value:function(){this.update(this.props)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.view&&this.view.renderer.removeActor(this.actor),this.actor.delete(),this.actor=null,this.mapper.delete(),this.mapper=null,this.lookupTable.delete(),this.lookupTable=null}},{key:"update",value:function(e,t){var n,r=e.actor,s=e.mapper,a=e.property,i=e.colorMapPreset,B=e.colorDataRange;if(!r||t&&r===t.actor||this.actor.set(r),!s||t&&s===t.mapper||this.mapper.set(s),!a||t&&a===t.property||this.actor.getProperty().set(a),i&&(!t||i!==t.colorMapPreset)){var o,l=Uo.getPresetByName(i);this.lookupTable.applyColorMap(l),(o=this.lookupTable).setMappingRange.apply(o,Object(Q.a)(B)),this.lookupTable.updateRange()}!B||t&&B===t.colorDataRange||((n=this.lookupTable).setMappingRange.apply(n,Object(Q.a)(B)),this.lookupTable.updateRange())}},{key:"dataChanged",value:function(){this.view&&this.view.renderView()}}]),i}();mF.defaultProps={colorMapPreset:"erdc_rainbow_bright",colorDataRange:[0,1]},mF.propTypes={id:i.a.string,actor:i.a.object,mapper:i.a.object,property:i.a.object,colorMapPreset:i.a.string,colorDataRange:i.a.arrayOf(i.a.number),children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var CF=mF,bF={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function yF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var SF=bF.OrientationModes,ZF=bF.ScaleModes,xF=B.b.vtkErrorMacro;function GF(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return B.b.enumToString(SF,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode(SF.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode(SF.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode(SF.MATRIX)},e.getOrientationArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.orientationArray?n.getPointData().getArray(t.orientationArray):n.getPointData().getVectors():null},e.getScaleModeAsString=function(){return B.b.enumToString(ZF,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(ZF.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(ZF.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(ZF.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.scaleArray?n.getPointData().getArray(t.scaleArray):n.getPointData().getScalars():null},e.getBounds=function(){var n=e.getInputData(0),r=e.getInputData(1);return n&&r?(e.buildArrays(),t.bounds):Object(b.h)()},e.buildArrays=function(){var n=e.getInputData(0),r=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=F[0]),F[1]>t.bounds[3]&&(t.bounds[3]=F[1]),F[2]>t.bounds[5]&&(t.bounds[5]=F[2]);var N=new Float32Array(m,36*y,9);ke(N,S),Ye(N,N),Me(N,N)}var E=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var f=e.getLookupTable();f&&E&&(f.build(),t.colorArray=f.mapScalars(E,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),n=e.getInputData().getPoints().getNumberOfValues()/3;return{points:n*t.getPoints().getNumberOfValues()/3,verts:n*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:n*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:n*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var hF={orient:!0,orientationMode:SF.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:ZF.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function pF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hF,n),Gr.extend(e,t,n),B.b.algo(e,t,2,0),t.buildTime={},B.b.obj(t.buildTime,{mtime:0}),t.boundsTime={},B.b.obj(t.boundsTime,{mtime:0}),B.b.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),B.b.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),GF(e,t)}var RF=function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:{};return{getArrays:function(){return{input:e.augmentInputArrays(t,n.map((function(e){return{location:t,name:e}}))),output:[{location:t,name:r,attribute:"outputAttributeType"in a?a.outputAttributeType:kF.a.SCALARS,numberOfComponents:"numberOfOutputComponents"in a?a.numberOfOutputComponents:1}]}},evaluate:function(e,t){var n=new Array(e.length),r=e.map((function(e,t){var r=e.getNumberOfComponents(),s=e.getData();return 1===r?function(e){return s[e]}:function(r){return e.getTuple(r,n[t])}})),a=t[0],i=a.getData(),B=a.getNumberOfComponents(),o=new Array(B);if(1===B)i.forEach((function(e,t){i[t]=s.apply(void 0,Object(Q.a)(r.map((function(e){return e(t)}))).concat([t,o]))}));else for(var l=a.getNumberOfTuples(),F=function(e){o=s.apply(void 0,Object(Q.a)(r.map((function(t){return t(e)}))).concat([e,o])),a.setTuple(e,o)},U=0;U4&&void 0!==arguments[4]?arguments[4]:{};return e.setFormula(e.createSimpleFormulaObject(t,n,r,s,a))},e.prepareArrays=function(e,t,n){var r=[],s=[];return e.input.forEach((function(e){if(e.location===TF.a.COORDINATE)r.push(t.getPoints());else{var n=[[TF.a.UNIFORM,function(e){return e.getFieldData()}],[TF.a.POINT,function(e){return e.getPointData()}],[TF.a.CELL,function(e){return e.getCellData()}],[TF.a.VERTEX,function(e){return e.getVertexData()}],[TF.a.EDGE,function(e){return e.getEdgeData()}],[TF.a.ROW,function(e){return e.getRowData()}]].reduce((function(e,t){return e[t[0]]=t[1],e}),{}),s="location"in e&&e.location in n?n[e.location](t):null;s?e.name?r.push(s.getArrayByName(e.name)):"index"in e?r.push(s.getArrayByIndex(e.index)):"attribute"in e&&e.location!==TF.a.UNIFORM?r.push(s.getActiveAttribute(e.attribute)):(YF('No matching array for specifier "'.concat(JSON.stringify(e),'".')),r.push(null)):(YF('Specifier "'.concat(JSON.stringify(e),'" did not provide a usable location.')),r.push(null))}})),e.output.forEach((function(e){var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OF,n),B.b.obj(e,t),B.b.algo(e,t,1,1),wF(e,t)}var PF={newInstance:B.b.newInstance(zF,"vtkCalculator"),extend:zF};var KF=Ee.a.FieldDataTypes,jF=function(e){bt(i,r.Component);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=xt(t);if(n){var s=xt(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return Zt(this,e)});function i(e){var t;return Object(ut.a)(this,i),(t=a.call(this,e)).calculator=PF.newInstance(),t}return Object(It.a)(i,[{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.arrays,a=t.location,i=t.formula;return this.calculator.setFormulaSimple(KF[a],r,n,i),s.a.createElement(wB.Consumer,null,(function(t){return e.downstream||(t.setInputConnection(e.calculator.getOutputPort(),e.props.port),e.downstream=t),s.a.createElement(wB.Provider,{value:e.calculator},s.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}},{key:"componentWillUnmount",value:function(){this.calculator.delete(),this.calculator=null}}]),i}();jF.defaultProps={port:0,name:"scalars",location:"POINT",arrays:[],formula:function(e){return e[0]}},jF.propTypes={id:i.a.string,port:i.a.number,name:i.a.string,location:i.a.string,arrays:i.a.arrayOf(i.a.string),formula:i.a.func,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var _F=jF;function qF(e){return s.a.createElement(MB.Consumer,null,(function(t){return s.a.createElement(YB.Provider,{value:t.getCellData()},e.children)}))}qF.defaultProps={},qF.propTypes={children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var $F={VolumeRepresentation:Po,SliceRepresentation:Il,VolumeController:eF,PointData:nF,PolyData:sF,Reader:iF,ShareDataSet:FF,View:KB,GeometryRepresentation:CF,GlyphRepresentation:LF,ImageData:NF,DataArray:fF,FieldData:vF,Algorithm:HF,Calculator:_F,CellData:qF};function eU(e){var t=0,n=null,r=null;return e.rgb&&(n=e.rgb,t=3,r="Uint8Array"),e.rgba&&(n=e.rgb,t=4,r="Uint8Array"),e.scalars&&(n=e.scalars,t=1,r="Float32Array"),console.log("nbComponents",t),s.a.createElement(CF,{id:e.id,colorMapPreset:e.colorMapPreset,colorDataRange:e.colorDataRange,property:e.property},s.a.createElement(sF,{points:e.xyz,connectivity:"points"},t&&s.a.createElement(nF,null,s.a.createElement(fF,{registration:"setScalars",numberOfComponents:t,values:n,type:r}))))}eU.defaultProps={xyz:[0,0,0],colorMapPreset:"erdc_rainbow_bright",colorDataRange:[0,1]},eU.propTypes={id:i.a.string,xyz:i.a.arrayOf(i.a.number),rgb:i.a.arrayOf(i.a.number),rgba:i.a.arrayOf(i.a.number),scalars:i.a.arrayOf(i.a.number),colorMapPreset:i.a.string,colorDataRange:i.a.arrayOf(i.a.number),property:i.a.object};var tU=eU;function nU(e){var t=0,n=null,r=null;return e.rgb&&(n=e.rgb,t=3,r="Uint8Array"),e.rgba&&(n=e.rgb,t=4,r="Uint8Array"),e.scalars&&(n=e.scalars,t=1,r=e.scalarsType),s.a.createElement(Po,{id:e.id,colorMapPreset:e.colorMapPreset,colorDataRange:e.colorDataRange,property:e.property,mapper:e.mapper,volume:e.volume},e.volumeController&&s.a.createElement(eF,{rescaleColorMap:e.rescaleColorMap,size:e.controllerSize}),s.a.createElement(NF,{dimensions:e.dimensions,origin:e.origin,spacing:e.spacing},s.a.createElement(nF,null,s.a.createElement(fF,{registration:"setScalars",numberOfComponents:t,values:n,type:r}))))}nU.defaultProps={scalarsType:"Float32Array",colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto",volumeController:!0,rescaleColorMap:!0,controllerSize:[400,150]},nU.propTypes={id:i.a.string,dimensions:i.a.arrayOf(i.a.number),spacing:i.a.arrayOf(i.a.number),origin:i.a.arrayOf(i.a.number),rgb:i.a.arrayOf(i.a.number),rgba:i.a.arrayOf(i.a.number),scalars:i.a.arrayOf(i.a.number),scalarsType:i.a.string,mapper:i.a.object,volume:i.a.object,property:i.a.object,colorMapPreset:i.a.string,volumeController:i.a.bool,controllerSize:i.a.arrayOf(i.a.number),rescaleColorMap:i.a.bool,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string])};var rU={PointCloudRepresentation:tU,VolumeDataRepresentation:nU},sU=$F.VolumeRepresentation,aU=$F.SliceRepresentation,iU=$F.VolumeController,QU=$F.PointData,BU=$F.PolyData,oU=$F.Reader,lU=$F.ShareDataSet,FU=$F.View,UU=$F.GeometryRepresentation,cU=$F.GlyphRepresentation,gU=$F.ImageData,dU=$F.DataArray,uU=$F.FieldData,IU=$F.Algorithm,mU=$F.Calculator,CU=$F.CellData,bU=rU.PointCloudRepresentation,yU=rU.VolumeDataRepresentation;function SU(e){return s.a.createElement(IU,e)}function ZU(e){return s.a.createElement(mU,e)}function xU(e){return s.a.createElement(CU,e)}function GU(e){return s.a.createElement(dU,e)}function hU(e){return s.a.createElement(uU,e)}function pU(e){return s.a.createElement(UU,e)}function RU(e){return s.a.createElement(cU,e)}function VU(e){return s.a.createElement(gU,e)}function LU(){return(LU=Object.assign||function(e){for(var t=1;te.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}a||(a=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(l),r.push(e.getParameter(i),null);break;case e.ACTIVE_TEXTURE:a=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(i))}for(n(e),s=0;se.TEXTURE31)break;e.activeTexture(l),e.bindTexture(e.TEXTURE_2D,o);break;case e.TEXTURE_BINDING_CUBE_MAP:var l;if((l=t[++s])e.TEXTURE31)break;e.activeTexture(l),e.bindTexture(e.TEXTURE_CUBE_MAP,o);break;case e.VIEWPORT:e.viewport(o[0],o[1],o[2],o[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:o?e.enable(i):e.disable(i);break;default:console.log("No GL restore behavior for 0x"+i.toString(16))}a&&e.activeTexture(a)}}else n(e)},L=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),V=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function A(e,t,n,r){this.gl=e,this.cardboardUI=t,this.bufferScale=n,this.dirtySubmitFrameBindings=r,this.ctxAttribs=e.getContextAttributes(),this.instanceExt=e.getExtension("ANGLE_instanced_arrays"),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,o()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=C(e,L,V,this.attribs),this.uniforms=b(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}A.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},A.prototype.onResize=function(){var e=this.gl,t=this,n=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];R(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)})),this.cardboardUI&&this.cardboardUI.onResize()},A.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,n=this.gl;o()||(t.width=u()*this.bufferScale,t.height=I()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(n){e.bufferWidth=n,e.realCanvasWidth.set.call(t,n),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(n){e.bufferHeight=n,e.realCanvasHeight.set.call(t,n),e.onResize()}})),this.lastBoundFramebuffer=n.getParameter(n.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r||e.framebuffer,e.realBindFramebuffer.call(n,t,e.lastBoundFramebuffer)},this.cullFace=n.getParameter(n.CULL_FACE),this.depthTest=n.getParameter(n.DEPTH_TEST),this.blend=n.getParameter(n.BLEND),this.scissorTest=n.getParameter(n.SCISSOR_TEST),this.stencilTest=n.getParameter(n.STENCIL_TEST),n.enable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!0;break;case n.DEPTH_TEST:e.depthTest=!0;break;case n.BLEND:e.blend=!0;break;case n.SCISSOR_TEST:e.scissorTest=!0;break;case n.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(n,t)},n.disable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!1;break;case n.DEPTH_TEST:e.depthTest=!1;break;case n.BLEND:e.blend=!1;break;case n.SCISSOR_TEST:e.scissorTest=!1;break;case n.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(n,t)},this.colorMask=n.getParameter(n.COLOR_WRITEMASK),n.colorMask=function(t,r,a,s){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=a,e.colorMask[3]=s,e.realColorMask.call(n,t,r,a,s)},this.clearColor=n.getParameter(n.COLOR_CLEAR_VALUE),n.clearColor=function(t,r,a,s){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=a,e.clearColor[3]=s,e.realClearColor.call(n,t,r,a,s)},this.viewport=n.getParameter(n.VIEWPORT),n.viewport=function(t,r,a,s){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=a,e.viewport[3]=s,e.realViewport.call(n,t,r,a,s)},this.isPatched=!0,x(t)}},A.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;o()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout((function(){x(t)}),1)}},A.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},A.prototype.submitFrame=function(){var e=this.gl,t=this,n=[];if(this.dirtySubmitFrameBindings||n.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),R(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null);var n=0,r=0;t.instanceExt&&(n=e.getVertexAttrib(t.attribs.position,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),r=e.getVertexAttrib(t.attribs.texCoord,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||o())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,0),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,0)),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,n),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,r))})),o()){var r=e.canvas;r.width==t.bufferWidth&&r.height==t.bufferHeight||(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},A.prototype.updateDeviceInfo=function(e){var t=this.gl,n=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];R(t,r,(function(t){var r=n.computeMeshVertices_(n.meshWidth,n.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,n.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!n.indexCount){var a=n.computeMeshIndices_(n.meshWidth,n.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,a,t.STATIC_DRAW),n.indexCount=a.length}}))},A.prototype.computeMeshVertices_=function(e,t,n){for(var r=new Float32Array(2*e*t*5),a=n.getLeftEyeVisibleTanAngles(),s=n.getLeftEyeNoLensTanAngles(),o=n.getLeftEyeVisibleScreenRect(s),l=0,B=0;B<2;B++){for(var Q=0;Qa-42&&r.clientXn.clientHeight-42?e(r):r.clientX<42&&r.clientY<42&&t(r)},n.addEventListener("click",this.listener,!1)},J.prototype.onResize=function(){var e=this.gl,t=this,n=[e.ARRAY_BUFFER_BINDING];R(e,n,(function(e){var n=[],r=e.drawingBufferWidth/2,a=Math.max(screen.width,screen.height)*window.devicePixelRatio,s=e.drawingBufferWidth/a*window.devicePixelRatio,i=4*s/2,o=42*s,l=v*s/2,B=14*s;function Q(e,t){var a=(90-e)*E,s=Math.cos(a),i=Math.sin(a);n.push(D*s*l+r,D*i*l+l),n.push(t*s*l+r,t*i*l+l)}n.push(r-i,o),n.push(r-i,e.drawingBufferHeight),n.push(r+i,o),n.push(r+i,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var c=0;c<=6;c++){var F=60*c;Q(F,1),Q(F+12,1),Q(F+20,.75),Q(F+40,.75),Q(F+48,1)}function U(t,r){n.push(B+t,e.drawingBufferHeight-B-r)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var g=i/Math.sin(45*E);U(0,l),U(l,0),U(l+g,g),U(g,l+g),U(g,l-g),U(0,l),U(l,2*l),U(l+g,2*l-g),U(g,l-g),U(0,l),U(g,l-i),U(v*s,l-i),U(g,l+i),U(v*s,l+i),t.arrowVertexCount=n.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW)}))},J.prototype.render=function(){var e=this.gl,t=this,n=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];R(e,n,(function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()}))},J.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),function(e,t,n,r,a,s,i){var o=1/(t-n),l=1/(r-a),B=1/(s-i);e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*B,e[11]=0,e[12]=(t+n)*o,e[13]=(a+r)*l,e[14]=(i+s)*B,e[15]=1}(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},W.prototype.distortInverse=function(e){for(var t=0,n=1,r=e-this.distort(t);Math.abs(n-t)>1e-4;){var a=e-this.distort(n),s=n-a*((n-t)/(a-r));t=n,n=s,r=a}return n},W.prototype.distort=function(e){for(var t=e*e,n=0,r=0;r=1)return this.w=s,this.x=n,this.y=r,this.z=a,this;var o=Math.acos(i),l=Math.sqrt(1-i*i);if(Math.abs(l)<.001)return this.w=.5*(s+this.w),this.x=.5*(n+this.x),this.y=.5*(r+this.y),this.z=.5*(a+this.z),this;var B=Math.sin((1-t)*o)/l,Q=Math.sin(t*o)/l;return this.w=s*B+this.w*Q,this.x=n*B+this.x*Q,this.y=r*B+this.y*Q,this.z=a*B+this.z*Q,this},setFromUnitVectors:(1e-6,function(e,t){return void 0===k&&(k=new T),(M=e.dot(t)+1)<1e-6?(M=0,Math.abs(e.x)>Math.abs(e.z)?k.set(-e.y,e.x,0):k.set(0,-e.z,e.y)):k.crossVectors(e,t),this.x=k.x,this.y=k.y,this.z=k.z,this.w=M,this.normalize(),this})};var O=new Y({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),z=new Y({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),P={CardboardV1:new j({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new j({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function K(e,t){this.viewer=P.CardboardV2,this.updateDeviceParams(e),this.distortion=new W(this.viewer.distortionCoefficients);for(var n=0;n=200&&n.status<=299?(r.dpdb=JSON.parse(n.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")})),n.send()}}function $(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function ee(e,t){this.set(e,t)}function te(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new ee,this.currentGyroMeasurement=new ee,this.previousGyroMeasurement=new ee,o()?this.filterQ=new w(-1,0,0,1):this.filterQ=new w(1,0,0,1),this.previousFilterQ=new w,this.previousFilterQ.copy(this.filterQ),this.accelQ=new w,this.isOrientationInitialized=!1,this.estimatedGravity=new T,this.measuredGravity=new T,this.gyroIntegralQ=new w}function ne(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new w,this.previousTimestampS=null,this.deltaQ=new w,this.outQ=new w}function re(e,t,n,r){this.yawOnly=n,this.accelerometer=new T,this.gyroscope=new T,this.filter=new te(e,r),this.posePredictor=new ne(t,r),this.isFirefoxAndroid=Q(),this.isIOS=o();var a=c();this.isDeviceMotionInRadians=!this.isIOS&&a&&a<66,this.isWithoutDeviceMotion=U()||F(),this.filterToWorldQ=new w,o()?this.filterToWorldQ.setFromAxisAngle(new T(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new T(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new w,this.worldToScreenQ=new w,this.originalPoseAdjustQ=new w,this.originalPoseAdjustQ.setFromAxisAngle(new T(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),d()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new w,this.orientationOut_=new Float32Array(4),this.start()}q.prototype.getDeviceParams=function(){return this.deviceParams},q.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},q.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,n=u(),r=I();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var a=0;a1)}(t-this.previousGyroMeasurement.timestampS)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},te.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var n=new w;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new w;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",H*function(e){return e.w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(e.w)}(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new w;a.copy(this.filterQ),a.multiply(r),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},te.prototype.getOrientation=function(){return this.filterQ},te.prototype.accelToQuaternion_=function(e){var t=new T;t.copy(e),t.normalize();var n=new w;return n.setFromUnitVectors(new T(0,0,-1),t),n.inverse(),n},te.prototype.gyroToQuaternionDelta_=function(e,t){var n=new w,r=new T;return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*t),n},ne.prototype.getPrediction=function(e,t,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new T;r.copy(t),r.normalize();var a=t.length();if(a<20*X)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(H*a).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=n,this.outQ},re.prototype.getPosition=function(){return null},re.prototype.getOrientation=function(){var e=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||(n=(new w).setFromAxisAngle(new T(0,0,-1),0),r=new w,-90===window.orientation?r.setFromAxisAngle(new T(0,1,0),Math.PI/-2):r.setFromAxisAngle(new T(0,1,0),Math.PI/2),n.multiply(r)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((t=new w).setFromAxisAngle(new T(1,0,0),-Math.PI/2),t),e=this._deviceOrientationQ,(a=new w).copy(e),a.multiply(this.deviceOrientationFilterToWorldQ),a.multiply(this.resetQ),a.multiply(this.worldToScreenQ),a.multiplyQuaternions(this.deviceOrientationFixQ,a),this.yawOnly&&(a.x=0,a.z=0,a.normalize()),this.orientationOut_[0]=a.x,this.orientationOut_[1]=a.y,this.orientationOut_[2]=a.z,this.orientationOut_[3]=a.w,this.orientationOut_;var t,n,r,a,s=this.filter.getOrientation();return e=this.posePredictor.getPrediction(s,this.gyroscope,this.previousTimestampS),(a=new w).copy(this.filterToWorldQ),a.multiply(this.resetQ),a.multiply(e),a.multiply(this.worldToScreenQ),this.yawOnly&&(a.x=0,a.z=0,a.normalize()),this.orientationOut_[0]=a.x,this.orientationOut_[1]=a.y,this.orientationOut_[2]=a.z,this.orientationOut_[3]=a.w,this.orientationOut_},re.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),d()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},re.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new w;var t=e.alpha,n=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(n,t,-r)},re.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},re.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,n=e.rotationRate,r=e.timeStamp/1e3,a=r-this.previousTimestampS;return a<0?(p("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=r)):a<=.001||a>1?(p("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),n&&(g()?this.gyroscope.set(-n.beta,n.alpha,n.gamma):this.gyroscope.set(n.alpha,n.beta,n.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,r)),this.filter.addAccelMeasurement(this.accelerometer,r),void(this.previousTimestampS=r))},re.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},re.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},re.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new T(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new T(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},re.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),o()&&function(){var e=window.self!==window.top,t=h(document.referrer),n=h(window.location.href);return e&&t!==n}()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},re.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)};var ae=new T(1,0,0),se=new T(0,0,1),ie=new w;ie.setFromAxisAngle(ae,-Math.PI/2),ie.multiply((new w).setFromAxisAngle(se,Math.PI/2));var oe=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new w,this._outQ=new w,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return a(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:60,referenceFrame:"screen"})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new re(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(ie),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}();function le(){this.loadIcon_();var e=document.createElement("div");(s=e.style).position="fixed",s.top=0,s.right=0,s.bottom=0,s.left=0,s.backgroundColor="gray",s.fontFamily="sans-serif",s.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(s=t.style).marginLeft="25%",s.marginTop="25%",s.width="50%",e.appendChild(t);var n=document.createElement("div");(s=n.style).textAlign="center",s.fontSize="16px",s.lineHeight="24px",s.margin="24px 25%",s.width="50%",n.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(n);var r=document.createElement("div");(s=r.style).backgroundColor="#CFD8DC",s.position="fixed",s.bottom=0,s.width="100%",s.height="48px",s.padding="14px 24px",s.boxSizing="border-box",s.color="#656A6B",e.appendChild(r);var a=document.createElement("div");a.style.float="left",a.innerHTML="No Cardboard viewer?";var s,i=document.createElement("a");i.href="https://www.google.com/get/cardboard/get-cardboard/",i.innerHTML="get one",i.target="_blank",(s=i.style).float="right",s.fontWeight=600,s.textTransform="uppercase",s.borderLeft="1px solid gray",s.paddingLeft="24px",s.textDecoration="none",s.color="#656A6B",r.appendChild(a),r.appendChild(i),this.overlay=e,this.text=n,this.hide()}le.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;d()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},le.prototype.hide=function(){this.overlay.style.display="none"},le.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},le.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},le.prototype.update=function(){this.disableShowTemporarily(),!d()&&y()?this.show():this.hide()},le.prototype.loadIcon_=function(){this.icon=function(e,t){return"data:"+e+","+encodeURIComponent(t)}("image/svg+xml","")};var Be="WEBVR_CARDBOARD_VIEWER";function Qe(e){try{this.selectedKey=localStorage.getItem(Be)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||"CardboardV1"),this.dialog=this.createDialog_(K.Viewers),this.root=null,this.onChangeCallbacks_=[]}Qe.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},Qe.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},Qe.prototype.getCurrentViewer=function(){return K.Viewers[this.selectedKey]},Qe.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},Qe.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},Qe.prototype.fireOnChange_=function(e){for(var t=0;t.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return r(e,[{key:"enable",value:function(){s?(this.disable(),this.noSleepTimer=window.setInterval((function(){window.location.href="/",window.setTimeout(window.stop,0)}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){s?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=i},function(e,t,n){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}))),Fe=1e3,Ue=[0,0,.5,1],ge=[.5,0,.5,1],de=window.requestAnimationFrame,ue=window.cancelAnimationFrame;function Ie(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return G("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function me(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=Fe++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return G("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new Ie({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&y()&&(this.wakelock_=new ce)}me.prototype.getFrameData=function(e){return Z(e,this._getPose(),this)},me.prototype.getPose=function(){return G("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},me.prototype.resetPose=function(){return G("VRDisplay.prototype.resetPose"),this._resetPose()},me.prototype.getImmediatePose=function(){return G("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},me.prototype.requestAnimationFrame=function(e){return de(e)},me.prototype.cancelAnimationFrame=function(e){return ue(e)},me.prototype.wrapForFullscreen=function(e){if(o())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var n=this.fullscreenElement_.parentElement;n.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),n.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var r=this;return function(){if(r.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];r.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},me.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},me.prototype.requestPresent=function(e){var t=this.isPresenting,n=this;return e instanceof Array||(G("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise((function(r,a){if(n.capabilities.canPresent)if(0==e.length||e.length>n.capabilities.maxLayers)a(new Error("Invalid number of layers."));else{var s=e[0];if(s.source){var i=s.leftBounds||Ue,B=s.rightBounds||ge;if(t){var Q=n.layer_;Q.source!==s.source&&(Q.source=s.source);for(var c=0;c<4;c++)Q.leftBounds[c]=i[c],Q.rightBounds[c]=B[c];return n.wrapForFullscreen(n.layer_.source),n.updatePresent_(),void r()}if(n.layer_={predistorted:s.predistorted,source:s.source,leftBounds:i.slice(0),rightBounds:B.slice(0)},n.waitingForPresent_=!1,n.layer_&&n.layer_.source){var F=n.wrapForFullscreen(n.layer_.source);n.addFullscreenListeners_(F,(function(){var e=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;n.isPresenting=F===e,n.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch((function(e){console.error("screen.orientation.lock() failed due to",e.message)})),n.waitingForPresent_=!1,n.beginPresent_(),r()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),n.removeFullscreenWrapper(),n.disableWakeLock(),n.endPresent_(),n.removeFullscreenListeners_()),n.fireVRDisplayPresentChange_()}),(function(){n.waitingForPresent_&&(n.removeFullscreenWrapper(),n.removeFullscreenListeners_(),n.disableWakeLock(),n.waitingForPresent_=!1,n.isPresenting=!1,a(new Error("Unable to present.")))})),function(e){if(l())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0}(F)?(n.enableWakeLock(),n.waitingForPresent_=!0):(o()||l())&&(n.enableWakeLock(),n.isPresenting=!0,n.beginPresent_(),n.fireVRDisplayPresentChange_(),r())}n.waitingForPresent_||o()||(m(),a(new Error("Unable to present.")))}else r()}else a(new Error("VRDisplay is not capable of presenting."))}))},me.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(n,r){e?(!m()&&o()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),l()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),n()):r(new Error("Was not presenting to VRDisplay."))}))},me.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},me.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},me.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},me.prototype.addFullscreenListeners_=function(e,t,n){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=n,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),n&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",n,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",n,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",n,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",n,!1))},me.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var n=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",n,!1),e.removeEventListener("webkitfullscreenerror",n,!1),document.removeEventListener("mozfullscreenerror",n,!1),e.removeEventListener("msfullscreenerror",n,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},me.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},me.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},me.prototype.beginPresent_=function(){},me.prototype.endPresent_=function(){},me.prototype.submitFrame=function(e){},me.prototype.getEyeParameters=function(e){return null};var Ce={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},be="left",ye="right";function Se(e){var t=S({},Ce);e=S(t,e||{}),me.call(this,{wakelock:e.MOBILE_WAKE_LOCK}),this.config=e,this.displayName="Cardboard VRDisplay",this.capabilities=new Ie({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new oe(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new q(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new K(this.dpdb_.getDeviceParams(),e.ADDITIONAL_VIEWERS),this.viewerSelector_=new Qe(e.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new le),o()&&window.addEventListener("resize",this.onResize_.bind(this))}return Se.prototype=Object.create(me.prototype),Se.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Se.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Se.prototype._getFieldOfView=function(e){var t;if(e==be)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=ye)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Se.prototype._getEyeOffset=function(e){var t;if(e==be)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=ye)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Se.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),n=this._getFieldOfView(e),r={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(r,"fieldOfView",{enumerable:!0,get:function(){return G("VRFieldOfView","VRFrameData's projection matrices"),n}}),r},Se.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Se.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Se.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(e.canvas.width=u()*this.bufferScale_,e.canvas.height=I()*this.bufferScale_,this.cardboardUI_=new J(e)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new J(e)),this.distorter_=new A(e,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(d()&&y()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Se.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Se.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Se.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var n=t.canvas;n.width==this.lastWidth&&n.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=n.width,this.lastHeight=n.height,this.cardboardUI_.render()}},Se.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Se.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));t.canvas.setAttribute("style",["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"].join("; ")+";"),x(t.canvas)}},Se.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Se.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},Se.VRFrameData=function(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null},Se.VRDisplay=me,Se}))}))),s={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function i(e){this.config=r(r({},s),e),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in navigator,this.native={},this.native.getVRDisplays=navigator.getVRDisplays,this.native.VRFrameData=window.VRFrameData,this.native.VRDisplay=window.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&t())&&(this.enable(),this.getVRDisplays().then((function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()})))}i.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(t()){var e=new a({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},i.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var e=this.native.VRFrameData,t=new this.native.VRFrameData,r=this.native.VRDisplay.prototype.getFrameData;window.VRDisplay.prototype.getFrameData=function(a){a instanceof e?r.call(this,a):(r.call(this,t),a.pose=t.pose,n(t.leftProjectionMatrix,a.leftProjectionMatrix),n(t.rightProjectionMatrix,a.rightProjectionMatrix),n(t.leftViewMatrix,a.leftViewMatrix),n(t.rightViewMatrix,a.rightViewMatrix))}}navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=a.VRDisplay,window.VRFrameData=a.VRFrameData},i.prototype.getVRDisplays=function(){var e=this;return this.config,this.hasNative?this.native.getVRDisplays.call(navigator).then((function(t){return t.length>0?t:e.getPolyfillDisplays()})):Promise.resolve(this.getPolyfillDisplays())},i.version="0.10.12",i.VRFrameData=a.VRFrameData,i.VRDisplay=a.VRDisplay;var o=Object.freeze({default:i}),l=o&&i||o;return void 0!==e&&e.window&&(e.document||(e.document=e.window.document),e.navigator||(e.navigator=e.window.navigator)),l}()}),"/$$rollup_base$$/node_modules/webvr-polyfill/build")),To=l.c.vtkDebugMacro,ko=l.c.vtkErrorMacro,Mo=-1!==navigator.userAgent.indexOf("Chrome");function wo(e,t,n){var r=e.createFramebuffer(),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,n,null),e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);var s=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),s===e.FRAMEBUFFER_COMPLETE}var Yo=0,Oo=[];function zo(){Yo++,Oo.forEach((function(e){return e(Yo)}))}function Po(){Yo--,Oo.forEach((function(e){return e(Yo)}))}function Ko(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow");var n=[0,0];e.onModified((function(){t.renderable&&(t.size[0]===n[0]&&t.size[1]===n[1]||(n[0]=t.size[0],n[1]=t.size[1],t.canvas.setAttribute("width",t.size[0]),t.canvas.setAttribute("height",t.size[1]))),t.viewStream&&t.viewStream.setSize(t.size[0],t.size[1]),t.canvas.style.display=t.useOffScreen?"none":"block",t.el&&(t.el.style.cursor=t.cursorVisibility?t.cursor:"none"),t.containerSize=null})),e.buildPass=function(n){if(n){if(!t.renderable)return;e.prepareNodes(),e.addMissingNodes(t.renderable.getRenderersByReference()),e.removeUnusedNodes(),e.initialize(),t.children.forEach((function(t){t.setOpenGLRenderWindow(e)}))}},e.initialize=function(){if(!t.initialized){t.context=e.get3DContext(),t.textureUnitManager=Xo.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var n=t.context;n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA),n.depthFunc(n.LEQUAL),n.enable(n.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(n){t.el&&t.el!==n&&(t.canvas.parentNode!==t.el&&ko("Error: canvas parent node does not match container"),t.el.removeChild(t.canvas),t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)),t.el!==n&&(t.el=n,t.el&&(t.el.appendChild(t.canvas),t.useBackgroundImage&&t.el.appendChild(t.bgImage)),e.modified())},e.getContainer=function(){return t.el},e.getContainerSize=function(){if(!t.containerSize&&t.el){var e=t.el.getBoundingClientRect(),n=e.width,r=e.height;t.containerSize=[n,r]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.isInViewport=function(t,n,r){var a=r.getViewportByReference(),s=e.getFramebufferSize();return a[0]*s[0]<=t&&a[2]*s[0]>=t&&a[1]*s[1]<=n&&a[3]*s[1]>=n},e.getViewportSize=function(t){var n=t.getViewportByReference(),r=e.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},e.getViewportCenter=function(t){var n=e.getViewportSize(t);return[.5*n[0],.5*n[1]]},e.displayToNormalizedDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t/a[0],n/a[1],r]},e.normalizedDisplayToDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t*a[0],n*a[1],r]},e.worldToView=function(e,t,n,r){return r.worldToView(e,t,n)},e.viewToWorld=function(e,t,n,r){return r.viewToWorld(e,t,n)},e.worldToDisplay=function(t,n,r,a){var s=a.worldToView(t,n,r),i=e.getViewportSize(a),o=a.viewToProjection(s[0],s[1],s[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(o[0],o[1],o[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,n,r,a){var s=e.displayToNormalizedDisplay(t,n,r),i=a.normalizedDisplayToProjection(s[0],s[1],s[2]),o=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],o[0]/o[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,n,r,a){var s=a.getViewportByReference();s=e.normalizedDisplayToDisplay(s[0],s[1],0);var i=e.normalizedDisplayToDisplay(t,n,r);return[i[0]-s[0]-.5,i[1]-s[1]-.5,r]},e.viewportToNormalizedViewport=function(t,n,r,a){var s=e.getViewportSize(a);return s&&0!==s[0]&&0!==s[1]?[t/(s[0]-1),n/(s[1]-1),r]:[t,n,r]},e.normalizedViewportToViewport=function(t,n,r){var a=e.getFramebufferSize();return[t*(a[0]-1),n*(a[1]-1),r]},e.displayToLocalDisplay=function(t,n,r){return[t,e.getFramebufferSize()[1]-n-1,r]},e.viewportToNormalizedDisplay=function(t,n,r,a){var s=a.getViewportByReference(),i=t+(s=e.normalizedDisplayToDisplay(s[0],s[1],0))[0]+.5,o=n+s[1]+.5;return e.displayToNormalizedDisplay(i,o,r)},e.getPixelData=function(e,n,r,a){var s=new Uint8Array((r-e+1)*(a-n+1)*4);return t.context.readPixels(e,n,r-e+1,a-n+1,t.context.RGBA,t.context.UNSIGNED_BYTE,s),s},e.get3DContext=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},r=null,a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(r=t.canvas.getContext("webgl2",n))&&(t.webgl2=!0,To("using webgl2")),r||(To("using webgl1"),r=t.canvas.getContext("webgl",n)||t.canvas.getContext("experimental-webgl",n)),new Ho({PROVIDE_MOBILE_VRDISPLAY:!0,DIRTY_SUBMIT_FRAME_BINDINGS:!1,BUFFER_SCALE:.75}),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(n){n.length>0&&(t.vrDisplay=n[0],t.vrDisplay.depthNear=.01,t.vrDisplay.depthFar=100,e.invokeHaveVRDisplay())})),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),r},e.startVR=function(){t.oldCanvasSize=t.size.slice(),t.vrDisplay.capabilities.canPresent?t.vrDisplay.requestPresent([{source:t.canvas}]).then((function(){if(t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&t.hideCanvasInVR&&(t.el.style.display="none"),t.queryVRSize){var n=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right"),a=Math.floor(n.renderWidth+r.renderWidth),s=Math.floor(Math.max(n.renderHeight,r.renderHeight));e.setSize(a,s)}else e.setSize(t.vrResolution);t.renderable.getRenderers()[0].resetCamera(),t.vrFrameData=new VRFrameData,t.renderable.getInteractor().switchToVRAnimation(),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),Mo&&(t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender))})).catch((function(){console.error("failed to requestPresent")})):ko("vrDisplay is not connected")},e.stopVR=function(){t.renderable.getInteractor().returnFromVRAnimation(),t.vrDisplay.exitPresent(),t.vrDisplay.cancelAnimationFrame(t.vrSceneFrame),e.setSize.apply(e,Object(o.a)(t.oldCanvasSize)),t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&(t.el.style.display="block");var n=t.renderable.getRenderers()[0];n.getActiveCamera().setProjectionMatrix(null),n.setViewport(0,0,1,1),e.traverseAllPasses()},e.vrRender=function(){if(t.vrDisplay.isPresenting){t.renderable.getInteractor().updateGamepads(t.vrDisplay.displayId),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),t.vrDisplay.getFrameData(t.vrFrameData);var n=t.renderable.getRenderers()[0];n.setViewport(0,0,.5,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.leftViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.leftProjectionMatrix),e.traverseAllPasses(),n.setViewport(.5,0,1,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.rightViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.rightProjectionMatrix),e.traverseAllPasses(),t.vrDisplay.submitFrame()}},e.restoreContext=function(){var t=In.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(n){var r=t.textureResourceIds.get(n);if(void 0===r){var a=e.getTextureUnitManager().allocate();a<0?ko("Hardware does not support the number of textures defined."):(t.textureResourceIds.set(n,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+r)},e.deactivateTexture=function(n){var r=t.textureResourceIds.get(n);void 0!==r&&(e.getTextureUnitManager().free(r),t.textureResourceIds.delete(n))},e.getTextureUnitForTexture=function(e){var n=t.textureResourceIds.get(e);return void 0!==n?n:-1},e.getDefaultTextureInternalFormat=function(e,n,r){if(t.webgl2)switch(e){case X.b.UNSIGNED_CHAR:switch(n){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;case 4:default:return t.context.RGBA8}default:case X.b.FLOAT:switch(n){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;case 4:default:return t.context.RGBA16F}}switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:default:return t.context.RGBA}},e.setBackgroundImage=function(e){t.bgImage.src=e.src},e.setUseBackgroundImage=function(e){t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if(t.deleted)return null;t.imageFormat=n;var r=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,new Promise((function(n,a){var s=e.onImageReady((function(e){t.notifyStartCaptureImage=r,s.unsubscribe(),n(e)}))}))},e.getGLInformations=function(){for(var n=e.get3DContext(),r=n.getExtension("OES_texture_float"),a=n.getExtension("OES_texture_half_float"),s=n.getExtension("WEBGL_debug_renderer_info"),i=n.getExtension("WEBGL_draw_buffers"),o=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",n.getParameter(n.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",n.getParameter(n.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",n.getParameter(n.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",o&&n.getParameter(o.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",n.getParameter(n.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",n.getParameter(n.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",n.getParameter(n.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",n.getParameter(n.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",n.getParameter(n.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",n.getParameter(n.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",n.getParameter(n.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",n.getParameter(n.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",n.getParameter(n.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",n.getParameter(n.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",n.getParameter(n.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",n.getParameter(n.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",n.getParameter(n.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[r&&wo(n,n.RGBA,n.UNSIGNED_BYTE)?"RGBA":"",r&&wo(n,n.RGB,n.UNSIGNED_BYTE)?"RGB":"",r&&wo(n,n.LUMINANCE,n.UNSIGNED_BYTE)?"LUMINANCE":"",r&&wo(n,n.ALPHA,n.UNSIGNED_BYTE)?"ALPHA":"",r&&wo(n,n.LUMINANCE_ALPHA,n.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&wo(n,n.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&wo(n,n.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&wo(n,n.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&wo(n,n.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&wo(n,n.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[r&&wo(n,n.RGBA,n.FLOAT)?"RGBA":"",r&&wo(n,n.RGB,n.FLOAT)?"RGB":"",r&&wo(n,n.LUMINANCE,n.FLOAT)?"LUMINANCE":"",r&&wo(n,n.ALPHA,n.FLOAT)?"ALPHA":"",r&&wo(n,n.LUMINANCE_ALPHA,n.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?n.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",n.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",n.getParameter(n.RENDERER)],["WebGL Vendor","VENDOR",n.getParameter(n.VENDOR)],["WebGL Version","VERSION",n.getParameter(n.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",n.getParameter(n.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",s&&n.getParameter(s.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",s&&n.getParameter(s.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],B={};l.length;){var Q=l.pop(),c=Object(ce.a)(Q,3),F=c[0],U=c[1],g=c[2];U&&(B[U]={label:F,value:g})}return B},e.traverseAllPasses=function(){if(t.renderPasses)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,r=document.createElement("canvas"),a=r.getContext("2d");r.width=t.canvas.width,r.height=t.canvas.height,a.drawImage(t.canvas,0,0);var s=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jo,n),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",zo(),t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",t.textureResourceIds=new Map,an.extend(e,t,n),t.myFactory=Go.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",qo),t.shaderCache=Eo.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=Xn.newInstance(),l.c.event(e,t,"imageReady"),l.c.event(e,t,"haveVRDisplay"),l.c.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage"]),l.c.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","queryVRSize","hideCanvasInVR","useOffScreen","activeFramebuffer"]),l.c.setGetArray(e,t,["size","vrResolution"],2),Ko(e,t)}var qo=l.c.newInstance(_o,"vtkOpenGLRenderWindow");ln("WebGL",qo);var $o={newInstance:qo,extend:_o,pushMonitorGLContextCount:function(e){Oo.push(e)},popMonitorGLContextCount:function(e){return Oo.pop()}},el={Device:{Unknown:0,LeftController:1,RightController:2},Input:{Unknown:0,Trigger:1,TrackPad:2,Grip:3,ApplicationMenu:4}};function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nl(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],s=document,i=n?"addEventListener":"removeEventListener",o=n?"removeEventListener":"addEventListener";!a&&!n&&r>0&&--r,r&&!a||(r=0,t.container&&t.container[o]("mousemove",e.handleMouseMove),s[i]("mouseup",e.handleMouseUp),s[i]("mousemove",e.handleMouseMove),s[i]("touchend",e.handleTouchEnd,!1),s[i]("touchcancel",e.handleTouchEnd,!1),s[i]("touchmove",e.handleTouchMove,!1)),!a&&n&&++r}function Q(){t.view&&t.enabled&&t.enableRender&&(t.inRender=!0,t.view.traverseAllPasses(),t.inRender=!1),e.invokeRenderEvent()}e.start=function(){(t.initialized||(e.initialize(),t.initialized))&&e.startEventLoop()},e.setRenderWindow=function(e){il("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(n){t.interactorStyle!==n&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=n,null!=t.interactorStyle&&t.interactorStyle.getInteractor()!==e&&t.interactorStyle.setInteractor(e))},e.initialize=function(){t.initialized=!0,e.enable(),e.render()},e.enable=function(){return e.setEnabled(!0)},e.disable=function(){return e.setEnabled(!1)},e.startEventLoop=function(){return sl("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||a(0,0),t.currentRenderer},e.bindEvents=function(n){t.container=n,n.addEventListener("contextmenu",cl),n.addEventListener("wheel",e.handleWheel),n.addEventListener("DOMMouseScroll",e.handleWheel),n.addEventListener("mouseenter",e.handleMouseEnter),n.addEventListener("mouseleave",e.handleMouseLeave),n.addEventListener("mousemove",e.handleMouseMove),n.addEventListener("mousedown",e.handleMouseDown),document.querySelector("body").addEventListener("keypress",e.handleKeyPress),document.querySelector("body").addEventListener("keydown",e.handleKeyDown),document.querySelector("body").addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),n.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){B(!1,!0),t.container.removeEventListener("contextmenu",cl),t.container.removeEventListener("wheel",e.handleWheel),t.container.removeEventListener("DOMMouseScroll",e.handleWheel),t.container.removeEventListener("mouseenter",e.handleMouseEnter),t.container.removeEventListener("mouseleave",e.handleMouseLeave),t.container.removeEventListener("mousemove",e.handleMouseMove),t.container.removeEventListener("mousedown",e.handleMouseDown),document.querySelector("body").removeEventListener("keypress",e.handleKeyPress),document.querySelector("body").removeEventListener("keydown",e.handleKeyDown),document.querySelector("body").removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var n=l(t);e.keyPressEvent(n)},e.handleKeyDown=function(t){var n=l(t);e.keyDownEvent(n)},e.handleKeyUp=function(t){var n=l(t);e.keyUpEvent(n)},e.handleMouseDown=function(t){if(!(t.button>2)){B(!0),t.stopPropagation(),t.preventDefault();var n=nl(nl({},o(t)),{},{position:s(t)});switch(t.button){case 0:e.leftButtonPressEvent(n);break;case 1:e.middleButtonPressEvent(n);break;case 2:e.rightButtonPressEvent(n);break;default:il("Unknown mouse button pressed: ".concat(t.button))}}},e.requestPointerLock=function(){e.getView().getCanvas().requestPointerLock()},e.exitPointerLock=function(){return document.exitPointerLock()},e.isPointerLocked=function(){return!!document.pointerLockElement},e.handlePointerLockChange=function(){e.isPointerLocked()?e.startPointerLockEvent():e.endPointerLockEvent()},e.requestAnimation=function(r){void 0!==r?n.has(r)?sl("requester is already registered for animating"):(n.add(r),1===n.size&&(t.lastFrameTime=.1,t.lastFrameStart=Date.now(),t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):il("undefined requester, can not start animating")},e.isAnimating=function(){return t.vrAnimation||null!==t.animationRequest},e.cancelAnimation=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.has(r))n.delete(r),t.animationRequest&&0===n.size&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var s=r&&r.getClassName?r.getClassName():r;sl("".concat(s," did not request an animation"))}},e.switchToVRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.vrAnimation=!0},e.returnFromVRAnimation=function(){t.vrAnimation=!1,0!==n.size&&(t.FrameTime=-1,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateGamepads=function(n){for(var r=navigator.getGamepads(),a=0;a1){var r=i(n.touches);if(2===n.touches.length){var a={position:s(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",r)}else{var o={position:s(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(o)}},e.handleTouchMove=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures&&n.touches.length>1){var r=i(n.touches);e.recognizeGesture("TouchMove",r)}else{var a={position:s(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures)if(0===n.touches.length)if(1===n.changedTouches.length){var r={position:s(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(r),B(!1)}else{var a=i(n.changedTouches);e.recognizeGesture("TouchEnd",a),B(!1)}else if(1===n.touches.length){var o=i(n.changedTouches);e.recognizeGesture("TouchEnd",o);var l={position:s(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var Q=i(n.touches);e.recognizeGesture("TouchMove",Q)}else{var c={position:s(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(c),B(!1)}},e.setView=function(n){t.view!==n&&(t.view=n,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){return t.view.getRenderable().getRenderersByReference()[0]},e.findPokedRenderer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var r=t.view.getRenderable().getRenderers();r.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var a=null,s=null,i=null,o=r.length;o--;){var l=r[o];if(t.view.isInViewport(e,n,l)&&l.getInteractive()){i=l;break}null===a&&l.getInteractive()&&(a=l),null===s&&t.view.isInViewport(e,n,l)&&(s=l)}return null===i&&(i=a),null===i&&(i=s),null==i&&(i=r[0]),i},e.render=function(){null!==t.animationRequest||t.inRender||Q()},Ql.forEach((function(n){var r=n.charAt(0).toLowerCase()+n.slice(1);e["".concat(r,"Event")]=function(r){if(t.enabled)if(e.getCurrentRenderer()){var a=nl({type:n,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},r);e["invoke".concat(n)](a)}else ll("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(n,r){if(!(Object.keys(r).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===n)return Object.keys(r).forEach((function(e){t.startingEventPositions[e]=r[e]})),void(t.currentGesture="Start");if("TouchEnd"===n)return"Pinch"===t.currentGesture&&(e.render(),e.endPinchEvent()),"Rotate"===t.currentGesture&&(e.render(),e.endRotateEvent()),"Pan"===t.currentGesture&&(e.render(),e.endPanEvent()),t.currentGesture="Start",void(t.startingEventPositions={});var a=0,s=[],i=[];Object.keys(r).forEach((function(e){s[a]=r[e],i[a]=t.startingEventPositions[e],a++}));var o=Math.sqrt((i[0].x-i[1].x)*(i[0].x-i[1].x)+(i[0].y-i[1].y)*(i[0].y-i[1].y)),l=Math.sqrt((s[0].x-s[1].x)*(s[0].x-s[1].x)+(s[0].y-s[1].y)*(s[0].y-s[1].y)),B=Object(b.E)(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),Q=Object(b.E)(Math.atan2(s[1].y-s[0].y,s[1].x-s[0].x)),c=Q-B;Q=Q+180>=360?Q-180:Q+180,B=B+180>=360?B-180:B+180,Math.abs(Q-B)U&&g>d&&g>u){t.currentGesture="Pinch";var I={scale:1,touches:r};e.startPinchEvent(I)}else if(d>U&&d>u){t.currentGesture="Rotate";var m={rotation:0,touches:r};e.startRotateEvent(m)}else if(u>U){t.currentGesture="Pan";var C={translation:[0,0],touches:r};e.startPanEvent(C)}}else{if("Rotate"===t.currentGesture){var y={rotation:c,touches:r};e.rotateEvent(y)}if("Pinch"===t.currentGesture){var S={scale:l/o,touches:r};e.pinchEvent(S)}if("Pan"===t.currentGesture){var x={translation:F,touches:r};e.panEvent(x)}}}},e.handleVisibilityChange=function(){t.lastFrameStart=Date.now()};var c=e.delete;e.delete=function(){for(;n.size;)e.cancelAnimation(n.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),c()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var Ul={renderWindow:null,interactorStyle:null,picker:null,pickingManager:null,initialized:!1,enabled:!1,enableRender:!0,currentRenderer:null,lightFollowCamera:!0,desiredUpdateRate:30,stillUpdateRate:2,container:null,view:null,recognizeGestures:!0,currentGesture:"Start",animationRequest:null,lastFrameTime:.1,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function gl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ul,n),l.c.obj(e,t),l.c.event(e,t,"RenderEvent"),Ql.forEach((function(n){return l.c.event(e,t,n)})),l.c.get(e,t,["initialized","container","interactorStyle","lastFrameTime","view"]),l.c.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),Fl(e,t)}var dl=nl({newInstance:l.c.newInstance(gl,"vtkRenderWindowInteractor"),extend:gl,handledEvents:Ql},el),ul=l.c.vtkDebugMacro;function Il(e,t){t.classHierarchy.push("vtkCamera");var n=new Float64Array(3),r=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),s=Object(Z.h)(new Float64Array(16)),i=new Float64Array(3),l=new Float64Array(3),B=new Float64Array(3),Q=Object(Z.h)(new Float64Array(16)),c=Object(Z.h)(new Float64Array(16)),F=new Float64Array(3),U=new Float64Array(3);function g(){t.viewPlaneNormal[0]=-t.directionOfProjection[0],t.viewPlaneNormal[1]=-t.directionOfProjection[1],t.viewPlaneNormal[2]=-t.directionOfProjection[2]}e.orthogonalizeViewUp=function(){var n=e.getViewMatrix();t.viewUp[0]=n[4],t.viewUp[1]=n[5],t.viewUp[2]=n[6],e.modified()},e.setPosition=function(n,r,a){n===t.position[0]&&r===t.position[1]&&a===t.position[2]||(t.position[0]=n,t.position[1]=r,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(n,r,a){n===t.focalPoint[0]&&r===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=n,t.focalPoint[1]=r,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(n){if(t.distance!==n){t.distance=n,t.distance<1e-20&&(t.distance=1e-20,ul("Distance is set to minimum."));var r=t.directionOfProjection;t.focalPoint[0]=t.position[0]+r[0]*t.distance,t.focalPoint[1]=t.position[1]+r[1]*t.distance,t.focalPoint[2]=t.position[2]+r[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],n=t.focalPoint[1]-t.position[1],r=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+n*n+r*r),t.distance<1e-20){t.distance=1e-20,ul("Distance is set to minimum.");var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance}t.directionOfProjection[0]=e/t.distance,t.directionOfProjection[1]=n/t.distance,t.directionOfProjection[2]=r/t.distance,g()},e.dolly=function(n){if(!(n<=0)){var r=t.distance/n;e.setPosition(t.focalPoint[0]-r*t.directionOfProjection[0],t.focalPoint[1]-r*t.directionOfProjection[1],t.focalPoint[2]-r*t.directionOfProjection[2])}},e.roll=function(n){var r=t.position,a=t.focalPoint,s=t.viewUp,i=new Float64Array([s[0],s[1],s[2],0]);Object(Z.h)(Q);var o=new Float64Array([a[0]-r[0],a[1]-r[1],a[2]-r[2]]);Object(Z.q)(Q,Q,Object(b.B)(n),o),Ca(i,i,Q),t.viewUp[0]=i[0],t.viewUp[1]=i[1],t.viewUp[2]=i[2],e.modified()},e.azimuth=function(n){var r=t.focalPoint;Object(Z.h)(c),Object(Z.s)(c,c,r),Object(Z.q)(c,c,Object(b.B)(n),t.viewUp),Object(Z.s)(c,c,[-r[0],-r[1],-r[2]]),Object(h.q)(F,t.position,c),e.setPosition(F[0],F[1],F[2])},e.yaw=function(n){var r=t.position;Object(Z.h)(c),Object(Z.s)(c,c,r),Object(Z.q)(c,c,Object(b.B)(n),t.viewUp),Object(Z.s)(c,c,[-r[0],-r[1],-r[2]]),Object(h.q)(U,t.focalPoint,c),e.setFocalPoint(U[0],U[1],U[2])},e.elevation=function(n){var r=t.focalPoint,a=e.getViewMatrix(),s=[-a[0],-a[1],-a[2]];Object(Z.h)(c),Object(Z.s)(c,c,r),Object(Z.q)(c,c,Object(b.B)(n),s),Object(Z.s)(c,c,[-r[0],-r[1],-r[2]]),Object(h.q)(F,t.position,c),e.setPosition(F[0],F[1],F[2])},e.pitch=function(n){var r=t.position,a=e.getViewMatrix(),s=[a[0],a[1],a[2]];Object(Z.h)(c),Object(Z.s)(c,c,r),Object(Z.q)(c,c,Object(b.B)(n),s),Object(Z.s)(c,c,[-r[0],-r[1],-r[2]]),Object(h.q)(U,t.focalPoint,c),e.setFocalPoint.apply(e,Object(o.a)(U))},e.zoom=function(n){n<=0||(t.parallelProjection?t.parallelScale/=n:t.viewAngle/=n,e.modified())},e.translate=function(n,r,a){var s=[n,r,a];Object(b.w)(t.position,s,t.position),Object(b.w)(t.focalPoint,s,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(n){var r=[].concat(Object(o.a)(t.viewUp),[1]),a=[],s=[],i=[];r[0]+=t.position[0],r[1]+=t.position[1],r[2]+=t.position[2],Ca(a,[].concat(Object(o.a)(t.position),[1]),n),Ca(s,[].concat(Object(o.a)(t.focalPoint),[1]),n),Ca(i,r,n),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,Object(o.a)(a.slice(0,3))),e.setFocalPoint.apply(e,Object(o.a)(s.slice(0,3))),e.setViewUp.apply(e,Object(o.a)(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(n){var r=n;r<1e-20&&(r=1e-20,ul("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+r)},e.setThicknessFromFocalPoint=function(n){var r=n;r<1e-20&&(r=1e-20,ul("Thickness is set to minimum.")),e.setClippingRange(t.distance-r/2,t.distance+r/2)},e.setRoll=function(e){},e.getRoll=function(){},e.setObliqueAngles=function(e,t){},e.getOrientation=function(){},e.getOrientationWXYZ=function(){},e.getFrustumPlanes=function(e){},e.getCameraLightTransformMatrix=function(){},e.deepCopy=function(e){},e.physicalOrientationToWorldDirection=function(e){var t,n,r=xa(e[0],e[1],e[2],e[3]),a=ba(),s=xa(0,0,1,0);return n=r,(t=a)[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],Sa(s,r,s),Sa(s,s,a),[s[0],s[1],s[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),Object(Z.g)(t,t)},e.getWorldToPhysicalMatrix=function(e){Object(Z.h)(e);var n=[3];Object(b.v)(t.physicalViewNorth,t.physicalViewUp,n),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[4]=t.physicalViewUp[0],e[5]=t.physicalViewUp[1],e[6]=t.physicalViewUp[2],e[8]=-t.physicalViewNorth[0],e[9]=-t.physicalViewNorth[1],e[10]=-t.physicalViewNorth[2],Object(Z.i)(e,e),Object(h.p)(i,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),Object(Z.r)(e,e,i),Object(Z.s)(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(o){Object(Z.g)(s,o),Object(h.q)(i,n,s),e.computeDistance();var Q=t.distance;e.setPosition(i[0],i[1],i[2]),Object(h.q)(l,r,s),Object(h.a)(l,l,i),Object(h.l)(l,l),e.setDirectionOfProjection(l[0],l[1],l[2]),Object(h.q)(B,a,s),Object(h.a)(B,B,i),Object(h.l)(B,B),e.setViewUp(B[0],B[1],B[2]),e.setDistance(Q)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(s),Object(Z.l)(s,t,s),e.computeViewParametersFromViewMatrix(s)},e.setViewMatrix=function(n){t.viewMatrix=n,t.viewMatrix&&(Object(Z.d)(s,t.viewMatrix),e.computeViewParametersFromViewMatrix(s),Object(Z.i)(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;Object(Z.o)(s,t.position,t.focalPoint,t.viewUp),Object(Z.i)(s,s);var e=new Float64Array(16);return Object(Z.d)(e,s),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,n,r){var a=new Float64Array(16);if(Object(Z.h)(a),t.projectionMatrix){var o=1/t.physicalScale;return Object(h.p)(i,o,o,o),Object(Z.d)(a,t.projectionMatrix),Object(Z.r)(a,a,i),Object(Z.i)(a,a),a}Object(Z.h)(s);var l=t.clippingRange[1]-t.clippingRange[0],B=[t.clippingRange[0]+(n+1)*l/2,t.clippingRange[0]+(r+1)*l/2];if(t.parallelProjection){var Q=t.parallelScale*e,c=t.parallelScale,F=(t.windowCenter[0]-1)*Q,U=(t.windowCenter[0]+1)*Q,g=(t.windowCenter[1]-1)*c,d=(t.windowCenter[1]+1)*c;Object(Z.p)(s,F,U,g,d,B[0],B[1]),Object(Z.i)(s,s)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var u,I,m=Math.tan(Object(b.B)(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(u=t.clippingRange[0]*m,I=t.clippingRange[0]*m/e):(u=t.clippingRange[0]*m*e,I=t.clippingRange[0]*m);var C=(t.windowCenter[0]-1)*u,y=(t.windowCenter[0]+1)*u,S=(t.windowCenter[1]-1)*I,x=(t.windowCenter[1]+1)*I,p=B[0],G=B[1];s[0]=2*p/(y-C),s[5]=2*p/(x-S),s[2]=(C+y)/(y-C),s[6]=(S+x)/(x-S),s[10]=-(p+G)/(G-p),s[14]=-1,s[11]=-2*p*G/(G-p),s[15]=0}return Object(Z.d)(a,s),a},e.getCompositeProjectionMatrix=function(t,n,r){var a=e.getViewMatrix(),s=e.getProjectionMatrix(t,n,r);return Object(Z.l)(s,a,s),s},e.setDirectionOfProjection=function(e,n,r){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==n||t.directionOfProjection[2]!==r){t.directionOfProjection[0]=e,t.directionOfProjection[1]=n,t.directionOfProjection[2]=r;var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance,g()}},e.setDeviceAngles=function(n,r,a,s){var i=[3];Object(b.v)(t.physicalViewNorth,t.physicalViewUp,i);var o=Object(Z.h)(new Float64Array(16));Object(Z.q)(o,o,Object(b.B)(n),t.physicalViewUp),Object(Z.q)(o,o,Object(b.B)(r),i),Object(Z.q)(o,o,Object(b.B)(a),t.physicalViewNorth),Object(Z.q)(o,o,Object(b.B)(-s),t.physicalViewUp);var l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),B=new Float64Array(t.physicalViewNorth);Object(h.q)(l,l,o),Object(h.q)(B,B,o),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(B[0],B[1],B[2]),e.modified()},e.setOrientationWXYZ=function(t,n,r,a){var s=Object(Z.h)(new Float64Array(16));if(0!==t&&(0!==n||0!==r||0!==a)){var i=Object(b.B)(t),l=ba();ya(l,[n,r,a],i),Object(Z.k)(s,l)}var B=new Float64Array(3);Object(h.q)(B,[0,0,-1],s);var Q=new Float64Array(3);Object(h.q)(Q,[0,1,0],s),e.setDirectionOfProjection.apply(e,Object(o.a)(B)),e.setViewUp.apply(e,Object(o.a)(Q)),e.modified()},e.computeClippingRange=function(e){var n,r;n=t.viewPlaneNormal,r=t.position;for(var a=-n[0],s=-n[1],i=-n[2],o=-(a*r[0]+s*r[1]+i*r[2]),l=[a*e[0]+s*e[2]+i*e[4]+o,1e-18],B=0;B<2;B++)for(var Q=0;Q<2;Q++)for(var c=0;c<2;c++){var F=a*e[c]+s*e[2+Q]+i*e[4+B]+o;l[0]=Fl[1]?F:l[1]}return l}}var ml={position:[0,0,1],focalPoint:[0,0,0],viewUp:[0,1,0],directionOfProjection:[0,0,-1],parallelProjection:!1,useHorizontalViewAngle:!1,viewAngle:30,parallelScale:1,clippingRange:[.01,1000.01],windowCenter:[0,0],viewPlaneNormal:[0,0,1],useOffAxisProjection:!1,screenBottomLeft:[-.5,-.5,-.5],screenBottomRight:[.5,-.5,-.5],screenTopRight:[.5,.5,-.5],freezeFocalPoint:!1,projectionMatrix:null,viewMatrix:null,physicalTranslation:[0,0,0],physicalScale:1,physicalViewUp:[0,1,0],physicalViewNorth:[0,0,-1]};function Cl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ml,n),l.c.obj(e,t),l.c.get(e,t,["distance"]),l.c.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),l.c.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),l.c.setGetArray(e,t,["clippingRange","windowCenter"],2),l.c.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),Il(e,t)}var bl={newInstance:l.c.newInstance(Cl,"vtkCamera"),extend:Cl};function yl(e,t){t.classHierarchy.push("vtkLight"),e.getTransformedPosition=function(){return t.transformMatrix?[]:[].concat(t.position)},e.getTransformedFocalPoint=function(){return t.transformMatrix?[]:[].concat(t.focalPoint)},e.getDirection=function(){return t.directionMTime2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sl,n),l.c.obj(e,t),l.c.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),l.c.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),yl(e,t)}var Zl={newInstance:l.c.newInstance(xl,"vtkLight"),extend:xl,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},hl=l.c.vtkErrorMacro;function pl(e,t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var r=e.getNestedProps();if(r&&r.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gl,n),l.c.obj(e,t),l.c.event(e,t,"event"),l.c.setGetArray(e,t,["viewport"],4),l.c.setGetArray(e,t,["background","background2"],3),pl(e,t)}var Ll={newInstance:l.c.newInstance(Rl,"vtkViewport"),extend:Rl},Vl=l.k,Al=l.l,fl=l.m;function Nl(e){return function(){return Al("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function El(e,t){for(t.classHierarchy.push("vtkRenderer"),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1);var n={type:"ComputeVisiblePropBoundsEvent",renderer:e},r={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(Vl("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var n=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(n.getPositionByReference()),e.setFocalPointFrom(n.getFocalPointByReference()),e.modified(n.getMTime())):Al("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=Nl("allocateTime"),e.updateGeometry=Nl("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(n){Vl(e.getClassName(),e,"setting Layer to ",n),t.layer!==n&&(t.layer=n,e.modified()),e.setPreserveColorBuffer(!!n)},e.setActiveCamera=function(n){return t.activeCamera!==n&&(t.activeCamera=n,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:n}),!0)},e.makeCamera=function(){var t=bl.newInstance();return e.invokeEvent({type:"CreateCameraEvent",camera:t}),t},e.getActiveCamera=function(){return t.activeCamera||(t.activeCamera=e.makeCamera()),t.activeCamera},e.getActiveCameraAndResetIfCreated=function(){return t.activeCamera||(e.getActiveCamera(),e.resetCamera()),t.activeCamera},e.getActors=function(){return t.actors=[],t.props.forEach((function(e){t.actors=t.actors.concat(e.getActors())})),t.actors},e.addActor=e.addViewProp,e.removeActor=function(n){t.actors=t.actors.filter((function(e){return e!==n})),e.removeViewProp(n),e.modified()},e.removeAllActors=function(){e.getActors().forEach((function(t){e.removeViewProp(t)})),t.actors=[],e.modified()},e.getVolumes=function(){return t.volumes=[],t.props.forEach((function(e){t.volumes=t.volumes.concat(e.getVolumes())})),t.volumes},e.addVolume=e.addViewProp,e.removeVolume=function(n){t.volumes=t.volumes.filter((function(e){return e!==n})),e.removeViewProp(n),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(n){t.lights=[].concat(t.lights,n),e.modified()},e.removeLight=function(n){t.lights=t.lights.filter((function(e){return e!==n})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(n){t.lights=n,e.modified()},e.makeLight=Zl.newInstance,e.createLight=function(){t.automaticLightCreation&&(t.createdLight&&(e.removeLight(t.createdLight),t.createdLight.delete(),t.createdLight=null),t.createdLight=e.makeLight(),e.addLight(t.createdLight),t.createdLight.setLightTypeToHeadLight(),t.createdLight.setPosition(e.getActiveCamera().getPosition()),t.createdLight.setFocalPoint(e.getActiveCamera().getFocalPoint()))},e.normalizedDisplayToWorld=function(t,n,r,a){var s=e.normalizedDisplayToProjection(t,n,r);return s=e.projectionToView(s[0],s[1],s[2],a),e.viewToWorld(s[0],s[1],s[2])},e.worldToNormalizedDisplay=function(t,n,r,a){var s=e.worldToView(t,n,r);return s=e.viewToProjection(s[0],s[1],s[2],a),e.projectionToNormalizedDisplay(s[0],s[1],s[2])},e.viewToWorld=function(e,n,r){if(null===t.activeCamera)return Al("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Object(Z.g)(a,a),Object(Z.i)(a,a);var s=new Float64Array([e,n,r]);return Object(h.q)(s,s,a),s},e.projectionToView=function(e,n,r,a){if(null===t.activeCamera)return Al("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);Object(Z.g)(s,s),Object(Z.i)(s,s);var i=new Float64Array([e,n,r]);return Object(h.q)(i,i,s),i},e.worldToView=function(e,n,r){if(null===t.activeCamera)return Al("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Object(Z.i)(a,a);var s=new Float64Array([e,n,r]);return Object(h.q)(s,s,a),s},e.viewToProjection=function(e,n,r,a){if(null===t.activeCamera)return Al("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);Object(Z.i)(s,s);var i=new Float64Array([e,n,r]);return Object(h.q)(i,i,s),i},e.computeVisiblePropBounds=function(){t.allBounds[0]=Bt.INIT_BOUNDS[0],t.allBounds[1]=Bt.INIT_BOUNDS[1],t.allBounds[2]=Bt.INIT_BOUNDS[2],t.allBounds[3]=Bt.INIT_BOUNDS[3],t.allBounds[4]=Bt.INIT_BOUNDS[4],t.allBounds[5]=Bt.INIT_BOUNDS[5];var r=!0;e.invokeEvent(n);for(var a=0;at.allBounds[1]&&(t.allBounds[1]=i[1]),i[2]t.allBounds[3]&&(t.allBounds[3]=i[3]),i[4]t.allBounds[5]&&(t.allBounds[5]=i[5]))}}return r&&(Object(b.D)(t.allBounds),Vl("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=n||e.computeVisiblePropBounds(),s=[0,0,0];if(!Object(b.m)(r))return Vl("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return Al("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),s[0]=(r[0]+r[1])/2,s[1]=(r[2]+r[3])/2,s[2]=(r[4]+r[5])/2;var o=r[1]-r[0],l=r[3]-r[2],B=r[5]-r[4],Q=(o*=o)+(l*=l)+(B*=B);Q=0===Q?1:Q,Q=.5*Math.sqrt(Q);var c=Object(b.B)(t.activeCamera.getViewAngle()),F=Q,U=Q/Math.sin(.5*c),g=t.activeCamera.getViewUp();return Math.abs(Object(b.r)(g,i))>.999&&(fl("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(s[0],s[1],s[2]),t.activeCamera.setPosition(s[0]+U*i[0],s[1]+U*i[1],s[2]+U*i[2]),e.resetCameraClippingRange(r),t.activeCamera.setParallelScale(F),t.activeCamera.setPhysicalScale(Q),t.activeCamera.setPhysicalTranslation(-s[0],-s[1],-s[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=n||e.computeVisiblePropBounds();if(!Object(b.m)(a))return Vl("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return Al("Trying to reset clipping range of non-existent camera"),!1;var s=t.activeCamera.computeClippingRange(a),i=0;if(t.activeCamera.getParallelProjection())i=.1*t.activeCamera.getParallelScale();else{var o=Object(b.B)(t.activeCamera.getViewAngle());i=.2*Math.tan(o/2)*s[1]}return s[1]-s[0]=s[1]?.01*s[1]:s[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),s[0]e&&(e=n);var r=t.createdLight?t.createdLight.getMTime():0;return r>e&&(e=r),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var Dl={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,createdLight:null,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Object(b.k)(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,pass:0};function vl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dl,n),Ll.extend(e,t,n),Object(l.d)(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),Object(l.i)(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),Object(l.e)(e,t,["actors","volumes","lights"]),Object(l.j)(e,t,["background"],4,1),El(e,t)}var Jl={newInstance:Object(l.f)(vl,"vtkRenderer"),extend:vl};function Wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ml,n),l.c.obj(e,t),l.c.event(e,t,"InteractionEvent"),l.c.event(e,t,"StartInteractionEvent"),l.c.event(e,t,"EndInteractionEvent"),l.c.get(e,t,["interactor","enabled"]),l.c.setGet(e,t,["priority","processEvents"]),kl(e,t)}var Yl=Xl({newInstance:l.c.newInstance(wl,"vtkInteractorObserver"),extend:wl},{computeWorldToDisplay:function(e,t,n,r){return e.getRenderWindow().getViews()[0].worldToDisplay(t,n,r,e)},computeDisplayToWorld:function(e,t,n,r){return e.getRenderWindow().getViews()[0].displayToWorld(t,n,r,e)}}),Ol={States:{IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025}};function zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Pl=Ol.States,Kl={Rotate:Pl.IS_ROTATE,Pan:Pl.IS_PAN,Spin:Pl.IS_SPIN,Dolly:Pl.IS_DOLLY,CameraPose:Pl.IS_CAMERA_POSE,WindowLevel:Pl.IS_WINDOW_LEVEL,Slice:Pl.IS_SLICE};function jl(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(Kl).forEach((function(n){l.c.event(e,t,"Start".concat(n,"Event")),e["start".concat(n)]=function(){t.state===Pl.IS_NONE&&(t.state=Kl[n],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(n,"Event")]({type:"Start".concat(n,"Event")}))},l.c.event(e,t,"End".concat(n,"Event")),e["end".concat(n)]=function(){t.state===Kl[n]&&(t.state=Pl.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(n,"Event")]({type:"End".concat(n,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var n=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),n.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),n.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),n.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),n.render()}}}var _l={state:Pl.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function ql(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_l,n),Yl.extend(e,t,n),jl(e,t)}var $l=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BB,n),$l.extend(e,t,n),l.c.setGet(e,t,["rotationFactor"]),l.c.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),l.c.setGetArray(e,t,["centerOfRotation"],3),lB(e,t)}var cB=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,UB,n),l.c.setGet(e,t,["rotationFactor"]),l.c.setGetArray(e,t,["displayCenter"],2),l.c.setGetArray(e,t,["center"],3),FB(e,t)}};function dB(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,n){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,n){},e.onStartScroll=function(e,t,n){},e.onScroll=function(e,t,n){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var uB={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};var IB={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uB,n),l.c.setGet(e,t,["button","shift","control","alt"]),l.c.set(e,t,["dragEnabled","scrollEnabled"]),dB(e,t)}};function mB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(3),s=new Float64Array(16),i=new Float64Array(3),o=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,B,Q){if(Q){var c=B.getActiveCamera(),F=c.getPosition(),U=c.getFocalPoint();Object(Z.h)(s);var g=t.center,d=t.rotationFactor;Object(Z.s)(s,s,g);var u=t.previousPosition.x-Q.x,I=t.previousPosition.y-Q.y,m=e.getView().getSize(),C=c.getViewUp();Object(Z.q)(s,s,Object(b.B)(360*u/m[0]*d),C),Object(b.v)(c.getDirectionOfProjection(),C,i),Object(Z.q)(s,s,Object(b.B)(-360*I/m[1]*d),i),o[0]=-g[0],o[1]=-g[1],o[2]=-g[2],Object(Z.s)(s,s,o),Object(h.q)(n,F,s),Object(h.q)(r,U,s),l[0]=C[0]+F[0],l[1]=C[1]+F[1],l[2]=C[2]+F[2],Object(h.q)(a,l,s),c.setPosition(n[0],n[1],n[2]),c.setFocalPoint(r[0],r[1],r[2]),c.setViewUp(a[0]-n[0],a[1]-n[1],a[2]-n[2]),c.orthogonalizeViewUp(),B.resetCameraClippingRange(),e.getLightFollowCamera()&&B.updateLightsGeometryToFollowCamera(),t.previousPosition=Q}}}var CB={};function bB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CB,n),l.c.obj(e,t),IB.extend(e,t,n),gB.extend(e,t,n),mB(e,t)}var yB={newInstance:l.c.newInstance(bB,"vtkMouseCameraTrackballRotateManipulator"),extend:bB};function SB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRollManipulator");var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(3),s=new Float64Array(16),i=new Float64Array(3),o=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(B,Q,c){if(c){var F=Q.getActiveCamera(),U=F.getPosition(),g=F.getFocalPoint(),d=F.getViewUp();n[0]=g[0]-U[0],n[1]=g[1]-U[1],n[2]=g[2]-U[2],e.computeDisplayCenter(B.getInteractorStyle(),Q);var u=t.previousPosition.x-t.displayCenter[0],I=c.x-t.displayCenter[0],m=t.previousPosition.y-t.displayCenter[1],C=c.y-t.displayCenter[1];if(!(0===I&&0===C||0===u&&0===m)){var y=Object(b.E)((u*C-m*I)/(Math.sqrt(u*u+m*m)*Math.sqrt(I*I+C*C))),S=t.center;Object(Z.h)(s),a[0]=-S[0],a[1]=-S[1],a[2]=-S[2],Object(Z.s)(s,s,S),Object(Z.q)(s,s,Object(b.B)(y),n),Object(Z.s)(s,s,a),Object(h.q)(i,U,s),Object(h.q)(o,g,s),r[0]=d[0]+U[0],r[1]=d[1]+U[1],r[2]=d[2]+U[2],Object(h.q)(l,r,s),F.setPosition(i[0],i[1],i[2]),F.setFocalPoint(o[0],o[1],o[2]),F.setViewUp(l[0]-i[0],l[1]-i[1],l[2]-i[2]),F.orthogonalizeViewUp(),Q.resetCameraClippingRange(),B.getLightFollowCamera()&&Q.updateLightsGeometryToFollowCamera(),t.previousPosition=c}}}}var xB={};function ZB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xB,n),l.c.obj(e,t),gB.extend(e,t,n),IB.extend(e,t,n),SB(e,t)}var hB={newInstance:l.c.newInstance(ZB,"vtkMouseCameraTrackballRollManipulator"),extend:ZB};function pB(e){return e*e}function GB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballMultiRotateManipulator");var n=yB.newInstance(),r=hB.newInstance(),a=null;e.onButtonDown=function(t,s,i){var o,l,B=t.getView().getSize(),Q=[.5*B[0],.5*B[1]],c=.9*((o=Q[0])<(l=Q[1])?l:o),F=pB(Q[0]-i.x)+pB(Q[1]-i.y);(a=c*c>F?n:r).setButton(e.getButton()),a.setShift(e.getShift()),a.setControl(e.getControl()),a.setCenter(e.getCenter()),a.onButtonDown(t,i)},e.onButtonUp=function(e){a&&a.onButtonUp(e)},e.onMouseMove=function(e,t,n){a&&a.onMouseMove(e,t,n)}}var RB={};function LB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,RB,n),l.c.obj(e,t),IB.extend(e,t,n),gB.extend(e,t,n),GB(e,t)}var VB={newInstance:l.c.newInstance(LB,"vtkMouseCameraTrackballMultiRotateManipulator"),extend:LB};function AB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,n,r){if(r){var a=r,s=t.previousPosition;t.previousPosition=r;var i=n.getActiveCamera(),o=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var B=i.getViewUp(),Q=i.getViewPlaneNormal(),c=[0,0,0];Object(b.v)(Q,B,c);var F=e.getView().getSize()[1],U=(a.x-s.x)/F,g=(s.y-a.y)/F,d=i.getParallelScale();g*=2*d;var u=c[0]*(U*=2*d)+B[0]*g;o[0]+=u,l[0]+=u,u=c[1]*U+B[1]*g,o[1]+=u,l[1]+=u,u=c[2]*U+B[2]*g,o[2]+=u,l[2]+=u,i.setPosition(o[0],o[1],o[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var I=t.center,m=e.getInteractorStyle(),C=m.computeWorldToDisplay(n,I[0],I[1],I[2])[2],y=m.computeDisplayToWorld(n,a.x,a.y,C),S=m.computeDisplayToWorld(n,s.x,s.y,C),x=[o[0]+(S[0]-y[0]),o[1]+(S[1]-y[1]),o[2]+(S[2]-y[2])],Z=[l[0]+(S[0]-y[0]),l[1]+(S[1]-y[1]),l[2]+(S[2]-y[2])];i.setPosition(x[0],x[1],x[2]),i.setFocalPoint(Z[0],Z[1],Z[2])}n.resetCameraClippingRange(),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}}var fB={};function NB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fB,n),l.c.obj(e,t),gB.extend(e,t,n),IB.extend(e,t,n),AB(e,t)}var EB={newInstance:l.c.newInstance(NB,"vtkMouseCameraTrackballPanManipulator"),extend:NB};function DB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r;var a=e.getView().getSize(),s=n.getActiveCamera(),i=t.flipDirection?-1:1;if(s.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var o=s.getClippingRange();t.zoomScale=o[1]/a[1]*1.5*i}},e.onMouseMove=function(e,n,r){if(r){var a=t.previousPosition.y-r.y,s=n.getActiveCamera();if(s.getParallelProjection()){var i=a*t.zoomScale;s.setParallelScale((1-i)*s.getParallelScale())}else{var o=s.getPosition(),l=s.getFocalPoint(),B=s.getDirectionOfProjection(),Q=a*t.zoomScale,c=Q*B[0];o[0]+=c,l[0]+=c,c=Q*B[1],o[1]+=c,l[1]+=c,c=Q*B[2],o[2]+=c,l[2]+=c,s.getFreezeFocalPoint()||s.setFocalPoint(l[0],l[1],l[2]),s.setPosition(o[0],o[1],o[2]),n.resetCameraClippingRange()}e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n){if(n){var r=t.getActiveCamera(),a=1-n/10;r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/a):(r.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var vB={zoomScale:0,flipDirection:!1};function JB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vB,n),l.c.obj(e,t),IB.extend(e,t,n),gB.extend(e,t,n),l.c.setGet(e,t,["flipDirection"]),DB(e,t)}var WB={newInstance:l.c.newInstance(JB,"vtkMouseCameraTrackballZoomManipulator"),extend:JB};function XB(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomToMouseManipulator");var n=e.onButtonDown;e.onButtonDown=function(e,r,a){n(e,r,a),t.zoomPosition=a},e.onMouseMove=function(e,n,r){if(r){var a=(t.previousPosition.y-r.y)*t.zoomScale;cB.dollyToPosition(1-a,t.zoomPosition,n,e),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n,r){if(n&&r){var a=1-.1*n;cB.dollyToPosition(a,r,t,e),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var HB={zoomPosition:null};function TB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,HB,n),WB.extend(e,t,n),XB(e,t)}var kB={newInstance:l.c.newInstance(TB,"vtkMouseCameraTrackballZoomToMouseManipulator"),extend:TB};function MB(e,t){t.classHierarchy.push("vtkCompositeGestureManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onStartPinch=function(e,t){},e.onStartRotate=function(e,t){},e.onStartPan=function(e,t){},e.onPinch=function(e,t,n){},e.onRotate=function(e,t,n){},e.onPan=function(e,t,n){},e.onEndPinch=function(e){},e.onEndRotate=function(e){},e.onEndPan=function(e){},e.isPinchEnabled=function(){return t.pinchEnabled},e.isPanEnabled=function(){return t.panEnabled},e.isRotateEnabled=function(){return t.rotateEnabled}}var wB={pinchEnabled:!0,panEnabled:!0,rotateEnabled:!0};var YB={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wB,n),l.c.set(e,t,["pinchEnabled","panEnabled","rotateEnabled"]),l.c.setGet(e,t,["interactorStyle"]),MB(e,t)}};function OB(e,t){t.classHierarchy.push("vtkGestureCameraManipulator"),e.onStartPinch=function(e,n){t.previousScale=n},e.onStartRotate=function(e,n){t.previousRotation=n},e.onStartPan=function(e,n){t.previousTranslation=n},e.onPinch=function(e,n,r){cB.dollyByFactor(e,n,r/t.previousScale),t.previousScale=r},e.onPan=function(e,n,r){var a=n.getActiveCamera(),s=e.getInteractorStyle(),i=a.getFocalPoint(),o=(i=s.computeWorldToDisplay(n,i[0],i[1],i[2]))[2],l=r,B=t.previousTranslation,Q=s.computeDisplayToWorld(n,i[0]+l[0]-B[0],i[1]+l[1]-B[1],o),c=s.computeDisplayToWorld(n,i[0],i[1],o),F=[];F[0]=c[0]-Q[0],F[1]=c[1]-Q[1],F[2]=c[2]-Q[2],i=a.getFocalPoint();var U=a.getPosition();a.setFocalPoint(F[0]+i[0],F[1]+i[1],F[2]+i[2]),a.setPosition(F[0]+U[0],F[1]+U[1],F[2]+U[2]),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),a.orthogonalizeViewUp(),t.previousTranslation=r},e.onRotate=function(e,n,r){var a=n.getActiveCamera();a.roll(r-t.previousRotation),a.orthogonalizeViewUp(),t.previousRotation=r}}var zB={};function PB(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zB,n),l.c.obj(e,t),YB.extend(e,t,n),gB.extend(e,t,n),OB(e,t)}var KB={newInstance:l.c.newInstance(PB,"vtkGestureCameraManipulator"),extend:PB},jB=n(20);function _B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qB(e){for(var t=1;te&&(e=r)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=lQ("pick"),e.hasKey=lQ("hasKey"),e.getRedrawMTime=function(){return t.mtime},e.setEstimatedRenderTime=function(e){t.estimatedRenderTime=e,t.savedEstimatedRenderTime=e},e.restoreEstimatedRenderTime=function(){t.estimatedRenderTime=t.savedEstimatedRenderTime},e.addEstimatedRenderTime=function(e){t.estimatedRenderTime+=e},e.setAllocatedRenderTime=function(e){t.allocatedRenderTime=e,t.savedEstimatedRenderTime=t.estimatedRenderTime,t.estimatedRenderTime=0},e.getSupportsSelection=function(){return!1},e.getTextures=function(){return t.textures},e.hasTexture=function(e){return-1!==t.textures.indexOf(e)},e.addTexture=function(n){n&&!e.hasTexture(n)&&(t.textures=t.textures.concat(n),e.modified())},e.removeTexture=function(n){var r=t.textures.filter((function(e){return e!==n}));t.textures.length!==r.length&&(t.textures=r,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}var QQ={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function cQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,QQ,n),l.c.obj(e,t),l.c.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),l.c.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier"]),BQ(e,t)}var FQ={newInstance:l.c.newInstance(cQ,"vtkProp"),extend:cQ};function UQ(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(n){t.position=t.position.map((function(e,t){return e+n[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=ba();Object(Z.j)(e,t.rotation);var n=new Float64Array(3),r=function(e,t){var n=2*Math.acos(t[3]),r=Math.sin(n/2);return r>ut.b?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}(n,e);return[Object(b.E)(r),n[0],n[1],n[2]]},e.rotateX=function(n){0!==n&&(Object(Z.a)(t.rotation,t.rotation,Object(b.B)(n)),e.modified())},e.rotateY=function(n){0!==n&&(Object(Z.b)(t.rotation,t.rotation,Object(b.B)(n)),e.modified())},e.rotateZ=function(n){0!==n&&(Object(Z.c)(t.rotation,t.rotation,Object(b.B)(n)),e.modified())},e.rotateWXYZ=function(n,r,a,s){if(0!==n&&(0!==r||0!==a||0!==s)){var i=Object(b.B)(n),o=ba();ya(o,[r,a,s],i);var l=new Float64Array(16);Object(Z.k)(l,o),Object(Z.l)(t.rotation,t.rotation,l),e.modified()}},e.setOrientation=function(n,r,a){return(n!==t.orientation[0]||r!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[n,r,a],Object(Z.h)(t.rotation),e.rotateZ(a),e.rotateX(n),e.rotateY(r),e.modified(),!0)},e.setUserMatrix=function(n){Object(Z.d)(t.userMatrix,n),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Object(Z.h)(t.matrix),t.userMatrix&&Object(Z.l)(t.matrix,t.matrix,t.userMatrix),Object(Z.s)(t.matrix,t.matrix,t.origin),Object(Z.s)(t.matrix,t.matrix,t.position),Object(Z.l)(t.matrix,t.matrix,t.rotation),Object(Z.r)(t.matrix,t.matrix,t.scale),Object(Z.s)(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),Object(Z.i)(t.matrix,t.matrix),t.isIdentity=!0;for(var n=0;n<4;++n)for(var r=0;r<4;++r)(n===r?1:0)!==t.matrix[n+4*r]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Bt.getCenter(t.bounds)},e.getLength=function(){return Bt.getLength(t.bounds)},e.getXRange=function(){return Bt.getXRange(t.bounds)},e.getYRange=function(){return Bt.getYRange(t.bounds)},e.getZRange=function(){return Bt.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var gQ={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[1,-1,1,-1,1,-1],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function dQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gQ,n),FQ.extend(e,t,n),t.matrixMTime={},l.c.obj(t.matrixMTime),l.c.get(e,t,["bounds","isIdentity"]),l.c.getArray(e,t,["orientation"]),l.c.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Object(Z.h)(new Float64Array(16)),t.rotation=Object(Z.h)(new Float64Array(16)),t.userMatrix=Object(Z.h)(new Float64Array(16)),t.transform=null,UQ(e,t)}var uQ={newInstance:l.c.newInstance(dQ,"vtkProp3D"),extend:dQ},IQ=l.c.vtkErrorMacro;function mQ(e,t){t.classHierarchy.push("vtkPiecewiseFunction"),e.getSize=function(){return t.nodes.length},e.getType=function(){var e,n=0,r=0;t.nodes.length>0&&(n=t.nodes[0].y);for(var a=1;an)switch(r){case 0:case 1:r=1;break;default:case 2:r=3}else switch(r){case 0:case 2:r=2;break;default:case 1:r=3}if(n=e,3===r)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:case 3:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var n=0;n0?t.nodes[n-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,n){var r=t.nodes.length;return e<0||e>=r?(IQ("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].y,n[2]=t.nodes[e].midpoint,n[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){var a=t.nodes.length;if(n<0||n>=a)return IQ("Index out of range!"),-1;var s=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].y=r[1],t.nodes[n].midpoint=r[2],t.nodes[n].sharpness=r[3],s!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,n){return e.addPointLong(t,n,.5,0)},e.addPointLong=function(n,r,a,s){if(a<0||a>1)return IQ("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return IQ("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var i,o={x:n,y:r,midpoint:a,sharpness:s};for(t.nodes.push(o),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=r,s=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(s=e.updateRange()),s||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(n,r,a,s){e.sortAndUpdateRange();for(var i=0;i=n&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(n,r,.5,0),e.addPoint(a,s,.5,0)},e.getValue=function(t){var n=[];return e.getTable(t,t,1,n),n[0]},e.adjustRange=function(n){if(n.length<2)return 0;var r=e.getRange();r[0]n[1]?e.addPoint(n[1],e.getValue(n[1])):e.addPoint(n[1],e.getValue(r[1])),e.sortAndUpdateRange();for(var a=0;a=n[0]&&t.nodes[a].x<=n[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var n=t.nodes[1].x-t.nodes[0].x,r=0;r4&&void 0!==arguments[4]?arguments[4]:1,o=0,l=t.nodes.length,B=0;0!==l&&(B=t.nodes[l-1].y);var Q=0,c=0,F=0,U=0,g=0,d=0,u=0;for(s=0;s1?e+s/(r-1)*(n-e):.5*(e+n);ot.nodes[o].x;)++o.99999&&(d=.99999));if(o>=l)a[I]=t.clamping?B:0;else if(0===o)a[I]=t.clamping?t.nodes[0].y:0;else{var m=(Q-c)/(F-c);if(m=m.99){if(m<.5){a[I]=U;continue}a[I]=g;continue}if(u<.01){a[I]=(1-m)*U+m*g;continue}m<.5?m=.5*Math.pow(2*m,1+10*u):m>.5&&(m=1-.5*Math.pow(2*(1-m),1+10*u));var C=m*m,b=C*m,y=2*b-3*C+1,S=-2*b+3*C,x=b-2*C+m,Z=b-C,h=g-U,p=(1-u)*h;a[I]=y*U+S*g+x*p+Z*p;var G=Ug?U:g;a[I]=a[I]R?R:a[I]}}}}var CQ={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function bQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CQ,n),l.c.obj(e,t),t.nodes=[],l.c.setGet(e,t,["allowDuplicateScalars","clamping"]),l.c.setArray(e,t,["range"],2),l.c.getArray(e,t,["range"]),mQ(e,t)}var yQ={newInstance:l.c.newInstance(bQ,"vtkPiecewiseFunction"),extend:bQ},SQ=Object.create(null);[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,7.54296e-7,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,1.11641e-7,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,3.63578e-7,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,4.05298e-7,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4.264e-8,0,6.20844e-7,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,3.3216e-7,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,4.05432e-7,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,4.55569e-8]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,4.55569e-8,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}].filter((function(e){return e.RGBPoints})).filter((function(e){return"CIELAB"!==e.ColorSpace})).forEach((function(e){SQ[e.Name]=e}));var xQ=Object.keys(SQ);xQ.sort();var ZQ={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(SQ[e.Name]||(xQ.push(e.Name),xQ.sort()),SQ[e.Name]=e)},removePresetByName:function(e){var t=xQ.indexOf(e);t>-1&&xQ.splice(t,1),delete SQ[e]},getPresetByName:function(e){return SQ[e]},rgbPresetNames:xQ},hQ={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};function pQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var GQ=hQ.ColorSpace,RQ=hQ.Scale,LQ=Gr.ScalarMappingTarget,VQ=l.c.vtkDebugMacro,AQ=l.c.vtkErrorMacro,fQ=l.c.vtkWarningMacro;function NQ(e,t){var n=e[0],r=e[1],a=e[2],s=Math.sqrt(n*n+r*r+a*a),i=s>.001?Math.acos(n/s):0,o=i>.001?Math.atan2(a,r):0;t[0]=s,t[1]=i,t[2]=o}function EQ(e,t){if(e[0]>=t-.1)return e[2];var n=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+n:e[2]-n}function DQ(e,t,n,r){var a=[],s=[];Object(b.f)(t,a),Object(b.f)(n,s);var i=[],o=[];NQ(a,i),NQ(s,o);var l=e;if(i[1]>.05&&o[1]>.05&&function(e,t){var n=e-t;for(n<0&&(n=-n);n>=2*Math.PI;)n-=2*Math.PI;return n>Math.PI&&(n=2*Math.PI-n),n}(i[2],o[2])>.33*Math.PI){var B=Math.max(i[0],o[0]);B=Math.max(88,B),e<.5?(o[0]=B,o[1]=0,o[2]=0,l*=2):(i[0]=B,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&o[1]>.05?i[2]=EQ(o,i[0]):o[1]<.05&&i[1]>.05&&(o[2]=EQ(i,o[0]));var Q=[];Q[0]=(1-l)*i[0]+l*o[0],Q[1]=(1-l)*i[1]+l*o[1],Q[2]=(1-l)*i[2]+l*o[2];var c=[];!function(e,t){var n=e[0],r=e[1],a=e[2];t[0]=n*Math.cos(r),t[1]=n*Math.sin(r)*Math.cos(a),t[2]=n*Math.sin(r)*Math.sin(a)}(Q,c),Object(b.g)(c,r)}function vQ(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,n,r,a){return e.addRGBPointLong(t,n,r,a,.5,0)},e.addRGBPointLong=function(n,r,a,s){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return AQ("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return AQ("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var l={x:n,r:r,g:a,b:s,midpoint:i,sharpness:o};t.nodes.push(l),e.sortAndUpdateRange();for(var B=0;B4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=[],l=[n,r,a];return Object(b.b)(l,o),e.addRGBPoint(t,o[0],o[1],o[2],s,i)},e.setNodes=function(n){t.nodes!==n&&(t.nodes=n,e.sortAndUpdateRange())},e.sortAndUpdateRange=function(){t.nodes.sort((function(e,t){return e.x-t.x})),e.updateRange()||e.modified()},e.updateRange=function(){var n=[2];n[0]=t.mappingRange[0],n[1]=t.mappingRange[1];var r=t.nodes.length;return r?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[r-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(n[0]!==t.mappingRange[0]||n[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(n){for(var r=0;r=t.nodes.length)return-1;var s=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(s=e.updateRange()),s||e.modified(),a},e.movePoint=function(n,r){if(n!==r){e.removePoint(r);for(var a=0;a=n&&t.nodes[Q].x<=i?t.nodes.splice(Q,1):Q++;e.addRGBPointLong(n,r,a,s,.5,0),e.addRGBPointLong(i,o,l,B,.5,0),e.modified()},e.addHSVSegment=function(t,n,r,a,s,i,o,l){var B=[i,o,l],Q=[],c=[];Object(b.b)([n,r,a],Q),Object(b.b)(B,c),e.addRGBSegment(t,Q[0],Q[1],Q[2],s,c[0],c[1],c[2])},e.mapValue=function(t){var n=[];return e.getColor(t,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},e.getColor=function(n,r){if(t.indexedLookup){var a=e.getSize(),s=e.getAnnotatedValueIndexInternal(n);if(s<0||0===a)e.getNanColor(r);else{var i=[];e.getNodeValue(s%a,i),r[0]=i.r,r[1]=i.g,r[2]=i.b}}else e.getTable(n,n,1,r)},e.getRedValue=function(t){var n=[];return e.getColor(t,n),n[0]},e.getGreenValue=function(t){var n=[];return e.getColor(t,n),n[1]},e.getBlueValue=function(t){var n=[];return e.getColor(t,n),n[2]},e.getTable=function(n,r,a,s){if(Object(b.c)(n)||Object(b.c)(r))for(var i=0;i0);var S=0,x=0,Z=0;y&&(S=Math.log10(n),x=Math.log10(r));for(var h=0;h1?y?(Z=S+h/(a-1)*(x-S),F=Math.pow(10,Z)):F=n+h/(a-1)*(r-n):y?(Z=.5*(S+x),F=Math.pow(10,Z)):F=.5*(n+r),t.discretize){var G=t.mappingRange;if(F>=G[0]&&F<=G[1]){var R=t.numberOfValues,L=G[1]-G[0];if(R<=1)F=G[0]+L/2;else{var V=(F-G[0])/L,A=Object(b.h)(R*V);F=G[0]+A/(R-1)*L}}}for(;ot.nodes[o].x;)++o.99999&&(I=.99999));if(F>t.mappingRange[1])s[p]=0,s[p+1]=0,s[p+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(s[p]=t.aboveRangeColor[0],s[p+1]=t.aboveRangeColor[1],s[p+2]=t.aboveRangeColor[2]):(s[p]=B,s[p+1]=Q,s[p+2]=c));else if(F0&&(s[p]=t.nodes[0].r,s[p+1]=t.nodes[0].g,s[p+2]=t.nodes[0].b));else if(0===o&&(Math.abs(F-n)<1e-6||t.discretize))l>0?(s[p]=t.nodes[0].r,s[p+1]=t.nodes[0].g,s[p+2]=t.nodes[0].b):(s[p]=0,s[p+1]=0,s[p+2]=0);else{var f=0;if(f=(f=y?(Z-U)/(g-U):(F-U)/(g-U)).99){if(f<.5){s[p]=d[0],s[p+1]=d[1],s[p+2]=d[2];continue}s[p]=u[0],s[p+1]=u[1],s[p+2]=u[2];continue}if(m<.01){if(t.colorSpace===GQ.RGB)s[p]=(1-f)*d[0]+f*u[0],s[p+1]=(1-f)*d[1]+f*u[1],s[p+2]=(1-f)*d[2]+f*u[2];else if(t.colorSpace===GQ.HSV){var N=[],E=[];Object(b.e)(d,N),Object(b.e)(u,E),t.hSVWrap&&(N[0]-E[0]>.5||E[0]-N[0]>.5)&&(N[0]>E[0]?N[0]-=1:E[0]-=1);var D=[];D[0]=(1-f)*N[0]+f*E[0],D[0]<0&&(D[0]+=1),D[1]=(1-f)*N[1]+f*E[1],D[2]=(1-f)*N[2]+f*E[2],Object(b.b)(D,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]}else if(t.colorSpace===GQ.LAB){var v=[],J=[];Object(b.f)(d,v),Object(b.f)(u,J);var W=[];W[0]=(1-f)*v[0]+f*J[0],W[1]=(1-f)*v[1]+f*J[1],W[2]=(1-f)*v[2]+f*J[2],Object(b.g)(W,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]}else t.colorSpace===GQ.DIVERGING?(DQ(f,d,u,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]):AQ("ColorSpace set to invalid value.",t.colorSpace);continue}f<.5?f=.5*Math.pow(2*f,1+10*m):f>.5&&(f=1-.5*Math.pow(2*(1-f),1+10*m));var X=f*f,H=X*f,T=2*H-3*X+1,k=-2*H+3*X,M=H-2*X+f,w=H-X,Y=void 0;if(t.colorSpace===GQ.RGB)for(var O=0;O<3;O++)Y=(1-m)*(u[O]-d[O]),s[p+O]=T*d[O]+k*u[O]+M*Y+w*Y;else if(t.colorSpace===GQ.HSV){var z=[],P=[];Object(b.e)(d,z),Object(b.e)(u,P),t.hSVWrap&&(z[0]-P[0]>.5||P[0]-z[0]>.5)&&(z[0]>P[0]?z[0]-=1:P[0]-=1);for(var K=[],j=0;j<3;j++)Y=(1-m)*(P[j]-z[j]),K[j]=T*z[j]+k*P[j]+M*Y+w*Y,0===j&&K[j]<0&&(K[j]+=1);Object(b.b)(K,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]}else if(t.colorSpace===GQ.LAB){var _=[],q=[];Object(b.f)(d,_),Object(b.f)(u,q);for(var $=[],ee=0;ee<3;ee++)Y=(1-m)*(q[ee]-_[ee]),$[ee]=T*_[ee]+k*q[ee]+M*Y+w*Y;Object(b.g)($,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]}else t.colorSpace===GQ.DIVERGING?(DQ(f,d,u,C),s[p]=C[0],s[p+1]=C[1],s[p+2]=C[2]):AQ("ColorSpace set to invalid value.");for(var te=0;te<3;te++)s[p+te]=s[p+te]<0?0:s[p+te],s[p+te]=s[p+te]>1?1:s[p+te]}}}},e.getUint8Table=function(n,r,a){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==s)return t.table;if(0===t.nodes.length)return AQ("Attempting to lookup a value with no points in the function"),t.table;var i=s?4:3;t.tableSize===a&&t.tableWithAlpha===s||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=s);var o=[];e.getTable(n,r,a,o);for(var l=0;l1&&(i=(r-n)/(a-1));for(var o=0;o=t.nodes.length?(AQ("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].r,n[2]=t.nodes[e].g,n[3]=t.nodes[e].b,n[4]=t.nodes[e].midpoint,n[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){if(n<0||n>=t.nodes.length)return AQ("Index out of range!"),-1;var a=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].r=r[1],t.nodes[n].g=r[2],t.nodes[n].b=r[3],t.nodes[n].midpoint=r[4],t.nodes[n].sharpness=r[5],a!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.getNumberOfAvailableColors=function(){return t.indexedLookup&&e.getSize()?e.getSize():t.tableSize?t.tableSize:16777216},e.getIndexedColor=function(t,n){var r=e.getSize();if(r>0&&t>=0){var a=[];e.getNodeValue(t%r,a);for(var s=0;s<3;++s)n[s]=a[s+1];n[3]=1}else e.getNanColor(n),n[3]=1},e.fillFromDataPointer=function(t,n){if(!(t<=0)&&n){e.removeAllPoints();for(var r=0;rn[1]?(e.getColor(n[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])):(e.getColor(r[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var s=0;s=n[0]&&t.nodes[s].x<=n[1]?t.nodes.splice(s,1):++s;return 1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,JQ,n),Gr.extend(e,t,n),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},l.c.obj(t.buildTime),l.c.get(e,t,["buildTime","mappingRange"]),l.c.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),l.c.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),l.c.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),vQ(e,t)}var XQ=function(e){for(var t=1;t(e=t.componentData[r].grayTransferFunction.getMTime())?n:e):3===t.componentData[r].colorChannels&&t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].scalarOpacity&&(n=n>(e=t.componentData[r].scalarOpacity.getMTime())?n:e),t.componentData[r].gradientOpacity&&(t.componentData[r].disableGradientOpacity||(n=n>(e=t.componentData[r].gradientOpacity.getMTime())?n:e));return n},e.getColorChannels=function(e){return e<0||e>3?(MQ("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(n,r){var a=!1;return t.componentData[n].grayTransferFunction!==r&&(t.componentData[n].grayTransferFunction=r,a=!0),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(n){return null===t.componentData[n].grayTransferFunction&&(t.componentData[n].grayTransferFunction=yQ.newInstance(),t.componentData[n].grayTransferFunction.addPoint(0,0),t.componentData[n].grayTransferFunction.addPoint(1024,1),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1),e.modified()),t.componentData[n].grayTransferFunction},e.setRGBTransferFunction=function(n,r){var a=!1;return t.componentData[n].rGBTransferFunction!==r&&(t.componentData[n].rGBTransferFunction=r,a=!0),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(n){return null===t.componentData[n].rGBTransferFunction&&(t.componentData[n].rGBTransferFunction=XQ.newInstance(),t.componentData[n].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[n].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3),e.modified()),t.componentData[n].rGBTransferFunction},e.setScalarOpacity=function(n,r){return t.componentData[n].scalarOpacity!==r&&(t.componentData[n].scalarOpacity=r,e.modified(),!0)},e.getScalarOpacity=function(n){return null===t.componentData[n].scalarOpacity&&(t.componentData[n].scalarOpacity=yQ.newInstance(),t.componentData[n].scalarOpacity.addPoint(0,1),t.componentData[n].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[n].scalarOpacity},e.setComponentWeight=function(n,r){if(n<0||n>=4)return MQ("Invalid index"),!1;var a=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==a&&(t.componentData[n].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(MQ("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(TQ.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(TQ.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(TQ.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return l.c.enumToString(TQ,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(n){var r=l.c.capitalize(n);e["set".concat(r)]=function(r,a){return t.componentData[r]["".concat(n)]!==a&&(t.componentData[r]["".concat(n)]=a,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(n){var r=l.c.capitalize(n);e["get".concat(r)]=function(e){return t.componentData[e]["".concat(n)]}}))}var YQ={independentComponents:!0,interpolationType:TQ.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function OQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,YQ,n),l.c.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r<4;++r)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:kQ.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}l.c.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),wQ(e,t)}var zQ=function(e){for(var t=1;tr[1])return t.mapperBounds=r.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),r;if(!t.mapperBounds||!(n=[r,t.mapperBounds],n[0].map((function(e,t){return n.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){PQ("Recomputing bounds..."),t.mapperBounds=r.map((function(e){return e}));var a=[];Bt.getCorners(r,a),e.computeMatrix();var s=new Float64Array(16);Object(Z.i)(s,t.matrix),a.forEach((function(e){return Object(h.q)(e,e,s)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?a.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):a.reduce((function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e}}var jQ={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function _Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jQ,n),uQ.extend(e,t,n),t.boundsMTime={},l.c.obj(t.boundsMTime),l.c.set(e,t,["property"]),l.c.setGet(e,t,["mapper"]),l.c.getArray(e,t,["bounds"],6),KQ(e,t)}var qQ={newInstance:l.c.newInstance(_Q,"vtkVolume"),extend:_Q},$Q=Qo.BlendMode;function ec(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Object(b.k)(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode($Q.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode($Q.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode($Q.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode($Q.AVERAGE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return l.c.enumToString($Q,t.blendMode)}}var tc={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:$Q.COMPOSITE_BLEND,averageIPScalarRange:[-1e6,1e6]};function nc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tc,n),Dr.extend(e,t,n),l.c.obj(e,t),l.c.algo(e,t,1,0),l.c.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode"]),l.c.setGetArray(e,t,["averageIPScalarRange"],2),l.c.event(e,t,"lightingActivated"),ec(e,t)}var rc={newInstance:l.c.newInstance(nc,"vtkVolumeMapper"),extend:nc};var ac=function(e){Kt(i,r.Component);var t,n,s=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=$t(t);if(n){var a=$t(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return qt(this,e)});function i(e){var t;return Object(pe.a)(this,i),(t=s.call(this,e)).lookupTable=XQ.newInstance(),t.piecewiseFunction=yQ.newInstance(),t.volume=qQ.newInstance(),t.mapper=rc.newInstance(),t.volume.setMapper(t.mapper),t.volume.getProperty().setRGBTransferFunction(0,t.lookupTable),t.volume.getProperty().setScalarOpacity(0,t.piecewiseFunction),t.volume.getProperty().setInterpolationTypeToLinear(),t}return Object(Ge.a)(i,[{key:"render",value:function(){var e=this;return a.a.createElement($B.Consumer,null,(function(t){return e.view||(t.renderer.addVolume(e.volume),e.view=t),a.a.createElement(eQ.Provider,{value:e},a.a.createElement(rQ.Provider,{value:e.mapper},a.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children)))}))}},{key:"componentDidMount",value:function(){this.update(this.props)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.view&&(this.view.renderer.removeVolume(this.volume),this.view=null),this.volume.delete(),this.volume=null,this.mapper.delete(),this.mapper=null}},{key:"update",value:function(e,t){var n,r=e.volume,a=e.property,s=e.mapper,i=e.colorMapPreset,l=e.colorDataRange;if(!r||t&&r===t.volume||this.volume.set(r),!a||t&&a===t.property||this.volume.getProperty().set(a),!s||t&&s===t.mapper||this.mapper.set(s),i&&(!t||i!==t.colorMapPreset)){var B,Q=ZQ.getPresetByName(i);this.lookupTable.applyColorMap(Q),(B=this.lookupTable).setMappingRange.apply(B,Object(o.a)(l)),this.lookupTable.updateRange()}!l||t&&l===t.colorDataRange||("string"==typeof l?t?(console.log("from update"),this.dataChanged()):(this.lookupTable.setMappingRange(0,1),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:0,y:0,midpoint:.5,sharpness:0},{x:1,y:1,midpoint:.5,sharpness:0}])):((n=this.lookupTable).setMappingRange.apply(n,Object(o.a)(l)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:l[0],y:0,midpoint:.5,sharpness:0},{x:l[1],y:1,midpoint:.5,sharpness:0}])))}},{key:"dataChanged",value:function(){if("auto"===this.props.colorDataRange){this.mapper.update();var e,t=this.mapper.getInputData(),n=t&&t.getPointData().getScalars(),r=n&&n.getRange();r&&((e=this.lookupTable).setMappingRange.apply(e,Object(o.a)(r)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:r[0],y:0,midpoint:.5,sharpness:0},{x:r[1],y:1,midpoint:.5,sharpness:0}])),this.view&&this.view.renderView()}}}]),i}();ac.defaultProps={colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto"},ac.propTypes={id:i.a.string,mapper:i.a.object,volume:i.a.object,property:i.a.object,colorMapPreset:i.a.string,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string]),children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var sc=ac,ic=Ws.InterpolationType,oc=l.c.vtkErrorMacro;function lc(e,t){t.classHierarchy.push("vtkImageProperty"),e.getMTime=function(){for(var e,n=t.mtime,r=0;r<4;r++)t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].piecewiseFunction&&(n=n>(e=t.componentData[r].piecewiseFunction.getMTime())?n:e);return n},e.setRGBTransferFunction=function(n,r){var a=n,s=r;return Number.isInteger(n)||(s=n,a=0),t.componentData[a].rGBTransferFunction!==s&&(t.componentData[a].rGBTransferFunction=s,e.modified(),!0)},e.getRGBTransferFunction=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.componentData[e].rGBTransferFunction},e.setPiecewiseFunction=function(n,r){var a=n,s=r;return Number.isInteger(n)||(s=n,a=0),t.componentData[a].piecewiseFunction!==s&&(t.componentData[a].piecewiseFunction=s,e.modified(),!0)},e.getPiecewiseFunction=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.componentData[e].piecewiseFunction},e.setScalarOpacity=function(t,n){var r=t,a=n;return Number.isInteger(t)||(a=t,r=0),e.setPiecewiseFunction(r,a)},e.getScalarOpacity=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e.getPiecewiseFunction(t)},e.setComponentWeight=function(n,r){if(n<0||n>=4)return oc("Invalid index"),!1;var a=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==a&&(t.componentData[n].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(oc("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(ic.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(ic.LINEAR)},e.getInterpolationTypeAsString=function(){return l.c.enumToString(ic,t.interpolationType)}}var Bc={independentComponents:!1,interpolationType:ic.LINEAR,colorWindow:255,colorLevel:127.5,ambient:1,diffuse:0,opacity:1};function Qc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Bc,n),l.c.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r<4;r++)t.componentData.push({rGBTransferFunction:null,piecewiseFunction:null,componentWeight:1})}l.c.setGet(e,t,["independentComponents","interpolationType","colorWindow","colorLevel","ambient","diffuse","opacity"]),lc(e,t)}var cc={newInstance:l.c.newInstance(Qc,"vtkImageProperty"),extend:Qc},Fc=l.c.vtkDebugMacro;function Uc(e,t){t.classHierarchy.push("vtkImageSlice"),e.getActors=function(){return e},e.getImages=function(){return e},e.getIsOpaque=function(){if(t.forceOpaque)return!0;if(t.forceTranslucent)return!1;t.property||e.getProperty();var n=t.property.getOpacity()>=1;return n&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return!1},e.makeProperty=cc.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n,r=t.mapper.getBounds();if(!r||6!==r.length)return r;if(r[0]>r[1])return t.mapperBounds=r.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),r;if(!t.mapperBounds||!(n=[r,t.mapperBounds],n[0].map((function(e,t){return n.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){Fc("Recomputing bounds..."),t.mapperBounds=r.map((function(e){return e}));var a=[];Bt.getCorners(r,a),e.computeMatrix();var s=new Float64Array(16);Object(Z.i)(s,t.matrix),a.forEach((function(e){return Object(h.q)(e,e,s)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?a.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):a.reduce((function(e,n){return e1&&void 0!==arguments[1]?arguments[1]:0,a=t.mapper.getBoundsForSlice(n,r);if(!a||6!==a.length)return a;if(a[0]>a[1])return a;var s=[];Bt.getCorners(a,s),e.computeMatrix();var i=new Float64Array(16);Object(Z.i)(i,t.matrix),s.forEach((function(e){return Object(h.q)(e,e,i)}));var o=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];return o.map((function(e,t){return t%2==0?s.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):s.reduce((function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}if(null!==t.property){var r=t.property.getMTime();e=r>e?r:e,null!==t.property.getRGBTransferFunction()&&(e=(r=t.property.getRGBTransferFunction().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var gc={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function dc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gc,n),uQ.extend(e,t,n),t.boundsMTime={},l.c.obj(t.boundsMTime),l.c.set(e,t,["property"]),l.c.setGet(e,t,["mapper"]),l.c.getArray(e,t,["bounds"],6),Uc(e,t)}var uc={newInstance:l.c.newInstance(dc,"vtkImageSlice"),extend:dc};function Ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;ti&&(i=Q,l=r[B]<0,o=B)}if(1!==i){var c="IJKXYZ"[t.slicingMode],F="IJKXYZ"[o];yc("Unaccurate slicing along ".concat(c," axis which ")+"is not aligned with any IJK axis of the image data. "+"Using ".concat(F," axis as a fallback (").concat(i,"% aligned). ")+"Necessitates slice reformat that is not yet implemented. You can switch the slicing mode on your mapper to do IJK slicing instead.")}t.closestIJKAxis={ijkMode:o,flip:l}}function r(n,r){var a=e.getInputData(),s=a.getExtent(),i=[s[0],s[2],s[4]],o=e.getClosestIJKAxis().ijkMode,l=t.slice;o!==t.slicingMode&&(l=e.getSliceAtPosition(l)),i[o]+=l;var B=[0,0,0];a.indexToWorld(i,B),i[o]+=1;var Q=[0,0,0];a.indexToWorld(i,Q),Q[0]-=B[0],Q[1]-=B[1],Q[2]-=B[2],Object(h.l)(Q,Q);var c=Re.a.intersectWithLine(n,r,B,Q);if(c.intersection){var F=c.x,U=[0,0,0];return a.worldToIndex(F,U),{t:c.t,absoluteIJK:U}}return null}t.classHierarchy.push("vtkImageMapper"),e.getSliceAtPosition=function(n){var r,a=e.getInputData();if(3===n.length)r=n;else if(Number.isFinite(n)){var s=a.getBounds();switch(t.slicingMode){case Sc.X:r=[n,(s[3]+s[2])/2,(s[5]+s[4])/2];break;case Sc.Y:r=[(s[1]+s[0])/2,n,(s[5]+s[4])/2];break;case Sc.Z:r=[(s[1]+s[0])/2,(s[3]+s[2])/2,n]}}var i=[0,0,0];a.worldToIndex(r,i);var o=a.getExtent(),l=0;switch(e.getClosestIJKAxis().ijkMode){case Sc.I:l=Object(b.F)(i[0],o[0],o[1]),l=Math.round(l);break;case Sc.J:l=Object(b.F)(i[1],o[2],o[3]),l=Math.round(l);break;case Sc.K:l=Object(b.F)(i[2],o[4],o[5]),l=Math.round(l);break;default:return 0}return l},e.setSliceFromCamera=function(n){var r=n.getFocalPoint();switch(t.slicingMode){case Sc.I:case Sc.J:case Sc.K:var a=e.getSliceAtPosition(r);e.setSlice(a);break;case Sc.X:e.setSlice(r[0]);break;case Sc.Y:e.setSlice(r[1]);break;case Sc.Z:e.setSlice(r[2])}},e.setXSlice=function(t){e.setSlicingMode(Sc.X),e.setSlice(t)},e.setYSlice=function(t){e.setSlicingMode(Sc.Y),e.setSlice(t)},e.setZSlice=function(t){e.setSlicingMode(Sc.Z),e.setSlice(t)},e.setISlice=function(t){e.setSlicingMode(Sc.I),e.setSlice(t)},e.setJSlice=function(t){e.setSlicingMode(Sc.J),e.setSlice(t)},e.setKSlice=function(t){e.setSlicingMode(Sc.K),e.setSlice(t)},e.getSlicingModeNormal=function(){var n=[0,0,0],r=e.getInputData().getDirection(),a=[[r[0],r[1],r[2]],[r[3],r[4],r[5]],[r[6],r[7],r[8]]];switch(t.slicingMode){case Sc.X:n[0]=1;break;case Sc.Y:n[1]=1;break;case Sc.Z:n[2]=1;break;case Sc.I:Object(b.l)(a,[1,0,0],n);break;case Sc.J:Object(b.l)(a,[0,1,0],n);break;case Sc.K:Object(b.l)(a,[0,0,1],n)}return n},e.setSlicingMode=function(r){t.slicingMode!==r&&(t.slicingMode=r,e.getInputData()&&n(),e.modified())},e.getClosestIJKAxis=function(){return void 0!==t.closestIJKAxis&&t.closestIJKAxis.ijkMode!==Sc.NONE||!e.getInputData()||n(),t.closestIJKAxis},e.getBounds=function(){var n=e.getInputData();if(!n)return Object(b.k)();if(!t.useCustomExtents)return n.getBounds();var r=t.customDisplayExtent.slice(),a=e.getClosestIJKAxis().ijkMode,s=t.slice;switch(a!==t.slicingMode&&(s=e.getSliceAtPosition(t.slice)),a){case Sc.I:r[0]=s,r[1]=s;break;case Sc.J:r[2]=s,r[3]=s;break;case Sc.K:r[4]=s,r[5]=s}return n.extentToBounds(r)},e.getBoundsForSlice=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.slice,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.getInputData();if(!a)return Object(b.k)();var s=a.getExtent(),i=e.getClosestIJKAxis(),o=i.ijkMode,l=n;switch(o!==t.slicingMode&&(l=e.getSliceAtPosition(n)),o){case Sc.I:s[0]=l-r,s[1]=l+r;break;case Sc.J:s[2]=l-r,s[3]=l+r;break;case Sc.K:s[4]=l-r,s[5]=l+r}return a.extentToBounds(s)},e.getIsOpaque=function(){return!0},e.intersectWithLineForPointPicking=function(t,n){var a=r(t,n);if(a){var s=e.getInputData().getExtent(),i=[Math.round(a.absoluteIJK[0]),Math.round(a.absoluteIJK[1]),Math.round(a.absoluteIJK[2])];return i[0]s[1]||i[1]s[3]||i[2]s[5]?null:{t:a.t,ijk:i}}return null},e.intersectWithLineForCellPicking=function(t,n){var a=r(t,n);if(a){var s=e.getInputData().getExtent(),i=a.absoluteIJK,o=[Math.floor(i[0]),Math.floor(i[1]),Math.floor(i[2])];if(o[0]s[1]-1||o[1]s[3]-1||o[2]s[5]-1)return null;var l=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];return{t:a.t,ijk:o,pCoords:l}}return null}}var Zc={displayExtent:[0,0,0,0,0,0],customDisplayExtent:[0,0,0,0],useCustomExtents:!1,slice:0,slicingMode:Sc.NONE,closestIJKAxis:{ijkMode:Sc.NONE,flip:!1},renderToRectangle:!1,sliceAtFocalPoint:!1};function hc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zc,n),Dr.extend(e,t,n),l.c.get(e,t,["slicingMode"]),l.c.setGet(e,t,["slice","closestIJKAxis","useCustomExtents","renderToRectangle","sliceAtFocalPoint"]),l.c.setGetArray(e,t,["customDisplayExtent"],4),zr.implementCoincidentTopologyMethods(e,t),xc(e,t)}var pc=mc(mc(mc({newInstance:l.c.newInstance(hc,"vtkImageMapper"),extend:hc},Cc),bc),vs);var Gc=function(e){Kt(i,r.Component);var t,n,s=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=$t(t);if(n){var a=$t(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return qt(this,e)});function i(e){var t;return Object(pe.a)(this,i),(t=s.call(this,e)).lookupTable=XQ.newInstance(),t.piecewiseFunction=yQ.newInstance(),t.actor=uc.newInstance(),t.mapper=pc.newInstance(),t.actor.setMapper(t.mapper),t}return Object(Ge.a)(i,[{key:"render",value:function(){var e=this;return a.a.createElement($B.Consumer,null,(function(t){return e.view||(t.renderer.addActor(e.actor),e.view=t),a.a.createElement(eQ.Provider,{value:e},a.a.createElement(rQ.Provider,{value:e.mapper},a.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children)))}))}},{key:"componentDidMount",value:function(){this.update(this.props)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.view&&this.view.renderer.removeActor(this.actor),this.actor.delete(),this.actor=null,this.mapper.delete(),this.mapper=null}},{key:"update",value:function(e,t){var n,r=e.actor,a=e.property,s=e.mapper,i=e.colorMapPreset,l=e.colorDataRange,B=e.iSlice,Q=e.jSlice,c=e.kSlice,F=e.xSlice,U=e.ySlice,g=e.zSlice;if(!r||t&&r===t.actor||this.actor.set(r),!a||t&&a===t.property||this.actor.getProperty().set(a),!s||t&&s===t.mapper||this.mapper.set(s),i&&(!t||i!==t.colorMapPreset)){var d,u=ZQ.getPresetByName(i);this.lookupTable.applyColorMap(u),(d=this.lookupTable).setMappingRange.apply(d,Object(o.a)(l)),this.lookupTable.updateRange()}!l||t&&l===t.colorDataRange||("string"==typeof l?t?this.dataChanged():(this.lookupTable.setMappingRange(0,1),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:0,y:0,midpoint:.5,sharpness:0},{x:1,y:1,midpoint:.5,sharpness:0}])):((n=this.lookupTable).setMappingRange.apply(n,Object(o.a)(l)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:l[0],y:0,midpoint:.5,sharpness:0},{x:l[1],y:1,midpoint:.5,sharpness:0}]))),!B||t&&B===t.iSlice||this.mapper.setISlice(B),!Q||t&&Q===t.jSlice||this.mapper.setJSlice(Q),!c||t&&c===t.kSlice||this.mapper.setKSlice(c),!F||t&&F===t.xSlice||this.mapper.setXSlice(F),!U||t&&U===t.ySlice||this.mapper.setYSlice(U),!g||t&&g===t.zSlice||this.mapper.setZSlice(g)}},{key:"dataChanged",value:function(){if("auto"===this.props.colorDataRange){this.mapper.update();var e,t=this.mapper.getInputData(),n=t&&t.getPointData().getScalars(),r=n&&n.getRange();r&&((e=this.lookupTable).setMappingRange.apply(e,Object(o.a)(r)),this.lookupTable.updateRange(),this.piecewiseFunction.setNodes([{x:r[0],y:0,midpoint:.5,sharpness:0},{x:r[1],y:1,midpoint:.5,sharpness:0}])),this.view&&this.view.renderView()}}}]),i}();Gc.defaultProps={colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto"},Gc.propTypes={id:i.a.string,mapper:i.a.object,actor:i.a.object,property:i.a.object,colorMapPreset:i.a.string,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string]),iSlice:i.a.number,jSlice:i.a.number,kSlice:i.a.number,xSlice:i.a.number,ySlice:i.a.number,zSlice:i.a.number,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var Rc=Gc,Lc='',Vc='',Ac='',fc=function(){function e(e,t){for(var n=0;n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:null,n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments[3];return new Promise((function(s,i){var o=n._messageId++;n._messages.set(o,[s,i,a]),n._worker.postMessage([o,t,e],r||[])}))}},{key:"postMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];return new Promise((function(a,s){var i=t._messageId++;t._messages.set(i,[a,s,r]),t._worker.postMessage([i,e],n||[])}))}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:256,n=[];n.lengths+o||cs+l?F===l?s:s+F/(F-l)*(c-s-l):-F===l?s:s-F/(F+l)*(c-s-l))-s)/F,g=Math.exp(-4*U*U),d=1-U*U,u=1,I=i*(B<1?B*d+(1-B)*g:(2-B)*d+(B-1)*u);I>n[Q]&&(n[Q]=I)}}return n}function Kc(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],s=t[2]/(n.length-1),i=!!r.fillStyle,o=a+t[1];e.lineWidth=r.lineWidth,e.strokeStyle=r.strokeStyle,e.beginPath(),e.moveTo(t[0],t[1]+t[3]);for(var l=0;l3&&void 0!==arguments[3]?arguments[3]:[0,1];return[r[0]+(e-n[0])/n[2]*(r[1]-r[0]),(t-n[1])/n[3]]}function _c(e,t){var n=t.map((function(t){return Math.abs(t.position-e)})),r=Math.min.apply(Math,Object(o.a)(n));return n.indexOf(r)}function qc(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var r=n.offsetX,a=n.offsetY;t&&n.preventDefault(),e(r,a)}}function $c(){Oc.filter((function(e){return e.ready})).forEach((function(e){e.callbacks.forEach((function(t){t.touches===e.touches&&t.clicks===e.count&&t.action.apply(t,Object(o.a)(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function eF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var s=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,(function(e){return[e.pageX-s.left,e.pageY-s.top]})).reduce((function(e,t){return[e[0]+t[0],e[1]+t[1]]}),[0,0]).map((function(e){return e/a.touches.length}));"touchstart"===a.type?(clearTimeout(Oc[e].timeout),Oc[e].ts=a.timeStamp,Oc[e].singleTouche=i,Oc[e].touches=a.touches.length):"touchmove"===a.type?(Oc[e].ts=0,Oc[e].count=0,Oc[e].ready=!1):"touchend"===a.type&&(a.timeStamp-Oc[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=r.numberOfBinToConsiders,s=void 0===a?1:a,i=r.numberOfBinsToSkip,o=void 0===i?1:i,l=r.numberOfComponents,B=void 0===l?1:l,Q=r.component,c=void 0===Q?0:Q;t.histogram=null,t.histogramArray=n,t.dataRange=Object(b.a)(n,c,B);var F=Object(ce.a)(t.dataRange,2),U=F[0],g=F[1],d=4,u=Math.floor(n.length/d)||1;u+=u%B;for(var I=0,m=[],C=[];Ir;)a.shift();for(var l=a.reduce((function(e,t){return e+t}),0)/r,B=0,Q=t.histogram.length;B1){for(var B=t.style.iconSize+t.style.padding,Q=B,c=0;r>Q;)c+=1,Q+=B;switch(c){case 0:var F=e.addGaussian(0,1,.1,0,0),U=t.gaussians[F],g=wc({},U),d=zc.adjustPosition;t.activeGaussian=F,t.selectedGaussian=F,l.c.setImmediate((function(){e.onDown(n,r),t.dragAction={originalXY:[0,0],action:d,gaussian:U,originalGaussian:g}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(i<0||i>1||o<0||o>1)t.selectedGaussian=-1,t.dragAction=null;else{var u=_c(i,t.gaussians);u!==t.selectedGaussian&&(t.selectedGaussian=u,e.modified())}return!0},e.onHover=function(n,r){var a=20/t.canvas.height,s=jc(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),i=Object(ce.a)(s,2),o=i[0],l=i[1],B=jc(n,r,t.graphArea),Q=Object(ce.a)(B,1)[0],c=o<0?t.selectedGaussian:_c(o,t.gaussians);t.canvas.style.cursor="default";var F=t.gaussians[c];if(t.enableRangeZoom&&Q>=0&&rt.rangeZoom[1]-U?t.canvas.style.cursor=Yc.adjustZoom:t.canvas.style.cursor=Yc.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:zc.adjustZoom}}else if(F&&Q>=0){var g,d=1-l;g=d>F.height+a?"adjustPosition":d>F.height-a?Math.abs(o-F.position).5*F.height+a?"adjustPosition":d>.5*F.height-a?Math.abs(o-F.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=Yc[g];var u=zc[g],I=wc({},F);t.dragAction={originalXY:[o,l],action:u,gaussian:F,originalGaussian:I}}return c!==t.activeGaussian&&(t.activeGaussian=c,e.modified()),!0},e.onDown=function(n,r){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=jc(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],s=_c(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[s];return i&&(t.gaussianSide=i.position-a),s!==t.selectedGaussian&&a>0&&(t.selectedGaussian=s,e.modified()),!0},e.onDrag=function(n,r){if(t.dragAction){var a=jc(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),s=Object(ce.a)(a,2),i=s[0],o=s[1];(0,t.dragAction.action)(i,o,wc({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=Pc(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(n,r){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(n,r){return e.onUp(n,r),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(n,r){var a=jc(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),s=Object(ce.a)(a,2),i=s[0],o=s[1];return i>=0&&e.addGaussian(i,1-o,.1,0,0),!0},e.onRemoveGaussian=function(n,r){var a=jc(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],s=_c(a,t.gaussians);return a>=0&&-1!==s&&e.removeGaussian(s),!0},e.bindMouseListeners=function(){if(!t.listeners){var n=function(){return!!t.mouseIsDown},r=function(){for(var e=Oc.length,t=arguments.length,n=new Array(t),r=0;r1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),B=Math.round(l+s+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(B-s/2,B,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(B-l+t.style.strokeWidth+2-s/2,B),e.lineTo(B+l-t.style.strokeWidth-2-s/2,B),e.stroke(),e.moveTo(B-s/2,B-l+t.style.strokeWidth+2),e.lineTo(B-s/2,B+l-t.style.strokeWidth-2),e.stroke(),-1===t.selectedGaussian?(e.fillStyle=t.style.buttonDisableFillColor,e.lineWidth=t.style.buttonDisableStrokeWidth,e.strokeStyle=t.style.buttonDisableStrokeColor):(e.fillStyle=t.style.buttonFillColor,e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor),e.beginPath(),e.arc(B-s/2,B+s/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(B-l+t.style.strokeWidth+2-s/2,B+s/2+t.style.iconSize),e.lineTo(B+l-t.style.strokeWidth-2-s/2,B+s/2+t.style.iconSize),e.stroke()}if(t.histogram&&Kc(e,i,nF(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),Kc(e,i,nF(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var Q=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,n,r){var a=r||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var s=a.getContext("2d"),i=e.getUint8Table(n[0],n[1],t,4),o=s.getImageData(0,0,t,256),l=0;l<256;l++)o.data.set(i,4*l*t);for(var B=256*t*4,Q=4*t,c=3;c0&&(a=Math.min(a,i)),t.opacities[i]>0&&(s=Math.max(s,i));return[n[0]+a*r,n[0]+s*r]};var n=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var r=n(e);return r&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),r};var r=e.setRangeZoom;e.setRangeZoom=function(){var e=r.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,Object(o.a)(t.size))}var sF={histogram:[],numberOfBins:256,histogramArray:null,dataRange:[0,1],gaussians:[],opacities:[],size:[600,300],piecewiseSize:256,colorCanvasMTime:0,gaussianMinimumHeight:.05,style:{backgroundColor:"rgba(255, 255, 255, 1)",histogramColor:"rgba(200, 200, 200, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(0, 0, 150)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",handleColor:"rgb(0, 150, 0)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:20,padding:10,zoomControlHeight:10,zoomControlColor:"#999"},activeGaussian:-1,selectedGaussian:-1,enableRangeZoom:!0,rangeZoom:[0,1]};function iF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sF,n),l.c.obj(e,t),l.c.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),l.c.setGetArray(e,t,["rangeZoom"],2),l.c.get(e,t,["size","canvas","gaussians"]),l.c.event(e,t,"opacityChange"),l.c.event(e,t,"animation"),l.c.event(e,t,"zoomChange"),aF(e,t)}var oF=wc({newInstance:l.c.newInstance(iF,"vtkPiecewiseGaussianWidget"),extend:iF},rF);var lF={container:"VolumeController-module_container__2HNSO",line:"VolumeController-module_line__3rtqL",button:"VolumeController-module_button__2T-xL",sliderEntry:"VolumeController-module_sliderEntry__27XSC",sliderIcon:"VolumeController-module_sliderIcon__U8YAZ VolumeController-module_button__2T-xL",slider:"VolumeController-module_slider__3PS68",piecewiseEditor:"VolumeController-module_piecewiseEditor__2_jav",select:"VolumeController-module_select__7mbfS",presets:"VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadow:"VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS",buttonDarkBG:"VolumeController-module_buttonDarkBG__3W1zO VolumeController-module_button__2T-xL",presetsDarkBG:"VolumeController-module_presetsDarkBG__2ZI2W VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadowDarkBG:"VolumeController-module_shadowDarkBG__WHYZ- VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS",buttonBrightBG:"VolumeController-module_buttonBrightBG__2dstz VolumeController-module_button__2T-xL",presetsBrightBG:"VolumeController-module_presetsBrightBG__3_VRC VolumeController-module_presets__1h4j5 VolumeController-module_select__7mbfS",shadowBrightBG:"VolumeController-module_shadowBrightBG__YCHpe VolumeController-module_shadow__29K9t VolumeController-module_select__7mbfS"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".VolumeController-module_container__2HNSO {\n display: flex;\n align-items: stretch;\n flex-direction: column;\n justify-content: space-between;\n position: absolute;\n top: 5px;\n left: 5px;\n background: rgba(128, 128, 128, 0.5);\n border-radius: 5px;\n padding: 2px;\n border: 0.5px solid black;\n box-sizing: border-box;\n}\n\n.VolumeController-module_line__3rtqL {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n}\n\n.VolumeController-module_button__2T-xL {\n cursor: pointer;\n width: 1rem;\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.VolumeController-module_button__2T-xL svg {\n width: 1rem;\n height: 1rem;\n}\n\n.VolumeController-module_sliderEntry__27XSC {\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.VolumeController-module_sliderIcon__U8YAZ {\n height: 1rem;\n}\n\n.VolumeController-module_slider__3PS68 {\n flex: 1;\n min-height: 1rem;\n width: 5px;\n}\n\n.VolumeController-module_piecewiseEditor__2_jav {\n flex: 1;\n}\n\n.VolumeController-module_select__7mbfS {\n flex: 1;\n border: none;\n background: transparent;\n color: white;\n border: none;\n -moz-appearance: none;\n width: 5px;\n}\n\n.VolumeController-module_select__7mbfS select:focus {\n outline: none;\n border: none;\n}\n\n.VolumeController-module_presets__1h4j5 {\n}\n\n.VolumeController-module_shadow__29K9t {\n}\n\n.VolumeController-module_buttonDarkBG__3W1zO {\n}\n\n.VolumeController-module_presetsDarkBG__2ZI2W {\n color: white;\n}\n\n.VolumeController-module_presetsDarkBG__2ZI2W option {\n color: black;\n}\n\n.VolumeController-module_shadowDarkBG__WHYZ- {\n color: white;\n}\n\n.VolumeController-module_shadowDarkBG__WHYZ- option {\n color: black;\n}\n\n.VolumeController-module_buttonBrightBG__2dstz {\n}\n\n.VolumeController-module_presetsBrightBG__3_VRC {\n color: black;\n}\n\n.VolumeController-module_presetsBrightBG__3_VRC option {\n color: white;\n}\n\n.VolumeController-module_shadowBrightBG__YCHpe {\n color: black;\n}\n\n.VolumeController-module_shadowBrightBG__YCHpe option {\n color: white;\n}\n");var BF=ZQ.rgbPresetNames.map((function(e){return'")}));function QF(e,t){function n(){var e=!!Number(t.el.querySelector(".js-shadow").value);t.actor.getProperty().setShade(e),t.renderWindow.render()}function r(){var e=t.actor.getMapper().getInputData();if(e){var n=e.getPointData().getScalars()||e.getPointData().getArrays()[0],r=t.rescaleColorMap?t.colorDataRange:n.getRange(),a=ZQ.getPresetByName(t.el.querySelector(".js-color-preset").value),s=t.actor.getProperty().getRGBTransferFunction(0);s.applyColorMap(a),s.setMappingRange.apply(s,Object(o.a)(r)),s.updateRange(),t.renderWindow.render()}}function a(){var e=Number(t.el.querySelector(".js-spacing").value),n=t.actor.getMapper().getInputData(),r=.7*Math.sqrt(n.getSpacing().map((function(e){return e*e})).reduce((function(e,t){return e+t}),0));t.actor.getMapper().setSampleDistance(r*Math.pow(2,3*e-1.5)),t.renderWindow.render()}function s(){var e=Number(t.el.querySelector(".js-edge").value);if(0===e)t.actor.getProperty().setUseGradientOpacity(0,!1);else{var n=t.actor.getMapper().getInputData(),r=(n.getPointData().getScalars()||n.getPointData().getArrays()[0]).getRange();t.actor.getProperty().setUseGradientOpacity(0,!0);var a=Math.max(0,e-.3)/.7;t.actor.getProperty().setGradientOpacityMinimumValue(0,.2*(r[1]-r[0])*a*a),t.actor.getProperty().setGradientOpacityMaximumValue(0,1*(r[1]-r[0])*e*e)}t.renderWindow.render()}t.classHierarchy.push("vtkVolumeController"),t.el=document.createElement("div"),t.el.setAttribute("class",lF.container),t.widget=oF.newInstance({numberOfBins:256,size:t.size}),e.setupContent=function(i,o,l){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"1",Q=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"erdc_rainbow_bright";e.setActor(o),e.setRenderWindow(i);var c=t.actor.getMapper().getInputData(),F=c.getPointData().getScalars()||c.getPointData().getArrays()[0],U=t.actor.getProperty().getRGBTransferFunction(0),g=t.actor.getProperty().getScalarOpacity(0),d=l?"DarkBG":"BrightBG",u={};["button","presets","shadow"].forEach((function(e){u[e]=lF["".concat(e).concat(d)]})),t.el.innerHTML='\n
\n
').concat(Vc,'
\n \n \n
\n
\n
\n
').concat(Ac,'
\n \n
\n
\n
').concat(Lc,'
\n \n
\n
\n
\n ');var I=t.el.querySelector(".js-button"),m=t.el.querySelector(".js-shadow"),C=t.el.querySelector(".js-color-preset"),b=t.el.querySelector(".js-spacing"),y=t.el.querySelector(".js-edge"),S=t.el.querySelector(".js-pwf");t.widget.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(100, 100, 100, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(255, 255, 255)",handleColor:"rgb(50, 150, 50)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:0,padding:10}),t.widget.addGaussian(.5,1,.5,.5,.4),t.widget.setDataArray(F.getData()),t.widget.setColorTransferFunction(U),t.widget.applyOpacity(g),t.widget.setContainer(S),t.widget.bindMouseListeners(),t.colorDataRange=t.widget.getOpacityRange(),I.addEventListener("click",e.toggleVisibility),m.addEventListener("change",n),C.addEventListener("change",r),b.addEventListener("input",a),y.addEventListener("input",s),t.widget.onOpacityChange((function(){t.widget.applyOpacity(g),t.colorDataRange=t.widget.getOpacityRange(),t.rescaleColorMap&&r(),t.renderWindow.getInteractor().isAnimating()||t.renderWindow.render()})),t.widget.onAnimation((function(e){e?t.renderWindow.getInteractor().requestAnimation(t.widget):(t.renderWindow.getInteractor().cancelAnimation(t.widget),t.renderWindow.render())})),U.onModified((function(){t.widget.render(),t.renderWindow.getInteractor().isAnimating()||t.renderWindow.render()})),m.value=Number(B)?"1":"0",C.value=Q,n(),r(),a(),s()},e.setContainer=function(n){t.container&&t.container!==n&&t.container.removeChild(t.el),t.container!==n&&(t.container=n,t.container&&t.container.appendChild(t.el),e.modified())};var i=e.setRescaleColorMap;e.setRescaleColorMap=function(e){return!!i(e)&&(r(),!0)},e.toggleVisibility=function(){e.setExpanded(!e.getExpanded())},e.setExpanded=function(e){var n=t.el.querySelectorAll(".js-toggle"),r=n.length;if(t.expanded=e,t.expanded)for(;r--;)n[r].style.display="flex";else for(;r--;)n[r].style.display="none"},e.getExpanded=function(){return t.expanded},e.setSize=t.widget.setSize,e.render=t.widget.render,e.onAnimation=t.widget.onAnimation,e.onModified(e.render),e.setSize.apply(e,Object(o.a)(t.size))}var cF={size:[600,300],expanded:!0,rescaleColorMap:!1};function FF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cF,n),l.c.obj(e,t),l.c.setGet(e,t,["actor","renderWindow","rescaleColorMap"]),l.c.get(e,t,["widget"]),QF(e,t)}var UF={newInstance:l.c.newInstance(FF,"vtkVolumeController"),extend:FF};var gF=function(e){Kt(n,r.Component);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$t(e);if(t){var a=$t(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return qt(this,n)}}(n);function n(e){var r;Object(pe.a)(this,n),(r=t.call(this,e)).subscriptions=[],r.containerRef=a.a.createRef();var s=e.size,i=e.rescaleColorMap;return r.controller=UF.newInstance({size:s,rescaleColorMap:i}),r}return Object(Ge.a)(n,[{key:"render",value:function(){var e=this;return a.a.createElement($B.Consumer,null,(function(t){return a.a.createElement(eQ.Consumer,null,(function(n){return e.view=t,e.representation=n,a.a.createElement("div",{ref:e.containerRef})}))}))}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(e,t,n){var r;(r=this.controller).setSize.apply(r,Object(o.a)(this.props.size)),this.controller.render()}},{key:"componentWillUnmount",value:function(){for(;this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.controller.setContainer(null),this.controller.delete(),this.controller=null}},{key:"init",value:function(){var e=this,t=this.containerRef.current,n=this.view,r=n.renderWindow,a=n.props,s=this.representation.volume,i=a.background[0]+a.background[1]+a.background[2]<1.5;if(s&&s.getMapper()&&s.getMapper().getInputData()){var o=s.getMapper().getInputData();this.controller.setContainer(t),this.controller.setupContent(r,s,i),this.controller.render(),this.view.resetCamera(),this.view.renderView(),this.subscriptions.push(o.onModified((function(){return e.onDataChange()}),-1))}else setTimeout((function(){return e.init()}),100)}},{key:"onDataChange",value:function(){var e=this.controller.getWidget();if(this.representation&&this.representation.volume){var t=this.representation.volume.getMapper().getInputData(),n=t.getPointData().getScalars()||t.getPointData().getArrays()[0];e.setDataArray(n.getData())}}}]),n}();gF.defaultProps={size:[400,150],rescaleColorMap:!0},gF.propTypes={id:i.a.string,size:i.a.arrayOf(i.a.number),rescaleColorMap:i.a.bool};var dF=gF;function uF(e){return a.a.createElement(tQ.Consumer,null,(function(t){return a.a.createElement(nQ.Provider,{value:t.getPointData()},e.children)}))}uF.defaultProps={},uF.propTypes={children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var IF=uF;var mF=function(e){Kt(n,r.Component);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$t(e);if(t){var a=$t(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return qt(this,n)}}(n);function n(e){var r;return Object(pe.a)(this,n),(r=t.call(this,e)).polydata=c.a.newInstance(),r}return Object(Ge.a)(n,[{key:"render",value:function(){var e=this;return a.a.createElement(eQ.Consumer,null,(function(t){return a.a.createElement(rQ.Consumer,null,(function(n){return e.representation=t,e.downstream||(e.downstream=n),a.a.createElement(tQ.Provider,{value:e.polydata},a.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}))}},{key:"componentDidMount",value:function(){this.update(this.props),this.downstream.setInputData(this.polydata,this.props.port)}},{key:"componentDidUpdate",value:function(e,t,n){this.update(this.props,e)}},{key:"componentWillUnmount",value:function(){this.polydata.delete(),this.polydata=null}},{key:"update",value:function(e,t){var n=e.connectivity,r=e.points,a=e.verts,s=e.lines,i=e.polys,o=e.strips,l=!1,B=r&&r.length>196608?Uint32Array:Uint16Array;if(!r||t&&r===t.points||(this.polydata.getPoints().setData(Float64Array.from(r),3),l=!0),!a||t&&a===t.verts||(this.polydata.getVerts().setData(B.from(a)),l=!0),!s||t&&s===t.lines||(this.polydata.getLines().setData(B.from(s)),l=!0),!i||t&&i===t.polys||(this.polydata.getPolys().setData(B.from(i)),l=!0),!o||t&&o===t.strips||(this.polydata.getStrips().setData(B.from(o)),l=!0),n&&(n||!t||n!==t.connectivity)){var Q=r.length/3;switch(n){case"points":var c=new Uint32Array(Q+1);c[0]=Q;for(var F=0;F2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,n),l.c.obj(e,t),l.c.algo(e,t,1,1),SF(e,t)}),"vtkTrivialProducer"),ZF={},hF=function(e){Kt(n,r.Component);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$t(e);if(t){var a=$t(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return qt(this,n)}}(n);function n(){return Object(pe.a)(this,n),t.apply(this,arguments)}return Object(Ge.a)(n,[{key:"getTrivialProducer",value:function(){var e=ZF[this.props.name];return e||(e=xF(),ZF[this.props.name]=e),e}},{key:"render",value:function(){var e=this;return a.a.createElement(rQ.Consumer,null,(function(t){return e.downstream||(e.downstream=t),a.a.createElement(rQ.Provider,{value:e.getTrivialProducer()},a.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}},{key:"componentDidMount",value:function(){this.downstream&&this.downstream.setInputConnection(this.getTrivialProducer().getOutputPort(),this.props.port)}}]),n}();hF.defaultProps={port:0,name:"shared"},hF.propTypes={id:i.a.string,port:i.a.number,name:i.a.string,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var pF=hF;function GF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var RF=l.c.vtkDebugMacro;function LF(e,t){t.classHierarchy.push("vtkActor");var n=function(e){for(var t=1;t=1;return(n=n&&(!t.texture||!t.texture.isTranslucent()))&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return null!==t.mapper&&(null===t.property&&e.setProperty(e.makeProperty()),!e.getIsOpaque())},e.makeProperty=Fr.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||n[0]!==t.mapperBounds[0]||n[1]!==t.mapperBounds[1]||n[2]!==t.mapperBounds[2]||n[3]!==t.mapperBounds[3]||n[4]!==t.mapperBounds[4]||n[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){RF("Recomputing bounds..."),t.mapperBounds=n.concat();var r=[];Bt.getCorners(n,r),e.computeMatrix();var a=new Float64Array(16);Object(Z.i)(a,t.matrix),r.forEach((function(e){return Object(h.q)(e,e,a)})),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map((function(e,t){return t%2==0?r.reduce((function(e,n){return e>n[t/2]?n[t/2]:e}),e):r.reduce((function(e,n){return ee?r:e}if(null!==t.backfaceProperty){var a=t.backfaceProperty.getMTime();e=a>e?a:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var VF={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function AF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VF,n),uQ.extend(e,t,n),t.boundsMTime={},l.c.obj(t.boundsMTime),l.c.set(e,t,["property"]),l.c.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),LF(e,t)}var fF={newInstance:l.c.newInstance(AF,"vtkActor"),extend:AF};function NF(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,n,r,a,s){if(t.callback){var i=n.getCompositeProjectionMatrix(r,-1,1);Object(Z.i)(i,i);for(var o=e.getPoints(),l=new Float64Array(3),B=a.usize,Q=a.vsize,c=B/2,F=Q/2,U=[],g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EF,n),oa.extend(e,t,n),l.c.setGet(e,t,["callback","useZValues"]),NF(e,t)}var vF={newInstance:l.c.newInstance(DF,"vtkPixelSpaceCallbackMapper"),extend:DF};function JF(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setImage=function(n){t.image!==n&&(null!==n&&(e.setInputData(null),e.setInputConnection(null)),t.image=n,t.imageLoaded=!1,n.complete?e.imageLoaded():n.addEventListener("load",e.imageLoaded),e.modified())}}var WF={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,imageLoaded:!1};function XF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,WF,n),l.c.obj(e,t),l.c.algo(e,t,6,0),l.c.get(e,t,["imageLoaded"]),l.c.setGet(e,t,["repeat","edgeClamp","interpolate","image"]),JF(e,t)}var HF={newInstance:l.c.newInstance(XF,"vtkTexture"),extend:XF},TF=Math.sqrt(50),kF=Math.sqrt(10),MF=Math.sqrt(2);function wF(e,t,n){var r=(t-e)/Math.max(0,n),a=Math.floor(Math.log(r)/Math.LN10),s=r/Math.pow(10,a);return a>=0?(s>=TF?10:s>=kF?5:s>=MF?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=TF?10:s>=kF?5:s>=MF?2:1)}function YF(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function OF(e,t){return et?1:e>=t?0:NaN}function zF(e){let t=e,n=e;function r(e,t,r,a){for(null==r&&(r=0),null==a&&(a=e.length);r>>1;n(e[s],t)<0?r=s+1:a=s}return r}return 1===e.length&&(t=(t,n)=>e(t)-n,n=function(e){return(t,n)=>OF(e(t),n)}(e)),{left:r,center:function(e,n,a,s){null==a&&(a=0),null==s&&(s=e.length);const i=r(e,n,a,s-1);return i>a&&t(e[i-1],n)>-t(e[i],n)?i-1:i},right:function(e,t,r,a){for(null==r&&(r=0),null==a&&(a=e.length);r>>1;n(e[s],t)>0?a=s:r=s+1}return r}}}const PF=zF(OF).right;function KF(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _F(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qF(){}zF((function(e){return null===e?NaN:+e})).center;var $F="\\s*([+-]?\\d+)\\s*",eU="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tU="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nU=/^#([0-9a-f]{3,8})$/,rU=new RegExp("^rgb\\("+[$F,$F,$F]+"\\)$"),aU=new RegExp("^rgb\\("+[tU,tU,tU]+"\\)$"),sU=new RegExp("^rgba\\("+[$F,$F,$F,eU]+"\\)$"),iU=new RegExp("^rgba\\("+[tU,tU,tU,eU]+"\\)$"),oU=new RegExp("^hsl\\("+[eU,tU,tU]+"\\)$"),lU=new RegExp("^hsla\\("+[eU,tU,tU,eU]+"\\)$"),BU={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function QU(){return this.rgb().formatHex()}function cU(){return this.rgb().formatRgb()}function FU(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nU.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?UU(t):3===n?new IU(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?gU(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?gU(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=rU.exec(e))?new IU(t[1],t[2],t[3],1):(t=aU.exec(e))?new IU(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=sU.exec(e))?gU(t[1],t[2],t[3],t[4]):(t=iU.exec(e))?gU(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=oU.exec(e))?yU(t[1],t[2]/100,t[3]/100,1):(t=lU.exec(e))?yU(t[1],t[2]/100,t[3]/100,t[4]):BU.hasOwnProperty(e)?UU(BU[e]):"transparent"===e?new IU(NaN,NaN,NaN,0):null}function UU(e){return new IU(e>>16&255,e>>8&255,255&e,1)}function gU(e,t,n,r){return r<=0&&(e=t=n=NaN),new IU(e,t,n,r)}function dU(e){return e instanceof qF||(e=FU(e)),e?new IU((e=e.rgb()).r,e.g,e.b,e.opacity):new IU}function uU(e,t,n,r){return 1===arguments.length?dU(e):new IU(e,t,n,null==r?1:r)}function IU(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mU(){return"#"+bU(this.r)+bU(this.g)+bU(this.b)}function CU(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function bU(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function yU(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xU(e,t,n,r)}function SU(e){if(e instanceof xU)return new xU(e.h,e.s,e.l,e.opacity);if(e instanceof qF||(e=FU(e)),!e)return new xU;if(e instanceof xU)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),i=NaN,o=s-a,l=(s+a)/2;return o?(i=t===s?(n-r)/o+6*(n0&&l<1?0:i,new xU(i,o,l,e.opacity)}function xU(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ZU(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}jF(qF,FU,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:QU,formatHex:QU,formatHsl:function(){return SU(this).formatHsl()},formatRgb:cU,toString:cU}),jF(IU,uU,_F(qF,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new IU(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new IU(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mU,formatHex:mU,formatRgb:CU,toString:CU})),jF(xU,(function(e,t,n,r){return 1===arguments.length?SU(e):new xU(e,t,n,null==r?1:r)}),_F(qF,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new xU(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new xU(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new IU(ZU(e>=240?e-240:e+120,a,r),ZU(e,a,r),ZU(e<120?e+240:e-120,a,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var hU=e=>()=>e;function pU(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):hU(isNaN(e)?t:e)}var GU=function e(t){var n=function(e){return 1==(e=+e)?pU:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):hU(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=uU(e)).r,(t=uU(t)).r),a=n(e.g,t.g),s=n(e.b,t.b),i=pU(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=a(t),e.b=s(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function RU(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,a=t.slice();return function(s){for(n=0;ns&&(a=t.slice(s,a),o[i]?o[i]+=a:o[++i]=a),(n=n[0])===(r=r[0])?o[i]?o[i]+=r:o[++i]=r:(o[++i]=null,l.push({i:i,x:KF(n,r)})),s=NU.lastIndex;return st&&(n=e,e=t,t=n),B=function(n){return Math.max(e,Math.min(t,n))}),r=l>2?kU:TU,a=s=null,c}function c(t){return isNaN(t=+t)?n:(a||(a=r(i.map(e),o,l)))(e(B(t)))}return c.invert=function(n){return B(t((s||(s=r(o,i.map(e),KF)))(n)))},c.domain=function(e){return arguments.length?(i=Array.from(e,JU),Q()):i.slice()},c.range=function(e){return arguments.length?(o=Array.from(e),Q()):o.slice()},c.rangeRound=function(e){return o=Array.from(e),l=vU,Q()},c.clamp=function(e){return arguments.length?(B=!!e||XU,Q()):B!==XU},c.interpolate=function(e){return arguments.length?(l=e,Q()):l},c.unknown=function(e){return arguments.length?(n=e,c):n},function(n,r){return e=n,t=r,Q()}}()(XU,XU)}var YU,OU=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zU(e){if(!(t=OU.exec(e)))throw new Error("invalid format: "+e);var t;return new PU({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function PU(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function KU(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function jU(e){return(e=KU(Math.abs(e)))?e[1]:NaN}function _U(e,t){var n=KU(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}zU.prototype=PU.prototype,PU.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var qU={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>_U(100*e,t),r:_U,s:function(e,t){var n=KU(e,t);if(!n)return e+"";var r=n[0],a=n[1],s=a-(YU=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=r.length;return s===i?r:s>i?r+new Array(s-i+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+KU(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $U(e){return e}var eg,tg,ng,rg=Array.prototype.map,ag=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sg(e,t,n,r){var a,s=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),s=r/a;return s>=TF?a*=10:s>=kF?a*=5:s>=MF&&(a*=2),t0)return[e];if((r=t0)for(e=Math.ceil(e/i),t=Math.floor(t/i),s=new Array(a=Math.ceil(t-e+1));++o0;){if((a=wF(l,B,n))===r)return s[i]=l,s[o]=B,t(s);if(a>0)l=Math.floor(l/a)*a,B=Math.ceil(B/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,B=Math.floor(B*a)/a}r=a}return e},e}function og(){var e=wU();return e.copy=function(){return MU(e,og())},YF.apply(e,arguments),ig(e)}function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(a-=o,a+o)),!((l+=o+1)>r));)o=e[i=(i+1)%e.length];return s.reverse().join(t)}}(rg.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?$U:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(rg.call(e.numerals,String)),i=void 0===e.percent?"%":e.percent+"",o=void 0===e.minus?"−":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function B(e){var B=(e=zU(e)).fill,Q=e.align,c=e.sign,F=e.symbol,U=e.zero,g=e.width,d=e.comma,u=e.precision,I=e.trim,m=e.type;"n"===m?(d=!0,m="g"):qU[m]||(void 0===u&&(u=12),I=!0,m="g"),(U||"0"===B&&"="===Q)&&(U=!0,B="0",Q="=");var C="$"===F?n:"#"===F&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",b="$"===F?r:/[%p]/.test(m)?i:"",y=qU[m],S=/[defgprs%]/.test(m);function x(e){var n,r,i,F=C,x=b;if("c"===m)x=y(e)+x,e="";else{var Z=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:y(Math.abs(e),u),I&&(e=function(e){e:for(var t,n=e.length,r=1,a=-1;r0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),Z&&0==+e&&"+"!==c&&(Z=!1),F=(Z?"("===c?c:o:"-"===c||"("===c?"":c)+F,x=("s"===m?ag[8+YU/3]:"")+x+(Z&&"("===c?")":""),S)for(n=-1,r=e.length;++n(i=e.charCodeAt(n))||i>57){x=(46===i?a+e.slice(n+1):e.slice(n))+x,e=e.slice(0,n);break}}d&&!U&&(e=t(e,1/0));var h=F.length+e.length+x.length,p=h>1)+F+e+x+p.slice(h);break;default:e=p+F+e+x}return s(e)}return u=void 0===u?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,u)):Math.max(0,Math.min(20,u)),x.toString=function(){return e+""},x}return{format:B,formatPrefix:function(e,t){var n=B(((e=zU(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(jU(t)/3))),a=Math.pow(10,-r),s=ag[8+r/3];return function(e){return n(a*e)+s}}}}({thousands:",",grouping:[3],currency:["$",""]}),tg=eg.format,ng=eg.formatPrefix;var Qg=[[-1,0,0],[1,0,0],[0,-1,0],[0,1,0],[0,0,-1],[0,0,1]],cg=[[8,7,11,3],[9,1,10,5],[4,9,0,8],[2,11,6,10],[0,3,2,1],[4,5,6,7]],Fg=[[0,1],[1,3],[2,3],[0,2],[4,5],[5,7],[6,7],[4,6],[0,4],[1,5],[3,7],[2,6]],Ug=[0,1,0,1,0,1,0,1,2,2,2,2],gg=[[1,2],[1,2],[0,2],[0,2],[0,1],[0,1]],dg=new Float64Array(3),ug=new Float64Array(3),Ig=new Float64Array(3),mg=new Float64Array(3),Cg=new Float64Array(3),bg=new Float64Array(3),yg=new Float64Array(16);function Sg(e,t){e.strokeStyle=t.strokeColor,e.lineWidth=t.strokeSize,e.fillStyle=t.fontColor,e.font="".concat(t.fontStyle," ").concat(t.fontSize,"px ").concat(t.fontFamily)}function xg(e,t){t.classHierarchy.push("vtkCubeAxesActor");var n=new Map;e.setCamera=function(n){t.camera!==n&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=n,n&&(t.cameraModifiedSub=n.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=function(){var e=t.camera.getViewMatrix();Object(Z.i)(e,e);for(var n=!1,r=Bt.getDiagonalLength(t.dataBounds),a=Math.sin(t.faceVisibilityAngle*Math.PI/180),s=0;s<6;s++){var i=!1,o=Math.floor(s/2),l=(o+1)%3,B=(o+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*B]!==t.dataBounds[2*B+1]&&(dg[o]=t.dataBounds[s]-.1*r*Qg[s][o],dg[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),dg[B]=.5*(t.dataBounds[2*B]+t.dataBounds[2*B+1]),Object(h.q)(Ig,dg,e),dg[o]=t.dataBounds[s],Object(h.q)(mg,dg,e),Object(h.a)(Ig,mg,Ig),Object(h.l)(Ig,Ig),i=Ig[2]>a,t.camera.getParallelProjection()||(Object(h.l)(mg,mg),i=Object(h.d)(mg,Ig)>a)),i!==t.lastFacesToDraw[s]&&(t.lastFacesToDraw[s]=i,n=!0)}return n},e.updatePolyData=function(e,n,r){var a=0,s=0;a+=8;for(var i=0,o=0;o<12;o++)n[o]>0&&i++;if(s+=i,t.gridLines)for(var l=0;l<6;l++)e[l]&&(a+=2*r[gg[l][0]].length+2*r[gg[l][1]].length,s+=r[gg[l][0]].length+r[gg[l][1]].length);for(var B=new Float64Array(3*a),Q=new Uint32Array(3*s),c=0,F=0,U=0;U<2;U++)for(var g=0;g<2;g++)for(var d=0;d<2;d++)B[3*c]=t.dataBounds[d],B[3*c+1]=t.dataBounds[2+g],B[3*c+2]=t.dataBounds[4+U],c++;for(var u=0;u<12;u++)n[u]>0&&(Q[3*F]=2,Q[3*F+1]=Fg[u][0],Q[3*F+2]=Fg[u][1],F++);if(t.gridLines)for(var I=0;I<6;I++)if(e[I]){for(var m=Math.floor(I/2),C=r[gg[I][0]],b=0;b.5?Object(h.b)(Ig,Cg,i[0]*o):Object(h.b)(Ig,Cg,i[0]*o-B.width/2),Object(h.g)(dg,dg,Ig),Object(h.b)(Ig,bg,i[1]*o-B.height/2),Object(h.g)(dg,dg,Ig),l.points[3*U]=dg[0],l.points[3*U+1]=dg[1],l.points[3*U+2]=dg[2],l.tcoords[2*U]=B.tcoords[0],l.tcoords[2*U+1]=B.tcoords[1],U++,Object(h.b)(Ig,Cg,B.width),Object(h.g)(dg,dg,Ig),l.points[3*U]=dg[0],l.points[3*U+1]=dg[1],l.points[3*U+2]=dg[2],l.tcoords[2*U]=B.tcoords[2],l.tcoords[2*U+1]=B.tcoords[3],U++,Object(h.b)(Ig,bg,B.height),Object(h.g)(dg,dg,Ig),l.points[3*U]=dg[0],l.points[3*U+1]=dg[1],l.points[3*U+2]=dg[2],l.tcoords[2*U]=B.tcoords[4],l.tcoords[2*U+1]=B.tcoords[5],U++,Object(h.b)(Ig,Cg,B.width),Object(h.a)(dg,dg,Ig),l.points[3*U]=dg[0],l.points[3*U+1]=dg[1],l.points[3*U+2]=dg[2],l.tcoords[2*U]=B.tcoords[6],l.tcoords[2*U+1]=B.tcoords[7],U++,l.polys[4*g]=3,l.polys[4*g+1]=U-4,l.polys[4*g+2]=U-3,l.polys[4*g+3]=U-2,g++,l.polys[4*g]=3,l.polys[4*g+1]=U-4,l.polys[4*g+2]=U-2,l.polys[4*g+3]=U-1,l.ptIdx+=4,l.cellIdx+=2}},e.updateTexturePolyData=function(){var n=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);Object(Z.i)(n,n);var r=t.textValues.length,a=4*r,s=2*r,i=new Float64Array(3*a),o=new Uint16Array(4*s),l=new Float32Array(2*a);Object(Z.g)(yg,n);for(var Q={ptIdx:0,cellIdx:0,polys:o,points:i,tcoords:l},c=0,F=0,U=0,g=t.textPolyData.getPoints().getData();c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zg(n)),fF.extend(e,t,n),t.lastSize=[800,800],t.lastAspectRatio=1,t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.mapper=oa.newInstance(),t.polyData=c.a.newInstance(),t.mapper.setInputData(t.polyData),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.textPolyData=c.a.newInstance(),t.tmPolyData=c.a.newInstance(),t.tmMapper=oa.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=HF.newInstance(),t.tmTexture.setInterpolate(!1),t.tmActor=fF.newInstance(),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t.pixelMapper=vF.newInstance(),t.pixelMapperPolyData=c.a.newInstance(),t.pixelMapper.setInputData(t.pixelMapperPolyData),t.pixelMapper.setCallback((function(e,n,r,a,s){t.lastSize=s,t.lastAspectRatio=s[0]/s[1]})),t.pixelActor=fF.newInstance(),t.pixelActor.setMapper(t.pixelMapper),l.c.setGet(e,t,["axisTitlePixelOffset","faceVisibilityAngle","gridLines","tickLabelPixelOffset"]),l.c.setGetArray(e,t,["dataBounds"],6),l.c.setGetArray(e,t,["axisLabels"],3),l.c.get(e,t,["axisTextStyle","tickTextStyle","camera"]),xg(e,t)}var pg={newInstance:l.c.newInstance(hg,"vtkCubeAxesActor"),extend:hg};var Gg=function(e){Kt(n,r.Component);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$t(e);if(t){var a=$t(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return qt(this,n)}}(n);function n(e){var r;return Object(pe.a)(this,n),(r=t.call(this,e)).actor=fF.newInstance({representationId:e.id}),r.lookupTable=XQ.newInstance(),r.mapper=oa.newInstance({lookupTable:r.lookupTable,useLookupTableScalarRange:!0}),r.actor.setMapper(r.mapper),r.cubeAxes=pg.newInstance({visibility:!1,dataBounds:[-1,1,-1,1,-1,1]}),r.cubeAxes.getActors().forEach((function(e){return(0,e.setVisibility)(!1)})),r.subscriptions=[],r.subscriptions.push(r.mapper.onModified((function e(){if(r.mapper.getInputData()){1===r.subscriptions.length&&r.subscriptions.push(r.mapper.getInputData().onModified(e));var t=r.mapper.getInputData().getBounds();t[0]t.bounds[1]&&(t.bounds[1]=c[0]),c[1]>t.bounds[3]&&(t.bounds[3]=c[1]),c[2]>t.bounds[5]&&(t.bounds[5]=c[2]);var f=new Float32Array(m,36*y,9);mt(f,S),yt(f,f),bt(f,f)}var N=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var E=e.getLookupTable();E&&N&&(E.build(),t.colorArray=E.mapScalars(N,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),n=e.getInputData().getPoints().getNumberOfValues()/3;return{points:n*t.getPoints().getNumberOfValues()/3,verts:n*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:n*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:n*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var Dg={orient:!0,orientationMode:Ag.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:fg.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function vg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dg,n),oa.extend(e,t,n),l.c.algo(e,t,2,0),t.buildTime={},l.c.obj(t.buildTime,{mtime:0}),t.boundsTime={},l.c.obj(t.boundsTime,{mtime:0}),l.c.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),l.c.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),Eg(e,t)}var Jg=function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:{};return{getArrays:function(){return{input:e.augmentInputArrays(t,n.map((function(e){return{location:t,name:e}}))),output:[{location:t,name:r,attribute:"outputAttributeType"in s?s.outputAttributeType:T.a.SCALARS,numberOfComponents:"numberOfOutputComponents"in s?s.numberOfOutputComponents:1}]}},evaluate:function(e,t){var n=new Array(e.length),r=e.map((function(e,t){var r=e.getNumberOfComponents(),a=e.getData();return 1===r?function(e){return a[e]}:function(r){return e.getTuple(r,n[t])}})),s=t[0],i=s.getData(),l=s.getNumberOfComponents(),B=new Array(l);if(1===l)i.forEach((function(e,t){i[t]=a.apply(void 0,Object(o.a)(r.map((function(e){return e(t)}))).concat([t,B]))}));else for(var Q=s.getNumberOfTuples(),c=function(e){B=a.apply(void 0,Object(o.a)(r.map((function(t){return t(e)}))).concat([e,B])),s.setTuple(e,B)},F=0;F4&&void 0!==arguments[4]?arguments[4]:{};return e.setFormula(e.createSimpleFormulaObject(t,n,r,a,s))},e.prepareArrays=function(e,t,n){var r=[],a=[];return e.input.forEach((function(e){if(e.location===jB.b.COORDINATE)r.push(t.getPoints());else{var n=[[jB.b.UNIFORM,function(e){return e.getFieldData()}],[jB.b.POINT,function(e){return e.getPointData()}],[jB.b.CELL,function(e){return e.getCellData()}],[jB.b.VERTEX,function(e){return e.getVertexData()}],[jB.b.EDGE,function(e){return e.getEdgeData()}],[jB.b.ROW,function(e){return e.getRowData()}]].reduce((function(e,t){return e[t[0]]=t[1],e}),{}),a="location"in e&&e.location in n?n[e.location](t):null;a?e.name?r.push(a.getArrayByName(e.name)):"index"in e?r.push(a.getArrayByIndex(e.index)):"attribute"in e&&e.location!==jB.b.UNIFORM?r.push(a.getActiveAttribute(e.attribute)):(_g('No matching array for specifier "'.concat(JSON.stringify(e),'".')),r.push(null)):(_g('Specifier "'.concat(JSON.stringify(e),'" did not provide a usable location.')),r.push(null))}})),e.output.forEach((function(e){var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$g,n),l.c.obj(e,t),l.c.algo(e,t,1,1),qg(e,t)}var td={newInstance:l.c.newInstance(ed,"vtkCalculator"),extend:ed};var nd=Qt.a.FieldDataTypes,rd=function(e){Kt(n,r.Component);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$t(e);if(t){var a=$t(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return qt(this,n)}}(n);function n(e){var r;return Object(pe.a)(this,n),(r=t.call(this,e)).calculator=td.newInstance(),r}return Object(Ge.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.arrays,s=t.location,i=t.formula;return this.calculator.setFormulaSimple(nd[s],r,n,i),a.a.createElement(rQ.Consumer,null,(function(t){return e.downstream||(t.setInputConnection(e.calculator.getOutputPort(),e.props.port),e.downstream=t),a.a.createElement(rQ.Provider,{value:e.calculator},a.a.createElement("div",{key:e.props.id,id:e.props.id},e.props.children))}))}},{key:"componentWillUnmount",value:function(){this.calculator.delete(),this.calculator=null}}]),n}();rd.defaultProps={port:0,name:"scalars",location:"POINT",arrays:[],formula:function(e){return e[0]}},rd.propTypes={id:i.a.string,port:i.a.number,name:i.a.string,location:i.a.string,arrays:i.a.arrayOf(i.a.string),formula:i.a.func,children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var ad=rd;function sd(e){return a.a.createElement(tQ.Consumer,null,(function(t){return a.a.createElement(nQ.Provider,{value:t.getCellData()},e.children)}))}sd.defaultProps={},sd.propTypes={children:i.a.oneOfType([i.a.arrayOf(i.a.node),i.a.node])};var id={VolumeRepresentation:sc,SliceRepresentation:Rc,VolumeController:dF,PointData:IF,PolyData:CF,Reader:yF,ShareDataSet:pF,View:oQ,GeometryRepresentation:Rg,GlyphRepresentation:Xg,ImageData:Tg,DataArray:Mg,FieldData:Yg,Algorithm:Kg,Calculator:ad,CellData:sd};function od(e){var t=0,n=null,r=null;return e.rgb&&(n=e.rgb,t=3,r="Uint8Array"),e.rgba&&(n=e.rgb,t=4,r="Uint8Array"),e.scalars&&(n=e.scalars,t=1,r="Float32Array"),console.log("nbComponents",t),a.a.createElement(Rg,{id:e.id,colorMapPreset:e.colorMapPreset,colorDataRange:e.colorDataRange,property:e.property},a.a.createElement(CF,{points:e.xyz,connectivity:"points"},t&&a.a.createElement(IF,null,a.a.createElement(Mg,{registration:"setScalars",numberOfComponents:t,values:n,type:r}))))}od.defaultProps={xyz:[0,0,0],colorMapPreset:"erdc_rainbow_bright",colorDataRange:[0,1]},od.propTypes={id:i.a.string,xyz:i.a.arrayOf(i.a.number),rgb:i.a.arrayOf(i.a.number),rgba:i.a.arrayOf(i.a.number),scalars:i.a.arrayOf(i.a.number),colorMapPreset:i.a.string,colorDataRange:i.a.arrayOf(i.a.number),property:i.a.object};var ld=od;function Bd(e){var t=0,n=null,r=null;return e.rgb&&(n=e.rgb,t=3,r="Uint8Array"),e.rgba&&(n=e.rgb,t=4,r="Uint8Array"),e.scalars&&(n=e.scalars,t=1,r=e.scalarsType),a.a.createElement(sc,{id:e.id,colorMapPreset:e.colorMapPreset,colorDataRange:e.colorDataRange,property:e.property,mapper:e.mapper,volume:e.volume},e.volumeController&&a.a.createElement(dF,{rescaleColorMap:e.rescaleColorMap,size:e.controllerSize}),a.a.createElement(Tg,{dimensions:e.dimensions,origin:e.origin,spacing:e.spacing},a.a.createElement(IF,null,a.a.createElement(Mg,{registration:"setScalars",numberOfComponents:t,values:n,type:r}))))}Bd.defaultProps={scalarsType:"Float32Array",colorMapPreset:"erdc_rainbow_bright",colorDataRange:"auto",volumeController:!0,rescaleColorMap:!0,controllerSize:[400,150]},Bd.propTypes={id:i.a.string,dimensions:i.a.arrayOf(i.a.number),spacing:i.a.arrayOf(i.a.number),origin:i.a.arrayOf(i.a.number),rgb:i.a.arrayOf(i.a.number),rgba:i.a.arrayOf(i.a.number),scalars:i.a.arrayOf(i.a.number),scalarsType:i.a.string,mapper:i.a.object,volume:i.a.object,property:i.a.object,colorMapPreset:i.a.string,volumeController:i.a.bool,controllerSize:i.a.arrayOf(i.a.number),rescaleColorMap:i.a.bool,colorDataRange:i.a.oneOfType([i.a.arrayOf(i.a.number),i.a.string])};var Qd={PointCloudRepresentation:ld,VolumeDataRepresentation:Bd},cd=id.VolumeRepresentation,Fd=id.SliceRepresentation,Ud=id.VolumeController,gd=id.PointData,dd=id.PolyData,ud=id.Reader,Id=id.ShareDataSet,md=id.View,Cd=id.GeometryRepresentation,bd=id.GlyphRepresentation,yd=id.ImageData,Sd=id.DataArray,xd=id.FieldData,Zd=id.Algorithm,hd=id.Calculator,pd=id.CellData,Gd=Qd.PointCloudRepresentation,Rd=Qd.VolumeDataRepresentation;function Ld(e){return a.a.createElement(Zd,e)}function Vd(e){return a.a.createElement(hd,e)}function Ad(e){return a.a.createElement(pd,e)}function fd(e){return a.a.createElement(Sd,e)}function Nd(e){return a.a.createElement(xd,e)}function Ed(e){return a.a.createElement(Cd,e)}function Dd(e){return a.a.createElement(bd,e)}function vd(e){return a.a.createElement(yd,e)}function Jd(){return(Jd=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:2,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=[\"TB\",\"GB\",\"MB\",\"KB\"],o=Number(n),i=\"B\";o>e;)o/=e,i=r.pop();return\"\".concat(o.toFixed(t),\" \").concat(i)}function j(n){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\" \",e=[],r=n;r>1e3;)e.push(\"000\".concat(r%1e3).slice(-3)),r=Math.floor(r/1e3);return r>0&&e.push(r),e.reverse(),e.join(t)}function E(n){Object.keys(n).forEach((function(t){Array.isArray(n[t])&&(n[t]=[].concat(n[t]))}))}function w(n,t){if(n===t)return!0;if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return!1;for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};E(t);var e=[];function o(n){e[n]=null}function i(n){return Object.freeze({unsubscribe:function(){o(n)}})}return Number.isInteger(t.mtime)||(t.mtime=++u),t.classHierarchy=[\"vtkObject\"],n.isDeleted=function(){return!!t.deleted},n.modified=function(r){t.deleted?v(\"instance deleted - cannot call any method\"):r&&r0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-n]},n.set=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!1;return Object.keys(e).forEach((function(u){var c=i?null:n[\"set\".concat(k(u))];c&&Array.isArray(e[u])&&c.length>1?a=c.apply(void 0,r(e[u]))||a:c?a=c(e[u])||a:(-1!==[\"mtime\"].indexOf(u)||o||h(\"Warning: Set value to model directly \".concat(u,\", \").concat(e[u])),t[u]=e[u],a=!0)})),a},n.get=function(){for(var n=arguments.length,e=new Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1];if(e.getClassName()!==n.getClassName())throw new Error(\"Cannot ShallowCopy \".concat(e.getClassName(),\" into \").concat(n.getClassName()));var o=e.get(),i=Object.keys(t).sort(),a=Object.keys(o).sort();a.forEach((function(n){var e=i.indexOf(n);-1===e?r&&g(\"add \".concat(n,\" in shallowCopy\")):i.splice(e,1),t[n]=o[n]})),i.length&&r&&g(\"Untouched keys: \".concat(i.join(\", \"))),n.modified()},n}function D(n,e,r){r.forEach((function(r){\"object\"===t(r)?n[\"get\".concat(k(r.name))]=function(){return e[r.name]}:n[\"get\".concat(k(r))]=function(){return e[r]}}))}var T={enum:function(n,t,e){return function(r){if(\"string\"==typeof r){if(void 0!==e.enum[r])return t[e.name]!==e.enum[r]&&(t[e.name]=e.enum[r],n.modified(),!0);throw v(\"Set Enum with invalid argument \".concat(e,\", \").concat(r)),new RangeError(\"Set Enum with invalid string argument\")}if(\"number\"==typeof r){if(t[e.name]!==r){if(-1!==Object.keys(e.enum).map((function(n){return e.enum[n]})).indexOf(r))return t[e.name]=r,n.modified(),!0;throw v(\"Set Enum outside numeric range \".concat(e,\", \").concat(r)),new RangeError(\"Set Enum outside numeric range\")}return!1}throw v(\"Set Enum with invalid argument (String/Number) \".concat(e,\", \").concat(r)),new TypeError(\"Set Enum with invalid argument (String/Number)\")}}};function S(n){if(\"object\"===t(n)){var e=T[n.type];if(e)return function(t,r){return e(t,r,n)};throw v(\"No setter for field \".concat(n)),new TypeError(\"No setter for field\")}return function(t,e){return function(r){return e.deleted?(v(\"instance deleted - cannot call any method\"),!1):e[n]!==r&&(e[n]=r,t.modified(),!0)}}}function N(n,e,r){r.forEach((function(r){\"object\"===t(r)?n[\"set\".concat(k(r.name))]=S(r)(n,e):n[\"set\".concat(k(r))]=S(r)(n,e)}))}function x(n,t,e){D(n,t,e),N(n,t,e)}function L(n,t,e){e.forEach((function(e){n[\"get\".concat(k(e))]=function(){return[].concat(t[e])},n[\"get\".concat(k(e),\"ByReference\")]=function(){return t[e]}}))}function _(n,t,e,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;e.forEach((function(e){n[\"set\".concat(k(e))]=function(){if(t.deleted)return v(\"instance deleted - cannot call any method\"),!1;for(var i=arguments.length,a=new Array(i),u=0;u4&&void 0!==arguments[4]?arguments[4]:void 0;L(n,t,e),_(n,t,e,r,o)}function B(n,t,e,r){function i(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?v(\"instance deleted - cannot call any method\"):r>=t.numberOfInputs?v(\"algorithm \".concat(n.getClassName(),\" only has \").concat(t.numberOfInputs,\" input ports. To add more input ports, use addInputData()\")):(t.inputData[r]!==e||t.inputConnection[r])&&(t.inputData[r]=e,t.inputConnection[r]=null,n.modified&&n.modified())}function a(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)v(\"instance deleted - cannot call any method\");else{if(r>=t.numberOfInputs){var o=\"algorithm \".concat(n.getClassName(),\" only has \");return o+=\"\".concat(t.numberOfInputs),void v(o+=\" input ports. To add more input ports, use addInputConnection()\")}t.inputData[r]=null,t.inputConnection[r]=e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(v(\"instance deleted - cannot call any method\"),null):(n.shouldUpdate()&&n.update(),t.output[e])}if(t.inputData?t.inputData=t.inputData.map(o):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(o):t.inputConnection=[],t.output?t.output=t.output.map(o):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(o):t.inputArrayToProcess=[],t.numberOfInputs=e,n.shouldUpdate=function(){for(var e=n.getMTime(),o=r,i=1/0;o--;){if(!t.output[o])return!0;var a=t.output[o].getMTime();if(ai)return!0;return!1},t.numberOfInputs){for(var c=t.numberOfInputs;c--;)t.inputData.push(null),t.inputConnection.push(null);n.setInputData=i,n.setInputConnection=a,n.addInputData=function(n){t.deleted?v(\"instance deleted - cannot call any method\"):(t.numberOfInputs++,i(n,t.numberOfInputs-1))},n.addInputConnection=function(n){t.deleted?v(\"instance deleted - cannot call any method\"):(t.numberOfInputs++,a(n,t.numberOfInputs-1))},n.getInputData=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[n]&&(t.inputData[n]=t.inputConnection[n]()),t.inputData[n]},n.getInputConnection=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[n]}}r&&(n.getOutputData=u,n.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=function(){return u(t)};return e.filter=n,e}),n.update=function(){var e=[];if(t.numberOfInputs)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:\"Scalars\";t.inputArrayToProcess.length1&&void 0!==arguments[1]?arguments[1]:0;if(!n.apply)return console.error(\"Invalid callback for event \".concat(r)),null;if(e.deleted)return v(\"instance deleted - cannot call any method\"),null;var i=a++;return o.push([i,n,t]),o.sort((function(n,t){return t[2]-n[2]})),c(i)},t.delete=function(){i(),o.forEach((function(t){return u(n(t,1)[0])}))}}function R(n,t){var e=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},r={};return n(r,e,t),Object.freeze(r)};return t&&o.register(t,e),e}function K(){for(var n=arguments.length,t=new Array(n),e=0;e2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(Y(n)){if(r.indexOf(n)>=0)return e;r.push(n);var o=t(n);void 0!==o&&e.push(o);var i=n.get();Object.keys(i).forEach((function(n){var o=i[n];Array.isArray(o)?o.forEach((function(n){X(n,t,e,r)})):X(o,t,e,r)}))}return e}function z(n,t,e){var r,o=this;return function(){for(var i=arguments.length,a=new Array(i),u=0;u2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},e),n.setKey=function(n,e){t.keystore[n]=e},n.getKey=function(n){return t.keystore[n]},n.getAllKeys=function(){return Object.keys(t.keystore)},n.deleteKey=function(n){return delete t.keystore[n]},n.clearKeystore=function(){return n.getAllKeys().forEach((function(n){return delete t.keystore[n]}))}}var W=1;function V(n,t){J(n,t);var r=n.delete;t.proxyId=\"\".concat(W++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),D(n,t,[\"proxyId\",\"proxyGroup\",\"proxyName\"]),x(n,t,[\"proxyManager\"]);var o={},i={};function u(n,t){i[t]||(i[t]=[]);for(var e=i[t],r=0;r0&&void 0!==arguments[0]?arguments[0]:\"__root__\";return i[n]}function l(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"__root__\",r=[],o=t.proxyId,i=c(e)||[],a=0;a1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[n])return t.propertyLinkMap[n];var o=null,i=[],a=0,u=!1;function c(r){var c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u)return null;var l=[],f=null;for(a=i.length;a--;){var s=i[a];s.instance===r?f=s:l.push(s)}if(!f)return null;var p=f.instance[\"get\".concat(k(f.propertyName))]();if(!w(p,o)||c){for(o=p,u=!0;l.length;){var d=l.pop();d.instance.set(e({},d.propertyName,o))}u=!1}return t.propertyLinkMap[n].persistent&&(t.propertyLinkMap[n].value=p),p}function l(n,t){var e=[];for(a=i.length;a--;){var r=i[a];r.instance!==n||r.propertyName!==t&&void 0!==t||(r.subscription.unsubscribe(),e.push(a))}for(;e.length;)i.splice(e.pop(),1)}function f(r,o){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=r.onModified(c),f=i[0];return i.push({instance:r,propertyName:o,subscription:u}),a&&(t.propertyLinkMap[n].persistent&&void 0!==t.propertyLinkMap[n].value?r.set(e({},o,t.propertyLinkMap[n].value)):f&&c(f.instance,!0)),{unsubscribe:function(){return l(r,o)}}}function s(){for(;i.length;)i.pop().subscription.unsubscribe()}var p={bind:f,unbind:l,unsubscribe:s,persistent:r};return t.propertyLinkMap[n]=p,p},n.listPropertyNames=function(){return l().map((function(n){return n.name}))},n.getPropertyByName=function(n){return l().find((function(t){return t.name===n}))},n.getPropertyDomainByName=function(n){return(o[n]||{}).domain},n.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},n.delete=function(){for(var e=Object.keys(t.propertyLinkMap),o=e.length;o--;)t.propertyLinkMap[e[o]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(n.gcPropertyLinks),r()},M((function(){if(t.links)for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function o(n){for(var e=Object.keys(n),r=e.length;r--;){var o=e[r];t[o].set(n[o])}}t.this=n;for(var i=Object.keys(r),a=i.length,u=function(){var u=i[a];t[u]=r[u];var c=e[u];n[\"set\".concat(k(u))]=function(e){e!==t[u]&&(t[u]=e,o(c[e]),n.modified())}};a--;)u();i.length&&D(n,t,i)}function Q(n){var t=0,e=0,r=0,o=0;return\"detail\"in n&&(e=n.detail),\"wheelDelta\"in n&&(e=-n.wheelDelta/120),\"wheelDeltaY\"in n&&(e=-n.wheelDeltaY/120),\"wheelDeltaX\"in n&&(t=-n.wheelDeltaX/120),\"axis\"in n&&n.axis===n.HORIZONTAL_AXIS&&(t=e,e=0),r=10*t,o=10*e,\"deltaY\"in n&&(o=n.deltaY),\"deltaX\"in n&&(r=n.deltaX),(r||o)&&n.deltaMode&&(1===n.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!e&&(e=o<1?-1:1),{spinX:t,spinY:e,pixelX:r,pixelY:o}}var $={algo:B,capitalize:k,chain:K,debounce:z,enumToString:function(n,t){return Object.keys(n).find((function(e){return n[e]===t}))},event:G,EVENT_ABORT:F,formatBytesToProperUnit:I,formatNumbersWithThousandSeparator:j,get:D,getArray:L,getCurrentGlobalMTime:function(){return u},getStateArrayMapFunc:P,isVtkObject:Y,keystore:J,newInstance:R,normalizeWheel:Q,obj:C,proxy:V,proxyPropertyMapping:q,proxyPropertyState:Z,safeArrays:E,set:N,setArray:_,setGet:x,setGetArray:U,setImmediate:M,setLoggerFunction:p,throttle:H,traverseInstanceTree:X,TYPED_ARRAYS:O,uncapitalize:A,VOID:c,vtkDebugMacro:g,vtkErrorMacro:v,vtkInfoMacro:y,vtkLogMacro:d,vtkOnceErrorMacro:b,vtkWarningMacro:h};export default $;export{F as EVENT_ABORT,O as TYPED_ARRAYS,c as VOID,B as algo,k as capitalize,K as chain,z as debounce,G as event,I as formatBytesToProperUnit,j as formatNumbersWithThousandSeparator,D as get,L as getArray,Y as isVtkObject,J as keystore,R as newInstance,Q as normalizeWheel,C as obj,V as proxy,q as proxyPropertyMapping,Z as proxyPropertyState,N as set,_ as setArray,x as setGet,U as setGetArray,M as setImmediateVTK,p as setLoggerFunction,H as throttle,X as traverseInstanceTree,A as uncapitalize,g as vtkDebugMacro,v as vtkErrorMacro,y as vtkInfoMacro,d as vtkLogMacro,b as vtkOnceErrorMacro,h as vtkWarningMacro};\n","(function() { module.exports = window[\"PropTypes\"]; }());","import{A as t,E as n,R as r}from\"./common.js\";function a(){var n=new t(3);return t!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function u(t){var n=t[0],r=t[1],a=t[2];return Math.hypot(n,r,a)}function e(n,r,a){var u=new t(3);return u[0]=n,u[1]=r,u[2]=a,u}function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function s(t,n,r,a){return t[0]=n,t[1]=r,t[2]=a,t}function i(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t}function c(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t}function h(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t[2]=n[2]*r[2],t}function f(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t[2]=n[2]/r[2],t}function M(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t}function l(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r[2]*a,t}function m(t,n){var r=n[0]-t[0],a=n[1]-t[1],u=n[2]-t[2];return Math.hypot(r,a,u)}function v(t,n){var r=n[0]-t[0],a=n[1]-t[1],u=n[2]-t[2];return r*r+a*a+u*u}function d(t){var n=t[0],r=t[1],a=t[2];return n*n+r*r+a*a}function b(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function q(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function x(t,n){var r=n[0],a=n[1],u=n[2],e=r*r+a*a+u*u;return e>0&&(e=1/Math.sqrt(e)),t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function p(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function g(t,n,r){var a=n[0],u=n[1],e=n[2],o=r[0],s=r[1],i=r[2];return t[0]=u*i-e*s,t[1]=e*o-a*i,t[2]=a*s-u*o,t}function y(t,n,r){var a=n[0],u=n[1],e=n[2],o=r[3]*a+r[7]*u+r[11]*e+r[15];return o=o||1,t[0]=(r[0]*a+r[4]*u+r[8]*e+r[12])/o,t[1]=(r[1]*a+r[5]*u+r[9]*e+r[13])/o,t[2]=(r[2]*a+r[6]*u+r[10]*e+r[14])/o,t}function w(t,n,r){var a=n[0],u=n[1],e=n[2];return t[0]=a*r[0]+u*r[3]+e*r[6],t[1]=a*r[1]+u*r[4]+e*r[7],t[2]=a*r[2]+u*r[5]+e*r[8],t}function z(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function A(t,r){var a=t[0],u=t[1],e=t[2],o=r[0],s=r[1],i=r[2];return Math.abs(a-o)<=n*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(u-s)<=n*Math.max(1,Math.abs(u),Math.abs(s))&&Math.abs(e-i)<=n*Math.max(1,Math.abs(e),Math.abs(i))}var _,j=c,E=h,D=f,L=m,k=v,F=u,I=d,O=(_=a(),function(t,n,r,a,u,e){var o,s;for(n||(n=3),r||(r=0),s=a?Math.min(a*n+r,t.length):t.length,o=r;o>>0,s=(r*=s)>>>0,s+=4294967296*(r-=s)}return 2.3283064365386963e-10*(s>>>0)});t.next=function(){var n=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=n-(t.c=0|n)},t.c=1,t.s0=r(\" \"),t.s1=r(\" \"),t.s2=r(\" \"),t.s0-=r(n),t.s0<0&&(t.s0+=1),t.s1-=r(n),t.s1<0&&(t.s1+=1),t.s2-=r(n),t.s2<0&&(t.s2+=1),r=null}function e(n,s){return s.c=n.c,s.s0=n.s0,s.s1=n.s1,s.s2=n.s2,s}function o(n,s){var t=new r(n),o=s&&s.state,u=t.next;return u.int32=function(){return 4294967296*t.next()|0},u.double=function(){return u()+11102230246251565e-32*(2097152*u()|0)},u.quick=u,o&&(\"object\"==typeof o&&e(o,t),u.state=function(){return e(t,{})}),u}s&&s.exports?s.exports=o:t&&t.amd?t((function(){return o})):this.alea=o}(0,n,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{t as a};\n","import{d as n,b as t}from\"../../../_virtual/commonjsHelpers.js\";var e=n((function(n){!function(n,t,e){function r(n){var t=this,e=\"\";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var n=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^n^n>>>8},n===(0|n)?t.x=n:e+=n;for(var r=0;r>>0)/4294967296};return x.double=function(){do{var n=((e.next()>>>11)+(e.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},x.int32=e.next,x.quick=x,u&&(\"object\"==typeof u&&o(u,e),x.state=function(){return o(e,{})}),x}t&&t.exports?t.exports=u:e&&e.amd?e((function(){return u})):this.xor128=u}(0,n,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{e as x};\n","import{d as n,b as t}from\"../../../_virtual/commonjsHelpers.js\";var e=n((function(n){!function(n,t,e){function r(n){var t=this,e=\"\";t.next=function(){var n=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^n^n<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,n===(0|n)?t.x=n:e+=n;for(var r=0;r>>4),t.next()}function o(n,t){return t.x=n.x,t.y=n.y,t.z=n.z,t.w=n.w,t.v=n.v,t.d=n.d,t}function u(n,t){var e=new r(n),u=t&&t.state,x=function(){return(e.next()>>>0)/4294967296};return x.double=function(){do{var n=((e.next()>>>11)+(e.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},x.int32=e.next,x.quick=x,u&&(\"object\"==typeof u&&o(u,e),x.state=function(){return o(e,{})}),x}t&&t.exports?t.exports=u:e&&e.amd?e((function(){return u})):this.xorwow=u}(0,n,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{e as x};\n","import{d as n,b as t}from\"../../../_virtual/commonjsHelpers.js\";var e=n((function(n){!function(n,t,e){function r(n){var t=this;t.next=function(){var n,e,r=t.x,o=t.i;return n=r[o],e=(n^=n>>>7)^n<<24,e^=(n=r[o+1&7])^n>>>10,e^=(n=r[o+3&7])^n>>>3,e^=(n=r[o+4&7])^n<<7,n=r[o+7&7],e^=(n^=n<<13)^n<<9,r[o]=e,t.i=o+1&7,e},function(n,t){var e,r=[];if(t===(0|t))r[0]=t;else for(t=\"\"+t,e=0;e0;--e)n.next()}(t,n)}function o(n,t){return t.x=n.x.slice(),t.i=n.i,t}function i(n,t){null==n&&(n=+new Date);var e=new r(n),i=t&&t.state,u=function(){return(e.next()>>>0)/4294967296};return u.double=function(){do{var n=((e.next()>>>11)+(e.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},u.int32=e.next,u.quick=u,i&&(i.x&&o(i,e),u.state=function(){return o(e,{})}),u}t&&t.exports?t.exports=i:e&&e.amd?e((function(){return i})):this.xorshift7=i}(0,n,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{e as x};\n","import{d as n,b as t}from\"../../../_virtual/commonjsHelpers.js\";var e=n((function(n){!function(n,t,e){function r(n){var t=this;t.next=function(){var n,e,r=t.w,o=t.X,i=t.i;return t.w=r=r+1640531527|0,e=o[i+34&127],n=o[i=i+1&127],e^=e<<13,n^=n<<17,e^=e>>>15,n^=n>>>12,e=o[i]=e^n,t.i=i,e+(r^r>>>16)|0},function(n,t){var e,r,o,i,u,a=[],l=128;for(t===(0|t)?(r=t,t=null):(t+=\"\\0\",r=0,l=Math.max(l,t.length)),o=0,i=-32;i>>15,r^=r<<4,r^=r>>>13,i>=0&&(u=u+1640531527|0,o=0==(e=a[127&i]^=r+u)?o+1:0);for(o>=128&&(a[127&(t&&t.length||0)]=-1),o=127,i=512;i>0;--i)r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,a[o]=r^e;n.w=u,n.X=a,n.i=o}(t,n)}function o(n,t){return t.i=n.i,t.w=n.w,t.X=n.X.slice(),t}function i(n,t){null==n&&(n=+new Date);var e=new r(n),i=t&&t.state,u=function(){return(e.next()>>>0)/4294967296};return u.double=function(){do{var n=((e.next()>>>11)+(e.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},u.int32=e.next,u.quick=u,i&&(i.X&&o(i,e),u.state=function(){return o(e,{})}),u}t&&t.exports?t.exports=i:e&&e.amd?e((function(){return i})):this.xor4096=i}(0,n,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{e as x};\n","import{d as t,b as n}from\"../../../_virtual/commonjsHelpers.js\";var e=t((function(t){!function(t,n,e){function r(t){var n=this,e=\"\";n.next=function(){var t=n.b,e=n.c,r=n.d,o=n.a;return t=t<<25^t>>>7^e,e=e-r|0,r=r<<24^r>>>8^o,o=o-t|0,n.b=t=t<<20^t>>>12^e,n.c=e=e-r|0,n.d=r<<16^e>>>16^o,n.a=o-t|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,t===Math.floor(t)?(n.a=t/4294967296|0,n.b=0|t):e+=t;for(var r=0;r>>0)/4294967296};return u.double=function(){do{var t=((e.next()>>>11)+(e.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},u.int32=e.next,u.quick=u,a&&(\"object\"==typeof a&&o(a,e),u.state=function(){return o(e,{})}),u}n&&n.exports?n.exports=a:e&&e.amd?e((function(){return a})):this.tychei=a}(0,t,!1)}),\"/$$rollup_base$$/node_modules/seedrandom/lib\");export{e as t};\n","var e=Object.freeze({__proto__:null,default:{}});export{e as _};\n","import{e as o}from\"./commonjsHelpers.js\";import{_ as r}from\"./rollup_plugin_ignore_empty_module_placeholder.js\";var e=o(r);export{e as r};\n","import{d as r,b as n}from\"../../_virtual/commonjsHelpers.js\";import{r as t}from\"../../_virtual/_rollup_plugin_ignore_empty_module_placeholder_commonjs-proxy.js\";var o=r((function(r){!function(n,o,e){var u,a=256,i=e.pow(a,6),s=e.pow(2,52),f=2*s,c=255;function l(r,t,c){var l=[],h=g(d((t=1==t?{entropy:!0}:t||{}).entropy?[r,y(o)]:null==r?function(){try{var r;return u&&(r=u.randomBytes)?r=r(a):(r=new Uint8Array(a),(n.crypto||n.msCrypto).getRandomValues(r)),y(r)}catch(r){var t=n.navigator,e=t&&t.plugins;return[+new Date,n,e,n.screen,y(o)]}}():r,3),l),v=new p(l),_=function(){for(var r=v.g(6),n=i,t=0;r=f;)r/=2,n/=2,t>>>=1;return(r+t)/n};return _.int32=function(){return 0|v.g(4)},_.quick=function(){return v.g(4)/4294967296},_.double=_,g(y(v.S),o),(t.pass||c||function(r,n,t,o){return o&&(o.S&&m(o,v),r.state=function(){return m(v,{})}),t?(e.random=r,n):r})(_,h,\"global\"in t?t.global:this==e,t.state)}function p(r){var n,t=r.length,o=this,e=0,u=o.i=o.j=0,i=o.S=[];for(t||(r=[t++]);e0&&void 0!==arguments[0]?arguments[0]:3,a=[];a.length1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,t=1/0,o=-1/0,e=a,u=r.length;e0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=a-r;return r+n*Math.random()}function c(r,a,n){return n[0]=r[0]+a[0],n[1]=r[1]+a[1],n[2]=r[2]+a[2],n}function v(r,a,n){return n[0]=r[0]-a[0],n[1]=r[1]-a[1],n[2]=r[2]-a[2],n}function M(r,a){return r[0]*a[0]+r[1]*a[1]+r[2]*a[2]}function l(r,a,n){var t=r[1]*a[2]-r[2]*a[1],o=r[2]*a[0]-r[0]*a[2],e=r[0]*a[1]-r[1]*a[0];return n[0]=t,n[1]=o,n[2]=e,n}function m(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;switch(a){case 1:return Math.abs(r);case 2:return Math.sqrt(r[0]*r[0]+r[1]*r[1]);case 3:return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);default:for(var n=0,t=0;t2&&void 0!==arguments[2]?arguments[2]:1e-6;if(!r.length===a.length)return!1;function t(r,t){return Math.abs(r-a[t])f&&(f=c);if(0===f)return n(\"Unable to factor linear system\"),0;M[e]=1/f}for(u=0;u=f&&(f=h,v=e)}if(u!==v){for(i=0;i=0)for(e=u;e<=o-1;e++)f-=r[o][e]*n[e];else 0!==f&&(u=o);n[o]=f}for(o=t-1;o>=0;o--){for(f=n[o],e=o+1;eh?h=i:ih?h=f:f0?(h-c)/h:0)>0?(t=u===h?s*(i-f)/(h-c):i===h?1/3+s*(f-u)/(h-c):2/3+s*(u-i)/(h-c))<0&&(t+=1):t=0,n[0]=t,n[1]=o,n[2]=v}function L(a,n){var t,o,e,u=r(a,3),i=u[0],f=u[1],s=u[2],h=1/3,c=1/6,v=2/3,M=5/6;i>c&&i<=h?(o=1,t=(h-i)/c,e=0):i>h&&i<=.5?(o=1,e=(i-h)/c,t=0):i>.5&&i<=v?(e=1,o=(v-i)/c,t=0):i>v&&i<=M?(e=1,t=(i-v)/c,o=0):i>M&&i<=1?(t=1,e=(1-i)/c,o=0):(t=1,o=i/c,e=0),t=f*t+(1-f),o=f*o+(1-f),e=f*e+(1-f),t*=s,o*=s,e*=s,n[0]=t,n[1]=o,n[2]=e}function x(a,n){var t=r(a,3),o=(t[0]+16)/116,e=t[1]/500+o,u=o-t[2]/200;o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787,e=Math.pow(e,3)>.008856?Math.pow(e,3):(e-16/116)/7.787,u=Math.pow(u,3)>.008856?Math.pow(u,3):(u-16/116)/7.787;n[0]=.9505*e,n[1]=1*o,n[2]=1.089*u}function y(a,n){var t=r(a,3),o=t[0]/.9505,e=t[1]/1,u=t[2]/1.089;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,n[0]=116*e-16,n[1]=500*(o-e),n[2]=200*(e-u)}function V(a,n){var t=r(a,3),o=t[0],e=t[1],u=t[2],i=3.2406*o+-1.5372*e+-.4986*u,f=-.9689*o+1.8758*e+.0415*u,s=.0557*o+-.204*e+1.057*u;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,f>.0031308?f=1.055*Math.pow(f,1/2.4)-.055:f*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92;var h=i;h1&&(i/=h,f/=h,s/=h),i<0&&(i=0),f<0&&(f=0),s<0&&(s=0),n[0]=i,n[1]=f,n[2]=s}function X(a,n){var t=r(a,3),o=t[0],e=t[1],u=t[2];o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,e>.04045?e=Math.pow((e+.055)/1.055,2.4):e/=12.92,u>.04045?u=Math.pow((u+.055)/1.055,2.4):u/=12.92,n[0]=.4124*o+.3576*e+.1805*u,n[1]=.2126*o+.7152*e+.0722*u,n[2]=.0193*o+.1192*e+.9505*u}function j(r,a){var n=[0,0,0];X(r,n),y(n,a)}function q(r,a){var n=[0,0,0];x(r,n),V(n,a)}function I(r){r[0]=1,r[1]=-1,r[2]=1,r[3]=-1,r[4]=1,r[5]=-1}function k(r){return!(r[1]-r[0]<0)}function z(r,a,n){n[0]=Math.min(r[0],a[0]),n[1]=Math.max(r[0],a[0]),n[2]=Math.min(r[1],a[1]),n[3]=Math.max(r[1],a[1]),n[4]=Math.min(r[2],a[2]),n[5]=Math.max(r[2],a[2])}function B(r,a,n){return rn?n:r}function F(r,a,n){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return t[0]=B(r[0],a[0],n[0]),t[1]=B(r[1],a[1],n[1]),t[2]=B(r[2],a[2],n[2]),t}function P(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return a[0]=Math.round(r[0]),a[1]=Math.round(r[1]),a[2]=Math.round(r[2]),a}var C=function(r){return!Number.isFinite(r)},D=Number.isNaN,G=D;function H(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}export{i as B,I as D,C as E,E as F,j as G,q as H,u as I,H as K,g as L,k as M,s as N,f as O,A as a,y as aA,V as aB,X as aC,D as aN,N as ar,U as as,x as az,P as b,z as c,M as d,F as e,p as f,v as g,L as h,G as i,l as j,c as k,d as l,b as m,m as n,o as r,_ as s,e as t,h as u,w as y,B as z};\n","import{A as a,E as t}from\"./common.js\";function n(){var t=new a(16);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function r(a,t){return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a}function s(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function o(a,t){if(a===t){var n=t[1],r=t[2],s=t[3],o=t[6],h=t[7],u=t[11];a[1]=t[4],a[2]=t[8],a[3]=t[12],a[4]=n,a[6]=t[9],a[7]=t[13],a[8]=r,a[9]=o,a[11]=t[14],a[12]=s,a[13]=h,a[14]=u}else a[0]=t[0],a[1]=t[4],a[2]=t[8],a[3]=t[12],a[4]=t[1],a[5]=t[5],a[6]=t[9],a[7]=t[13],a[8]=t[2],a[9]=t[6],a[10]=t[10],a[11]=t[14],a[12]=t[3],a[13]=t[7],a[14]=t[11],a[15]=t[15];return a}function h(a,t){var n=t[0],r=t[1],s=t[2],o=t[3],h=t[4],u=t[5],M=t[6],e=t[7],i=t[8],c=t[9],f=t[10],b=t[11],m=t[12],l=t[13],v=t[14],p=t[15],x=n*u-r*h,y=n*M-s*h,g=n*e-o*h,d=r*M-s*u,q=r*e-o*u,R=s*e-o*M,w=i*l-c*m,S=i*v-f*m,T=i*p-b*m,A=c*v-f*l,j=c*p-b*l,D=f*p-b*v,I=x*D-y*j+g*A+d*T-q*S+R*w;return I?(I=1/I,a[0]=(u*D-M*j+e*A)*I,a[1]=(s*j-r*D-o*A)*I,a[2]=(l*R-v*q+p*d)*I,a[3]=(f*q-c*R-b*d)*I,a[4]=(M*T-h*D-e*S)*I,a[5]=(n*D-s*T+o*S)*I,a[6]=(v*g-m*R-p*y)*I,a[7]=(i*R-f*g+b*y)*I,a[8]=(h*j-u*T+e*w)*I,a[9]=(r*T-n*j-o*w)*I,a[10]=(m*q-l*g+p*x)*I,a[11]=(c*g-i*q-b*x)*I,a[12]=(u*S-h*A-M*w)*I,a[13]=(n*A-r*S+s*w)*I,a[14]=(l*y-m*d-v*x)*I,a[15]=(i*d-c*y+f*x)*I,a):null}function u(a,t,n){var r=t[0],s=t[1],o=t[2],h=t[3],u=t[4],M=t[5],e=t[6],i=t[7],c=t[8],f=t[9],b=t[10],m=t[11],l=t[12],v=t[13],p=t[14],x=t[15],y=n[0],g=n[1],d=n[2],q=n[3];return a[0]=y*r+g*u+d*c+q*l,a[1]=y*s+g*M+d*f+q*v,a[2]=y*o+g*e+d*b+q*p,a[3]=y*h+g*i+d*m+q*x,y=n[4],g=n[5],d=n[6],q=n[7],a[4]=y*r+g*u+d*c+q*l,a[5]=y*s+g*M+d*f+q*v,a[6]=y*o+g*e+d*b+q*p,a[7]=y*h+g*i+d*m+q*x,y=n[8],g=n[9],d=n[10],q=n[11],a[8]=y*r+g*u+d*c+q*l,a[9]=y*s+g*M+d*f+q*v,a[10]=y*o+g*e+d*b+q*p,a[11]=y*h+g*i+d*m+q*x,y=n[12],g=n[13],d=n[14],q=n[15],a[12]=y*r+g*u+d*c+q*l,a[13]=y*s+g*M+d*f+q*v,a[14]=y*o+g*e+d*b+q*p,a[15]=y*h+g*i+d*m+q*x,a}function M(a,t,n){var r,s,o,h,u,M,e,i,c,f,b,m,l=n[0],v=n[1],p=n[2];return t===a?(a[12]=t[0]*l+t[4]*v+t[8]*p+t[12],a[13]=t[1]*l+t[5]*v+t[9]*p+t[13],a[14]=t[2]*l+t[6]*v+t[10]*p+t[14],a[15]=t[3]*l+t[7]*v+t[11]*p+t[15]):(r=t[0],s=t[1],o=t[2],h=t[3],u=t[4],M=t[5],e=t[6],i=t[7],c=t[8],f=t[9],b=t[10],m=t[11],a[0]=r,a[1]=s,a[2]=o,a[3]=h,a[4]=u,a[5]=M,a[6]=e,a[7]=i,a[8]=c,a[9]=f,a[10]=b,a[11]=m,a[12]=r*l+u*v+c*p+t[12],a[13]=s*l+M*v+f*p+t[13],a[14]=o*l+e*v+b*p+t[14],a[15]=h*l+i*v+m*p+t[15]),a}function e(a,t,n){var r=n[0],s=n[1],o=n[2];return a[0]=t[0]*r,a[1]=t[1]*r,a[2]=t[2]*r,a[3]=t[3]*r,a[4]=t[4]*s,a[5]=t[5]*s,a[6]=t[6]*s,a[7]=t[7]*s,a[8]=t[8]*o,a[9]=t[9]*o,a[10]=t[10]*o,a[11]=t[11]*o,a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a}function i(a,n,r,s){var o,h,u,M,e,i,c,f,b,m,l,v,p,x,y,g,d,q,R,w,S,T,A,j,D=s[0],I=s[1],P=s[2],_=Math.hypot(D,I,P);return _0?(x=2*Math.sqrt(v+1),t[3]=.25*x,t[0]=(f-m)/x,t[1]=(b-e)/x,t[2]=(M-i)/x):u>c&&u>l?(x=2*Math.sqrt(1+u-c-l),t[3]=(f-m)/x,t[0]=.25*x,t[1]=(M+i)/x,t[2]=(b+e)/x):c>l?(x=2*Math.sqrt(1+c-u-l),t[3]=(b-e)/x,t[0]=(M+i)/x,t[1]=.25*x,t[2]=(f+m)/x):(x=2*Math.sqrt(1+l-u-c),t[3]=(M-i)/x,t[0]=(b+e)/x,t[1]=(f+m)/x,t[2]=.25*x),t}function y(a,t,n,r){var s=t[0],o=t[1],h=t[2],u=t[3],M=s+s,e=o+o,i=h+h,c=s*M,f=s*e,b=s*i,m=o*e,l=o*i,v=h*i,p=u*M,x=u*e,y=u*i,g=r[0],d=r[1],q=r[2];return a[0]=(1-(m+v))*g,a[1]=(f+y)*g,a[2]=(b-x)*g,a[3]=0,a[4]=(f-y)*d,a[5]=(1-(c+v))*d,a[6]=(l+p)*d,a[7]=0,a[8]=(b+x)*q,a[9]=(l-p)*q,a[10]=(1-(c+m))*q,a[11]=0,a[12]=n[0],a[13]=n[1],a[14]=n[2],a[15]=1,a}function g(a,t){var n=t[0],r=t[1],s=t[2],o=t[3],h=n+n,u=r+r,M=s+s,e=n*h,i=r*h,c=r*u,f=s*h,b=s*u,m=s*M,l=o*h,v=o*u,p=o*M;return a[0]=1-c-m,a[1]=i+p,a[2]=f-v,a[3]=0,a[4]=i-p,a[5]=1-e-m,a[6]=b+l,a[7]=0,a[8]=f+v,a[9]=b-l,a[10]=1-e-c,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function d(a,t,n,r,s,o,h){var u=1/(t-n),M=1/(r-s),e=1/(o-h);return a[0]=-2*u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*M,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*e,a[11]=0,a[12]=(t+n)*u,a[13]=(s+r)*M,a[14]=(h+o)*e,a[15]=1,a}function q(a,n,r,o){var h,u,M,e,i,c,f,b,m,l,v=n[0],p=n[1],x=n[2],y=o[0],g=o[1],d=o[2],q=r[0],R=r[1],w=r[2];return Math.abs(v-q)0?(r[0]=2*(M*u+c*s+e*h-i*o)/f,r[1]=2*(e*u+c*o+i*s-M*h)/f,r[2]=2*(i*u+c*h+M*o-e*s)/f):(r[0]=2*(M*u+c*s+e*h-i*o),r[1]=2*(e*u+c*o+i*s-M*h),r[2]=2*(i*u+c*h+M*o-e*s)),v(t,n,r),t},getTranslation:function(a,t){return a[0]=t[12],a[1]=t[13],a[2]=t[14],a},getScaling:p,getRotation:x,fromRotationTranslationScale:y,fromRotationTranslationScaleOrigin:function(a,t,n,r,s){var o=t[0],h=t[1],u=t[2],M=t[3],e=o+o,i=h+h,c=u+u,f=o*e,b=o*i,m=o*c,l=h*i,v=h*c,p=u*c,x=M*e,y=M*i,g=M*c,d=r[0],q=r[1],R=r[2],w=s[0],S=s[1],T=s[2],A=(1-(l+p))*d,j=(b+g)*d,D=(m-y)*d,I=(b-g)*q,P=(1-(f+p))*q,_=(v+x)*q,F=(m+y)*R,O=(v-x)*R,k=(1-(f+l))*R;return a[0]=A,a[1]=j,a[2]=D,a[3]=0,a[4]=I,a[5]=P,a[6]=_,a[7]=0,a[8]=F,a[9]=O,a[10]=k,a[11]=0,a[12]=n[0]+w-(A*w+I*S+F*T),a[13]=n[1]+S-(j*w+P*S+O*T),a[14]=n[2]+T-(D*w+_*S+k*T),a[15]=1,a},fromQuat:g,frustum:function(a,t,n,r,s,o,h){var u=1/(n-t),M=1/(s-r),e=1/(o-h);return a[0]=2*o*u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*o*M,a[6]=0,a[7]=0,a[8]=(n+t)*u,a[9]=(s+r)*M,a[10]=(h+o)*e,a[11]=-1,a[12]=0,a[13]=0,a[14]=h*o*2*e,a[15]=0,a},perspective:function(a,t,n,r,s){var o,h=1/Math.tan(t/2);return a[0]=h/n,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,null!=s&&s!==1/0?(o=1/(r-s),a[10]=(s+r)*o,a[14]=2*s*r*o):(a[10]=-1,a[14]=-2*r),a},perspectiveFromFieldOfView:function(a,t,n,r){var s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),h=Math.tan(t.leftDegrees*Math.PI/180),u=Math.tan(t.rightDegrees*Math.PI/180),M=2/(h+u),e=2/(s+o);return a[0]=M,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=e,a[6]=0,a[7]=0,a[8]=-(h-u)*M*.5,a[9]=(s-o)*e*.5,a[10]=r/(n-r),a[11]=-1,a[12]=0,a[13]=0,a[14]=r*n/(n-r),a[15]=0,a},ortho:d,lookAt:q,targetTo:function(a,t,n,r){var s=t[0],o=t[1],h=t[2],u=r[0],M=r[1],e=r[2],i=s-n[0],c=o-n[1],f=h-n[2],b=i*i+c*c+f*f;b>0&&(i*=b=1/Math.sqrt(b),c*=b,f*=b);var m=M*f-e*c,l=e*i-u*f,v=u*c-M*i;return(b=m*m+l*l+v*v)>0&&(m*=b=1/Math.sqrt(b),l*=b,v*=b),a[0]=m,a[1]=l,a[2]=v,a[3]=0,a[4]=c*v-f*l,a[5]=f*m-i*v,a[6]=i*l-c*m,a[7]=0,a[8]=i,a[9]=c,a[10]=f,a[11]=0,a[12]=s,a[13]=o,a[14]=h,a[15]=1,a},str:function(a){return\"mat4(\"+a[0]+\", \"+a[1]+\", \"+a[2]+\", \"+a[3]+\", \"+a[4]+\", \"+a[5]+\", \"+a[6]+\", \"+a[7]+\", \"+a[8]+\", \"+a[9]+\", \"+a[10]+\", \"+a[11]+\", \"+a[12]+\", \"+a[13]+\", \"+a[14]+\", \"+a[15]+\")\"},frob:function(a){return Math.hypot(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])},add:function(a,t,n){return a[0]=t[0]+n[0],a[1]=t[1]+n[1],a[2]=t[2]+n[2],a[3]=t[3]+n[3],a[4]=t[4]+n[4],a[5]=t[5]+n[5],a[6]=t[6]+n[6],a[7]=t[7]+n[7],a[8]=t[8]+n[8],a[9]=t[9]+n[9],a[10]=t[10]+n[10],a[11]=t[11]+n[11],a[12]=t[12]+n[12],a[13]=t[13]+n[13],a[14]=t[14]+n[14],a[15]=t[15]+n[15],a},subtract:R,multiplyScalar:function(a,t,n){return a[0]=t[0]*n,a[1]=t[1]*n,a[2]=t[2]*n,a[3]=t[3]*n,a[4]=t[4]*n,a[5]=t[5]*n,a[6]=t[6]*n,a[7]=t[7]*n,a[8]=t[8]*n,a[9]=t[9]*n,a[10]=t[10]*n,a[11]=t[11]*n,a[12]=t[12]*n,a[13]=t[13]*n,a[14]=t[14]*n,a[15]=t[15]*n,a},multiplyScalarAndAdd:function(a,t,n,r){return a[0]=t[0]+n[0]*r,a[1]=t[1]+n[1]*r,a[2]=t[2]+n[2]*r,a[3]=t[3]+n[3]*r,a[4]=t[4]+n[4]*r,a[5]=t[5]+n[5]*r,a[6]=t[6]+n[6]*r,a[7]=t[7]+n[7]*r,a[8]=t[8]+n[8]*r,a[9]=t[9]+n[9]*r,a[10]=t[10]+n[10]*r,a[11]=t[11]+n[11]*r,a[12]=t[12]+n[12]*r,a[13]=t[13]+n[13]*r,a[14]=t[14]+n[14]*r,a[15]=t[15]+n[15]*r,a},exactEquals:w,equals:function(a,n){var r=a[0],s=a[1],o=a[2],h=a[3],u=a[4],M=a[5],e=a[6],i=a[7],c=a[8],f=a[9],b=a[10],m=a[11],l=a[12],v=a[13],p=a[14],x=a[15],y=n[0],g=n[1],d=n[2],q=n[3],R=n[4],w=n[5],S=n[6],T=n[7],A=n[8],j=n[9],D=n[10],I=n[11],P=n[12],_=n[13],F=n[14],O=n[15];return Math.abs(r-y)<=t*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(s-g)<=t*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(o-d)<=t*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(h-q)<=t*Math.max(1,Math.abs(h),Math.abs(q))&&Math.abs(u-R)<=t*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(M-w)<=t*Math.max(1,Math.abs(M),Math.abs(w))&&Math.abs(e-S)<=t*Math.max(1,Math.abs(e),Math.abs(S))&&Math.abs(i-T)<=t*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(c-A)<=t*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-j)<=t*Math.max(1,Math.abs(f),Math.abs(j))&&Math.abs(b-D)<=t*Math.max(1,Math.abs(b),Math.abs(D))&&Math.abs(m-I)<=t*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(l-P)<=t*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(v-_)<=t*Math.max(1,Math.abs(v),Math.abs(_))&&Math.abs(p-F)<=t*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(x-O)<=t*Math.max(1,Math.abs(x),Math.abs(O))},mul:S,sub:T});export{c as a,f as b,b as c,r as d,m as e,l as f,h as g,n as h,s as i,w as j,o as k,q as l,u as m,g as n,d as o,x as p,y as q,i as r,e as s,M as t,A as u};\n","(function() { module.exports = window[\"React\"]; }());","import{c as e}from\"../../../_virtual/commonjsHelpers.js\";import{i as t}from\"../../inherits/inherits_browser.js\";import{_ as r}from\"./_stream_readable.js\";import{_ as a}from\"./_stream_writable.js\";e(\"/$$rollup_base$$/node_modules/readable-stream/lib/_stream_duplex.js\",(function(e,i){var o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=p;var s=r,n=a;t(p,s);for(var l=o(n.prototype),b=0;b1;)try{return y.stringifyByChunk(r,e,n)}catch(r){n=Math.floor(n/2)}return y.stringifyByChar(r)}function c(r,n){for(var e=0;e\",exports:{},parent:void 0,filename:null,loaded:!1,children:[],paths:[]},a=[\"\",\".js\",\".json\"];function c(e){const t=(e=e.replace(/\\\\/g,\"/\")).split(\"/\"),n=\"\"===t[0];for(let e=1;e0&&\"..\"!==t[e-1]&&\".\"!==t[e-1]&&(t.splice(--e,2),e--);return e=t.join(\"/\"),n&&\"/\"!==e[0]?e=\"/\"+e:0===e.length&&(e=\".\"),e}function f(){if(0===arguments.length)return\".\";let e;for(let t=0;t0&&(void 0===e?e=n:e+=\"/\"+n)}return void 0===e?\".\":e}function s(e){if(0===e.length)return\".\";let t=e.length-1;for(;t>0;){const n=e.charCodeAt(t);if((47===n||92===n)&&t!==e.length-1)break;t--}return t>0?e.substr(0,t):47===e.chartCodeAt(0)||92===e.chartCodeAt(0)?e.charAt(0):\".\"}function d(t,n){const r=function(e){let t=e[0];if(\"/\"===t||\"\\\\\"===t)return!1;let n=e[1],r=e[2];return!(!(\".\"!==t||n&&\"/\"!==n&&\"\\\\\"!==n)||!(\".\"!==t||\".\"!==n||r&&\"/\"!==r&&\"\\\\\"!==r))&&(\":\"!==n||\"/\"!==r&&\"\\\\\"!==r)}(t);let o;for(t=c(t);;){o=r?c(n?n+\"/node_modules/\"+t:f(\"node_modules\",t)):n?c(n+\"/\"+t):t;for(let t=0;ta&&(e=a),n1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=i(),a=e.length,o=0;if(n<0&&t>1){for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,t=e||[];t.length<=n;)t.push(null);return t}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}var v={computeRange:f,createRangeHelper:i,getDataType:g,getMaxNorm:function(e){for(var n=e.getNumberOfComponents(),t=0,r=0;rt&&(t=a)}return t}};function c(e,n){function t(){n.ranges=null,e.modified()}n.classHierarchy.push(\"vtkDataArray\"),e.getElementComponentSize=function(){return n.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n.values[e*n.numberOfComponents+t]},e.setComponent=function(e,r,a){a!==n.values[e*n.numberOfComponents+r]&&(n.values[e*n.numberOfComponents+r]=a,t())},e.getData=function(){return n.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=e<0?n.numberOfComponents:e,r=null;return n.ranges||(n.ranges=p(n.ranges,n.numberOfComponents)),(r=n.ranges[t])?(n.rangeTuple[0]=r.min,n.rangeTuple[1]=r.max,n.rangeTuple):(r=f(n.values,e,n.numberOfComponents),n.ranges[t]=r,n.rangeTuple[0]=r.min,n.rangeTuple[1]=r.max,n.rangeTuple)},e.setRange=function(e,t){n.ranges||(n.ranges=p(n.ranges,n.numberOfComponents));var r={min:e.min,max:e.max};return n.ranges[t]=r,n.rangeTuple[0]=r.min,n.rangeTuple[1]=r.max,n.rangeTuple},e.setTuple=function(e,t){for(var r=e*n.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:l,r=n.numberOfComponents||1;t.length!==r&&(t.length=r);var a=e*r;if(1===r)t[0]=n.values[a];else if(2===r)t[0]=n.values[a],t[1]=n.values[a+1];else if(3===r)t[0]=n.values[a],t[1]=n.values[a+1],t[2]=n.values[a+2];else if(4===r)t[0]=n.values[a],t[1]=n.values[a+1],t[2]=n.values[a+2],t[3]=n.values[a+3];else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:1;return e*n.numberOfComponents},e.getNumberOfComponents=function(){return n.numberOfComponents},e.getNumberOfValues=function(){return n.values.length},e.getNumberOfTuples=function(){return n.values.length/n.numberOfComponents},e.getDataType=function(){return n.dataType},e.newClone=function(){return d({empty:!0,name:n.name,dataType:n.dataType,numberOfComponents:n.numberOfComponents})},e.getName=function(){return n.name||(e.modified(),n.name=\"vtkDataArray\".concat(e.getMTime())),n.name},e.setData=function(e,r){n.values=e,n.size=e.length,n.dataType=g(e),r&&(n.numberOfComponents=r),n.size%n.numberOfComponents!=0&&(n.numberOfComponents=1),t()},e.getState=function(){var t=s(s({},n),{},{vtkClass:e.getClassName()});t.values=Array.from(t.values),delete t.buffer,Object.keys(t).forEach((function(e){t[e]||delete t[e]}));var r={};return Object.keys(t).sort().forEach((function(e){r[e]=t[e]})),r.mtime&&delete r.mtime,r}}var b={name:\"\",numberOfComponents:1,size:0,dataType:m,rangeTuple:[0,0]};function O(e,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(n,b,a),!n.empty&&!n.values&&!n.size)throw new TypeError(\"Cannot create vtkDataArray object without: size > 0, values\");n.values?Array.isArray(n.values)&&(n.values=window[n.dataType].from(n.values)):n.values=new window[n.dataType](n.size),n.values&&(n.size=n.values.length,n.dataType=g(n.values)),t(e,n),r(e,n,[\"name\",\"numberOfComponents\"]),c(e,n)}var d=n(O,\"vtkDataArray\"),y=s(s({newInstance:d,extend:O},v),a);export default y;export{v as STATIC,O as extend,d as newInstance};\n","var t=1e-6,a=\"undefined\"!=typeof Float32Array?Float32Array:Array,r=Math.random,n=Math.PI/180;function o(t){return t*n}Math.hypot||(Math.hypot=function(){for(var t=0,a=arguments.length;a--;)t+=arguments[a]*arguments[a];return Math.sqrt(t)});export{a as A,t as E,r as R,o as t};\n","function t(t){this.name=t||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}t.prototype={push:function(t){this.emit(\"data\",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit(\"error\",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit(\"error\",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,i){return this._listeners[t].push(i),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,i){if(this._listeners[t])for(var s=0;s \"+t:t}};var i=t;export{i as G};\n","var r=function(r){if(Array.isArray(r))return r};export default r;\n","var r=function(r,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(r)){var e=[],n=!0,l=!1,o=void 0;try{for(var a,i=r[Symbol.iterator]();!(n=(a=i.next()).done)&&(e.push(a.value),!t||e.length!==t);n=!0);}catch(r){l=!0,o=r}finally{try{n||null==i.return||i.return()}finally{if(l)throw o}}return e}};export default r;\n","var t=function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")};export default t;\n","import r from\"./arrayWithHoles.js\";import o from\"./iterableToArrayLimit.js\";import t from\"./unsupportedIterableToArray.js\";import e from\"./nonIterableRest.js\";var a=function(a,i){return r(a)||o(a,i)||t(a,i)||e()};export default a;\n","import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import n from\"../../macro.js\";import{D as o}from\"../Core/Math/index.js\";import t from\"../Core/Points.js\";function s(n,t){t.classHierarchy.push(\"vtkCell\"),n.initialize=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(o){t.pointsIds=o;var s=t.points.getData();s.length!==3*t.pointsIds.length&&(s=new(window[n.getDataType()])(3*t.pointsIds.length));var e=n.getData();t.pointsIds.forEach((function(n,o){var t=3*n,i=3*o;s[i]=e[t],s[++i]=e[++t],s[++i]=e[++t]})),t.points.setData(s)}else{t.points=n,t.pointsIds=new Array(n.getNumberOfPoints());for(var i=n.getNumberOfPoints()-1;i>=0;--i)t.pointsIds[i]=i}},n.getBounds=function(){var n=t.points.getNumberOfPoints(),s=[];if(n){t.points.getPoint(0,s),t.bounds[0]=s[0],t.bounds[1]=s[0],t.bounds[2]=s[1],t.bounds[3]=s[1],t.bounds[4]=s[2],t.bounds[5]=s[2];for(var e=1;et.bounds[1]?s[0]:t.bounds[1],t.bounds[2]=s[1]t.bounds[3]?s[1]:t.bounds[3],t.bounds[4]=s[2]t.bounds[5]?s[2]:t.bounds[5]}else o(t.bounds);return t.bounds},n.getLength2=function(){n.getBounds();for(var o=0,s=0,e=0;e<3;e++)o+=(s=t.bounds[2*e+1]-t.bounds[2*e])*s;return o},n.getParametricDistance=function(n){for(var o,t=0,s=0;s<3;s++)(o=n[s]<0?-n[s]:n[s]>1?n[s]-1:0)>t&&(t=o);return t},n.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},n.deepCopy=function(n){n.initialize(t.points,t.pointsIds)},n.getCellDimension=function(){},n.intersectWithLine=function(n,o,t,s,e,i,u){},n.evaluatePosition=function(n,o,t,s,e,i){}}var e={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function i(o,i){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(i,e,u),n.obj(o,i),i.points||(i.points=t.newInstance()),n.get(o,i,[\"points\",\"pointsIds\"]),s(o,i)}var u=n.newInstance(i,\"vtkCell\"),r={newInstance:u,extend:i};export default r;export{i as extend,u as newInstance};\n","import e from\"../../../../../@babel/runtime/helpers/toConsumableArray.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import n from\"../../macro.js\";import r from\"./Cell.js\";function l(n,l){l.classHierarchy.push(\"vtkCellLinks\"),n.buildLinks=function(e){var a=e.getPoints().getNumberOfPoints(),t=e.getNumberOfCells(),c=new Uint32Array(a);if(e.isA(\"vtkPolyData\")){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1e3;l.array=Array(e).fill().map((function(){return{ncells:0,cells:null}})),l.extend=n,l.maxId=-1},n.initialize=function(){l.array=null},n.getLink=function(e){return l.array[e]},n.getNcells=function(e){return l.array[e].ncells},n.getCells=function(e){return l.array[e].cells},n.insertNextPoint=function(e){l.array.push({ncells:e,cells:Array(e)}),++l.maxId},n.insertNextCellReference=function(e,n){l.array[e].cells[l.array[e].ncells++]=n},n.deletePoint=function(e){l.array[e].ncells=0,l.array[e].cells=null},n.removeCellReference=function(e,n){l.array[n].cells=l.array[n].cells.filter((function(n){return n!==e})),l.array[n].ncells=l.array[n].cells.length},n.addCellReference=function(e,n){l.array[n].cells[l.array[n].ncells++]=e},n.resizeCellList=function(e,n){l.array[e].cells.length=n},n.squeeze=function(){!function(e,n){var r=n;for(n>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(l,l.maxId+1)},n.reset=function(){l.maxId=-1},n.deepCopy=function(n){l.array=e(n.array),l.extend=n.extend,l.maxId=n.maxId},n.incrementLinkCount=function(e){++l.array[e].ncells},n.allocateLinks=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(r,a,t),n.obj(e,r),l(e,r)}var c=n.newInstance(t,\"vtkCellLinks\"),i={newInstance:c,extend:t};export default i;export{t as extend,c as newInstance};\n","import\"../../../vendor/readable-stream/lib/_stream_duplex.js\";var _={VTK_EMPTY_CELL:0,VTK_VERTEX:1,VTK_POLY_VERTEX:2,VTK_LINE:3,VTK_POLY_LINE:4,VTK_TRIANGLE:5,VTK_TRIANGLE_STRIP:6,VTK_POLYGON:7,VTK_PIXEL:8,VTK_QUAD:9,VTK_TETRA:10,VTK_VOXEL:11,VTK_HEXAHEDRON:12,VTK_WEDGE:13,VTK_PYRAMID:14,VTK_PENTAGONAL_PRISM:15,VTK_HEXAGONAL_PRISM:16,VTK_QUADRATIC_EDGE:21,VTK_QUADRATIC_TRIANGLE:22,VTK_QUADRATIC_QUAD:23,VTK_QUADRATIC_POLYGON:36,VTK_QUADRATIC_TETRA:24,VTK_QUADRATIC_HEXAHEDRON:25,VTK_QUADRATIC_WEDGE:26,VTK_QUADRATIC_PYRAMID:27,VTK_BIQUADRATIC_QUAD:28,VTK_TRIQUADRATIC_HEXAHEDRON:29,VTK_QUADRATIC_LINEAR_QUAD:30,VTK_QUADRATIC_LINEAR_WEDGE:31,VTK_BIQUADRATIC_QUADRATIC_WEDGE:32,VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON:33,VTK_BIQUADRATIC_TRIANGLE:34,VTK_CUBIC_LINE:35,VTK_CONVEX_POINT_SET:41,VTK_POLYHEDRON:42,VTK_PARAMETRIC_CURVE:51,VTK_PARAMETRIC_SURFACE:52,VTK_PARAMETRIC_TRI_SURFACE:53,VTK_PARAMETRIC_QUAD_SURFACE:54,VTK_PARAMETRIC_TETRA_REGION:55,VTK_PARAMETRIC_HEX_REGION:56,VTK_HIGHER_ORDER_EDGE:60,VTK_HIGHER_ORDER_TRIANGLE:61,VTK_HIGHER_ORDER_QUAD:62,VTK_HIGHER_ORDER_POLYGON:63,VTK_HIGHER_ORDER_TETRAHEDRON:64,VTK_HIGHER_ORDER_WEDGE:65,VTK_HIGHER_ORDER_PYRAMID:66,VTK_HIGHER_ORDER_HEXAHEDRON:67,VTK_LAGRANGE_CURVE:68,VTK_LAGRANGE_TRIANGLE:69,VTK_LAGRANGE_QUADRILATERAL:70,VTK_LAGRANGE_TETRAHEDRON:71,VTK_LAGRANGE_HEXAHEDRON:72,VTK_LAGRANGE_WEDGE:73,VTK_LAGRANGE_PYRAMID:74,VTK_NUMBER_OF_CELL_TYPES:75},T=[\"vtkEmptyCell\",\"vtkVertex\",\"vtkPolyVertex\",\"vtkLine\",\"vtkPolyLine\",\"vtkTriangle\",\"vtkTriangleStrip\",\"vtkPolygon\",\"vtkPixel\",\"vtkQuad\",\"vtkTetra\",\"vtkVoxel\",\"vtkHexahedron\",\"vtkWedge\",\"vtkPyramid\",\"vtkPentagonalPrism\",\"vtkHexagonalPrism\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"vtkQuadraticEdge\",\"vtkQuadraticTriangle\",\"vtkQuadraticQuad\",\"vtkQuadraticTetra\",\"vtkQuadraticHexahedron\",\"vtkQuadraticWedge\",\"vtkQuadraticPyramid\",\"vtkBiQuadraticQuad\",\"vtkTriQuadraticHexahedron\",\"vtkQuadraticLinearQuad\",\"vtkQuadraticLinearWedge\",\"vtkBiQuadraticQuadraticWedge\",\"vtkBiQuadraticQuadraticHexahedron\",\"vtkBiQuadraticTriangle\",\"vtkCubicLine\",\"vtkQuadraticPolygon\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"vtkConvexPointSet\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"vtkParametricCurve\",\"vtkParametricSurface\",\"vtkParametricTriSurface\",\"vtkParametricQuadSurface\",\"vtkParametricTetraRegion\",\"vtkParametricHexRegion\",\"UnknownClass\",\"UnknownClass\",\"UnknownClass\",\"vtkHigherOrderEdge\",\"vtkHigherOrderTriangle\",\"vtkHigherOrderQuad\",\"vtkHigherOrderPolygon\",\"vtkHigherOrderTetrahedron\",\"vtkHigherOrderWedge\",\"vtkHigherOrderPyramid\",\"vtkHigherOrderHexahedron\"];export{_ as CellType,T as CellTypesStrings};\n","import e from\"../../../../../@babel/runtime/helpers/defineProperty.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import t from\"../../macro.js\";import{CellType as r,CellTypesStrings as n}from\"./CellTypes/Constants.js\";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var a={getClassNameFromTypeId:function(e){return e0&&void 0!==arguments[0]?arguments[0]:512,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=r>0?r:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=function(e,r,n){t.typeArray[e]=r,t.locationArray[e]=n,e>t.maxId&&(t.maxId=e)},e.insertNextCell=function(r,n){return e.insertCell(++t.maxId,r,n),t.maxId},e.setCellTypes=function(e,r,n){t.size=e,t.typeArray=r,t.locationArray=n,t.maxId=e-1},e.getCellLocation=function(e){return t.locationArray[e]},e.deleteCell=function(e){t.typeArray[e]=r.VTK_EMPTY_CELL},e.getNumberOfTypes=function(){return t.maxId+1},e.isType=function(t){for(var r=e.getNumberOfTypes(),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(r,l,n),t.obj(e,r),t.get(e,r,[\"size\",\"maxId\",\"extend\"]),t.getArray(e,r,[\"typeArray\",\"locationArray\"]),i(e,r)}var s=t.newInstance(c,\"vtkCellTypes\"),y=function(t){for(var r=1;r3&&void 0!==arguments[3]?arguments[3]:null,a={t:Number.MIN_VALUE,distance:0},c=[];c[0]=i[0]-e[0],c[1]=i[1]-e[1],c[2]=i[2]-e[2];var u=c[0]*(t[0]-e[0])+c[1]*(t[1]-e[1])+c[2]*(t[2]-e[2]),f=r(c,c),p=1e-5*u;return 0!==f&&(a.t=u/f),p<0&&(p=-p),-p1?o=i:(o=c,c[0]=e[0]+a.t*c[0],c[1]=e[1]+a.t*c[1],c[2]=e[2]+a.t*c[2]),s&&(s[0]=o[0],s[1]=o[1],s[2]=o[2]),a.distance=n(o,t),a}function p(t,e,n,o,s,a){var c=[],p=[],v=[];s[0]=0,a[0]=0,c[0]=e[0]-t[0],c[1]=e[1]-t[1],c[2]=e[2]-t[2],p[0]=o[0]-n[0],p[1]=o[1]-n[1],p[2]=o[2]-n[2],v[0]=n[0]-t[0],v[1]=n[1]-t[1],v[2]=n[2]-t[2];var l=[];l[0]=[r(c,c),-r(c,p)],l[1]=[l[0][1],r(p,p)];var b=[];if(b[0]=r(c,v),b[1]=-r(p,v),0===i(l,b,2)){for(var d,O=Number.MAX_VALUE,m=[t,e,n,o],j=[n,n,t,t],E=[o,o,e,e],N=[a[0],a[0],s[0],s[0]],g=[s[0],s[0],a[0],a[0]],y=0;y<4;y++)(d=f(m[y],j[y],E[y])).distance=0&&s[0]<=1&&a[0]>=0&&a[0]<=1?u.YES_INTERSECTION:u.NO_INTERSECTION}var v={distanceToLine:f,intersection:p};function l(t,e){e.classHierarchy.push(\"vtkLine\"),t.getCellDimension=function(){return 1},t.intersectWithLine=function(t,r,i,o,s){var a={intersect:0,t:Number.MIN_VALUE,subId:0};s[1]=0,s[2]=0;var c=[],v=[],l=[];e.points.getPoint(0,v),e.points.getPoint(1,l);var b=[],d=[],O=p(t,r,v,l,b,d);if(a.t=b[0],s[0]=d[0],O===u.YES_INTERSECTION){for(var m=0;m<3;m++)o[m]=v[m]+s[0]*(l[m]-v[m]),c[m]=t[m]+a.t*(r[m]-t[m]);if(n(o,c)<=i*i)return a.intersect=1,a}else{var j;if(a.t<0)return a.t=0,j=f(t,v,l,o),s[0]=j.t,j.distance<=i*i?(a.intersect=1,a):a;if(a.t>1)return a.t=1,j=f(r,v,l,o),s[0]=j.t,j.distance<=i*i?(a.intersect=1,a):a;if(s[0]<0)return s[0]=0,j=f(v,t,r,o),a.t=j.t,j.distance<=i*i?(a.intersect=1,a):a;if(s[1]>1)return s[1]=1,j=f(l,t,r,o),a.t=j.t,j.distance<=i*i?(a.intersect=1,a):a}return a},t.evaluatePosition=function(t,e,r,n,i,o){}}var b={};function d(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(e,b,r),o.extend(t,e,r),l(t,e)}var O=e.newInstance(d,\"vtkLine\"),m=c(c({newInstance:O,extend:d},v),s);export default m;export{v as STATIC,d as extend,O as newInstance};\n","import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import t from\"../../vtk.js\";import n from\"../../macro.js\";import o from\"./DataSet.js\";import e from\"../Core/Points.js\";function s(n,o){o.classHierarchy.push(\"vtkPointSet\"),o.points?o.points=t(o.points):o.points=e.newInstance(),n.getNumberOfPoints=function(){return o.points.getNumberOfPoints()},n.getBounds=function(){return o.points.getBounds()},n.computeBounds=function(){n.getBounds()};var s=n.shallowCopy;n.shallowCopy=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s(t,n),o.points=e.newInstance(),o.points.shallowCopy(t.getPoints())}}var i={};function r(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(e,i,r),o.extend(t,e,r),n.setGet(t,e,[\"points\"]),s(t,e)}var a=n.newInstance(r,\"vtkPointSet\"),p={newInstance:a,extend:r};export default p;export{r as extend,a as newInstance};\n","import t from\"../../../../../@babel/runtime/helpers/defineProperty.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import e from\"../../macro.js\";import{f as i,d as n,m as r}from\"../Core/Math/index.js\";import o from\"./Plane.js\";import s from\"./Cell.js\";import a from\"./Line.js\";function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t,e,i,n){var r=i[0]-e[0],o=i[1]-e[1],s=i[2]-e[2],a=t[0]-e[0],c=t[1]-e[1],f=t[2]-e[2];n[0]=o*f-s*c,n[1]=s*a-r*f,n[2]=r*c-o*a}function l(t,e,i,n){f(t,e,i,n);var r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==r&&(n[0]/=r,n[1]/=r,n[2]/=r)}var u={computeNormalDirection:f,computeNormal:l};function d(t,e){e.classHierarchy.push(\"vtkTriangle\"),t.getCellDimension=function(){return 2},t.intersectWithLine=function(r,s,c,f,u){var d={subId:0,t:0,intersect:-1};u[2]=0;var v=c*c,p=[],P=[],g=[];e.points.getPoint(0,p),e.points.getPoint(1,P),e.points.getPoint(2,g);var m=[];if(l(p,P,g,m),0!==m[0]||0!==m[1]||0!==m[2]){var b=o.intersectWithLine(r,s,p,m);if(d.t=b.t,f[0]=b.x[0],f[1]=b.x[1],f[2]=b.x[2],!b.intersection)return u[0]=0,u[1]=0,d.intersect=0,d;var j=t.evaluatePosition(f,[],u,[]);if(j.evaluation>=0)return j.dist2<=v?(d.intersect=1,d):(d.intersect=j.evaluation,d)}var O=i(p,P),L=i(P,g),h=i(g,p);if(e.line||(e.line=a.newInstance()),O>L&&O>h?(e.line.getPoints().setPoint(0,p),e.line.getPoints().setPoint(1,P)):L>h&&L>O?(e.line.getPoints().setPoint(0,P),e.line.getPoints().setPoint(1,g)):(e.line.getPoints().setPoint(0,g),e.line.getPoints().setPoint(1,p)),e.line.intersectWithLine(r,s,c,f,u).intersect){for(var y=[],T=[],w=[],x=0;x<3;x++)y[x]=p[x]-g[x],T[x]=P[x]-g[x],w[x]=f[x]-g[x];return u[0]=n(w,y)/h,u[1]=n(w,T)/L,d.evaluation=1,d}return u[0]=0,u[1]=0,d.evaluation=0,d},t.evaluatePosition=function(t,n,s,c){var l,u,d,v,p,P,g,m={subId:0,dist2:0,evaluation:-1},b=[],j=[],O=[],L=[],h=[],y=[],T=[],w=0,x=[],D=[],I=[],k=[],C=[];m.subId=0,s[2]=0,e.points.getPoint(1,b),e.points.getPoint(2,j),e.points.getPoint(0,O),f(b,j,O,L),o.generalizedProjectPoint(t,b,L,C);var W=0;for(l=0;l<3;l++)(d=L[l]<0?-L[l]:L[l])>W&&(W=d,w=l);for(u=0,l=0;l<3;l++)l!==w&&(x[u++]=l);for(l=0;l<2;l++)h[l]=C[x[l]]-O[x[l]],y[l]=b[x[l]]-O[x[l]],T[l]=j[x[l]]-O[x[l]];if(0===(v=r(y,T)))return s[0]=0,s[1]=0,m.evaluation=-1,m;if(s[0]=r(h,T)/v,s[1]=r(y,h)/v,c[0]=1-(s[0]+s[1]),c[1]=s[0],c[2]=s[1],c[0]>=0&&c[0]<=1&&c[1]>=0&&c[1]<=1&&c[2]>=0&&c[2]<=1)n&&(m.dist2=i(C,t),n[0]=C[0],n[1]=C[1],n[2]=C[2]),m.evaluation=1;else{var E;if(n)if(c[1]<0&&c[2]<0)for(p=i(t,O),P=a.distanceToLine(t,b,O,E,I),g=a.distanceToLine(t,O,j,E,k),p1?n[r]-1:0)>i&&(i=e);return i}}var v={};function p(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(e,v,i),s.extend(t,e,i),d(t,e)}var P=e.newInstance(p,\"vtkTriangle\"),g=function(e){for(var i=1;i1&&void 0!==arguments[1]&&arguments[1];a(e,t),u.forEach((function(t){n[t]=l.newInstance(),n[t].shallowCopy(e.getReferenceByName(t))}))},e.buildCells=function(){var t=e.getNumberOfVerts(),l=e.getNumberOfLines(),r=e.getNumberOfPolys(),a=e.getNumberOfStrips(),o=t+l+r+a,c=new Uint8Array(o),u=c,f=new Uint32Array(o),T=f;if(t){var g=0;n.verts.getCellSizes().forEach((function(e,t){T[t]=g,u[t]=e>1?s.VTK_POLY_VERTEX:s.VTK_VERTEX,g+=e+1})),T=T.subarray(t),u=u.subarray(t)}if(l){var m=0;n.lines.getCellSizes().forEach((function(e,t){T[t]=m,u[t]=e>2?s.VTK_POLY_LINE:s.VTK_LINE,1===e&&p(\"Building VTK_LINE \",t,\" with only one point, but VTK_LINE needs at least two points. Check the input.\"),m+=e+1})),T=T.subarray(l),u=u.subarray(l)}if(r){var b=0;n.polys.getCellSizes().forEach((function(e,t){switch(T[t]=b,e){case 3:u[t]=s.VTK_TRIANGLE;break;case 4:u[t]=s.VTK_QUAD;break;default:u[t]=s.VTK_POLYGON}e<3&&p(\"Building VTK_TRIANGLE \",t,\" with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.\"),b+=e+1})),T+=T.subarray(r),u+=u.subarray(r)}if(a){var C=0;u.fill(s.VTK_TRIANGLE_STRIP,0,a),n.strips.getCellSizes().forEach((function(e,t){T[t]=C,C+=e+1}))}n.cells=i.newInstance(),n.cells.setCellTypes(o,c,f)},e.buildLinks=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===n.cells&&e.buildCells(),n.links=r.newInstance(),t>0?n.links.allocate(t):n.links.allocate(e.getPoints().getNumberOfPoints()),n.links.buildLinks(e)},e.getCellPoints=function(e){var t=n.cells.getCellType(e),l=null;switch(t){case s.VTK_VERTEX:case s.VTK_POLY_VERTEX:l=n.verts;break;case s.VTK_LINE:case s.VTK_POLY_LINE:l=n.lines;break;case s.VTK_TRIANGLE:case s.VTK_QUAD:case s.VTK_POLYGON:l=n.polys;break;case s.VTK_TRIANGLE_STRIP:l=n.strips;break;default:return l=null,{type:0,cellPointIds:null}}var r=n.cells.getCellLocation(e);return{cellType:t,cellPointIds:l.getCell(r)}},e.getPointCells=function(e){return n.links.getCells(e)},e.getCellEdgeNeighbors=function(e,t,l){var r=n.links.getLink(t),s=n.links.getLink(l);return r.cells.filter((function(t){return t!==e&&-1!==s.cells.indexOf(t)}))},e.getCell=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=e.getCellPoints(t),r=n||T[l.cellType].newInstance();return r.initialize(e.getPoints(),l.cellPointIds),r}}var m={};function b(e,t){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,m,l),o.extend(e,t,l),n.get(e,t,[\"cells\",\"links\"]),n.setGet(e,t,[\"verts\",\"lines\",\"polys\",\"strips\"]),g(e,t)}var C=n.newInstance(b,\"vtkPolyData\"),_={newInstance:C,extend:b};export default _;export{T as CELL_FACTORY,b as extend,C as newInstance};\n","import\"../../../vendor/readable-stream/lib/_stream_duplex.js\";var e=[\"verts\",\"lines\",\"polys\",\"strips\"];export{e as POLYDATA_FIELDS};\n","import\"../../../vendor/readable-stream/lib/_stream_duplex.js\";var r={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},a={VOID:\"\",CHAR:\"Int8Array\",SIGNED_CHAR:\"Int8Array\",UNSIGNED_CHAR:\"Uint8Array\",SHORT:\"Int16Array\",UNSIGNED_SHORT:\"Uint16Array\",INT:\"Int32Array\",UNSIGNED_INT:\"Uint32Array\",FLOAT:\"Float32Array\",DOUBLE:\"Float64Array\"},t=a.FLOAT,A={DefaultDataType:t,DataTypeByteSize:r,VtkDataTypes:a};export default A;export{r as DataTypeByteSize,t as DefaultDataType,a as VtkDataTypes};\n","import{d as e}from\"../../../_virtual/commonjsHelpers.js\";import{r}from\"./readable-stream-browser.js\";var a=e((function(e,a){if(a.base64=!0,a.array=!0,a.string=!0,a.arraybuffer=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array,a.nodebuffer=\"undefined\"!=typeof Buffer,a.uint8array=\"undefined\"!=typeof Uint8Array,\"undefined\"==typeof ArrayBuffer)a.blob=!1;else{var o=new ArrayBuffer(0);try{a.blob=0===new Blob([o],{type:\"application/zip\"}).size}catch(e){try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);f.append(o),a.blob=0===f.getBlob(\"application/zip\").size}catch(e){a.blob=!1}}}try{a.nodestream=!!r.Readable}catch(e){a.nodestream=!1}}),\"/$$rollup_base$$/node_modules/jszip/lib\");export{a as s};\n","var a=function(a,n){if(!(a instanceof n))throw new TypeError(\"Cannot call a class as a function\")};export default a;\n","function e(e,r){for(var n=0;n=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const l=new Array(512);t(l);const o=new Array(256);t(o);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const b=t=>t<256?l[t]:l[256+(t>>>7)],g=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{m(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)i[n]=r=r+a[n-1]<<1;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=t=>{t.bi_valid>8?g(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let s,r,l,_,f=0;if(0!==t.last_lit)do{s=t.pending_buf[t.d_buf+2*f]<<8|t.pending_buf[t.d_buf+2*f+1],r=t.pending_buf[t.l_buf+f],f++,0===s?p(t,r,i):(l=o[r],p(t,l+256+1,i),_=e[l],0!==_&&(r-=h[l],m(t,r,_)),s--,l=b(s),p(t,l,n),_=a[l],0!==_&&(s-=d[l],m(t,s,_)))}while(f{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,l,o,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)A(t,a,r);o=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),l=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=l,a[2*o]=a[2*r]+a[2*l],t.depth[o]=(t.depth[r]>=t.depth[l]?t.depth[r]:t.depth[l])+1,a[2*r+1]=a[2*l+1]=o,t.heap[1]=o++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,o=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>o&&(f=o,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=l&&(c=r[d-l]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=o-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[o]--,w-=2}while(w>0);for(f=o;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{m(t,0+(i?1:0),3),((t,e,a,i)=>{x(t),i&&(g(t,a),g(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var O={_tr_init:t=>{S||((()=>{let t,n,w,b,g;const m=new Array(16);for(w=0,b=0;b<28;b++)for(h[b]=w,t=0;t<1<>=7;b<30;b++)for(d[b]=g<<7,t=0;t<1<{let l,o,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),l=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=l&&(l=o)):l=o=a+5,a+4<=l&&-1!==e?D(t,e,a,i):4===t.strategy||o===l?(m(t,2+(i?1:0),3),E(t,s,r)):(m(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(m(t,e-257,5),m(t,a-1,5),m(t,i-4,4),s=0;s(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(o[a]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{m(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(g(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var T=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const F=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var I=(t,e,a,i)=>{const n=F,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},L={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},N={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:B,_tr_stored_block:C,_tr_flush_block:H,_tr_tally:M,_tr_align:j}=O,{Z_NO_FLUSH:K,Z_PARTIAL_FLUSH:P,Z_FULL_FLUSH:Y,Z_FINISH:G,Z_BLOCK:X,Z_OK:W,Z_STREAM_END:q,Z_STREAM_ERROR:J,Z_DATA_ERROR:Q,Z_BUF_ERROR:V,Z_DEFAULT_COMPRESSION:$,Z_FILTERED:tt,Z_HUFFMAN_ONLY:et,Z_RLE:at,Z_FIXED:it,Z_DEFAULT_STRATEGY:nt,Z_UNKNOWN:st,Z_DEFLATED:rt}=N,lt=(t,e)=>(t.msg=L[e],e),ot=t=>(t<<1)-(t>4?9:0),ht=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let dt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ft=(t,e)=>{H(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,_t(t.strm)},ct=(t,e)=>{t.pending_buf[t.pending++]=e},ut=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},wt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=T(t.adler,e,n,a):2===t.state.wrap&&(t.adler=I(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},bt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},gt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=wt(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=dt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=dt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},mt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(gt(t),t.lookahead<262&&e===K)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=bt(t,a)),t.match_length>=3)if(i=M(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=dt(t,t.ins_h,t.window[t.strstart+1]);else i=M(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ft(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===G?(ft(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ft(t,!1),0===t.strm.avail_out)?1:2},pt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(gt(t),t.lookahead<262&&e===K)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=M(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ft(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=M(t,0,t.window[t.strstart-1]),i&&ft(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=M(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===G?(ft(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ft(t,!1),0===t.strm.avail_out)?1:2};function kt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const vt=[new kt(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(gt(t),0===t.lookahead&&e===K)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,ft(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(ft(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===G?(ft(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(ft(t,!1),t.strm.avail_out),1)})),new kt(4,4,8,4,mt),new kt(4,5,16,8,mt),new kt(4,6,32,32,mt),new kt(4,4,16,16,pt),new kt(8,16,32,32,pt),new kt(8,16,128,128,pt),new kt(8,32,128,256,pt),new kt(32,128,258,1024,pt),new kt(32,258,258,4096,pt)];function yt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ht(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xt=t=>{if(!t||!t.state)return lt(t,J);t.total_in=t.total_out=0,t.data_type=st;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=K,B(e),W},zt=t=>{const e=xt(t);var a;return e===W&&((a=t.state).window_size=2*a.w_size,ht(a.head),a.max_lazy_match=vt[a.level].max_lazy,a.good_match=vt[a.level].good_length,a.nice_match=vt[a.level].nice_length,a.max_chain_length=vt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},At=(t,e,a,i,n,s)=>{if(!t)return J;let r=1;if(e===$&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==rt||i<8||i>15||e<0||e>9||s<0||s>it)return lt(t,J);8===i&&(i=9);const l=new yt;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<At(t,e,rt,15,8,nt),deflateInit2:At,deflateReset:zt,deflateResetKeep:xt,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?J:(t.state.gzhead=e,W):J,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>X||e<0)return t?lt(t,J):J;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==G)return lt(t,0===t.avail_out?V:J);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,ct(n,31),ct(n,139),ct(n,8),n.gzhead?(ct(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),ct(n,255&n.gzhead.time),ct(n,n.gzhead.time>>8&255),ct(n,n.gzhead.time>>16&255),ct(n,n.gzhead.time>>24&255),ct(n,9===n.level?2:n.strategy>=et||n.level<2?4:0),ct(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(ct(n,255&n.gzhead.extra.length),ct(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=I(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(ct(n,0),ct(n,0),ct(n,0),ct(n,0),ct(n,0),ct(n,9===n.level?2:n.strategy>=et||n.level<2?4:0),ct(n,3),n.status=113);else{let e=rt+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=et||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=113,ut(n,e),0!==n.strstart&&(ut(n,t.adler>>>16),ut(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),_t(t),a=n.pending,n.pending!==n.pending_buf_size));)ct(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),_t(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),_t(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=I(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&_t(t),n.pending+2<=n.pending_buf_size&&(ct(n,255&t.adler),ct(n,t.adler>>8&255),t.adler=0,n.status=113)):n.status=113),0!==n.pending){if(_t(t),0===t.avail_out)return n.last_flush=-1,W}else if(0===t.avail_in&&ot(e)<=ot(s)&&e!==G)return lt(t,V);if(666===n.status&&0!==t.avail_in)return lt(t,V);if(0!==t.avail_in||0!==n.lookahead||e!==K&&666!==n.status){let a=n.strategy===et?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(gt(t),0===t.lookahead)){if(e===K)return 1;break}if(t.match_length=0,a=M(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ft(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===G?(ft(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ft(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===at?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(gt(t),t.lookahead<=258&&e===K)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=M(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=M(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ft(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===G?(ft(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ft(t,!1),0===t.strm.avail_out)?1:2})(n,e):vt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),W;if(2===a&&(e===P?j(n):e!==X&&(C(n,0,0,!1),e===Y&&(ht(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),_t(t),0===t.avail_out))return n.last_flush=-1,W}return e!==G?W:n.wrap<=0?q:(2===n.wrap?(ct(n,255&t.adler),ct(n,t.adler>>8&255),ct(n,t.adler>>16&255),ct(n,t.adler>>24&255),ct(n,255&t.total_in),ct(n,t.total_in>>8&255),ct(n,t.total_in>>16&255),ct(n,t.total_in>>24&255)):(ut(n,t.adler>>>16),ut(n,65535&t.adler)),_t(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?W:q)},deflateEnd:t=>{if(!t||!t.state)return J;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?lt(t,J):(t.state=null,113===e?lt(t,Q):W)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return J;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return J;if(1===n&&(t.adler=T(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(ht(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,gt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=dt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,gt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,W},deflateInfo:\"pako deflate (from Nodeca project)\"};const Rt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Zt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if(\"object\"!=typeof a)throw new TypeError(a+\"must be non-object\");for(const e in a)Rt(a,e)&&(t[e]=a[e])}}return t},Ut=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Dt[254]=Dt[254]=1;var Ot=t=>{let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Tt=(t,e)=>{let a,i;const n=e||t.length,s=new Array(2*n);for(i=0,a=0;a4)s[i++]=65533,a+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&a1?s[i++]=65533:e<65536?s[i++]=e:(e-=65536,s[i++]=55296|e>>10&1023,s[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&St)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a=\"\";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Dt[t[a]]>e?a:e};var It=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};const Lt=Object.prototype.toString,{Z_NO_FLUSH:Nt,Z_SYNC_FLUSH:Bt,Z_FULL_FLUSH:Ct,Z_FINISH:Ht,Z_OK:Mt,Z_STREAM_END:jt,Z_DEFAULT_COMPRESSION:Kt,Z_DEFAULT_STRATEGY:Pt,Z_DEFLATED:Yt}=N;function Gt(t){this.options=Zt({level:Kt,method:Yt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Pt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new It,this.strm.avail_out=0;let a=Et.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Mt)throw new Error(L[a]);if(e.header&&Et.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t=\"string\"==typeof e.dictionary?Ot(e.dictionary):\"[object ArrayBuffer]\"===Lt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Et.deflateSetDictionary(this.strm,t),a!==Mt)throw new Error(L[a]);this._dict_set=!0}}function Xt(t,e){const a=new Gt(e);if(a.push(t,!0),a.err)throw a.msg||L[a.err];return a.result}Gt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Ht:Nt,\"string\"==typeof t?a.input=Ot(t):\"[object ArrayBuffer]\"===Lt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Bt||s===Ct)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Et.deflate(a,s),n===jt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Et.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Mt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Gt.prototype.onData=function(t){this.chunks.push(t)},Gt.prototype.onEnd=function(t){t===Mt&&(this.result=Ut(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Wt={Deflate:Gt,deflate:Xt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Xt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Xt(t,e)},constants:N};var qt=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,m,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=p,c-=p,p=m>>>16&255,0===p)A[n++]=65535&m;else{if(!(16&p)){if(0==(64&p)){m=u[(65535&m)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=m>>>16&255,!(16&p)){if(0==(64&p)){m=w[(65535&m)+(f&(1<l){t.msg=\"invalid distance too far back\",E.mode=30;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg=\"invalid distance too far back\",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,m=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,O=null,T=0;for(w=0;w<=15;w++)R[w]=0;for(b=0;b=1&&0===R[m];m--);if(p>m&&(p=m),0===m)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==m))return-1;for(Z[1]=0,w=1;w<15;w++)Z[w+1]=Z[w]+R[w];for(b=0;b852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=O[T+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===m)break;w=e[a+r[b]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=p,0};const{Z_FINISH:ee,Z_BLOCK:ae,Z_TREES:ie,Z_OK:ne,Z_STREAM_END:se,Z_NEED_DICT:re,Z_STREAM_ERROR:le,Z_DATA_ERROR:oe,Z_MEM_ERROR:he,Z_BUF_ERROR:de,Z_DEFLATED:_e}=N,fe=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ce(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ue=t=>{if(!t||!t.state)return le;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ne},we=t=>{if(!t||!t.state)return le;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ue(t)},be=(t,e)=>{let a;if(!t||!t.state)return le;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?le:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,we(t))},ge=(t,e)=>{if(!t)return le;const a=new ce;t.state=a,a.window=null;const i=be(t,e);return i!==ne&&(t.state=null),i};let me,pe,ke=!0;const ve=t=>{if(ke){me=new Int32Array(512),pe=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(te(1,t.lens,0,288,me,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;te(2,t.lens,0,32,pe,0,t.work,{bits:5}),ke=!1}t.lencode=me,t.lenbits=9,t.distcode=pe,t.distbits=5},ye=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whavege(t,15),inflateInit2:ge,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,m,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return le;a=t.state,12===a.mode&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=ne;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=I(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg=\"incorrect header check\",a.mode=30;break}if((15&h)!==_e){t.msg=\"unknown compression method\",a.mode=30;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg=\"invalid window size\",a.mode=30;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=I(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=I(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=I(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=12;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(ve(a),a.mode=20,e===ie){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg=\"invalid block type\",a.mode=30}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg=\"invalid stored block lengths\",a.mode=30;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ie)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=12;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg=\"too many length or distance symbols\",a.mode=30;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=te(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid code lengths set\",a.mode=30;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,m=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=m;else{if(16===m){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg=\"invalid bit length repeat\",a.mode=30;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===m){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg=\"invalid bit length repeat\",a.mode=30;break}for(;c--;)a.lens[a.have++]=y}}if(30===a.mode)break;if(0===a.lens[256]){t.msg=\"invalid code -- missing end-of-block\",a.mode=30;break}if(a.lenbits=9,E={bits:a.lenbits},x=te(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid literal/lengths set\",a.mode=30;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=te(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg=\"invalid distances set\",a.mode=30;break}if(a.mode=20,e===ie)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,qt(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,12===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,m=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>p)],b=z>>>24,g=z>>>16&255,m=65535&z,!(p+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=b,d-=b,a.back+=b,a.length=m,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=12;break}if(64&g){t.msg=\"invalid literal/length code\",a.mode=30;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,m=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>p)],b=z>>>24,g=z>>>16&255,m=65535&z,!(p+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg=\"invalid distance code\",a.mode=30;break}a.offset=m,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg=\"invalid distance too far back\",a.mode=30;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg=\"invalid distance too far back\",a.mode=30;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return le;let e=t.state;return e.window&&(e.window=null),t.state=null,ne},inflateGetHeader:(t,e)=>{if(!t||!t.state)return le;const a=t.state;return 0==(2&a.wrap)?le:(a.head=e,e.done=!1,ne)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?le:11===i.mode&&(n=1,n=T(n,e,a,0),n!==i.check)?oe:(s=ye(t,e,a,a),s?(i.mode=31,he):(i.havedict=1,ne))):le},inflateInfo:\"pako inflate (from Nodeca project)\"};var ze=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1};const Ae=Object.prototype.toString,{Z_NO_FLUSH:Ee,Z_FINISH:Re,Z_OK:Ze,Z_STREAM_END:Ue,Z_NEED_DICT:Se,Z_STREAM_ERROR:De,Z_DATA_ERROR:Oe,Z_MEM_ERROR:Te}=N;function Fe(t){this.options=Zt({chunkSize:65536,windowBits:15,to:\"\"},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new It,this.strm.avail_out=0;let a=xe.inflateInit2(this.strm,e.windowBits);if(a!==Ze)throw new Error(L[a]);if(this.header=new ze,xe.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=Ot(e.dictionary):\"[object ArrayBuffer]\"===Ae.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=xe.inflateSetDictionary(this.strm,e.dictionary),a!==Ze)))throw new Error(L[a])}function Ie(t,e){const a=new Fe(e);if(a.push(t),a.err)throw a.msg||L[a.err];return a.result}Fe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Re:Ee,\"[object ArrayBuffer]\"===Ae.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=xe.inflate(a,r),s===Se&&n&&(s=xe.inflateSetDictionary(a,n),s===Ze?s=xe.inflate(a,r):s===Oe&&(s=Se));a.avail_in>0&&s===Ue&&a.state.wrap>0&&0!==t[a.next_in];)xe.inflateReset(a),s=xe.inflate(a,r);switch(s){case De:case Oe:case Se:case Te:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===Ue))if(\"string\"===this.options.to){let t=Ft(a.output,a.next_out),e=a.next_out-t,n=Tt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Ze||0!==l){if(s===Ue)return s=xe.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Fe.prototype.onData=function(t){this.chunks.push(t)},Fe.prototype.onEnd=function(t){t===Ze&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=Ut(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Le={Inflate:Fe,inflate:Ie,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Ie(t,e)},ungzip:Ie,constants:N};const{Deflate:Ne,deflate:Be,deflateRaw:Ce,gzip:He}=Wt,{Inflate:Me,inflate:je,inflateRaw:Ke,ungzip:Pe}=Le;var Ye={Deflate:Ne,deflate:Be,deflateRaw:Ce,gzip:He,Inflate:Me,inflate:je,inflateRaw:Ke,ungzip:Pe,constants:N};export{Ye as p};\n","import{b as e}from\"../../../_virtual/commonjsHelpers.js\";var t,n,a=e.MutationObserver||e.WebKitMutationObserver;if(a){var o=0,r=new a(u),s=e.document.createTextNode(\"\");r.observe(s,{characterData:!0}),t=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)t=\"document\"in e&&\"onreadystatechange\"in e.document.createElement(\"script\")?function(){var t=e.document.createElement(\"script\");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,t=function(){c.port2.postMessage(0)}}var i=[];function u(){var e,t;n=!0;for(var a=i.length;a;){for(t=i,i=[],e=-1;++e2?\"one of \".concat(n,\" \").concat(t.slice(0,e-1).join(\", \"),\", or \")+t[e-1]:2===e?\"one of \".concat(n,\" \").concat(t[0],\" or \").concat(t[1]):\"of \".concat(n,\" \").concat(t[0])}return\"of \".concat(n,\" \").concat(String(t))}n(\"ERR_INVALID_OPT_VALUE\",(function(t,n){return'The value \"'+n+'\" is invalid for option \"'+t+'\"'}),TypeError),n(\"ERR_INVALID_ARG_TYPE\",(function(t,n,r){var o,c,a,E;if(\"string\"==typeof n&&(c=\"not \",n.substr(!a||a<0?0:+a,c.length)===c)?(o=\"must not be\",n=n.replace(/^not /,\"\")):o=\"must be\",function(t,n,e){return(void 0===e||e>t.length)&&(e=t.length),t.substring(e-n.length,e)===n}(t,\" argument\"))E=\"The \".concat(t,\" \").concat(o,\" \").concat(e(n,\"type\"));else{var i=function(t,n,e){return\"number\"!=typeof e&&(e=0),!(e+n.length>t.length)&&-1!==t.indexOf(n,e)}(t,\".\")?\"property\":\"argument\";E='The \"'.concat(t,'\" ').concat(i,\" \").concat(o,\" \").concat(e(n,\"type\"))}return E+=\". Received type \".concat(typeof r)}),TypeError),n(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),n(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(t){return\"The \"+t+\" method is not implemented\"})),n(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),n(\"ERR_STREAM_DESTROYED\",(function(t){return\"Cannot call \"+t+\" after a stream was destroyed\"})),n(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),n(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),n(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),n(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),n(\"ERR_UNKNOWN_ENCODING\",(function(t){return\"Unknown encoding: \"+t}),TypeError),n(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\");var r={codes:t};export{r as e};\n","import\"../../vendor/readable-stream/lib/_stream_duplex.js\";function r(){var r=new ArrayBuffer(4),n=new Uint8Array(r),e=new Uint32Array(r);return n[0]=161,n[1]=178,n[2]=195,n[3]=212,3569595041===e[0]?\"LittleEndian\":2712847316===e[0]?\"BigEndian\":null}var n=r();function e(r,n){if(!(n<2))for(var e=new Int8Array(r),a=e.length,t=[],i=0;i1?arguments[1]:void 0;return new Promise((function(r,n){var o=s(c(e));null===o?n(new Error(\"No such JSON \".concat(e))):r(JSON.parse(o))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,n){var o=s(e);null===o?n(new Error(\"No such text \".concat(e))):r(o)}))},fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=arguments.length>1?arguments[1]:void 0,l=arguments.length>2?arguments[2]:void 0,m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(d,v){var p=c([u,l.ref.basepath,m.compression?\"\".concat(l.ref.id,\".gz\"):l.ref.id].join(\"/\")),h=s(p);if(null===h)v(new Error(\"No such array \".concat(p)));else{if(\"string\"===l.dataType){var y=atob(h);m.compression&&(y=t.inflate(y,{to:\"string\"})),l.values=JSON.parse(y)}else{var w=new Uint8Array(r.toArrayBuffer(h));l.buffer=new ArrayBuffer(w.length),new Uint8Array(l.buffer).set(w),m.compression&&(\"string\"===l.dataType||\"JSON\"===l.dataType?l.buffer=t.inflate(new Uint8Array(l.buffer),{to:\"string\"}):l.buffer=t.inflate(new Uint8Array(l.buffer)).buffer),\"JSON\"===l.ref.encode?l.values=JSON.parse(l.buffer):(o.ENDIANNESS!==l.ref.encode&&o.ENDIANNESS&&(i(\"Swap bytes of \".concat(l.name)),o.swapBytes(l.buffer,n[l.dataType])),l.values=new window[l.dataType](l.buffer)),l.values.length!==l.size&&a(\"Error in FetchArray: \".concat(l.name,\" does not have the proper array size. Got \").concat(l.values.length,\", instead of \").concat(l.size))}delete l.ref,0==--f&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),d(l)}}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,n){var o=u(e);o?r(o):n(new Error(\"No such image \".concat(e)))}))}};export default l;\n","import e from\"../../../../../../@babel/runtime/helpers/slicedToArray.js\";import\"../../../vendor/readable-stream/lib/_stream_duplex.js\";import r from\"../../../macro.js\";import{DataTypeByteSize as n}from\"../../../Common/Core/DataArray/Constants.js\";import t from\"../../../Common/Core/Endian.js\";import{p as o}from\"../../../vendor/pako/dist/pako.esm.mjs.js\";var s=r.vtkErrorMacro,a=r.vtkDebugMacro,i=0;function f(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new XMLHttpRequest;return o.open(r,n,!0),t.headers&&Object.entries(t.headers).forEach((function(r){var n=e(r,2),t=n[0],s=n[1];return o.setRequestHeader(t,s)})),t.progressCallback&&o.addEventListener(\"progress\",t.progressCallback),o}var u={fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,u=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.ref&&!u.ref.pending?new Promise((function(d,p){var v=f(\"GET\",[r,u.ref.basepath,c.compression?\"\".concat(u.ref.id,\".gz\"):u.ref.id].join(\"/\"),c);v.onreadystatechange=function(r){1===v.readyState&&(u.ref.pending=!0,1==++i&&e.invokeBusy&&e.invokeBusy(!0)),4===v.readyState&&(u.ref.pending=!1,200===v.status||0===v.status?(u.buffer=v.response,c.compression&&(\"string\"===u.dataType||\"JSON\"===u.dataType?u.buffer=o.inflate(new Uint8Array(u.buffer),{to:\"string\"}):u.buffer=o.inflate(new Uint8Array(u.buffer)).buffer),\"JSON\"===u.ref.encode?u.values=JSON.parse(u.buffer):(t.ENDIANNESS!==u.ref.encode&&t.ENDIANNESS&&(a(\"Swap bytes of \".concat(u.name)),t.swapBytes(u.buffer,n[u.dataType])),u.values=new window[u.dataType](u.buffer)),u.values.length!==u.size&&s(\"Error in FetchArray: \".concat(u.name,\", does not have the proper array size. Got \").concat(u.values.length,\", instead of \").concat(u.size)),delete u.ref,0==--i&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),d(u)):p({xhr:v,e:r}))},v.responseType=c.compression||\"string\"!==u.dataType?\"arraybuffer\":\"text\",v.send()})):Promise.resolve(u)},fetchJSON:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(t,s){var a=f(\"GET\",r,n);a.onreadystatechange=function(r){1===a.readyState&&1==++i&&e.invokeBusy&&e.invokeBusy(!0),4===a.readyState&&(0==--i&&e.invokeBusy&&e.invokeBusy(!1),200===a.status||0===a.status?n.compression?t(JSON.parse(o.inflate(new Uint8Array(a.response),{to:\"string\"}))):t(JSON.parse(a.responseText)):s({xhr:a,e:r}))},a.responseType=n.compression?\"arraybuffer\":\"text\",a.send()}))},fetchText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n&&n.compression&&\"gz\"!==n.compression&&(s(\"Supported algorithms are: [gz]\"),s(\"Unkown compression algorithm: \".concat(n.compression))),new Promise((function(t,s){var a=f(\"GET\",r,n);a.onreadystatechange=function(r){1===a.readyState&&1==++i&&e.invokeBusy&&e.invokeBusy(!0),4===a.readyState&&(0==--i&&e.invokeBusy&&e.invokeBusy(!1),200===a.status||0===a.status?n.compression?t(o.inflate(new Uint8Array(a.response),{to:\"string\"})):t(a.responseText):s({xhr:a,e:r}))},a.responseType=n.compression?\"arraybuffer\":\"text\",a.send()}))},fetchBinary:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,t){var o=f(\"GET\",e,r);o.onreadystatechange=function(e){4===o.readyState&&(200===o.status||0===o.status?n(o.response):t({xhr:o,e:e}))},o.responseType=\"arraybuffer\",o.send()}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(n,t){var o=new Image;r.crossOrigin&&(o.crossOrigin=r.crossOrigin),o.onload=function(){return n(o)},o.onerror=t,o.src=e}))}};export default u;\n","var s={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null};export{s as d};\n","import{d as t}from\"../../../_virtual/commonjsHelpers.js\";import{s as r}from\"./support.js\";import{n as e}from\"./nodejsUtils.js\";import{u as n}from\"./utils.js\";import{G as a}from\"./stream/GenericWorker.js\";var o=t((function(t,o){for(var s=new Array(256),f=0;f<256;f++)s[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1;function i(){a.call(this,\"utf-8 decode\"),this.leftOver=null}function u(){a.call(this,\"utf-8 encode\")}o.utf8encode=function(t){return r.nodebuffer?e.newBufferFrom(t,\"utf-8\"):function(t){var e,n,a,o,s,f=t.length,i=0;for(o=0;o>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e}(t)},o.utf8decode=function(t){return r.nodebuffer?n.transformTo(\"nodebuffer\",t).toString(\"utf-8\"):function(t){var r,e,a,o,f=t.length,i=new Array(2*f);for(e=0,r=0;r4)i[e++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;o>1&&r1?i[e++]=65533:a<65536?i[e++]=a:(a-=65536,i[e++]=55296|a>>10&1023,i[e++]=56320|1023&a)}return i.length!==e&&(i.subarray?i=i.subarray(0,e):i.length=e),n.applyFromCharCode(i)}(t=n.transformTo(r.uint8array?\"uint8array\":\"array\",t))},n.inherits(i,a),i.prototype.processChunk=function(t){var e=n.transformTo(r.uint8array?\"uint8array\":\"array\",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var a=e;(e=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),e.set(a,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var f=function(t,r){var e;for((r=r||t.length)>t.length&&(r=t.length),e=r-1;e>=0&&128==(192&t[e]);)e--;return e<0||0===e?r:e+s[t[e]]>r?e:r}(e),i=e;f!==e.length&&(r.uint8array?(i=e.subarray(0,f),this.leftOver=e.subarray(f,e.length)):(i=e.slice(0,f),this.leftOver=e.slice(f,e.length))),this.push({data:o.utf8decode(i),meta:t.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=i,n.inherits(u,a),u.prototype.processChunk=function(t){this.push({data:o.utf8encode(t.data),meta:t.meta})},o.Utf8EncodeWorker=u}),\"/$$rollup_base$$/node_modules/jszip/lib\");export{o as u};\n","import{u as t}from\"../utils.js\";import{G as i}from\"./GenericWorker.js\";function e(e){i.call(this,\"DataWorker\");var s=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then((function(i){s.dataIsReady=!0,s.data=i,s.max=i&&i.length||0,s.type=t.getTypeOf(i),s.isPaused||s._tickAndRepeat()}),(function(t){s.error(t)}))}t.inherits(e,i),e.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},e.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,t.delay(this._tickAndRepeat,[],this)),!0)},e.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(t.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},e.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,i=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":t=this.data.substring(this.index,i);break;case\"uint8array\":t=this.data.subarray(this.index,i);break;case\"array\":case\"nodebuffer\":t=this.data.slice(this.index,i)}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};var s=e;export{s as D};\n","import{u as t}from\"../utils.js\";import{G as r}from\"./GenericWorker.js\";function o(t){r.call(this,\"DataLengthProbe for \"+t),this.propName=t,this.withStreamInfo(t,0)}t.inherits(o,r),o.prototype.processChunk=function(t){if(t){var o=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=o+t.data.length}r.prototype.processChunk.call(this,t)};var s=o;export{s as D};\n","import{u as r}from\"./utils.js\";var t=function(){for(var r,t=[],n=0;n<256;n++){r=n;for(var o=0;o<8;o++)r=1&r?3988292384^r>>>1:r>>>1;t[n]=r}return t}();var n=function(n,o){return void 0!==n&&n.length?\"string\"!==r.getTypeOf(n)?function(r,n,o,a){var e=t,f=a+o;r^=-1;for(var u=a;u>>8^e[255&(r^n[u])];return-1^r}(0|o,n,n.length,0):function(r,n,o,a){var e=t,f=a+o;r^=-1;for(var u=a;u>>8^e[255&(r^n.charCodeAt(u))];return-1^r}(0|o,n,n.length,0):0};export{n as c};\n","import{u as r}from\"../utils.js\";import{G as t}from\"./GenericWorker.js\";import{c as s}from\"../crc32.js\";function o(){t.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}r.inherits(o,t),o.prototype.processChunk=function(r){this.streamInfo.crc32=s(r.data,this.streamInfo.crc32||0),this.push(r)};var c=o;export{c as C};\n","import{e}from\"./external.js\";import{D as r}from\"./stream/DataWorker.js\";import{D as s}from\"./stream/DataLengthProbe.js\";import{C as o}from\"./stream/Crc32Probe.js\";function t(e,r,s,o,t){this.compressedSize=e,this.uncompressedSize=r,this.crc32=s,this.compression=o,this.compressedContent=t}t.prototype={getContentWorker:function(){var o=new r(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s(\"data_length\")),t=this;return o.on(\"end\",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")})),o},getCompressedWorker:function(){return new r(e.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},t.createWorkerFrom=function(e,r,t){return e.pipe(new o).pipe(new s(\"uncompressedSize\")).pipe(r.compressWorker(t)).pipe(new s(\"compressedSize\")).withStreamInfo(\"compression\",r)};var i=t;export{i as c};\n","import{G as r}from\"./stream/GenericWorker.js\";import{u as e}from\"./utf8.js\";import{S as t}from\"./stream/StreamHelper.js\";import{D as s}from\"./stream/DataWorker.js\";import{c as o}from\"./compressedObject.js\";var i=function(r,e,t){this.name=r,this.dir=t.dir,this.date=t.date,this.comment=t.comment,this.unixPermissions=t.unixPermissions,this.dosPermissions=t.dosPermissions,this._data=e,this._dataBinary=t.binary,this.options={compression:t.compression,compressionOptions:t.compressionOptions}};i.prototype={internalStream:function(s){var o=null,i=\"string\";try{if(!s)throw new Error(\"No output type specified.\");var a=\"string\"===(i=s.toLowerCase())||\"text\"===i;\"binarystring\"!==i&&\"text\"!==i||(i=\"string\"),o=this._decompressWorker();var n=!this._dataBinary;n&&!a&&(o=o.pipe(new e.Utf8EncodeWorker)),!n&&a&&(o=o.pipe(new e.Utf8DecodeWorker))}catch(e){(o=new r(\"error\")).error(e)}return new t(o,i,\"\")},async:function(r,e){return this.internalStream(r).accumulate(e)},nodeStream:function(r,e){return this.internalStream(r||\"nodebuffer\").toNodejsStream(e)},_compressWorker:function(r,t){if(this._data instanceof o&&this._data.compression.magic===r.magic)return this._data.getCompressedWorker();var s=this._decompressWorker();return this._dataBinary||(s=s.pipe(new e.Utf8EncodeWorker)),o.createWorkerFrom(s,r,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof r?this._data:new s(this._data)}};for(var a=[\"asText\",\"asBinary\",\"asNodeBuffer\",\"asUint8Array\",\"asArrayBuffer\"],n=function(){throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\")},m=0;m=0;)e[t]=0}var n=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],a=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],i=new Array(576);t(i);var l=new Array(60);t(l);var d=new Array(512);t(d);var f=new Array(256);t(f);var o=new Array(29);t(o);var b,u,s,c=new Array(30);function p(e,t,n,_,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=_,this.max_length=r,this.has_stree=e&&e.length}function h(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?d[e]:d[256+(e>>>7)]}function y(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function m(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function x(e,t,n){var _,r,a=new Array(16),i=0;for(_=1;_<=15;_++)a[_]=i=i+n[_-1]<<1;for(r=0;r<=t;r++){var l=e[2*r+1];0!==l&&(e[2*r]=w(a[l]++,l))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function k(e){e.bi_valid>8?y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function j(e,t,n,_){var r=2*t,a=2*n;return e[r]>1;n>=1;n--)z(e,a,n);r=d;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],z(e,a,1),_=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=_,a[2*r]=a[2*n]+a[2*_],e.depth[r]=(e.depth[n]>=e.depth[_]?e.depth[n]:e.depth[_])+1,a[2*n+1]=a[2*_+1]=r,e.heap[1]=r++,z(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,_,r,a,i,l,d=t.dyn_tree,f=t.max_code,o=t.stat_desc.static_tree,b=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,p=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(d[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(a=d[2*d[2*(_=e.heap[n])+1]+1]+1)>c&&(a=c,p++),d[2*_+1]=a,_>f||(e.bl_count[a]++,i=0,_>=s&&(i=u[_-s]),l=d[2*_],e.opt_len+=l*(a+i),b&&(e.static_len+=l*(o[2*_+1]+i)));if(0!==p){do{for(a=c-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[c]--,p-=2}while(p>0);for(a=c;0!==a;a--)for(_=e.bl_count[a];0!==_;)(r=e.heap[--n])>f||(d[2*r+1]!==a&&(e.opt_len+=(a-d[2*r+1])*d[2*r],d[2*r+1]=a),_--)}}(e,t),x(a,f,e.bl_count)}function B(e,t,n){var _,r,a=-1,i=t[1],l=0,d=7,f=4;for(0===i&&(d=138,f=3),t[2*(n+1)+1]=65535,_=0;_<=n;_++)r=i,i=t[2*(_+1)+1],++l>=7;h<30;h++)for(c[h]=v<<7,e=0;e<1<<_[h]-7;e++)d[256+v++]=h;for(t=0;t<=15;t++)y[t]=0;for(e=0;e<=143;)i[2*e+1]=8,e++,y[8]++;for(;e<=255;)i[2*e+1]=9,e++,y[9]++;for(;e<=279;)i[2*e+1]=7,e++,y[7]++;for(;e<=287;)i[2*e+1]=8,e++,y[8]++;for(x(i,287,y),e=0;e<30;e++)l[2*e+1]=5,l[2*e]=w(e,5);b=new p(i,n,257,286,15),u=new p(l,_,0,30,15),s=new p(new Array(0),r,0,19,7)}(),D=!0),e.l_desc=new h(e.dyn_ltree,b),e.d_desc=new h(e.dyn_dtree,u),e.bl_desc=new h(e.bl_tree,s),e.bi_buf=0,e.bi_valid=0,A(e)},_tr_stored_block:E,_tr_flush_block:function(e,t,n,_){var r,d,f=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),q(e,e.l_desc),q(e,e.d_desc),f=function(e){var t;for(B(e,e.dyn_ltree,e.l_desc.max_code),B(e,e.dyn_dtree,e.d_desc.max_code),q(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*a[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(d=e.static_len+3+7>>>3)<=r&&(r=d)):r=d=n+5,n+4<=r&&-1!==t?E(e,t,n,_):4===e.strategy||d===r?(m(e,2+(_?1:0),3),S(e,i,l)):(m(e,4+(_?1:0),3),function(e,t,n,_){var r;for(m(e,t-257,5),m(e,n-1,5),m(e,_-4,4),r=0;r<_;r++)m(e,e.bl_tree[2*a[r]+1],3);C(e,e.dyn_ltree,t-1),C(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1),S(e,e.dyn_ltree,e.dyn_dtree)),A(e),_&&k(e)},_tr_tally:function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(f[n]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){m(e,2,3),g(e,256,i),function(e){16===e.bi_valid?(y(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}};export{F as t};\n","import{c as t}from\"../utils/common.js\";import{t as a}from\"./trees.js\";import{a as e}from\"./adler32.js\";import{c as s}from\"./crc32.js\";import{m as i}from\"./messages.js\";var r;function n(t,a){return t.msg=i[a],a}function h(t){return(t<<1)-(t>4?9:0)}function l(t){for(var a=t.length;--a>=0;)t[a]=0}function _(a){var e=a.state,s=e.pending;s>a.avail_out&&(s=a.avail_out),0!==s&&(t.arraySet(a.output,e.pending_buf,e.pending_out,s,a.next_out),a.next_out+=s,e.pending_out+=s,a.total_out+=s,a.avail_out-=s,e.pending-=s,0===e.pending&&(e.pending_out=0))}function d(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,_(t.strm)}function o(t,a){t.pending_buf[t.pending++]=a}function u(t,a){t.pending_buf[t.pending++]=a>>>8&255,t.pending_buf[t.pending++]=255&a}function g(t,a){var e,s,i=t.max_chain_length,r=t.strstart,n=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,_=t.window,d=t.w_mask,o=t.prev,u=t.strstart+258,g=_[r+n-1],f=_[r+n];t.prev_length>=t.good_match&&(i>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(e=a)+n]===f&&_[e+n-1]===g&&_[e]===_[r]&&_[++e]===_[r+1]){r+=2,e++;do{}while(_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&_[++r]===_[++e]&&rn){if(t.match_start=a,n=s,s>=h)break;g=_[r+n-1],f=_[r+n]}}}while((a=o[a&d])>l&&0!=--i);return n<=t.lookahead?n:t.lookahead}function f(a){var i,r,n,h,l,_,d,o,u,g,f=a.w_size;do{if(h=a.window_size-a.lookahead-a.strstart,a.strstart>=f+(f-262)){t.arraySet(a.window,a.window,f,f,0),a.match_start-=f,a.strstart-=f,a.block_start-=f,i=r=a.hash_size;do{n=a.head[--i],a.head[i]=n>=f?n-f:0}while(--r);i=r=f;do{n=a.prev[--i],a.prev[i]=n>=f?n-f:0}while(--r);h+=f}if(0===a.strm.avail_in)break;if(_=a.strm,d=a.window,o=a.strstart+a.lookahead,u=h,g=void 0,(g=_.avail_in)>u&&(g=u),r=0===g?0:(_.avail_in-=g,t.arraySet(d,_.input,_.next_in,g,o),1===_.state.wrap?_.adler=e(_.adler,d,g,o):2===_.state.wrap&&(_.adler=s(_.adler,d,g,o)),_.next_in+=g,_.total_in+=g,g),a.lookahead+=r,a.lookahead+a.insert>=3)for(l=a.strstart-a.insert,a.ins_h=a.window[l],a.ins_h=(a.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<15&&(l=2,i-=16),r<1||r>9||8!==s||i<8||i>15||e<0||e>9||h<0||h>4)return n(a,-2);8===i&&(i=9);var _=new w;return a.state=_,_.strm=a,_.wrap=l,_.gzhead=null,_.w_bits=i,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new t.Buf8(2*_.w_size),_.head=new t.Buf16(_.hash_size),_.prev=new t.Buf16(_.w_size),_.lit_bufsize=1<t.pending_buf_size-5&&(e=t.pending_buf_size-5);;){if(t.lookahead<=1){if(f(t),0===t.lookahead&&0===a)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var s=t.block_start+e;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,d(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===a?(d(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(d(t,!1),t.strm.avail_out),1)})),new p(4,4,8,4,m),new p(4,5,16,8,m),new p(4,6,32,32,m),new p(4,4,16,16,c),new p(8,16,32,32,c),new p(8,16,128,128,c),new p(8,32,128,256,c),new p(32,128,258,1024,c),new p(32,258,258,4096,c)];var b={deflateInit:function(t,a){return z(t,a,8,15,8,0)},deflateInit2:z,deflateReset:k,deflateResetKeep:v,deflateSetHeader:function(t,a){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=a,0):-2},deflate:function(t,e){var i,g,m,c;if(!t||!t.state||e>5||e<0)return t?n(t,-2):-2;if(g=t.state,!t.output||!t.input&&0!==t.avail_in||666===g.status&&4!==e)return n(t,0===t.avail_out?-5:-2);if(g.strm=t,i=g.last_flush,g.last_flush=e,42===g.status)if(2===g.wrap)t.adler=0,o(g,31),o(g,139),o(g,8),g.gzhead?(o(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),o(g,255&g.gzhead.time),o(g,g.gzhead.time>>8&255),o(g,g.gzhead.time>>16&255),o(g,g.gzhead.time>>24&255),o(g,9===g.level?2:g.strategy>=2||g.level<2?4:0),o(g,255&g.gzhead.os),g.gzhead.extra&&g.gzhead.extra.length&&(o(g,255&g.gzhead.extra.length),o(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(t.adler=s(t.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(o(g,0),o(g,0),o(g,0),o(g,0),o(g,0),o(g,9===g.level?2:g.strategy>=2||g.level<2?4:0),o(g,3),g.status=113);else{var p=8+(g.w_bits-8<<4)<<8;p|=(g.strategy>=2||g.level<2?0:g.level<6?1:6===g.level?2:3)<<6,0!==g.strstart&&(p|=32),p+=31-p%31,g.status=113,u(g,p),0!==g.strstart&&(u(g,t.adler>>>16),u(g,65535&t.adler)),t.adler=1}if(69===g.status)if(g.gzhead.extra){for(m=g.pending;g.gzindex<(65535&g.gzhead.extra.length)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>m&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),_(t),m=g.pending,g.pending!==g.pending_buf_size));)o(g,255&g.gzhead.extra[g.gzindex]),g.gzindex++;g.gzhead.hcrc&&g.pending>m&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(73===g.status)if(g.gzhead.name){m=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>m&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),_(t),m=g.pending,g.pending===g.pending_buf_size)){c=1;break}c=g.gzindexm&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),0===c&&(g.gzindex=0,g.status=91)}else g.status=91;if(91===g.status)if(g.gzhead.comment){m=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>m&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),_(t),m=g.pending,g.pending===g.pending_buf_size)){c=1;break}c=g.gzindexm&&(t.adler=s(t.adler,g.pending_buf,g.pending-m,m)),0===c&&(g.status=103)}else g.status=103;if(103===g.status&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&_(t),g.pending+2<=g.pending_buf_size&&(o(g,255&t.adler),o(g,t.adler>>8&255),t.adler=0,g.status=113)):g.status=113),0!==g.pending){if(_(t),0===t.avail_out)return g.last_flush=-1,0}else if(0===t.avail_in&&h(e)<=h(i)&&4!==e)return n(t,-5);if(666===g.status&&0!==t.avail_in)return n(t,-5);if(0!==t.avail_in||0!==g.lookahead||0!==e&&666!==g.status){var w=2===g.strategy?function(t,e){for(var s;;){if(0===t.lookahead&&(f(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,s=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,s&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(g,e):3===g.strategy?function(t,e){for(var s,i,r,n,h=t.window;;){if(t.lookahead<=258){if(f(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=h[r=t.strstart-1])===h[++r]&&i===h[++r]&&i===h[++r]){n=t.strstart+258;do{}while(i===h[++r]&&i===h[++r]&&i===h[++r]&&i===h[++r]&&i===h[++r]&&i===h[++r]&&i===h[++r]&&i===h[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(s=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(s=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),s&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(g,e):r[g.level].func(g,e);if(3!==w&&4!==w||(g.status=666),1===w||3===w)return 0===t.avail_out&&(g.last_flush=-1),0;if(2===w&&(1===e?a._tr_align(g):5!==e&&(a._tr_stored_block(g,0,0,!1),3===e&&(l(g.head),0===g.lookahead&&(g.strstart=0,g.block_start=0,g.insert=0))),_(t),0===t.avail_out))return g.last_flush=-1,0}return 4!==e?0:g.wrap<=0?1:(2===g.wrap?(o(g,255&t.adler),o(g,t.adler>>8&255),o(g,t.adler>>16&255),o(g,t.adler>>24&255),o(g,255&t.total_in),o(g,t.total_in>>8&255),o(g,t.total_in>>16&255),o(g,t.total_in>>24&255)):(u(g,t.adler>>>16),u(g,65535&t.adler)),_(t),g.wrap>0&&(g.wrap=-g.wrap),0!==g.pending?0:1)},deflateEnd:function(t){var a;return t&&t.state?42!==(a=t.state.status)&&69!==a&&73!==a&&91!==a&&103!==a&&113!==a&&666!==a?n(t,-2):(t.state=null,113===a?n(t,-3):0):-2},deflateSetDictionary:function(a,s){var i,r,n,h,_,d,o,u,g=s.length;if(!a||!a.state)return-2;if(2===(h=(i=a.state).wrap)||1===h&&42!==i.status||i.lookahead)return-2;for(1===h&&(a.adler=e(a.adler,s,g,0)),i.wrap=0,g>=i.w_size&&(0===h&&(l(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new t.Buf8(i.w_size),t.arraySet(u,s,g-i.w_size,i.w_size,0),s=u,g=i.w_size),_=a.avail_in,d=a.next_in,o=a.input,a.avail_in=g,a.next_in=0,a.input=s,f(i);i.lookahead>=3;){r=i.strstart,n=i.lookahead-2;do{i.ins_h=(i.ins_h<>>16&65535|0,f=0;0!==a;){a-=f=a>2e3?2e3:a;do{t=t+(n=n+e[o++]|0)|0}while(--f);n%=65521,t%=65521}return n|t<<16|0};export{r as a};\n","var r=function(){for(var r,a=[],n=0;n<256;n++){r=n;for(var o=0;o<8;o++)r=1&r?3988292384^r>>>1:r>>>1;a[n]=r}return a}();var a=function(a,n,o,v){var f=r,t=v+o;a^=-1;for(var u=v;u>>8^f[255&(a^n[u])];return-1^a};export{a as c};\n","import{c as r}from\"./common.js\";var n=!0,t=!0;try{String.fromCharCode.apply(null,[0])}catch(r){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(r){t=!1}for(var e=new r.Buf8(256),o=0;o<256;o++)e[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;e[254]=e[254]=1;function f(e,o){if(o<65534&&(e.subarray&&t||!e.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(e,o));for(var f=\"\",a=0;a>>6,t[a++]=128|63&e):e<65536?(t[a++]=224|e>>>12,t[a++]=128|e>>>6&63,t[a++]=128|63&e):(t[a++]=240|e>>>18,t[a++]=128|e>>>12&63,t[a++]=128|e>>>6&63,t[a++]=128|63&e);return t},buf2binstring:function(r){return f(r,r.length)},binstring2buf:function(n){for(var t=new r.Buf8(n.length),e=0,o=t.length;e4)h[o++]=65533,t+=u-1;else{for(a&=2===u?31:3===u?15:7;u>1&&t1?h[o++]=65533:a<65536?h[o++]=a:(a-=65536,h[o++]=55296|a>>10&1023,h[o++]=56320|1023&a)}return f(h,o)},utf8border:function(r,n){var t;for((n=n||r.length)>r.length&&(n=r.length),t=n-1;t>=0&&128==(192&r[t]);)t--;return t<0||0===t?n:t+e[r[t]]>n?t:n}};export{a as s};\n","var t=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};export{t as z};\n","import{c as t}from\"./utils/common.js\";import{m as i}from\"./zlib/messages.js\";import{d as n}from\"./zlib/deflate.js\";import{s}from\"./utils/strings.js\";import{z as r}from\"./zlib/zstream.js\";var e=Object.prototype.toString;function o(a){if(!(this instanceof o))return new o(a);this.options=t.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:\"\"},a||{});var h=this.options;h.raw&&h.windowBits>0?h.windowBits=-h.windowBits:h.gzip&&h.windowBits>0&&h.windowBits<16&&(h.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;var u=n.deflateInit2(this.strm,h.level,h.method,h.windowBits,h.memLevel,h.strategy);if(0!==u)throw new Error(i[u]);if(h.header&&n.deflateSetHeader(this.strm,h.header),h.dictionary){var d;if(d=\"string\"==typeof h.dictionary?s.string2buf(h.dictionary):\"[object ArrayBuffer]\"===e.call(h.dictionary)?new Uint8Array(h.dictionary):h.dictionary,0!==(u=n.deflateSetDictionary(this.strm,d)))throw new Error(i[u]);this._dict_set=!0}}function a(t,n){var s=new o(n);if(s.push(t,!0),s.err)throw s.msg||i[s.err];return s.result}o.prototype.push=function(i,r){var o,a,h=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=r===~~r?r:!0===r?4:0,\"string\"==typeof i?h.input=s.string2buf(i):\"[object ArrayBuffer]\"===e.call(i)?h.input=new Uint8Array(i):h.input=i,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new t.Buf8(u),h.next_out=0,h.avail_out=u),1!==(o=n.deflate(h,a))&&0!==o)return this.onEnd(o),this.ended=!0,!1;0!==h.avail_out&&(0!==h.avail_in||4!==a&&2!==a)||(\"string\"===this.options.to?this.onData(s.buf2binstring(t.shrinkBuf(h.output,h.next_out))):this.onData(t.shrinkBuf(h.output,h.next_out)))}while((h.avail_in>0||0===h.avail_out)&&1!==o);return 4===a?(o=n.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,0===o):2!==a||(this.onEnd(0),h.avail_out=0,!0)},o.prototype.onData=function(t){this.chunks.push(t)},o.prototype.onEnd=function(i){0===i&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};var h={Deflate:o,deflate:a,deflateRaw:function(t,i){return(i=i||{}).raw=!0,a(t,i)},gzip:function(t,i){return(i=i||{}).gzip=!0,a(t,i)}};export{h as d};\n","var _={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};export{_ as c};\n","var i=function(i,e){var a,o,t,d,n,l,f,s,r,b,c,v,u,w,h,m,k,_,x,g,p,z,j,q,y;a=i.state,o=i.next_in,q=i.input,t=o+(i.avail_in-5),d=i.next_out,y=i.output,n=d-(e-i.avail_out),l=d+(i.avail_out-257),f=a.dmax,s=a.wsize,r=a.whave,b=a.wnext,c=a.window,v=a.hold,u=a.bits,w=a.lencode,h=a.distcode,m=(1<>>=x=_>>>24,u-=x,0===(x=_>>>16&255))y[d++]=65535&_;else{if(!(16&x)){if(0==(64&x)){_=w[(65535&_)+(v&(1<>>=x,u-=x),u<15&&(v+=q[o++]<>>=x=_>>>24,u-=x,!(16&(x=_>>>16&255))){if(0==(64&x)){_=h[(65535&_)+(v&(1<f){i.msg=\"invalid distance too far back\",a.mode=30;break i}if(v>>>=x,u-=x,p>(x=d-n)){if((x=p-x)>r&&a.sane){i.msg=\"invalid distance too far back\",a.mode=30;break i}if(z=0,j=c,0===b){if(z+=s-x,x2;)y[d++]=j[z++],y[d++]=j[z++],y[d++]=j[z++],g-=3;g&&(y[d++]=j[z++],g>1&&(y[d++]=j[z++]))}else{z=d-p;do{y[d++]=y[z++],y[d++]=y[z++],y[d++]=y[z++],g-=3}while(g>2);g&&(y[d++]=y[z++],g>1&&(y[d++]=y[z++]))}break}}break}}while(o>3,v&=(1<<(u-=g<<3))-1,i.next_in=o,i.next_out=d,i.avail_in=o=1&&0===J[z];z--);if(A>z&&(A=z),0===z)return l[a++]=20971520,l[a++]=20971520,m.bits=1,0;for(y=1;y0&&(0===t||1!==z))return-1;for(K[1]=0,g=1;g<15;g++)K[g+1]=K[g]+J[g];for(q=0;q852||2===t&&F>592)return 1;for(;;){h=g-D,b[q]d?(j=L[M+b[q]],k=H[I+b[q]]):(j=96,k=0),c=1<>D)+(w-=c)]=h<<24|j<<16|k|0}while(0!==w);for(c=1<>=1;if(0!==c?(G&=c-1,G+=c):G=0,q++,0==--J[g]){if(g===z)break;g=u[e+b[q]]}if(g>A&&(G&v)!==p){for(0===D&&(D=A),B+=y,E=1<<(C=g-D);C+D852||2===t&&F>592)return 1;l[p=G&v]=A<<24|C<<16|B-a|0}}return 0!==G&&(l[B+G]=g-D<<24|64<<16|0),m.bits=A,0};export{t as i};\n","import{c as e}from\"../utils/common.js\";import{a}from\"./adler32.js\";import{c as t}from\"./crc32.js\";import{i}from\"./inffast.js\";import{i as s}from\"./inftrees.js\";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(a){var t;return a&&a.state?(t=a.state,a.total_in=a.total_out=t.total=0,a.msg=\"\",t.wrap&&(a.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new e.Buf32(852),t.distcode=t.distdyn=new e.Buf32(592),t.sane=1,t.back=-1,0):-2}function l(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,r(e)):-2}function d(e,a){var t,i;return e&&e.state?(i=e.state,a<0?(t=0,a=-a):(t=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?-2:(null!==i.window&&i.wbits!==a&&(i.window=null),i.wrap=t,i.wbits=a,l(e))):-2}function f(e,a){var t,i;return e?(i=new o,e.state=i,i.window=null,0!==(t=d(e,a))&&(e.state=null),t):-2}var c,h,k=!0;function b(a){if(k){var t;for(c=new e.Buf32(512),h=new e.Buf32(32),t=0;t<144;)a.lens[t++]=8;for(;t<256;)a.lens[t++]=9;for(;t<280;)a.lens[t++]=7;for(;t<288;)a.lens[t++]=8;for(s(1,a.lens,0,288,c,0,a.work,{bits:9}),t=0;t<32;)a.lens[t++]=5;s(2,a.lens,0,32,h,0,a.work,{bits:5}),k=!1}a.lencode=c,a.lenbits=9,a.distcode=h,a.distbits=5}function m(a,t,i,s){var n,o=a.state;return null===o.window&&(o.wsize=1<=o.wsize?(e.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>s&&(n=s),e.arraySet(o.window,t,i-s,n,o.wnext),(s-=n)?(e.arraySet(o.window,t,i-s,s,0),o.wnext=s,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,l.check=t(l.check,H,2,0),u=0,g=0,l.mode=2;break}if(l.flags=0,l.head&&(l.head.done=!1),!(1&l.wrap)||(((255&u)<<8)+(u>>8))%31){o.msg=\"incorrect header check\",l.mode=30;break}if(8!=(15&u)){o.msg=\"unknown compression method\",l.mode=30;break}if(g-=4,R=8+(15&(u>>>=4)),0===l.wbits)l.wbits=R;else if(R>l.wbits){o.msg=\"invalid window size\",l.mode=30;break}l.dmax=1<>8&1),512&l.flags&&(H[0]=255&u,H[1]=u>>>8&255,l.check=t(l.check,H,2,0)),u=0,g=0,l.mode=3;case 3:for(;g<32;){if(0===k)break e;k--,u+=d[c++]<>>8&255,H[2]=u>>>16&255,H[3]=u>>>24&255,l.check=t(l.check,H,4,0)),u=0,g=0,l.mode=4;case 4:for(;g<16;){if(0===k)break e;k--,u+=d[c++]<>8),512&l.flags&&(H[0]=255&u,H[1]=u>>>8&255,l.check=t(l.check,H,2,0)),u=0,g=0,l.mode=5;case 5:if(1024&l.flags){for(;g<16;){if(0===k)break e;k--,u+=d[c++]<>>8&255,l.check=t(l.check,H,2,0)),u=0,g=0}else l.head&&(l.head.extra=null);l.mode=6;case 6:if(1024&l.flags&&((_=l.length)>k&&(_=k),_&&(l.head&&(R=l.head.extra_len-l.length,l.head.extra||(l.head.extra=new Array(l.head.extra_len)),e.arraySet(l.head.extra,d,c,_,R)),512&l.flags&&(l.check=t(l.check,d,_,c)),k-=_,c+=_,l.length-=_),l.length))break e;l.length=0,l.mode=7;case 7:if(2048&l.flags){if(0===k)break e;_=0;do{R=d[c+_++],l.head&&R&&l.length<65536&&(l.head.name+=String.fromCharCode(R))}while(R&&_>9&1,l.head.done=!0),o.adler=l.check=0,l.mode=12;break;case 10:for(;g<32;){if(0===k)break e;k--,u+=d[c++]<>>=7&g,g-=7&g,l.mode=27;break}for(;g<3;){if(0===k)break e;k--,u+=d[c++]<>>=1)){case 0:l.mode=14;break;case 1:if(b(l),l.mode=20,6===r){u>>>=2,g-=2;break e}break;case 2:l.mode=17;break;case 3:o.msg=\"invalid block type\",l.mode=30}u>>>=2,g-=2;break;case 14:for(u>>>=7&g,g-=7&g;g<32;){if(0===k)break e;k--,u+=d[c++]<>>16^65535)){o.msg=\"invalid stored block lengths\",l.mode=30;break}if(l.length=65535&u,u=0,g=0,l.mode=15,6===r)break e;case 15:l.mode=16;case 16:if(_=l.length){if(_>k&&(_=k),_>w&&(_=w),0===_)break e;e.arraySet(f,d,c,_,h),k-=_,c+=_,w-=_,h+=_,l.length-=_;break}l.mode=12;break;case 17:for(;g<14;){if(0===k)break e;k--,u+=d[c++]<>>=5,g-=5,l.ndist=1+(31&u),u>>>=5,g-=5,l.ncode=4+(15&u),u>>>=4,g-=4,l.nlen>286||l.ndist>30){o.msg=\"too many length or distance symbols\",l.mode=30;break}l.have=0,l.mode=18;case 18:for(;l.have>>=3,g-=3}for(;l.have<19;)l.lens[K[l.have++]]=0;if(l.lencode=l.lendyn,l.lenbits=7,D={bits:l.lenbits},A=s(0,l.lens,0,19,l.lencode,0,l.work,D),l.lenbits=D.bits,A){o.msg=\"invalid code lengths set\",l.mode=30;break}l.have=0,l.mode=19;case 19:for(;l.have>>16&255,S=65535&G,!((z=G>>>24)<=g);){if(0===k)break e;k--,u+=d[c++]<>>=z,g-=z,l.lens[l.have++]=S;else{if(16===S){for(E=z+2;g>>=z,g-=z,0===l.have){o.msg=\"invalid bit length repeat\",l.mode=30;break}R=l.lens[l.have-1],_=3+(3&u),u>>>=2,g-=2}else if(17===S){for(E=z+3;g>>=z)),u>>>=3,g-=3}else{for(E=z+7;g>>=z)),u>>>=7,g-=7}if(l.have+_>l.nlen+l.ndist){o.msg=\"invalid bit length repeat\",l.mode=30;break}for(;_--;)l.lens[l.have++]=R}}if(30===l.mode)break;if(0===l.lens[256]){o.msg=\"invalid code -- missing end-of-block\",l.mode=30;break}if(l.lenbits=9,D={bits:l.lenbits},A=s(1,l.lens,0,l.nlen,l.lencode,0,l.work,D),l.lenbits=D.bits,A){o.msg=\"invalid literal/lengths set\",l.mode=30;break}if(l.distbits=6,l.distcode=l.distdyn,D={bits:l.distbits},A=s(2,l.lens,l.nlen,l.ndist,l.distcode,0,l.work,D),l.distbits=D.bits,A){o.msg=\"invalid distances set\",l.mode=30;break}if(l.mode=20,6===r)break e;case 20:l.mode=21;case 21:if(k>=6&&w>=258){o.next_out=h,o.avail_out=w,o.next_in=c,o.avail_in=k,l.hold=u,l.bits=g,i(o,x),h=o.next_out,f=o.output,w=o.avail_out,c=o.next_in,d=o.input,k=o.avail_in,u=l.hold,g=l.bits,12===l.mode&&(l.back=-1);break}for(l.back=0;B=(G=l.lencode[u&(1<>>16&255,S=65535&G,!((z=G>>>24)<=g);){if(0===k)break e;k--,u+=d[c++]<>j)])>>>16&255,S=65535&G,!(j+(z=G>>>24)<=g);){if(0===k)break e;k--,u+=d[c++]<>>=j,g-=j,l.back+=j}if(u>>>=z,g-=z,l.back+=z,l.length=S,0===B){l.mode=26;break}if(32&B){l.back=-1,l.mode=12;break}if(64&B){o.msg=\"invalid literal/length code\",l.mode=30;break}l.extra=15&B,l.mode=22;case 22:if(l.extra){for(E=l.extra;g>>=l.extra,g-=l.extra,l.back+=l.extra}l.was=l.length,l.mode=23;case 23:for(;B=(G=l.distcode[u&(1<>>16&255,S=65535&G,!((z=G>>>24)<=g);){if(0===k)break e;k--,u+=d[c++]<>j)])>>>16&255,S=65535&G,!(j+(z=G>>>24)<=g);){if(0===k)break e;k--,u+=d[c++]<>>=j,g-=j,l.back+=j}if(u>>>=z,g-=z,l.back+=z,64&B){o.msg=\"invalid distance code\",l.mode=30;break}l.offset=S,l.extra=15&B,l.mode=24;case 24:if(l.extra){for(E=l.extra;g>>=l.extra,g-=l.extra,l.back+=l.extra}if(l.offset>l.dmax){o.msg=\"invalid distance too far back\",l.mode=30;break}l.mode=25;case 25:if(0===w)break e;if(_=x-w,l.offset>_){if((_=l.offset-_)>l.whave&&l.sane){o.msg=\"invalid distance too far back\",l.mode=30;break}_>l.wnext?(_-=l.wnext,p=l.wsize-_):p=l.wnext-_,_>l.length&&(_=l.length),y=l.window}else y=f,p=h-l.offset,_=l.length;_>w&&(_=w),w-=_,l.length-=_;do{f[h++]=y[p++]}while(--_);0===l.length&&(l.mode=21);break;case 26:if(0===w)break e;f[h++]=l.length,w--,l.mode=21;break;case 27:if(l.wrap){for(;g<32;){if(0===k)break e;k--,u|=d[c++]<=0&&_.windowBits<16&&(_.windowBits=-_.windowBits,0===_.windowBits&&(_.windowBits=-15)),!(_.windowBits>=0&&_.windowBits<16)||h&&h.windowBits||(_.windowBits+=32),_.windowBits>15&&_.windowBits<48&&0==(15&_.windowBits)&&(_.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var w=o.inflateInit2(this.strm,_.windowBits);if(w!==r.Z_OK)throw new Error(i[w]);if(this.header=new a,o.inflateGetHeader(this.strm,this.header),_.dictionary&&(\"string\"==typeof _.dictionary?_.dictionary=n.string2buf(_.dictionary):\"[object ArrayBuffer]\"===e.call(_.dictionary)&&(_.dictionary=new Uint8Array(_.dictionary)),_.raw&&(w=o.inflateSetDictionary(this.strm,_.dictionary))!==r.Z_OK))throw new Error(i[w])}function h(t,n){var s=new u(n);if(s.push(t,!0),s.err)throw s.msg||i[s.err];return s.result}u.prototype.push=function(i,s){var a,u,h,_,w,d=this.strm,f=this.options.chunkSize,l=this.options.dictionary,p=!1;if(this.ended)return!1;u=s===~~s?s:!0===s?r.Z_FINISH:r.Z_NO_FLUSH,\"string\"==typeof i?d.input=n.binstring2buf(i):\"[object ArrayBuffer]\"===e.call(i)?d.input=new Uint8Array(i):d.input=i,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new t.Buf8(f),d.next_out=0,d.avail_out=f),(a=o.inflate(d,r.Z_NO_FLUSH))===r.Z_NEED_DICT&&l&&(a=o.inflateSetDictionary(this.strm,l)),a===r.Z_BUF_ERROR&&!0===p&&(a=r.Z_OK,p=!1),a!==r.Z_STREAM_END&&a!==r.Z_OK)return this.onEnd(a),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&a!==r.Z_STREAM_END&&(0!==d.avail_in||u!==r.Z_FINISH&&u!==r.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(h=n.utf8border(d.output,d.next_out),_=d.next_out-h,w=n.buf2string(d.output,h),d.next_out=_,d.avail_out=f-_,_&&t.arraySet(d.output,d.output,h,_,0),this.onData(w)):this.onData(t.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(p=!0)}while((d.avail_in>0||0===d.avail_out)&&a!==r.Z_STREAM_END);return a===r.Z_STREAM_END&&(u=r.Z_FINISH),u===r.Z_FINISH?(a=o.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===r.Z_OK):u!==r.Z_SYNC_FLUSH||(this.onEnd(r.Z_OK),d.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(i){i===r.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};var _={Inflate:u,inflate:h,inflateRaw:function(t,i){return(i=i||{}).raw=!0,h(t,i)},ungzip:h};export{_ as i};\n","import{c as s}from\"./lib/utils/common.js\";import{d as i}from\"./lib/deflate.js\";import{c as o}from\"./lib/zlib/constants.js\";import{i as a}from\"./lib/inflate.js\";var r={};(0,s.assign)(r,i,a,o);var m=r;export{m as p};\n","import{u as t}from\"./utils.js\";import{G as o}from\"./stream/GenericWorker.js\";import{p as a}from\"../node_modules/pako/index.js\";var e=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array?\"uint8array\":\"array\";function n(t,a){o.call(this,\"FlateWorker/\"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=a,this.meta={}}t.inherits(n,o),n.prototype.processChunk=function(o){this.meta=o.meta,null===this._pako&&this._createPako(),this._pako.push(t.transformTo(e,o.data),!1)},n.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},n.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(o){t.push({data:o,meta:t.meta})}};var r={magic:\"\\b\\0\",compressWorker:function(t){return new n(\"Deflate\",t)},uncompressWorker:function(){return new n(\"Inflate\",{})}};export{r as f};\n","import{G as r}from\"./stream/GenericWorker.js\";import{f as e}from\"./flate.js\";var o={STORE:{magic:\"\\0\\0\",compressWorker:function(e){return new r(\"STORE compression\")},uncompressWorker:function(){return new r(\"STORE decompression\")}},DEFLATE:e};export{o as c};\n","var E={LOCAL_FILE_HEADER:\"PK\u0003\u0004\",CENTRAL_FILE_HEADER:\"PK\u0001\u0002\",CENTRAL_DIRECTORY_END:\"PK\u0005\u0006\",ZIP64_CENTRAL_DIRECTORY_LOCATOR:\"PK\u0006\u0007\",ZIP64_CENTRAL_DIRECTORY_END:\"PK\u0006\u0006\",DATA_DESCRIPTOR:\"PK\u0007\\b\"};export{E as s};\n","import{u as e}from\"../utils.js\";import{G as t}from\"../stream/GenericWorker.js\";import{u as r}from\"../utf8.js\";import{c as s}from\"../crc32.js\";import{s as i}from\"../signature.js\";var o=function(e,t){var r,s=\"\";for(r=0;r>>=8;return s},n=function(t,n,c,u,h,a){var p,l,f=t.file,m=t.compression,d=a!==r.utf8encode,g=e.transformTo(\"string\",a(f.name)),v=e.transformTo(\"string\",r.utf8encode(f.name)),S=f.comment,y=e.transformTo(\"string\",a(S)),C=e.transformTo(\"string\",r.utf8encode(S)),R=v.length!==f.name.length,F=C.length!==S.length,T=\"\",_=\"\",z=\"\",E=f.dir,N=f.date,P={crc32:0,compressedSize:0,uncompressedSize:0};n&&!c||(P.crc32=t.crc32,P.compressedSize=t.compressedSize,P.uncompressedSize=t.uncompressedSize);var A=0;n&&(A|=8),d||!R&&!F||(A|=2048);var D,I,O,U=0,W=0;E&&(U|=16),\"UNIX\"===h?(W=798,U|=(D=f.unixPermissions,I=E,O=D,D||(O=I?16893:33204),(65535&O)<<16)):(W=20,U|=63&(f.dosPermissions||0)),p=N.getUTCHours(),p<<=6,p|=N.getUTCMinutes(),p<<=5,p|=N.getUTCSeconds()/2,l=N.getUTCFullYear()-1980,l<<=4,l|=N.getUTCMonth()+1,l<<=5,l|=N.getUTCDate(),R&&(_=o(1,1)+o(s(g),4)+v,T+=\"up\"+o(_.length,2)+_),F&&(z=o(1,1)+o(s(y),4)+C,T+=\"uc\"+o(z.length,2)+z);var k=\"\";return k+=\"\\n\\0\",k+=o(A,2),k+=m.magic,k+=o(p,2),k+=o(l,2),k+=o(P.crc32,4),k+=o(P.compressedSize,4),k+=o(P.uncompressedSize,4),k+=o(g.length,2),k+=o(T.length,2),{fileRecord:i.LOCAL_FILE_HEADER+k+g+T,dirRecord:i.CENTRAL_FILE_HEADER+o(W,2)+k+o(y.length,2)+\"\\0\\0\\0\\0\"+o(U,4)+o(u,4)+g+T+y}},c=function(e){return i.DATA_DESCRIPTOR+o(e.crc32,4)+o(e.compressedSize,4)+o(e.uncompressedSize,4)};function u(e,r,s,i){t.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=s,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}e.inherits(u,t),u.prototype.push=function(e){var r=e.meta.percent||0,s=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,t.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:s?(r+100*(s-i-1))/s:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:c(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var t=this.bytesWritten,r=0;r0?e.substring(0,t):\"\"},c=function(e){return\"/\"!==e.slice(-1)&&(e+=\"/\"),e},u=function(e,t){return t=void 0!==t?t:s.createFolders,e=c(e),this.files[e]||m.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function h(e){return\"[object RegExp]\"===Object.prototype.toString.call(e)}var d={load:function(){throw new Error(\"This method has been removed in JSZip 3.0, please check the upgrade guide.\")},forEach:function(e){var t,r,i;for(t in this.files)this.files.hasOwnProperty(t)&&(i=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,i))},filter:function(e){var t=[];return this.forEach((function(r,i){e(r,i)&&t.push(i)})),t},file:function(e,t,r){if(1===arguments.length){if(h(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var n=this.files[this.root+e];return n&&!n.dir?n:null}return e=this.root+e,m.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(h(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=u.call(this,t),i=this.clone();return i.root=r.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(\"/\"!==e.slice(-1)&&(e+=\"/\"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),i=0;i=this.index;n--)e=(e<<8)+this.byteAt(n);return this.index+=t,e},readString:function(n){return t.transformTo(\"string\",this.readData(n))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}};var e=n;export{e as D};\n","import{u as t}from\"../utils.js\";import{D as r}from\"./DataReader.js\";function a(t){r.call(this,t);for(var a=0;a=0;--o)if(this.data[o]===r&&this.data[o+1]===a&&this.data[o+2]===e&&this.data[o+3]===i)return o-this.zero;return-1},a.prototype.readAndCheckSignature=function(t){var r=t.charCodeAt(0),a=t.charCodeAt(1),e=t.charCodeAt(2),i=t.charCodeAt(3),o=this.readData(4);return r===o[0]&&a===o[1]&&e===o[2]&&i===o[3]},a.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var r=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,r};var e=a;export{e as A};\n","import{u as t}from\"../utils.js\";import{D as e}from\"./DataReader.js\";function r(t){e.call(this,t)}t.inherits(r,e),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};var i=r;export{i as S};\n","import{u as r}from\"../utils.js\";import{A as t}from\"./ArrayReader.js\";function i(r){t.call(this,r)}r.inherits(i,t),i.prototype.readData=function(r){if(this.checkOffset(r),0===r)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,t};var s=i;export{s as U};\n","import{u as t}from\"../utils.js\";import{U as i}from\"./Uint8ArrayReader.js\";function r(t){i.call(this,t)}t.inherits(r,i),r.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i};var s=r;export{s as N};\n","import{s as r}from\"../support.js\";import{u as a}from\"../utils.js\";import{A as o}from\"./ArrayReader.js\";import{S as e}from\"./StringReader.js\";import{U as t}from\"./Uint8ArrayReader.js\";import{N as s}from\"./NodeBufferReader.js\";var n=function(n){var f=a.getTypeOf(n);return a.checkSupport(f),\"string\"!==f||r.uint8array?\"nodebuffer\"===f?new s(n):r.uint8array?new t(a.transformTo(\"uint8array\",n)):new o(a.transformTo(\"array\",n)):new e(n)};export{n as r};\n","import{s as e}from\"./support.js\";import{u as t}from\"./utils.js\";import{u as i}from\"./utf8.js\";import{c as r}from\"./crc32.js\";import{c as s}from\"./compressedObject.js\";import{c as a}from\"./compressions.js\";import{r as n}from\"./reader/readerFor.js\";function o(e,t){this.options=e,this.loadOptions=t}o.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var i,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error(\"Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)\");if(null===(i=function(e){for(var t in a)if(a.hasOwnProperty(t)&&a[t].magic===e)return a[t];return null}(this.compressionMethod)))throw new Error(\"Corrupted zip : compression \"+t.pretty(this.compressionMethod)+\" unknown (inner file : \"+t.transformTo(\"string\",this.fileName)+\")\");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,i,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error(\"Encrypted zip are not supported\");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var i=n(this.extraFields[1].value);this.uncompressedSize===t.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===t.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===t.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===t.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(e){var t,i,r,s=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error(\"Multi-volumes zip are not supported\")},readLocalFiles:function(){var r,e;for(r=0;r0)this.isSignature(i,t.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error(\"Corrupted zip: missing \"+Math.abs(s)+\" bytes.\")},prepareReader:function(r){this.reader=i(r)},load:function(r){this.prepareReader(r),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var n=s;export{n as z};\n","import{n as e}from\"./nodejsUtils.js\";import{e as r}from\"./external.js\";import{u as t}from\"./utils.js\";import{u as i}from\"./utf8.js\";import{C as n}from\"./stream/Crc32Probe.js\";import{z as o}from\"./zipEntries.js\";function s(e){return new r.Promise((function(r,t){var i=e.decompressed.getContentWorker().pipe(new n);i.on(\"error\",(function(e){t(e)})).on(\"end\",(function(){i.streamInfo.crc32!==e.decompressed.crc32?t(new Error(\"Corrupted zip : CRC32 mismatch\")):r()})).resume()}))}var m=function(n,m){var a=this;return m=t.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:i.utf8decode}),e.isNode&&e.isStream(n)?r.Promise.reject(new Error(\"JSZip can't accept a stream when loading a zip file.\")):t.prepareContent(\"the loaded zip file\",n,!0,m.optimizedBinaryString,m.base64).then((function(e){var r=new o(m);return r.load(e),r})).then((function(e){var t=[r.Promise.resolve(e)],i=e.files;if(m.checkCRC32)for(var n=0;n1;){var o=t.shift();u=u.folder(o)}e.callback&&e.callback(a)})),{fetchArray:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,l){r||i(\"ERROR!!! zip not ready...\");var p=c([t,o.ref.basepath,a.compression?\"\".concat(o.ref.id,\".gz\"):o.ref.id].join(\"/\"));1==++n&&e.invokeBusy&&e.invokeBusy(!0);var v=\"string\"!==o.dataType||a.compression?\"uint8array\":\"string\",d=f[v](o,a.compression,(function(){delete o.ref,0==--n&&e.invokeBusy&&e.invokeBusy(!1),e.modified&&e.modified(),s(o)}));u.file(p).async(v).then(d)}))},fetchJSON:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=c(e);return r||i(\"ERROR!!! zip not ready...\"),n.compression?\"gz\"===n.compression?u.file(o).async(\"uint8array\").then((function(e){var r=t.inflate(e,{to:\"string\"});return Promise.resolve(JSON.parse(r))})):Promise.reject(new Error(\"Invalid compression\")):u.file(o).async(\"string\").then((function(e){return Promise.resolve(JSON.parse(e))}))},fetchText:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=c(e);return r||i(\"ERROR!!! zip not ready...\"),n.compression?\"gz\"===n.compression?u.file(o).async(\"uint8array\").then((function(e){var r=t.inflate(e,{to:\"string\"});return Promise.resolve(r)})):Promise.reject(new Error(\"Invalid compression\")):u.file(o).async(\"string\").then((function(e){return Promise.resolve(e)}))},fetchImage:function(){var e=arguments.length>1?arguments[1]:void 0,n=c(e);return r||i(\"ERROR!!! zip not ready...\"),new Promise((function(e,r){var t=new Image;t.onload=function(){return e(t)},t.onerror=r,u.file(n).async(\"base64\").then((function(e){t.src=\"data:image/\".concat(s(n),\";base64,\").concat(e)}))}))},fetchBinary:function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=c(e);return r||i(\"ERROR!!! zip not ready...\"),n.compression?\"gz\"===n.compression?u.file(o).then((function(e){var r=t.inflate(e).buffer;return Promise.resolve(r)})):Promise.reject(new Error(\"Invalid compression\")):u.file(o).async(\"arraybuffer\").then((function(e){return Promise.resolve(e)}))}}}};export default u;\n","import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import e from\"./DataAccessHelper/HtmlDataAccessHelper.js\";import t from\"./DataAccessHelper/HttpDataAccessHelper.js\";import r from\"./DataAccessHelper/JSZipDataAccessHelper.js\";var a={http:function(e){return t},zip:function(e){return r.create(e)},html:function(t){return e}};var s={get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"http\",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a[e](t)}};export default s;\n","import t from\"../../../../../@babel/runtime/helpers/toConsumableArray.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import{a as i}from\"./Math/index.js\";import{t as r}from\"../../vendor/gl-matrix/esm/common.js\";import{i as a,f as s,m as e,r as n,a as m,b as h,c as o,t as l,s as u,d as p}from\"../../vendor/gl-matrix/esm/mat4.js\";import{s as v,n as x,d as c,c as f,l as y,v as d,t as g}from\"../../vendor/gl-matrix/esm/vec3.js\";import b from\"../../../../../@babel/runtime/helpers/classCallCheck.js\";import k from\"../../../../../@babel/runtime/helpers/createClass.js\";var C=function(t){return t},F=new Float64Array(16);a(F);var j=function(){function j(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];b(this,j),this.matrix=new Float64Array(16),a(this.matrix),this.tmp=new Float64Array(3),this.angleConv=t?r:C}return k(j,[{key:\"rotateFromDirections\",value:function(t,i){var r=new Float64Array(3),a=new Float64Array(3),n=new Float64Array(16);v(r,t[0],t[1],t[2]),v(a,i[0],i[1],i[2]),x(r,r),x(a,a);var m=c(r,a);return m>=1||(f(this.tmp,r,a),y(this.tmp)<1e-6&&(f(this.tmp,[1,0,0],t),y(this.tmp)<1e-6&&f(this.tmp,[0,1,0],t)),s(n,Math.acos(m),this.tmp),e(this.matrix,this.matrix,n)),this}},{key:\"rotate\",value:function(i,r){return v.apply(d,[this.tmp].concat(t(r))),x(this.tmp,this.tmp),n(this.matrix,this.matrix,this.angleConv(i),this.tmp),this}},{key:\"rotateX\",value:function(t){return m(this.matrix,this.matrix,this.angleConv(t)),this}},{key:\"rotateY\",value:function(t){return h(this.matrix,this.matrix,this.angleConv(t)),this}},{key:\"rotateZ\",value:function(t){return o(this.matrix,this.matrix,this.angleConv(t)),this}},{key:\"translate\",value:function(t,i,r){return v(this.tmp,t,i,r),l(this.matrix,this.matrix,this.tmp),this}},{key:\"scale\",value:function(t,i,r){return v(this.tmp,t,i,r),u(this.matrix,this.matrix,this.tmp),this}},{key:\"identity\",value:function(){return a(this.matrix),this}},{key:\"apply\",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(i(F,this.matrix))return this;for(var s=-1===a?t.length:r+3*a,e=r;e0?h-4:h;for(e=0;e>16&255,c[A++]=t>>8&255,c[A++]=255&t;2===u&&(t=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4,c[A++]=255&t);1===u&&(t=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2,c[A++]=t>>8&255,c[A++]=255&t);return c},e=function(r){for(var t,e=r.length,o=e%3,a=[],h=16383,u=0,c=e-o;uc?c:u+h));1===o?(t=r[e-1],a.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(r[e-2]<<8)+r[e-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\"));return a.join(\"\")},n=[],o=[],a=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,h=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",u=0,c=h.length;u0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var e=r.indexOf(\"=\");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function A(r,t,e){for(var o,a,h=[],u=t;u>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return h.join(\"\")}o[\"-\".charCodeAt(0)]=62,o[\"_\".charCodeAt(0)]=63;var d={byteLength:r,toByteArray:t,fromByteArray:e};export{d as b,e as f};\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nvar a={read:function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<>1,e=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-e)-1,s>>=-e,e+=w;e>0;M=256*M+a[o+N],N+=n,e-=8);for(p=M&(1<<-e)-1,M>>=-e,e+=r;e>0;p=256*p+a[o+N],N+=n,e-=8);if(0===M)M=1-i;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=i}return(s?-1:1)*p*Math.pow(2,M-r)},write:function(a,o,t,r,h,M){var p,w,f,i=8*M-h-1,e=(1<>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=e):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=e?(w=0,p=e):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<0;a[t+s]=255&p,s+=u,p/=256,i-=8);a[t+s-u]|=128*l}};export{a as i};\n","import{d as t}from\"../../_virtual/commonjsHelpers.js\";import{b as e}from\"../base64-js/index.js\";import{i as r}from\"../ieee754/index.js\";\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */var n=t((function(t,n){const i=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;n.Buffer=s,n.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},n.INSPECT_MAX_BYTES=50;const o=2147483647;function f(t){if(t>o)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if(\"number\"==typeof t){if(\"string\"==typeof e)throw new TypeError('The \"string\" argument must be of type string. Received type number');return c(t)}return u(t,e,r)}function u(t,e,r){if(\"string\"==typeof t)return function(t,e){\"string\"==typeof e&&\"\"!==e||(e=\"utf8\");if(!s.isEncoding(e))throw new TypeError(\"Unknown encoding: \"+e);const r=0|g(t,e);let n=f(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return a(t)}(t);if(null==t)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return l(t,e,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return l(t,e,r);if(\"number\"==typeof t)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);const i=function(t){if(s.isBuffer(t)){const e=0|p(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return\"number\"!=typeof t.length||H(t.length)?f(0):a(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return a(t.data)}(t);if(i)return i;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive](\"string\"),e,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t)}function h(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be of type number');if(t<0)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"')}function c(t){return h(t),f(t<0?0:0|p(t))}function a(t){const e=t.length<0?0:0|p(t.length),r=f(e);for(let n=0;n=o)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+o.toString(16)+\" bytes\");return 0|t}function g(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if(\"string\"!=typeof t)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return V(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return q(t).length;default:if(i)return n?-1:V(t).length;e=(\"\"+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return L(this,e,r);case\"utf8\":case\"utf-8\":return v(this,e,r);case\"ascii\":return T(this,e,r);case\"latin1\":case\"binary\":return O(this,e,r);case\"base64\":return A(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return _(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function w(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function b(t,e,r,n,i){let o,f=1,s=t.length,u=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function h(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){let n=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let f;for(n>o/2&&(n=o/2),f=0;f>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function v(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+f<=r){let r,n,s,u;switch(f){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=f}return function(t){const e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);let r=\"\",n=0;for(;nn.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!s.isBuffer(e))throw new TypeError('\"list\" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},s.byteLength=g,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let e=0;ee&&(t+=\" ... \"),\"\"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,i){if(X(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),f=(r>>>=0)-(e>>>=0);const u=Math.min(o,f),h=this.slice(n,i),c=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let o=!1;for(;;)switch(n){case\"hex\":return m(this,t,e,r);case\"utf8\":case\"utf-8\":return B(this,t,e,r);case\"ascii\":case\"latin1\":case\"binary\":return E(this,t,e,r);case\"base64\":return I(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,e,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function T(t,e,r){let n=\"\";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i=\"\";for(let n=e;nr)throw new RangeError(\"Trying to access beyond buffer length\")}function $(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError(\"Index out of range\")}function x(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function P(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function C(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function j(t,e,n,i,o){return e=+e,n>>>=0,o||C(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function k(t,e,n,i,o){return e=+e,n>>>=0,o||C(t,0,n,8),r.write(t,e,n,i,52,8),n+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=Z((function(t){z(t>>>=0,\"offset\");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,\"offset\");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=Z((function(t){z(t>>>=0,\"offset\");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,\"offset\");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||S(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){$(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){$(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=Z((function(t,e=0){return x(this,t,e,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),s.prototype.writeBigUInt64BE=Z((function(t,e=0){return P(this,t,e,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);$(this,t,e,r,n-1,-n)}let i=0,o=1,f=0;for(this[e]=255&t;++i>0)-f&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);$(this,t,e,r,n-1,-n)}let i=r-1,o=1,f=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/o>>0)-f&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=Z((function(t,e=0){return x(this,t,e,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),s.prototype.writeBigInt64BE=Z((function(t,e=0){return P(this,t,e,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),s.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new N.ERR_OUT_OF_RANGE(\"value\",i,t)}!function(t,e,r){z(e,\"offset\"),void 0!==t[e]&&void 0!==t[e+r]||Y(e,t.length-(r+1))}(n,i,o)}function z(t,e){if(\"number\"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,\"number\",t)}function Y(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new N.ERR_OUT_OF_RANGE(r||\"offset\",\"an integer\",t);if(e<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(r||\"offset\",`>= ${r?1:0} and <= ${e}`,t)}F(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(t){return t?`${t} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),F(\"ERR_INVALID_ARG_TYPE\",(function(t,e){return`The \"${t}\" argument must be of type number. Received type ${typeof e}`}),TypeError),F(\"ERR_OUT_OF_RANGE\",(function(t,e,r){let n=`The value of \"${t}\" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=M(String(r)):\"bigint\"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=M(i)),i+=\"n\"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let f=0;f55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return e.toByteArray(function(t){if((t=(t=t.split(\"=\")[0]).trim().replace(G,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function W(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}const J=function(){const t=\"0123456789abcdef\",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Z(t){return\"undefined\"==typeof BigInt?K:t}function K(){throw new Error(\"BigInt not supported\")}}),\"/$$rollup_base$$/node_modules/buffer\");export{n as b};\n","import{d as o}from\"../../_virtual/commonjsHelpers.js\";var t=o((function(o){\"function\"==typeof Object.create?o.exports=function(o,t){o.super_=t,o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}})}:o.exports=function(o,t){o.super_=t;var e=function(){};e.prototype=t.prototype,o.prototype=new e,o.prototype.constructor=o}}),\"/$$rollup_base$$/node_modules/inherits\");export{t as i};\n","import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import n from\"../../macro.js\";import{VtkDataTypes as e}from\"./DataArray/Constants.js\";import o from\"./DataArray.js\";var t=n.vtkErrorMacro,s=[1,-1,1,-1,1,-1];function r(n,e){e.classHierarchy.push(\"vtkPoints\"),n.getNumberOfPoints=n.getNumberOfTuples,n.setNumberOfPoints=function(o){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;n.getNumberOfPoints()!==o&&(e.size=o*t,e.values=new window[e.dataType](e.size),n.setNumberOfComponents(t),n.modified())},n.setPoint=function(n){for(var o=n*e.numberOfComponents,t=0;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(e,u,t),o.extend(n,e,t),r(n,e)}var m=n.newInstance(a,\"vtkPoints\"),d={newInstance:m,extend:a};export default d;export{a as extend,m as newInstance};\n","import{e}from\"../../../../events/events.js\";var t=e.EventEmitter;export{t as s};\n","import\"../../../vendor/readable-stream/lib/_stream_duplex.js\";import e from\"../../../vtk.js\";import r from\"../../../macro.js\";import a from\"../../Core/DataArray.js\";function t(r,t){t.classHierarchy.push(\"vtkFieldData\");var n=r.getState;t.arrays&&(t.arrays=t.arrays.map((function(r){return{data:e(r.data)}}))),r.initialize=function(){r.initializeFields(),r.copyAllOn(),r.clearFieldFlags()},r.initializeFields=function(){t.arrays=[],t.copyFieldFlags={},r.modified()},r.copyStructure=function(e){r.initializeFields(),t.copyFieldFlags=e.getCopyFieldFlags().map((function(e){return e})),t.arrays=e.arrays().map((function(e){return{array:e}}))},r.getNumberOfArrays=function(){return t.arrays.length},r.getNumberOfActiveArrays=function(){return t.arrays.length},r.addArray=function(e){return t.arrays=[].concat(t.arrays,{data:e}),t.arrays.length-1},r.removeAllArrays=function(){t.arrays=[]},r.removeArray=function(e){t.arrays=t.arrays.filter((function(r){return e!==r.data.getName()}))},r.removeArrayByIndex=function(e){t.arrays=t.arrays.filter((function(r,a){return a!==e}))},r.getArrays=function(){return t.arrays.map((function(e){return e.data}))},r.getArray=function(e){return\"number\"==typeof e?r.getArrayByIndex(e):r.getArrayByName(e)},r.getArrayByName=function(e){return t.arrays.reduce((function(r,a,t){return a.data.getName()===e?a.data:r}),null)},r.getArrayWithIndex=function(e){return t.arrays.reduce((function(r,a,t){return a.data&&a.data.getName()===e?{array:a.data,index:t}:r}),{array:null,index:-1})},r.getArrayByIndex=function(e){return e>=0&&e=0},r.getArrayName=function(e){var r=t.arrays[e];return r?r.data.getName():\"\"},r.getCopyFieldFlags=function(){return t.copyFieldFlags},r.getFlag=function(e){return t.copyFieldFlags[e]},r.passData=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;e.getArrays().forEach((function(e){var u=r.getFlag(e.getName());if(!1!==u&&(!t.doCopyAllOff||!0===u)&&e){var i=r.getArrayByName(e.getName());if(i){if(e.getNumberOfComponents()===i.getNumberOfComponents())if(n>-1&&n-1?o:n;i.setTuple(l,e.getTuple(n))}else for(var f=0;fe.getNumberOfTuples())r.addArray(e);else{var y=e.getNumberOfComponents(),s=e.getNumberOfValues(),d=o>-1?o:n;se?r.data.getMTime():e}),t.mtime)},r.getNumberOfComponents=function(){return t.arrays.reduce((function(e,r){return e+r.data.getNumberOfComponents()}),0)},r.getNumberOfTuples=function(){return t.arrays.length>0?t.arrays[0].getNumberOfTuples():0},r.getState=function(){var e=n();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var n={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function o(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(a,n,o),r.obj(e,a),t(e,a)}var u=r.newInstance(o,\"vtkFieldData\"),i={newInstance:u,extend:o};export default i;export{o as extend,u as newInstance};\n","import t from\"../../../../../@babel/runtime/helpers/defineProperty.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import e from\"../../macro.js\";import r from\"../Core/DataArray.js\";import a from\"./DataSetAttributes/FieldData.js\";import n from\"./DataSetAttributes/Constants.js\";function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}var o=n.AttributeTypes,i=n.AttributeCopyOperations,s=e.vtkWarningMacro;function u(t,a){var n=[\"Scalars\",\"Vectors\",\"Normals\",\"TCoords\",\"Tensors\",\"GlobalIds\",\"PedigreeIds\"];function c(t){var e=n.find((function(e){return o[e.toUpperCase()]===t||\"number\"!=typeof t&&e.toLowerCase()===t.toLowerCase()}));return void 0===e&&(e=null),e}a.classHierarchy.push(\"vtkDataSetAttributes\"),t.checkNumberOfComponents=function(t){return!0},t.setAttribute=function(e,r){var n=c(r);if(e&&\"PEDIGREEIDS\"===n.toUpperCase()&&!e.isA(\"vtkDataArray\"))return s(\"Cannot set attribute \".concat(n,\". The attribute must be a vtkDataArray.\")),-1;if(e&&!t.checkNumberOfComponents(e,n))return s(\"Cannot set attribute \".concat(n,\". Incorrect number of components.\")),-1;var o=a[\"active\".concat(n)];if(o>=0&&o=0&&e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(r,f,n),a.extend(t,r,n),e.setGet(t,r,[\"activeScalars\",\"activeNormals\",\"activeTCoords\",\"activeVectors\",\"activeTensors\",\"activeGlobalIds\",\"activePedigreeIds\"]),r.arrays||(r.arrays={}),u(t,r)}var v=e.newInstance(y,\"vtkDataSetAttributes\"),b=function(e){for(var r=1;r1&&void 0!==arguments[1]&&arguments[1];o(e,t),c.forEach((function(t){r[t]=n.newInstance(),r[t].shallowCopy(e.getReferenceByName(t))}))}}var i={};function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,i,n),r.obj(e,t),r.setGet(e,t,c),s(e,t)}var f=r.newInstance(p,\"vtkDataSet\"),l=function(t){for(var r=1;r2&&void 0!==arguments[2]?arguments[2]:null,i=e(r),a=n.exec(i);if(!a)return{text:i};var l=a.index+a[0].length,u=i.substring(0,l),o=null,d=t?t.exec(i):null;if(d){var f=i.substr(d.index);o={text:u+f,binaryBuffer:r.slice(l,d.index)}}else o={text:u,binaryBuffer:r.slice(l)};return o}};export default r;\n","function t(t,r){a(t,r),e(t)}function e(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit(\"close\")}function a(t,e){t.emit(\"error\",e)}var r={destroy:function(r,i){var s=this,d=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return d||l?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(a,this,r)):process.nextTick(a,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(a){!i&&a?s._writableState?s._writableState.errorEmitted?process.nextTick(e,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,a)):process.nextTick(t,s,a):i?(process.nextTick(e,s),i(a)):process.nextTick(e,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var a=t._readableState,r=t._writableState;a&&a.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit(\"error\",e)}};export{r as d};\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","import r from\"../../../../../@babel/runtime/helpers/defineProperty.js\";import\"../../vendor/readable-stream/lib/_stream_duplex.js\";import n from\"../../macro.js\";import{g as e,d as t,j as o,k as i}from\"../Core/Math/index.js\";function a(r,n){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable}))),e.push.apply(e,t)}return e}function c(r,n,e){var t=e[0]*(r[0]-n[0])+e[1]*(r[1]-n[1])+e[2]*(r[2]-n[2]);return Math.abs(t)}function s(r,n,o,i){var a=[];e(r,n,a);var c=t(o,a);i[0]=r[0]-c*o[0],i[1]=r[1]-c*o[1],i[2]=r[2]-c*o[2]}function u(r,n,e){var o=t(r,n),i=t(n,n);0===i&&(i=1),e[0]=r[0]-o*n[0]/i,e[1]=r[1]-o*n[1]/i,e[2]=r[2]-o*n[2]/i}function l(r,n,o,i){var a=[];e(r,n,a);var c=t(o,a),s=t(o,o);0!==s?(i[0]=r[0]-c*o[0]/s,i[1]=r[1]-c*o[1]/s,i[2]=r[2]-c*o[2]/s):(i[0]=r[0],i[1]=r[1],i[2]=r[2])}function f(r,n,o,i){var a={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},c=[],s=[];e(n,r,c),e(o,r,s);var u=t(i,s),l=t(i,c);return(l<0?-l:l)<=(u<0?1e-6*-u:1e-6*u)||(a.t=u/l,a.x[0]=r[0]+a.t*c[0],a.x[1]=r[1]+a.t*c[1],a.x[2]=r[2]+a.t*c[2],a.intersection=!0,a.betweenPoints=a.t>=0&&a.t<=1),a}function m(r,n,a,c){var s={intersection:!1,l0:[],l1:[],error:null},u=[];o(n,c,u);var l,f=u.map((function(r){return Math.abs(r)}));if(f[0]+f[1]+f[2]<1e-6){var m=[];return e(r,a,m),0===t(n,m)?s.error=\"coincide\":s.error=\"disjoint\",s}l=f[0]>f[1]&&f[0]>f[2]?\"x\":f[1]>f[2]?\"y\":\"z\";var p=[],v=-t(n,r),b=-t(c,a);switch(l){case\"x\":p[0]=0,p[1]=(b*n[2]-v*c[2])/u[0],p[2]=(v*c[1]-b*n[1])/u[0];break;case\"y\":p[0]=(v*c[2]-b*n[2])/u[1],p[1]=0,p[2]=(b*n[0]-v*c[0])/u[1];break;case\"z\":p[0]=(b*n[1]-v*c[1])/u[2],p[1]=(v*c[0]-b*n[0])/u[2],p[2]=0}return s.l0=p,i(p,u,s.l1),s.intersection=!0,s}var p={evaluate:function(r,n,e){return r[0]*(e[0]-n[0])+r[1]*(e[1]-n[1])+r[2]*(e[2]-n[2])},distanceToPlane:c,projectPoint:s,projectVector:u,generalizedProjectPoint:l,intersectWithLine:f,intersectWithPlane:m,DISJOINT:\"disjoint\",COINCIDE:\"coincide\"};function v(r,n){n.classHierarchy.push(\"vtkPlane\"),r.distanceToPlane=function(r){return c(r,n.origin,n.normal)},r.projectPoint=function(r,e){s(r,n.origin,n.normal,e)},r.projectVector=function(r,e){u(r,n.normal,e)},r.push=function(r){if(0!==r)for(var e=0;e<3;e++)n.origin[e]+=r*n.normal[e]},r.generalizedProjectPoint=function(r,e){l(r,n.origin,n.normal,e)},r.evaluateFunction=function(r,e,t){return Array.isArray(r)?n.normal[0]*(r[0]-n.origin[0])+n.normal[1]*(r[1]-n.origin[1])+n.normal[2]*(r[2]-n.origin[2]):n.normal[0]*(r-n.origin[0])+n.normal[1]*(e-n.origin[1])+n.normal[2]*(t-n.origin[2])},r.evaluateGradient=function(r){return[n.normal[0],n.normal[1],n.normal[2]]},r.intersectWithLine=function(r,e){return f(r,e,n.origin,n.normal)},r.intersectWithPlane=function(r,e){return m(r,e,n.origin,n.normal)}}var b={normal:[0,0,1],origin:[0,0,0]};function g(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(e,b,t),n.obj(r,e),n.setGetArray(r,e,[\"normal\",\"origin\"],3),v(r,e)}var j=n.newInstance(g,\"vtkPlane\"),P=function(n){for(var e=1;e>16&255,n[l++]=A>>8&255,n[l++]=255&A}switch(f){case 3:for(;!e(o[d]);)d++;for(A=r[o.charCodeAt(d++)]<<10;!e(o[d]);)d++;for(A|=r[o.charCodeAt(d++)]<<4;!e(o[d]);)d++;A|=r[o.charCodeAt(d++)]>>2,n[l++]=A>>8&255,n[l++]=255&A;break;case 2:for(;!e(o[d]);)d++;for(A=r[o.charCodeAt(d++)]<<2;!e(o[d]);)d++;A|=r[o.charCodeAt(d++)]>>4,n[l++]=255&A;break;case 1:throw new Error(\"BASE64: remain 1 should not happen\")}return l}var n={toArrayBuffer:function(r){for(var o=function(r){for(var o=r.length,t=[],a=null,n=0;n 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","import{e}from\"../../../errors-browser.js\";var r=e.codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}var n=function e(n,o,a){if(\"function\"==typeof o)return e(n,null,o);o||(o={}),a=function(e){var r=!1;return function(){if(!r){r=!0;for(var t=arguments.length,n=new Array(t),o=0;o0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");a.name=\"MaxListenersExceededWarning\",a.emitter=e,a.type=t,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:\"function\"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var u=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw u.context=s,u}var f=o[e];if(void 0===f)return!1;if(\"function\"==typeof f)n(f,this,t);else{var v=f.length,a=y(f,v);for(r=0;r=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return\"function\"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},o.once=s;export{o as e};\n","var r=function(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(r,i,t),n.extend(e,r,t),a(e,r)}var u=r.newInstance(c,\"vtkCellArray\"),f=function(r){for(var t=1;t0)if(\"string\"==typeof t||o.objectMode||Object.getPrototypeOf(t)===m.prototype||(t=function(e){return m.from(e)}(t)),n)o.endEmitted?L(e,new E):W(e,o,t,!0);else if(o.ended)L(e,new M);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?W(e,o,t,!1):U(e,o)):W(e,o,t,!1)}else n||(o.reading=!1,U(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;b(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b(\"emitReadable\",t.flowing),t.emittedReadable=!0,process.nextTick(P,e))}function P(e){var t=e._readableState;b(\"emitReadable_\",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function U(e,t){t.readingMore||(t.readingMore=!0,process.nextTick($,e,t))}function $(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(\"data\")>0&&e.resume()}function N(e){b(\"readable nexttick read 0\"),e.read(0)}function I(e,t){b(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(b(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function V(e){var t=e._readableState;b(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(G,t,e))}function G(e,t){if(b(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Y(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return b(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?V(this):O(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&V(this),null;var n,a=t.needReadable;return b(\"need readable\",a),(0===t.length||t.length-e0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&V(this)),null!==n&&this.emit(\"data\",n),n},T.prototype._read=function(e){L(this,new k(\"_read()\"))},T.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,b(\"pipe count=%d opts=%j\",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?o:h;function i(t,a){b(\"onunpipe\"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,b(\"cleanup\"),e.removeListener(\"close\",p),e.removeListener(\"finish\",f),e.removeListener(\"drain\",d),e.removeListener(\"error\",u),e.removeListener(\"unpipe\",i),r.removeListener(\"end\",o),r.removeListener(\"end\",h),r.removeListener(\"data\",l),s=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function o(){b(\"onend\"),e.end()}n.endEmitted?process.nextTick(a):r.once(\"end\",a),e.on(\"unpipe\",i);var d=function(e){return function(){var t=e._readableState;b(\"pipeOnDrain\",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&g(e,\"data\")&&(t.flowing=!0,F(e))}}(r);e.on(\"drain\",d);var s=!1;function l(t){b(\"ondata\");var a=e.write(t);b(\"dest.write\",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Y(n.pipes,e))&&!s&&(b(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function u(t){b(\"onerror\",t),h(),e.removeListener(\"error\",u),0===g(e,\"error\")&&L(e,t)}function p(){e.removeListener(\"finish\",f),h()}function f(){b(\"onfinish\"),e.removeListener(\"close\",p),h()}function h(){b(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",l),function(e,t,r){if(\"function\"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,\"error\",u),e.once(\"close\",p),e.once(\"finish\",f),e.emit(\"pipe\",r),n.flowing||(b(\"pipe resume\"),r.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):\"readable\"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,b(\"on readable\",a.length,a.reading),a.length?O(this):a.reading||process.nextTick(N,this))),n},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return\"readable\"===e&&process.nextTick(H,this),n},T.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||process.nextTick(H,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(b(\"resume\"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(I,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return b(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(b(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on(\"end\",(function(){if(b(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(a){(b(\"wrapped data\"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&\"function\"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,r){r(new g(\"_write()\"))},M.prototype._writev=null,M.prototype.end=function(e,t,r){var n=this._writableState;return\"function\"==typeof e?(r=e,e=null,t=null):\"function\"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?process.nextTick(r):e.once(\"finish\",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(M.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=i.destroy,M.prototype._undestroy=i.undestroy,M.prototype._destroy=function(e,t){t(e)};export{c as _};\n","import{s as r}from\"./support.js\";import{u as t}from\"./utils.js\";var a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",e={encode:function(r){for(var e,n,h,o,c,i,A,d=[],l=0,s=r.length,f=s,u=\"string\"!==t.getTypeOf(r);l>2,c=(3&e)<<4|n>>4,i=f>1?(15&n)<<2|h>>6:64,A=f>2?63&h:64,d.push(a.charAt(o)+a.charAt(c)+a.charAt(i)+a.charAt(A));return d.join(\"\")},decode:function(t){var e,n,h,o,c,i,A=0,d=0,l=\"data:\";if(t.substr(0,l.length)===l)throw new Error(\"Invalid base64 input, it looks like a data url.\");var s,f=3*(t=t.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\")).length/4;if(t.charAt(t.length-1)===a.charAt(64)&&f--,t.charAt(t.length-2)===a.charAt(64)&&f--,f%1!=0)throw new Error(\"Invalid base64 input, bad content length.\");for(s=r.uint8array?new Uint8Array(0|f):new Array(0|f);A>4,n=(15&o)<<4|(c=a.indexOf(t.charAt(A++)))>>2,h=(3&c)<<6|(i=a.indexOf(t.charAt(A++))),s[d++]=e,64!==c&&(s[d++]=n),64!==i&&(s[d++]=h);return s}};export{e as b};\n","import{s as r}from\"../support.js\";import{b as t}from\"../base64.js\";import{e}from\"../external.js\";import{u as o}from\"../utils.js\";import{G as n}from\"./GenericWorker.js\";import{C as s}from\"./ConvertWorker.js\";import{N as a}from\"../nodejs/NodejsStreamOutputAdapter.js\";var u=null;if(r.nodestream)try{u=a}catch(r){}function i(r,n){return new e.Promise((function(e,s){var a=[],u=r._internalType,i=r._outputType,c=r._mimeType;r.on(\"data\",(function(r,t){a.push(r),n&&n(t)})).on(\"error\",(function(r){a=[],s(r)})).on(\"end\",(function(){try{var r=function(r,e,n){switch(r){case\"blob\":return o.newBlob(o.transformTo(\"arraybuffer\",e),n);case\"base64\":return t.encode(e);default:return o.transformTo(r,e)}}(i,function(r,t){var e,o=0,n=null,s=0;for(e=0;e0,(function(r){o||(o=r),r&&i.forEach(u),e||(i.forEach(u),f(o))}))}));return n.reduce(c)};export{s as p};\n","import{a as e}from\"../../_virtual/commonjsHelpers.js\";import{e as r}from\"../events/events.js\";import{e as s}from\"../readable-stream/lib/internal/streams/end-of-stream.js\";import{_ as o}from\"../readable-stream/lib/_stream_readable.js\";import{_ as t}from\"../readable-stream/lib/_stream_writable.js\";import{i as a}from\"./node_modules/inherits/inherits_browser.js\";import{_ as i}from\"../readable-stream/lib/_stream_transform.js\";import{_ as n}from\"../readable-stream/lib/_stream_passthrough.js\";import{p as m}from\"../readable-stream/lib/internal/streams/pipeline.js\";var l=p,d=r.EventEmitter;function p(){d.call(this)}a(p,d),p.Readable=o,p.Writable=t,p.Duplex=e(\"readable-stream/lib/_stream_duplex.js\",\"/$$rollup_base$$/node_modules/stream-browserify\"),p.Transform=i,p.PassThrough=n,p.finished=s,p.pipeline=m,p.Stream=p,p.prototype.pipe=function(e,r){var s=this;function o(r){e.writable&&!1===e.write(r)&&s.pause&&s.pause()}function t(){s.readable&&s.resume&&s.resume()}s.on(\"data\",o),e.on(\"drain\",t),e._isStdio||r&&!1===r.end||(s.on(\"end\",i),s.on(\"close\",n));var a=!1;function i(){a||(a=!0,e.end())}function n(){a||(a=!0,\"function\"==typeof e.destroy&&e.destroy())}function m(e){if(l(),0===d.listenerCount(this,\"error\"))throw e}function l(){s.removeListener(\"data\",o),e.removeListener(\"drain\",t),s.removeListener(\"end\",i),s.removeListener(\"close\",n),s.removeListener(\"error\",m),e.removeListener(\"error\",m),s.removeListener(\"end\",l),s.removeListener(\"close\",l),e.removeListener(\"close\",l)}return s.on(\"error\",m),e.on(\"error\",m),s.on(\"end\",l),s.on(\"close\",l),e.on(\"close\",l),e.emit(\"pipe\",s),e};export{l as s};\n","import{s as r}from\"../../stream-browserify/index.js\";var s=r;export{s as r};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","import{d as r}from\"../../_virtual/commonjsHelpers.js\";import{b as e}from\"../buffer/index.js\";var n=r((function(r,n){var o=e.Buffer;function f(r,e){for(var n in r)e[n]=r[n]}function t(r,e,n){return o(r,e,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?r.exports=e:(f(e,n),n.Buffer=t),f(o,t),t.from=function(r,e,n){if(\"number\"==typeof r)throw new TypeError(\"Argument must not be a number\");return o(r,e,n)},t.alloc=function(r,e,n){if(\"number\"!=typeof r)throw new TypeError(\"Argument must be a number\");var f=o(r);return void 0!==e?\"string\"==typeof n?f.fill(e,n):f.fill(e):f.fill(0),f},t.allocUnsafe=function(r){if(\"number\"!=typeof r)throw new TypeError(\"Argument must be a number\");return o(r)},t.allocUnsafeSlow=function(r){if(\"number\"!=typeof r)throw new TypeError(\"Argument must be a number\");return e.SlowBuffer(r)}}),\"/$$rollup_base$$/node_modules/safe-buffer\");export{n as s};\n","import{s as t}from\"../../safe-buffer/index.js\";var e=t.Buffer,s=e.isEncoding||function(t){switch((t=\"\"+t)&&t.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};var i=a;function a(t){var i;switch(this.encoding=function(t){var i=function(t){if(!t)return\"utf8\";for(var e;;)switch(t){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return t;default:if(e)return;t=(\"\"+t).toLowerCase(),e=!0}}(t);if(\"string\"!=typeof i&&(e.isEncoding===s||!s(t)))throw new Error(\"Unknown encoding: \"+t);return i||t}(t),this.encoding){case\"utf16le\":this.text=h,this.end=l,i=4;break;case\"utf8\":this.fillLast=n,i=4;break;case\"base64\":this.text=u,this.end=o,i=3;break;default:return this.write=f,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(i)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function n(t){var e=this.lastTotal-this.lastNeed,s=function(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,\"�\";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,\"�\";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,\"�\"}}(this,t);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var s=t.toString(\"utf16le\",e);if(s){var i=s.charCodeAt(s.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString(\"utf16le\",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):\"\";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString(\"utf16le\",0,s)}return e}function u(t,e){var s=(t.length-e)%3;return 0===s?t.toString(\"base64\",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString(\"base64\",e,t.length-s))}function o(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):\"\"}a.prototype.write=function(t){if(0===t.length)return\"\";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return\"\";s=this.lastNeed,this.lastNeed=0}else s=0;return s=0)return a>0&&(t.lastNeed=a-1),a;if(--i=0)return a>0&&(t.lastNeed=a-2),a;if(--i=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=s;var i=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString(\"utf8\",e,i)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};var d={StringDecoder:i};export{d as s};\n","import{b as t}from\"../../../../buffer/index.js\";import{d as e}from\"../../../../../_virtual/_node-resolve_empty.js_commonjs-proxy.js\";function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=t.Buffer,h=e.inspect,r=h&&h.custom||\"inspect\";var s=function(){function t(){this.head=null,this.tail=null,this.length=0}var e=t.prototype;return e.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},e.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},e.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},e.clear=function(){this.head=this.tail=null,this.length=0},e.join=function(t){if(0===this.length)return\"\";for(var e=this.head,n=\"\"+e.data;e=e.next;)n+=t+e.data;return n},e.concat=function(t){if(0===this.length)return a.alloc(0);for(var e,n,i,h=a.allocUnsafe(t>>>0),r=this.head,s=0;r;)e=r.data,n=h,i=s,a.prototype.copy.call(e,n,i),s+=r.data.length,r=r.next;return h},e.consume=function(t,e){var n;return ta.length?a.length:t;if(h===a.length?i+=a:i+=a.slice(0,t),0===(t-=h)){h===a.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=a.slice(h));break}++n}return this.length-=n,i},e._getBuffer=function(t){var e=a.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var h=n.data,r=t>h.length?h.length:t;if(h.copy(e,e.length-t,0,r),0===(t-=r)){r===h.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=h.slice(r));break}++i}return this.length-=i,e},e[r]=function(t,e){return h(this,function(t){for(var e=1;e 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a