diff --git a/dist/diglettk.js b/dist/diglettk.js index 9364f85..df6f4cb 100644 --- a/dist/diglettk.js +++ b/dist/diglettk.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(self,(function(){return(()=>{var e={757:(e,t,r)=>{e.exports=r(666)},289:(e,t,r)=>{"use strict";var n=r(215),a="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,i=Array.prototype.concat,s=Object.defineProperty,l=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,r,n){var a;(!(t in e)||"function"==typeof(a=n)&&"[object Function]"===o.call(a)&&n())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);a&&(o=i.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,r)=>{"use strict";var n=r(289),a=r(221),o=r(168),i=r(471),s=o(),l=function(){return s};n(l,{getPolyfill:o,implementation:a,shim:i}),e.exports=l},168:(e,t,r)=>{"use strict";var n=r(221);e.exports=function(){return"object"==typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},471:(e,t,r)=>{"use strict";var n=r(289),a=r(168);e.exports=function(){var e=a();if(n.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=r(414),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&a.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=i(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var g=c&&r;if(s&&e.length>0&&!a.call(e,0))for(var m=0;m0)for(var v=0;v{"use strict";var n=Array.prototype.slice,a=r(414),o=Object.keys,i=o?function(e){return o(e)}:r(987),s=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return a(e)?s(n.call(e)):s(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),i=new M(n||[]);return o._invoke=function(e,t,r){var n=d;return function(a,o){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===a)throw o;return R()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=w(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=g,r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function v(){}function h(){}function y(){}var b={};l(b,o,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(I([])));S&&S!==r&&n.call(S,o)&&(b=S);var C=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(a,o,i,s){var l=u(e[a],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(l.arg)}var a;this._invoke=function(e,n){function o(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(o,o):o()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function I(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},377:(e,t,r)=>{var n=r(832),a=r(652),o=r(801),i=r(30),s=r(618),l=r(49),c=r(971);c.alea=n,c.xor128=a,c.xorwow=o,c.xorshift7=i,c.xor4096=s,c.tychei=l,e.exports=c},832:function(e,t,r){var n;!function(e,a,o){function i(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new i(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},49:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>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):r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},652:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},618:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,o=t.i;return t.w=n=n+1640531527|0,r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,a,o,i,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(i=i+1640531527|0,a=0==(r=s[127&o]^=n+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=i,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},30:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},801:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>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 l(e,t){var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},971:function(e,t,r){var n;!function(a,o,i){var s,l=256,c=i.pow(l,6),u=i.pow(2,52),d=2*u,f=255;function p(e,t,r){var n=[],f=h(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,r=t&&t.plugins;return[+new Date,a,r,a.screen,y(o)]}}():e,3),n),p=new g(n),b=function(){for(var e=p.g(6),t=c,r=0;e=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|p.g(4)},b.quick=function(){return p.g(4)/4294967296},b.double=b,h(y(p.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,p),e.state=function(){return m(p,{})}),r?(i.random=e,t):e})(b,f,"global"in t?t.global:this==i,t.state)}function g(e){var t,r=e.length,n=this,a=0,o=n.i=n.j=0,i=n.S=[];for(r||(e=[r++]);a{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],a=e[2],o=e[3];n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&a)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+t[2]+606105819|0)<<17|a>>>15)+o|0)&o|~a&r)+t[3]-1044525330|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&a)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+t[6]-1473231341|0)<<17|a>>>15)+o|0)&o|~a&r)+t[7]-45705983|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&a)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+t[10]-42063|0)<<17|a>>>15)+o|0)&o|~a&r)+t[11]-1990404162|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&a)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+t[14]-1502002290|0)<<17|a>>>15)+o|0)&o|~a&r)+t[15]+1236535329|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[1]-165796510|0)<<5|r>>>27)+n|0)&a|n&~a)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|a>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[5]-701558691|0)<<5|r>>>27)+n|0)&a|n&~a)+t[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|a>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[9]+568446438|0)<<5|r>>>27)+n|0)&a|n&~a)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|a>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&a|n&~a)+t[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|a>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^a)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|a>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^a)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|a>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^a)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|a>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^a)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|a>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|n>>>9)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~a))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[14]-1416354905|0)<<15|a>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~a))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[10]-1051523|0)<<15|a>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~a))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[6]-1560198380|0)<<15|a>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~a))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[2]+718787259|0)<<15|a>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+a|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=a+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function a(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var t,a,o,i,s,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,n(e.substring(t-64,t)));for(a=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}function i(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;tc?new ArrayBuffer(0):(n=c-l,a=new ArrayBuffer(n),o=new Uint8Array(a),i=new Uint8Array(this,l,n),o.set(i),a)}}(),u.prototype.append=function(e){return this.appendBinary(l(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,a=this._buff.length;for(t=64;t<=a;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.prototype.end=function(e){var t,r,n=this._buff,a=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var n,a,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(r(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=a,e[15]=o,r(this._hash,e)},u.hash=function(e,t){return u.hashBinary(l(e),t)},u.hashBinary=function(e,t){var r=s(o(e));return t?c(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var t,n,o,i,s,l=(n=this._buff.buffer,o=e,i=!0,(s=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(o),n.byteLength),i?s:s.buffer),c=l.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)r(this._hash,a(l.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,a=new ArrayBuffer(n),o=new Uint8Array(a);for(r=0;r>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}(new Uint8Array(e)));return t?c(n):n},u}()},146:(e,t,r)=>{const n=r(544);e.exports=class extends n{constructor(e){super(),this._messageId=1,this._messages=new Map,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._id=Math.ceil(1e7*Math.random())}terminate(){this._worker.terminate()}isFree(){return 0===this._messages.size}jobsLength(){return this._messages.size}exec(e,t=null,r=[],n){return new Promise(((a,o)=>{const i=this._messageId++;this._messages.set(i,[a,o,n]),this._worker.postMessage([i,t,e],r||[])}))}postMessage(e=null,t=[],r){return new Promise(((n,a)=>{const o=this._messageId++;this._messages.set(o,[n,a,r]),this._worker.postMessage([o,e],t||[])}))}emit(e,...t){this._worker.postMessage({eventName:e,args:t})}_onMessage(e){if(!Array.isArray(e.data)&&e.data.eventName)return super.emit(e.data.eventName,...e.data.args);const[t,...r]=e.data;if(1===t)this._onEvent(...r);else{if(0!==t)throw new Error(`Wrong message type '${t}'`);this._onResult(...r)}}_onResult(e,t,r){const[n,a]=this._messages.get(e);return this._messages.delete(e),1===t?n(r):a(r)}_onEvent(e,t,r){const[,,n]=this._messages.get(e);n&&n(t,r)}}},544:e=>{e.exports=class{constructor(){Object.defineProperty(this,"__listeners",{value:{},enumerable:!1,writable:!1})}emit(e,...t){if(!this.__listeners[e])return this;for(const r of this.__listeners[e])r(...t);return this}once(e,t){const r=(...n)=>{this.off(e,r),t(...n)};return this.on(e,r)}on(e,t){return this.__listeners[e]||(this.__listeners[e]=[]),this.__listeners[e].push(t),this}off(e,t){return this.__listeners[e]=t?this.__listeners[e].filter((e=>e!==t)):[],this}}},42:()=>{}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{MPRManager:()=>hw,VRView:()=>XP,buildVtkVolume:()=>ws,loadDemoSerieWithLarvitar:()=>As});var e={};r.r(e),r.d(e,{add:()=>Rn,angle:()=>oa,bezier:()=>Qn,ceil:()=>Vn,clone:()=>wn,copy:()=>Mn,create:()=>Pn,cross:()=>qn,dist:()=>ga,distance:()=>Un,div:()=>pa,divide:()=>Bn,dot:()=>Xn,equals:()=>ca,exactEquals:()=>la,floor:()=>Ln,forEach:()=>ya,fromValues:()=>An,hermite:()=>Zn,inverse:()=>Hn,len:()=>va,length:()=>On,lerp:()=>Yn,max:()=>kn,min:()=>Nn,mul:()=>fa,multiply:()=>Dn,negate:()=>zn,normalize:()=>Kn,random:()=>$n,rotateX:()=>ra,rotateY:()=>na,rotateZ:()=>aa,round:()=>Fn,scale:()=>Gn,scaleAndAdd:()=>_n,set:()=>In,sqrDist:()=>ma,sqrLen:()=>ha,squaredDistance:()=>Wn,squaredLength:()=>jn,str:()=>sa,sub:()=>da,subtract:()=>En,transformMat3:()=>ea,transformMat4:()=>Jn,transformQuat:()=>ta,zero:()=>ia});var t={};r.r(t),r.d(t,{add:()=>lo,adjoint:()=>Aa,clone:()=>Ta,copy:()=>Sa,create:()=>ba,determinant:()=>Ma,equals:()=>go,exactEquals:()=>po,frob:()=>so,fromQuat:()=>Ya,fromQuat2:()=>ja,fromRotation:()=>Fa,fromRotationTranslation:()=>Wa,fromRotationTranslationScale:()=>Xa,fromRotationTranslationScaleOrigin:()=>qa,fromScaling:()=>ka,fromTranslation:()=>Na,fromValues:()=>Ca,fromXRotation:()=>Ga,fromYRotation:()=>_a,fromZRotation:()=>Ua,frustum:()=>Za,getRotation:()=>Ka,getScaling:()=>Ha,getTranslation:()=>za,identity:()=>Pa,invert:()=>Oa,lookAt:()=>ao,mul:()=>mo,multiply:()=>Ia,multiplyScalar:()=>uo,multiplyScalarAndAdd:()=>fo,ortho:()=>ro,orthoNO:()=>to,orthoZO:()=>no,perspective:()=>$a,perspectiveFromFieldOfView:()=>eo,perspectiveNO:()=>Qa,perspectiveZO:()=>Ja,rotate:()=>Da,rotateX:()=>Ba,rotateY:()=>Va,rotateZ:()=>La,scale:()=>Ea,set:()=>xa,str:()=>io,sub:()=>vo,subtract:()=>co,targetTo:()=>oo,translate:()=>Ra,transpose:()=>wa});var a={};function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{add:()=>Uo,adjoint:()=>Oo,clone:()=>bo,copy:()=>To,create:()=>ho,determinant:()=>Ao,equals:()=>Ko,exactEquals:()=>Ho,frob:()=>_o,fromMat2d:()=>Lo,fromMat4:()=>yo,fromQuat:()=>No,fromRotation:()=>Bo,fromScaling:()=>Vo,fromTranslation:()=>Do,fromValues:()=>So,identity:()=>xo,invert:()=>wo,mul:()=>Xo,multiply:()=>Mo,multiplyScalar:()=>jo,multiplyScalarAndAdd:()=>zo,normalFromMat4:()=>ko,projection:()=>Fo,rotate:()=>Ro,scale:()=>Eo,set:()=>Co,str:()=>Go,sub:()=>qo,subtract:()=>Wo,translate:()=>Io,transpose:()=>Po});var i={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:i.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:i};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?t-1:0),n=1;n1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(t);var r=[];function n(e){r[e]=null}function a(e){return Object.freeze({unsubscribe:function(){n(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++D),"classHierarchy"in t?t.classHierarchy instanceof I||(t.classHierarchy=I.from(t.classHierarchy)):t.classHierarchy=new I("vtkObject"),e.isDeleted=function(){return!!t.deleted},e.modified=function(n){t.deleted?F("instance deleted - cannot call any method"):n&&n0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(r).forEach((function(i){var s=a?null:e["set".concat(H(i))];s&&Array.isArray(r[i])&&s.length>1?o=s.apply(void 0,f(r[i]))||o:s?o=s(r[i])||o:(-1!==["mtime"].indexOf(i)||n||G("Warning: Set value to model directly ".concat(i,", ").concat(r[i])),o=t[i]!==r[i]||o,t[i]=r[i])})),o},e.get=function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&void 0!==arguments[1]&&arguments[1];if(r.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(r.getClassName()," into ").concat(e.getClassName()));var a=r.get(),o=Object.keys(t).sort(),i=Object.keys(a).sort();i.forEach((function(e){var r=o.indexOf(e);-1===r?n&&k("add ".concat(e," in shallowCopy")):o.splice(r,1),t[e]=a[e]})),o.length&&n&&k("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function Q(e,t,r){r.forEach((function(r){"object"===d(r)?e["get".concat(H(r.name))]=function(){return t[r.name]}:e["get".concat(H(r))]=function(){return t[r]}}))}W.Float32Array=Float32Array,W.Float64Array=Float64Array,W.Uint8Array=Uint8Array,W.Int8Array=Int8Array,W.Uint16Array=Uint16Array,W.Int16Array=Int16Array,W.Uint32Array=Uint32Array,W.Int32Array=Int32Array,W.Uint8ClampedArray=Uint8ClampedArray;var $={enum:function(e,t,r){return function(n){if("string"==typeof n){if(void 0!==r.enum[n])return t[r.name]!==r.enum[n]&&(t[r.name]=r.enum[n],e.modified(),!0);throw F("Set Enum with invalid argument ".concat(r,", ").concat(n)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof n){if(t[r.name]!==n){if(-1!==Object.keys(r.enum).map((function(e){return r.enum[e]})).indexOf(n))return t[r.name]=n,e.modified(),!0;throw F("Set Enum outside numeric range ".concat(r,", ").concat(n)),new RangeError("Set Enum outside numeric range")}return!1}throw F("Set Enum with invalid argument (String/Number) ".concat(r,", ").concat(n)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function J(e){if("object"===d(e)){var t=$[e.type];if(t)return function(r,n){return t(r,n,e)};throw F("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,r){return function(n){return r.deleted?(F("instance deleted - cannot call any method"),!1):r[e]!==n&&(r[e]=n,t.modified(),!0)}}}function ee(e,t,r){r.forEach((function(r){"object"===d(r)?e["set".concat(H(r.name))]=J(r)(e,t):e["set".concat(H(r))]=J(r)(e,t)}))}function te(e,t,r){Q(e,t,r),ee(e,t,r)}function re(e,t,r){r.forEach((function(r){e["get".concat(H(r))]=function(){return t[r]?[].concat(t[r]):t[r]},e["get".concat(H(r),"ByReference")]=function(){return t[r]}}))}function ne(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;r.forEach((function(r){if(t[r]&&n&&t[r].length!==n)throw new RangeError("Invalid initial number of values for array (".concat(r,")"));e["set".concat(H(r))]=function(){if(t.deleted)return F("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s=0)&&(c=c[0],u=!0),null==c)l=t[r]!==c;else{if(n&&c.length!==n){if(!(c.length4&&void 0!==arguments[4]?arguments[4]:void 0;re(e,t,r),ne(e,t,r,n,a)}var oe=Symbol("Event abort");function ie(e,t){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},n={};return e(n,r,t),Object.freeze(n)};return t&&T.register(t,r),r}function se(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},r),e.setKey=function(e,r){t.keystore[e]=r},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 ue=1,de="__root__",fe={algo:function(e,t,r,n){function a(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?F("instance deleted - cannot call any method"):n>=t.numberOfInputs?F("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[n]!==r||t.inputConnection[n])&&(t.inputData[n]=r,t.inputConnection[n]=null,e.modified&&e.modified())}function o(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)F("instance deleted - cannot call any method");else{if(n>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void F(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[n]=null,t.inputConnection[n]=r}}function i(){for(var e=t.numberOfInputs;e&&!t.inputData[e-1]&&!t.inputConnection[e-1];)e--;return e===t.numberOfInputs&&t.numberOfInputs++,e}function s(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(F("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[r])}if(t.inputData?t.inputData=t.inputData.map(T):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(T):t.inputConnection=[],t.output?t.output=t.output.map(T):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(T):t.inputArrayToProcess=[],t.numberOfInputs=r,e.shouldUpdate=function(){for(var r=e.getMTime(),a=1/0,o=n;o--;){if(!t.output[o]||t.output[o].isDeleted())return!0;var i=t.output[o].getMTime();if(ia)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=o,e.addInputData=function(e){t.deleted?F("instance deleted - cannot call any method"):a(e,i())},e.addInputConnection=function(e){t.deleted?F("instance deleted - cannot call any method"):o(e,i())},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]}}n&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=function(){return s(t)};return r.filter=e,r}),e.update=function(){var r=[];if(t.numberOfInputs)for(var n=0;n3&&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(r)),null;if(t.deleted)return F("instance deleted - cannot call any method"),null;var i=o++;return n.push([i,e,a]),n.sort((function(e,t){return t[2]-e[2]})),s(i)},e.delete=function(){a(),n.forEach((function(e){return i(u(e,1)[0])}))}},EVENT_ABORT:oe,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=["TB","GB","MB","KB"],a=Number(e),o="B";a>r;)a/=r,o=n.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=[],n=e;n>1e3;)r.push("000".concat(n%1e3).slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(t)},get:Q,getArray:re,getCurrentGlobalMTime:function(){return D},getStateArrayMapFunc:q,isVtkObject:le,keystore:ce,newInstance:ie,newTypedArray:j,newTypedArrayFrom:z,normalizeWheel:function(e){var t=0,r=0,n=0,a=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,a=10*r,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||a)&&e.deltaMode&&(1===e.deltaMode?(n*=40,a*=40):(n*=800,a*=800)),n&&!t&&(t=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:a}},obj:Z,proxy:function(e,t){ce(e,t);var r=e.delete;t.proxyId="".concat(ue++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),Q(e,t,["proxyId","proxyGroup","proxyName"]),te(e,t,["proxyManager"]);var n={},a={};function i(e,t){a[t]||(a[t]=[]);for(var r=a[t],o=0;o0&&void 0!==arguments[0]?arguments[0]:de;return a[e]}function l(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,n=[],a=t.proxyId,o=s(r)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var n=null,a=[],i=0,s=!1;function l(r){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(s)return null;var c=[],u=null;for(i=a.length;i--;){var d=a[i];d.instance===r?u=d:c.push(d)}if(!u)return null;var f=u.instance["get".concat(H(u.propertyName))]();if(!X(f,n)||l){for(n=f,s=!0;c.length;){var p=c.pop();p.instance.set(o({},p.propertyName,n))}s=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=f),f}function c(e,t){var r=[];for(i=a.length;i--;){var n=a[i];n.instance!==e||n.propertyName!==t&&void 0!==t||(n.subscription.unsubscribe(),r.push(i))}for(;r.length;)a.splice(r.pop(),1)}function u(r,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=r.onModified(l),u=a[0];return a.push({instance:r,propertyName:n,subscription:s}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?r.set(o({},n,t.propertyLinkMap[e].value)):u&&l(u.instance,!0)),{unsubscribe:function(){return c(r,n)}}}function d(){for(;a.length;)a.pop().subscription.unsubscribe()}var f={bind:u,unbind:c,unsubscribe:d,persistent:r};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(n[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},e.delete=function(){for(var n=Object.keys(t.propertyLinkMap),a=n.length;a--;)t.propertyLinkMap[n[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),r()},Y((function(){if(t.links)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function a(e){for(var r=Object.keys(e),n=r.length;n--;){var a=r[n];t[a].set(e[a])}}t.this=e;for(var o=Object.keys(n),i=o.length,s=function(){var s=o[i];t[s]=n[s];var l=r[s];e["set".concat(H(s))]=function(r){r!==t[s]&&(t[s]=r,a(l[r]),e.modified())}};i--;)s();o.length&&Q(e,t,o)},safeArrays:K,set:ee,setArray:ne,setGet:te,setGetArray:ae,setImmediate:Y,setLoggerFunction:function(e,t){N[e]&&(N[e]=t||L)},throttle:function(e,t){var r=!1,n=null;function a(){r=!1,null!==n&&(o.apply(void 0,f(n)),n=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(le(t)){if(a.indexOf(t)>=0)return n;a.push(t);var o=r(t);void 0!==o&&n.push(o);var i=t.get();Object.keys(i).forEach((function(t){var o=i[t];Array.isArray(o)?o.forEach((function(t){e(t,r,n,a)})):e(o,r,n,a)}))}return n},TYPED_ARRAYS:W,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:B,vtkDebugMacro:k,vtkErrorMacro:F,vtkInfoMacro:function(){N.info.apply(N,arguments)},vtkLogMacro:function(){N.log.apply(N,arguments)},vtkOnceErrorMacro:function(e){U[e]||(N.error(e),U[e]=!0)},vtkWarningMacro:G},pe=r(377),ge=r.n(pe),me=fe.vtkErrorMacro,ve=fe.vtkWarningMacro,he=0,ye=1e-12;function be(e){return function(){return me("vtkMath::".concat(e," - NOT IMPLEMENTED"))}}function Te(e,t){for(var r=0;r<3;r++){var n=e[r];e[r]=t[r],t[r]=n}}function Se(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=-1/0,o=t,i=e.length;o1&&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 r=0,n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;function n(e,n){return Math.abs(e-t[n])<=r}return e.every(n)}var tt=et;function rt(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 r="".concat(e).split("e"),n="";return+r[1]+t>0&&(n="+"),+"".concat(Math.round("".concat(+r[0],"e").concat(n).concat(+r[1]+t)),"e-").concat(t)}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=rt(e[0],r),t[1]=rt(e[1],r),t[2]=rt(e[2],r),t}function at(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g,m,v,h,y,b,T=Se(t),S=Se(t),C=function(e,t,r,n,a){h=e[t][r],v=e[n][a],e[t][r]=h-m*(v+h*p),e[n][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(r[l])+h===Math.abs(r[l])&&Math.abs(r[s])+h===Math.abs(r[s]))e[l][s]=0;else if(Math.abs(e[l][s])>u){for(v=r[s]-r[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],S[l]-=v,S[s]+=v,r[l]-=v,r[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)C(e,o,l,o,s);for(o=l+1;o<=s-1;o++)C(e,l,o,o,s);for(o=s+1;o=20)return ve("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=r[i=a]);if(i!==o)for(r[i]=r[o],r[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&c++;if(c(n=l>s?l:s)?c:n,a[i]=1,0!==n&&(a[i]/=n)}var u=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(n=u)&&(n=d,o[0]=1),f>=n&&(o[0]=2),0!==o[0]&&(Te(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(n=p)&&(o[1]=2,Te(t[2],t[1])),o[2]=2;var m=0;if($e(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Se(4);if(ot(t,h),Je(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Te(t[o[1]],t[1]),0!==o[0]&&Te(t[o[0]],t[0])}function st(e,t,r){var n,a,o,i,s,l,c=[Se(3),Se(3),Se(3)],u=Se(3),d=Se(3);for(n=0;n<3;n++)c[n][0]=e[n][0],c[n][1]=e[n][1],c[n][2]=e[n][2],u[n]=c[n],d[n]=r[n];if(at(u,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(Ze(r,r),n=0;n<3;n++)if(t[(n+1)%3]===t[(n+2)%3]){for(l=Math.abs(r[n][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(r[n][a]))&&(l=s,i=a);return i!==n&&(s=t[i],t[i]=t[n],t[n]=s,Te(r[n],r[i])),r[i][i]<0&&(r[i][0]=-r[i][0],r[i][1]=-r[i][1],r[i][2]=-r[i][2]),o=(i+2)%3,r[a=(i+1)%3][0]=0,r[a][1]=0,r[a][2]=0,r[a][a]=1,_e(r[i],r[a],r[o]),We(r[o]),_e(r[o],r[i],r[a]),void Ze(r,r)}for(l=Math.abs(r[0][0]),i=0,n=1;n<3;n++)l<(s=Math.abs(r[n][0]))&&(l=s,i=n);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Te(r[i],r[0])),Math.abs(r[1][1])i&&(i=c);if(0===i)return ve("Unable to factor linear system"),0;d[n]=1/i}for(a=0;a=i&&(i=l,u=n)}if(a!==u){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*r[o];else 0!==l&&(i=a);r[a]=l}for(a=n-1;a>=0;a--){for(l=r[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=n||Se(r),i=a||Se(r);if(0===lt(e,o,r))return 0;for(var s=0;sc?c=i:ic?c=s:s0?(c-d)/c:0)>0?(r=o===c?l*(i-s)/(c-d):i===c?1/3+l*(s-o)/(c-d):2/3+l*(o-i)/(c-d))<0&&(r+=1):r=0,t[0]=r,t[1]=n,t[2]=f}function gt(e,t){var r,n,a,o=u(e,3),i=o[0],s=o[1],l=o[2],c=1/3,d=1/6,f=2/3,p=5/6;i>d&&i<=c?(n=1,r=(c-i)/d,a=0):i>c&&i<=.5?(n=1,a=(i-c)/d,r=0):i>.5&&i<=f?(a=1,n=(f-i)/d,r=0):i>f&&i<=p?(a=1,r=(i-f)/d,n=0):i>p&&i<=1?(r=1,a=(1-i)/d,n=0):(r=1,n=i/d,a=0),r=s*r+(1-s),n=s*n+(1-s),a=s*a+(1-s),r*=l,n*=l,a*=l,t[0]=r,t[1]=n,t[2]=a}function mt(e,t){var r=u(e,3),n=(r[0]+16)/116,a=r[1]/500+n,o=n-r[2]/200;n=Math.pow(n,3)>.008856?Math.pow(n,3):(n-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787,t[0]=.9505*a,t[1]=1*n,t[2]=1.089*o}function vt(e,t){var r=u(e,3),n=r[0]/.9505,a=r[1]/1,o=r[2]/1.089;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(n-a),t[2]=200*(a-o)}function ht(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2],i=3.2406*n+-1.5372*a+-.4986*o,s=-.9689*n+1.8758*a+.0415*o,l=.0557*n+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var c=i;c1&&(i/=c,s/=c,l/=c),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function yt(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2];n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*n+.3576*a+.1805*o,t[1]=.2126*n+.7152*a+.0722*o,t[2]=.0193*n+.1192*a+.9505*o}function bt(e,t){var r=[0,0,0];yt(e,r),vt(r,t)}function Tt(e,t){var r=[0,0,0];mt(e,r),ht(r,t)}function St(e){return e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1,e}function Ct(e){return!(e[1]-e[0]<0)}function xt(e,t,r){return r[0]=Math.min(e[0],t[0]),r[1]=Math.max(e[0],t[0]),r[2]=Math.min(e[1],t[1]),r[3]=Math.max(e[1],t[1]),r[4]=Math.min(e[2],t[2]),r[5]=Math.max(e[2],t[2]),r}function Pt(e,t,r){return er?r:e}function wt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0,0];return n[0]=Pt(e[0],t[0],r[0]),n[1]=Pt(e[1],t[1],r[1]),n[2]=Pt(e[2],t[2],r[2]),n}var Ot=be("GetScalarTypeFittingRange"),At=be("GetAdjustedScalarRange");var Mt=function(e){return!Number.isFinite(e)},It=Number.isFinite,Rt=Number.isNaN,Et=Rt;function Dt(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Bt(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function Vt(e){return Math.round(255*e)}var Lt={Pi:function(){return Math.PI},radiansFromDegrees:Ce,degreesFromRadians:xe,round:Pe,floor:we,ceil:Oe,ceilLog2:Re,min:Ae,max:Me,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=-1/0,a=t,o=e.length;a=0;--a)if(r[a]0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=t-e;return e+r*Math.random()},gaussian:Ve,add:Le,subtract:Ne,multiplyScalar:ke,multiplyScalar2D:Fe,multiplyAccumulate:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n},multiplyAccumulate2D:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n},dot:Ge,outer:function(e,t,r){for(var n=0;n<3;n++)for(var a=0;a<3;a++)r[n][a]=e[n]*t[a]},cross:_e,norm:Ue,normalize:We,perpendiculars:function(e,t,r,n){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],c=e[2]*e[2],u=Math.sqrt(s+l+c);s>l&&s>c?(a=0,o=1,i=2):l>c?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/u,f=e[o]/u,p=e[i]/u,g=Math.sqrt(d*d+p*p);if(0!==n){var m=Math.sin(n),v=Math.cos(n);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),r&&(r[a]=(-p*m-d*f*v)/g,r[o]=v*g,r[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),r&&(r[a]=-d*f/g,r[o]=g,r[i]=-f*p/g)},projectVector:function(e,t,r){var n=Ge(t,t);if(0===n)return r[0]=0,r[1]=0,r[2]=0,!1;for(var a=Ge(e,t)/n,o=0;o<3;o++)r[o]=t[o];return ke(r,a),!0},projectVector2D:function(e,t,r){var n=je(t,t);if(0===n)return r[0]=0,r[1]=0,!1;for(var a=je(e,t)/n,o=0;o<2;o++)r[o]=t[o];return Fe(r,a),!0},distance2BetweenPoints:ze,angleBetweenVectors:He,gaussianAmplitude:function(e,t,r){var n=Math.abs(e-r);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(n,2)/(2*t))},gaussianWeight:function(e,t,r){var n=Math.abs(e-r);return Math.exp(-Math.pow(n,2)/(2*t))},dot2D:je,outer2D:function(e,t,r){for(var n=0;n<2;n++)for(var a=0;a<2;a++)r[n][a]=e[n]*t[a]},norm2D:Ke,normalize2D:Xe,determinant2x2:qe,LUFactor3x3:function(e,t){for(var r,n,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(n=Math.abs(e[i][1]))>a&&(a=n),(n=Math.abs(e[i][2]))>a&&(a=n),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),r=0,(n=o[1]*Math.abs(e[1][0]))>=a&&(a=n,r=1),(n=o[2]*Math.abs(e[2][0]))>=a&&(r=2),0!==r&&(Te(e[r],e[0]),o[r]=o[0]),t[0]=r,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),r=1,(n=o[2]*Math.abs(e[2][1]))>=a&&(r=2,Te(e[2],e[1]),o[2]=o[1]),t[1]=r,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,r){var n=r[t[0]];r[t[0]]=r[0],r[0]=n,n=r[t[1]],r[t[1]]=r[1],r[1]=n-e[1][0]*r[0],n=r[t[2]],r[t[2]]=r[2],r[2]=n-e[2][0]*r[0]-e[2][1]*r[1],r[2]/=e[2][2],r[1]=(r[1]-e[1][2]*r[2])/e[1][1],r[0]=(r[0]-e[0][1]*r[1]-e[0][2]*r[2])/e[0][0]},linearSolve3x3:function(e,t,r){var n=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],u=e[2][1],d=e[2][2],f=+qe(s,u,l,d),p=-qe(i,c,l,d),g=+qe(i,c,s,u),m=-qe(a,u,o,d),v=+qe(n,c,o,d),h=-qe(n,c,a,u),y=+qe(a,s,o,l),b=-qe(n,i,o,l),T=+qe(n,i,a,s),S=n*f+a*p+o*g,C=f*t[0]+m*t[1]+y*t[2],x=p*t[0]+v*t[1]+b*t[2],P=g*t[0]+h*t[1]+T*t[2];r[0]=C/S,r[1]=x/S,r[2]=P/S},multiply3x3_vect3:function(e,t,r){var n=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];r[0]=n,r[1]=a,r[2]=o},multiply3x3_mat3:Ye,multiplyMatrix:function(e,t,r,n,a,o,i){n!==a&&me("Number of columns of A must match number of rows of B.");for(var s=0;sMe&&(n=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eye&&(f=0,d[c]=0);if(f&&1===a)return ve("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),ft(e,t,r,o);if(f)g=1;else for(c=0;c1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:pt,hsv2rgb:gt,lab2xyz:mt,xyz2lab:vt,xyz2rgb:ht,rgb2xyz:yt,rgb2lab:bt,lab2rgb:Tt,uninitializeBounds:St,areBoundsInitialized:Ct,computeBoundsFromPoints:xt,clampValue:Pt,clampVector:wt,clampAndNormalizeValue:function(e,t){var r=0;return t[0]!==t[1]&&(r=((r=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),r},getScalarTypeFittingRange:Ot,getAdjustedScalarRange:At,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]t[r+1]||e[r+1]t[r+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,r){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]+r[n/2]t[n+1]||e[n+1]+r[n/2]t[n+1])return 0;return 1},pointIsWithinBounds:function(e,t,r){if(!e||!t||!r)return 0;for(var n=0;n<3;n++)if(e[n]+r[n]t[2*n+1])return 0;return 1},solve3PointCircle:function(e,t,r,n){for(var a=Se(3),o=Se(3),i=Se(3),s=Se(3),l=Se(3),c=Se(3),u=0;u<3;++u)a[u]=e[u]-t[u],o[u]=t[u]-r[u],i[u]=r[u]-e[u],s[u]=-a[u],l[u]=-o[u],c[u]=-i[u];var d=Ue(s),f=Ue(l),p=Ue(i),g=Se(3);_e(a,o,g);for(var m=Ue(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*Ge(a,c)/h,b=p*p*Ge(s,o)/h,T=d*d*Ge(i,l)/h,S=0;S<3;++S)n[S]=y*e[S]+b*t[S]+T*r[S];return v},inf:1/0,negInf:-1/0,isInf:Mt,isNan:Rt,isNaN:Rt,isFinite:It,createUninitializedBounds:Dt,getMajorAxisIndex:function(e){for(var t=-1,r=-1,n=0;nt&&(r=n,t=a)}return r},floatToHex2:Bt,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Bt).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(Vt).join(", "),")"):"rgba(".concat(Vt(e[0]||0),", ").concat(Vt(e[1]||0),", ").concat(Vt(e[2]||0),", ").concat(e[3]||0,")")}};function Nt(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}function kt(e){for(var t=1;ta&&(a=o);return{min:n,max:a}}function _t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<0&&r>1){for(var n=e.length,a=n/r,o=new Float64Array(a),i=0,s=0;i1&&void 0!==arguments[1]?arguments[1]:0,r=e||[];r.length<=t;)r.push(null);return r}function Wt(e){return Object.prototype.toString.call(e).slice(8,-1)}var jt={computeRange:_t,createRangeHelper:function(){var e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=0,n=0;return{add:function(a){e>a&&(e=a),tr&&(r=a)}return r}};function zt(e,t){function r(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=function(e,n,a){a!==t.values[e*t.numberOfComponents+n]&&(t.values[e*t.numberOfComponents+n]=a,r())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,r=e<0?t.numberOfComponents:e,n=null;return t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents)),(n=t.ranges[r])?(t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple):(n=_t(t.values,e,t.numberOfComponents),t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple)},e.setRange=function(e,r){t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents));var n={min:e.min,max:e.max};return t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple},e.setTuple=function(e,r){for(var n=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:Ft,n=t.numberOfComponents||1;r.length!==n&&(r.length=n);var a=e*n;if(1===n)r[0]=t.values[a];else if(2===n)r[0]=t.values[a],r[1]=t.values[a+1];else if(3===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2];else if(4===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2],r[3]=t.values[a+3];else for(var o=0;o0&&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 Xt({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,n){t.values=e,t.size=e.length,t.dataType=Wt(e),n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),r()},e.getState=function(){var r=kt(kt({},t),{},{vtkClass:e.getClassName()});r.values=Array.from(r.values),delete r.buffer,Object.keys(r).forEach((function(e){r[e]||delete r[e]}));var n={};return Object.keys(r).sort().forEach((function(e){n[e]=r[e]})),n.mtime&&delete n.mtime,n}}var Ht={name:"",numberOfComponents:1,size:0,dataType:s.DefaultDataType,rangeTuple:[0,0]};function Kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Ht,r),!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=z(t.dataType,t.values)):t.values=j(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=Wt(t.values)),Z(e,t),ee(e,t,["name","numberOfComponents"]),zt(e,t)}var Xt=ie(Kt,"vtkDataArray"),qt=kt(kt({newInstance:Xt,extend:Kt},jt),s);function Yt(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 Zt=1e-6,Qt="coincide",$t="disjoint";function Jt(e,t,r){var n=r[0]*(e[0]-t[0])+r[1]*(e[1]-t[1])+r[2]*(e[2]-t[2]);return Math.abs(n)}function er(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a);n[0]=e[0]-o*r[0],n[1]=e[1]-o*r[1],n[2]=e[2]-o*r[2]}function tr(e,t,r){var n=Ge(e,t),a=Ge(t,t);return 0===a&&(a=1),r[0]=e[0]-n*t[0]/a,r[1]=e[1]-n*t[1]/a,r[2]=e[2]-n*t[2]/a,r}function rr(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a),i=Ge(r,r);0!==i?(n[0]=e[0]-o*r[0]/i,n[1]=e[1]-o*r[1]/i,n[2]=e[2]-o*r[2]/i):(n[0]=e[0],n[1]=e[1],n[2]=e[2])}function nr(e,t,r,n){var a={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},o=[],i=[];Ne(t,e,o),Ne(r,e,i);var s=Ge(n,i),l=Ge(n,o);return(l<0?-l:l)<=(s<0?-s*Zt:s*Zt)||(a.t=s/l,a.x[0]=e[0]+a.t*o[0],a.x[1]=e[1]+a.t*o[1],a.x[2]=e[2]+a.t*o[2],a.intersection=!0,a.betweenPoints=a.t>=0&&a.t<=1),a}function ar(e,t,r,n){var a={intersection:!1,l0:[],l1:[],error:null},o=[];_e(t,n,o);var i,s=o.map((function(e){return Math.abs(e)}));if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var c=[],u=-Ge(t,e),d=-Ge(n,r);switch(i){case"x":c[0]=0,c[1]=(d*t[2]-u*n[2])/o[0],c[2]=(u*n[1]-d*t[1])/o[0];break;case"y":c[0]=(u*n[2]-d*t[2])/o[1],c[1]=0,c[2]=(d*t[0]-u*n[0])/o[1];break;case"z":c[0]=(d*t[1]-u*n[1])/o[2],c[1]=(u*n[0]-d*t[0])/o[2],c[2]=0}return a.l0=c,Le(c,o,a.l1),a.intersection=!0,a}var or={evaluate:function(e,t,r){return e[0]*(r[0]-t[0])+e[1]*(r[1]-t[1])+e[2]*(r[2]-t[2])},distanceToPlane:Jt,projectPoint:er,projectVector:tr,generalizedProjectPoint:rr,intersectWithLine:nr,intersectWithPlane:ar,DISJOINT:$t,COINCIDE:Qt};function ir(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return Jt(e,t.origin,t.normal)},e.projectPoint=function(e,r){er(e,t.origin,t.normal,r)},e.projectVector=function(e,r){return tr(e,t.normal,r)},e.push=function(e){if(0!==e)for(var r=0;r<3;r++)t.origin[r]+=e*t.normal[r]},e.generalizedProjectPoint=function(e,r){rr(e,t.origin,t.normal,r)},e.evaluateFunction=function(e,r,n){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]*(r-t.origin[1])+t.normal[2]*(n-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,r){return nr(e,r,t.origin,t.normal)},e.intersectWithPlane=function(e,r){return ar(e,r,t.origin,t.normal)}}var sr={normal:[0,0,1],origin:[0,0,0]};function lr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sr,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),ir(e,t)}var cr=function(e){for(var t=1;t(arguments.length<=1?void 0:arguments[1])?n: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]=o>(arguments.length<=2?void 0:arguments[2])?o: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]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function hr(e,t,r,n,a,o,i){var s=u(e,6),l=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],c),e[2]=Math.min(t[2],d),e[3]=Math.max(t[3],f),e[4]=Math.min(t[4],p),e[5]=Math.max(t[5],g)):(e[0]=Math.min(t,l),e[1]=Math.max(r,c),e[2]=Math.min(n,d),e[3]=Math.max(a,f),e[4]=Math.min(o,p),e[5]=Math.max(i,g))}function yr(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=r,e[3]=r>l?r:l,e[4]=n,e[5]=n>d?n:d,o!==t||s!==r||c!==n}function br(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),r>=0?(e[2]*=r,e[3]*=r):(e[2]=r*e[3],e[3]=r*e[2]),n>=0?(e[4]*=n,e[5]*=n):(e[4]=n*e[5],e[5]=n*e[4]),!0)}function Cr(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function xr(e,t){return e[2*t+1]-e[2*t]}function Pr(e){return[xr(e,0),xr(e,1),xr(e,2)]}function wr(e){return e.slice(0,2)}function Or(e){return e.slice(2,4)}function Ar(e){return e.slice(4,6)}function Mr(e){var t=Pr(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function Ir(e){if(pr(e)){var t=Pr(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Rr(e){return[e[0],e[2],e[4]]}function Er(e){return[e[1],e[3],e[5]]}function Dr(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Br(e,t){for(var r=0,n=0;n<2;n++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[r]=[e[n],e[a],e[o]],r++}function Vr(e,t,r){t[0]=e[0],t[1]=e[2],t[2]=e[4],r[0]=e[1],r[1]=e[3],r[2]=e[5]}function Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Cr(e);return t[0]=e[1]-r[0],t[1]=e[3]-r[1],t[2]=e[5]-r[2],t}function Nr(e,t,r,n){for(var a=[].concat(dr),o=e.getData(),i=0;ie[2*u+1]?(i[u]=0,c[u]=e[2*u+1],o=!1):i[u]=2;if(o)return n[0]=t[0],n[1]=t[1],n[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==r[d]?l[d]=(c[d]-t[d])/r[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(n[p]=t[p]+l[s]*r[p],n[p]e[2*p+1])return 0}else n[p]=c[p];return 1}function Fr(e,t,r){for(var n=[],a=0,o=1,i=1,s=4;s<=5;++s){n[2]=e[s];for(var l=2;l<=3;++l){n[1]=e[l];for(var c=0;c<=1;++c)if(n[0]=e[c],a=cr.evaluate(r,t,n),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Gr(e,t){if(!pr(e)||!pr(t))return!1;for(var r,n=[0,0,0,0,0,0],a=0;a<3;a++)if(r=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(r=!0,n[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(r=!0,n[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(r=!0,n[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(r=!0,n[2*a+1]=e[2*a+1]),!r)return!1;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],!0}function _r(e,t){if(!pr(e)||!pr(t))return!1;for(var r=0;r<3;r++)if(!(t[2*r]>=e[2*r]&&t[2*r]<=e[2*r+1]||e[2*r]>=t[2*r]&&e[2*r]<=t[2*r+1]||t[2*r+1]>=e[2*r]&&t[2*r+1]<=e[2*r+1]||e[2*r+1]>=t[2*r]&&e[2*r+1]<=t[2*r+1]))return!1;return!0}function Ur(e,t,r,n){return!(te[1]||re[3]||ne[5])}function Wr(e,t,r){for(var n=[[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],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var c=[e[i],e[s],e[l]];a[o++]=cr.evaluate(r,t,c)}for(var u=2;u--&&!(Dr(a[n[u][0]],a[n[u][4]])&&Dr(a[n[u][1]],a[n[u][5]])&&Dr(a[n[u][2]],a[n[u][6]])&&Dr(a[n[u][3]],a[n[u][7]])););if(u<0)return!1;for(var d=Math.sign(r[u]),f=Math.abs((e[2*u+1]-e[2*u])*r[u]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[n[u][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*u]+p*e[2*u+1];return d>0?e[2*u]=v:e[2*u+1]=v,!0}var jr=function(){function e(t){S(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),gr(this.bounds,dr))}return x(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return fr(this.bounds,e)}},{key:"isValid",value:function(){return pr(this.bounds)}},{key:"setBounds",value:function(e){return gr(this.bounds,e)}},{key:"reset",value:function(){return mr(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r=0&&e=0},e.getArrayName=function(e){var r=t.arrays[e];return r?r.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r.getArrays().forEach((function(r){var o=e.getFlag(r.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&r){var i=e.getArrayByName(r.getName());if(i){if(r.getNumberOfComponents()===i.getNumberOfComponents())if(n>-1&&n-1?a:n;i.setTuple(s,r.getTuple(n))}else for(var l=0;lr.getNumberOfTuples())e.addArray(r);else{var c=r.getNumberOfComponents(),u=r.getNumberOfValues(),d=a>-1?a:n;ue?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=r();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var Xr={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function qr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xr,r),fe.obj(e,t),Kr(e,t)}var Yr={newInstance:fe.newInstance(qr,"vtkFieldData"),extend:qr},Zr={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Qr(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 $r=Zr.AttributeTypes,Jr=Zr.AttributeCopyOperations,en=fe.vtkWarningMacro;function tn(e,t){var r=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(e){var t=r.find((function(t){return $r[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(r,a){var o=n(a);if(r&&"PEDIGREEIDS"===o.toUpperCase()&&!r.isA("vtkDataArray"))return en("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(r&&!e.checkNumberOfComponents(r,o))return en("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rn,r),Yr.extend(e,t,r),fe.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),tn(e,t)}var an=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),cn.forEach((function(r){t[r]=an.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))}}var dn={};function fn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dn,r),fe.obj(e,t),fe.setGet(e,t,cn),un(e,t)}var pn=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?hn.EMPTY:3===t?hn.XYZ_GRID:2===t?e[0]===e[1]?hn.YZ_PLANE:e[2]===e[3]?hn.XZ_PLANE:hn.XY_PLANE:1===t?e[0]0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Xn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[0],s=r[1],l=r[2];return e[0]=a*l-o*s,e[1]=o*i-n*l,e[2]=n*s-a*i,e}function Yn(e,t,r,n){var a=t[0],o=t[1],i=t[2];return e[0]=a+n*(r[0]-a),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function Zn(e,t,r,n,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,c=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*s+r[0]*l+n[0]*c+a[0]*u,e[1]=t[1]*s+r[1]*l+n[1]*c+a[1]*u,e[2]=t[2]*s+r[2]*l+n[2]*c+a[2]*u,e}function Qn(e,t,r,n,a,o){var i=1-o,s=i*i,l=o*o,c=s*i,u=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*d+a[0]*f,e[1]=t[1]*c+r[1]*u+n[1]*d+a[1]*f,e[2]=t[2]*c+r[2]*u+n[2]*d+a[2]*f,e}function $n(e,t){t=t||1;var r=2*Sn()*Math.PI,n=2*Sn()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}function Jn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[3]*n+r[7]*a+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*a+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*a+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*a+r[10]*o+r[14])/i,e}function ea(e,t,r){var n=t[0],a=t[1],o=t[2];return e[0]=n*r[0]+a*r[3]+o*r[6],e[1]=n*r[1]+a*r[4]+o*r[7],e[2]=n*r[2]+a*r[5]+o*r[8],e}function ta(e,t,r){var n=r[0],a=r[1],o=r[2],i=r[3],s=t[0],l=t[1],c=t[2],u=a*c-o*l,d=o*s-n*c,f=n*l-a*s,p=a*f-o*d,g=o*u-n*f,m=n*d-a*u,v=2*i;return u*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+u+p,e[1]=l+d+g,e[2]=c+f+m,e}function ra(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0],o[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),o[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function na(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),o[1]=a[1],o[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function aa(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),o[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),o[2]=a[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function oa(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(r*r+n*n+a*a)*Math.sqrt(o*o+i*i+s*s),c=l&&Xn(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function ia(e){return e[0]=0,e[1]=0,e[2]=0,e}function sa(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function la(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ca(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(r-o)<=bn*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=bn*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-s)<=bn*Math.max(1,Math.abs(a),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ua,da=En,fa=Dn,pa=Bn,ga=Un,ma=Wn,va=On,ha=jn,ya=(ua=Pn(),function(e,t,r,n,a,o){var i,s;for(t||(t=3),r||(r=0),s=n?Math.min(n*t+r,e.length):e.length,i=r;i0?(r[0]=2*(s*i+u*n+l*o-c*a)/d,r[1]=2*(l*i+u*a+c*n-s*o)/d,r[2]=2*(c*i+u*o+s*a-l*n)/d):(r[0]=2*(s*i+u*n+l*o-c*a),r[1]=2*(l*i+u*a+c*n-s*o),r[2]=2*(c*i+u*o+s*a-l*n)),Wa(e,t,r),e}function za(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ha(e,t){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,c,u),e}function Ka(e,t){var r=new Tn(3);Ha(r,t);var n=1/r[0],a=1/r[1],o=1/r[2],i=t[0]*n,s=t[1]*a,l=t[2]*o,c=t[4]*n,u=t[5]*a,d=t[6]*o,f=t[8]*n,p=t[9]*a,g=t[10]*o,m=i+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),e[3]=.25*v,e[0]=(d-p)/v,e[1]=(f-l)/v,e[2]=(s-c)/v):i>u&&i>g?(v=2*Math.sqrt(1+i-u-g),e[3]=(d-p)/v,e[0]=.25*v,e[1]=(s+c)/v,e[2]=(f+l)/v):u>g?(v=2*Math.sqrt(1+u-i-g),e[3]=(f-l)/v,e[0]=(s+c)/v,e[1]=.25*v,e[2]=(d+p)/v):(v=2*Math.sqrt(1+g-i-u),e[3]=(s-c)/v,e[0]=(f+l)/v,e[1]=(d+p)/v,e[2]=.25*v),e}function Xa(e,t,r,n){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,c=o+o,u=i+i,d=a*l,f=a*c,p=a*u,g=o*c,m=o*u,v=i*u,h=s*l,y=s*c,b=s*u,T=n[0],S=n[1],C=n[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*S,e[5]=(1-(d+v))*S,e[6]=(m+h)*S,e[7]=0,e[8]=(p+y)*C,e[9]=(m-h)*C,e[10]=(1-(d+g))*C,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function qa(e,t,r,n,a){var o=t[0],i=t[1],s=t[2],l=t[3],c=o+o,u=i+i,d=s+s,f=o*c,p=o*u,g=o*d,m=i*u,v=i*d,h=s*d,y=l*c,b=l*u,T=l*d,S=n[0],C=n[1],x=n[2],P=a[0],w=a[1],O=a[2],A=(1-(m+h))*S,M=(p+T)*S,I=(g-b)*S,R=(p-T)*C,E=(1-(f+h))*C,D=(v+y)*C,B=(g+b)*x,V=(v-y)*x,L=(1-(f+m))*x;return e[0]=A,e[1]=M,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=B,e[9]=V,e[10]=L,e[11]=0,e[12]=r[0]+P-(A*P+R*w+B*O),e[13]=r[1]+w-(M*P+E*w+V*O),e[14]=r[2]+O-(I*P+D*w+L*O),e[15]=1,e}function Ya(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=u+h,e[2]=f-v,e[3]=0,e[4]=u-h,e[5]=1-c-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Za(e,t,r,n,a,o,i){var s=1/(r-t),l=1/(a-n),c=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*l,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function Qa(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=(a+n)*o,e[14]=2*a*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=Qa;function Ja(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=a*o,e[14]=a*n*o):(e[10]=-1,e[14]=-n),e}function eo(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),c=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function to(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(i+o)*c,e[15]=1,e}var ro=to;function no(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=o*c,e[15]=1,e}function ao(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g=t[0],m=t[1],v=t[2],h=n[0],y=n[1],b=n[2],T=r[0],S=r[1],C=r[2];return Math.abs(g-T)0&&(u*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-c*d,m=c*u-s*f,v=s*d-l*u;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-u*v,e[6]=u*m-d*g,e[7]=0,e[8]=u,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function io(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]+")"}function so(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])}function lo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function co(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function uo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function fo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function po(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]}function go(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],h=e[15],y=t[0],b=t[1],T=t[2],S=t[3],C=t[4],x=t[5],P=t[6],w=t[7],O=t[8],A=t[9],M=t[10],I=t[11],R=t[12],E=t[13],D=t[14],B=t[15];return Math.abs(r-y)<=bn*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-b)<=bn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-T)<=bn*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(o-S)<=bn*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-C)<=bn*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-x)<=bn*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-P)<=bn*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-w)<=bn*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(u-O)<=bn*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(d-A)<=bn*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-M)<=bn*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(p-I)<=bn*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=bn*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=bn*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=bn*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-B)<=bn*Math.max(1,Math.abs(h),Math.abs(B))}var mo=Ia,vo=co;function ho(){var e=new Tn(9);return Tn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function yo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function bo(e){var t=new Tn(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function To(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}function So(e,t,r,n,a,o,i,s,l){var c=new Tn(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=a,c[5]=o,c[6]=i,c[7]=s,c[8]=l,c}function Co(e,t,r,n,a,o,i,s,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i,e[6]=s,e[7]=l,e[8]=c,e}function xo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Po(e,t){if(e===t){var r=t[1],n=t[2],a=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=a}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function wo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*i-s*c,f=-u*o+s*l,p=c*o-i*l,g=r*d+n*f+a*p;return g?(g=1/g,e[0]=d*g,e[1]=(-u*n+a*c)*g,e[2]=(s*n-a*i)*g,e[3]=f*g,e[4]=(u*r-a*l)*g,e[5]=(-s*r+a*o)*g,e[6]=p*g,e[7]=(-c*r+n*l)*g,e[8]=(i*r-n*o)*g,e):null}function Oo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=i*u-s*c,e[1]=a*c-n*u,e[2]=n*s-a*i,e[3]=s*l-o*u,e[4]=r*u-a*l,e[5]=a*o-r*s,e[6]=o*c-i*l,e[7]=n*l-r*c,e[8]=r*i-n*o,e}function Ao(e){var t=e[0],r=e[1],n=e[2],a=e[3],o=e[4],i=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-i*l)+r*(-c*a+i*s)+n*(l*a-o*s)}function Mo(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],h=r[5],y=r[6],b=r[7],T=r[8];return e[0]=f*n+p*i+g*c,e[1]=f*a+p*s+g*u,e[2]=f*o+p*l+g*d,e[3]=m*n+v*i+h*c,e[4]=m*a+v*s+h*u,e[5]=m*o+v*l+h*d,e[6]=y*n+b*i+T*c,e[7]=y*a+b*s+T*u,e[8]=y*o+b*l+T*d,e}function Io(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1];return e[0]=n,e[1]=a,e[2]=o,e[3]=i,e[4]=s,e[5]=l,e[6]=f*n+p*i+c,e[7]=f*a+p*s+u,e[8]=f*o+p*l+d,e}function Ro(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=Math.sin(r),p=Math.cos(r);return e[0]=p*n+f*i,e[1]=p*a+f*s,e[2]=p*o+f*l,e[3]=p*i-f*n,e[4]=p*s-f*a,e[5]=p*l-f*o,e[6]=c,e[7]=u,e[8]=d,e}function Eo(e,t,r){var n=r[0],a=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Do(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Bo(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Vo(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function No(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[3]=u-h,e[6]=f+v,e[1]=u+h,e[4]=1-c-g,e[7]=p-m,e[2]=f-v,e[5]=p+m,e[8]=1-c-d,e}function ko(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],h=t[15],y=r*s-n*i,b=r*l-a*i,T=r*c-o*i,S=n*l-a*s,C=n*c-o*s,x=a*c-o*l,P=u*m-d*g,w=u*v-f*g,O=u*h-p*g,A=d*v-f*m,M=d*h-p*m,I=f*h-p*v,R=y*I-b*M+T*A+S*O-C*w+x*P;return R?(R=1/R,e[0]=(s*I-l*M+c*A)*R,e[1]=(l*O-i*I-c*w)*R,e[2]=(i*M-s*O+c*P)*R,e[3]=(a*M-n*I-o*A)*R,e[4]=(r*I-a*O+o*w)*R,e[5]=(n*O-r*M-o*P)*R,e[6]=(m*x-v*C+h*S)*R,e[7]=(v*T-g*x-h*b)*R,e[8]=(g*C-m*T+h*y)*R,e):null}function Fo(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Go(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function _o(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Uo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Wo(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function jo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function zo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function Ho(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]}function Ko(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=t[0],f=t[1],p=t[2],g=t[3],m=t[4],v=t[5],h=t[6],y=t[7],b=t[8];return Math.abs(r-d)<=bn*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-f)<=bn*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=bn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=bn*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-m)<=bn*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-v)<=bn*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-h)<=bn*Math.max(1,Math.abs(l),Math.abs(h))&&Math.abs(c-y)<=bn*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=bn*Math.max(1,Math.abs(u),Math.abs(b))}var Xo=Mo,qo=Wo,Yo=fe.vtkErrorMacro;function Zo(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&(r*=t[n]-1)}return r},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(r){var n=e.getDimensions();if(0===n[0]||0===n[1]||0===n[2])return Yo("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case gn.EMPTY:return null;case gn.SINGLE_POINT:break;case gn.X_LINE:a[0]=r;break;case gn.Y_LINE:a[1]=r;break;case gn.Z_LINE:a[2]=r;break;case gn.XY_PLANE:a[0]=r%n[0],a[1]=r/n[0];break;case gn.YZ_PLANE:a[1]=r%n[1],a[2]=r/n[1];break;case gn.XZ_PLANE:a[0]=r%n[0],a[2]=r/n[0];break;case gn.XYZ_GRID:a[0]=r%n[0],a[1]=r/n[0]%n[1],a[2]=r/(n[0]*n[1]);break;default:Yo("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var r=[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]],n=new Float64Array([r[0],r[1],r[2]]),a=new Float64Array(3);e.indexToWorld(n,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],i=3;i<24;i+=3)In(n,r[i],r[i+1],r[i+2]),e.indexToWorld(n,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){Na(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],Ea(t.indexToWorld,t.indexToWorld,t.spacing),Oa(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.indexToWorld),r},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.worldToIndex),r},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.indexToWorld),Jn(i,a,t.indexToWorld),xt(o,i,r)},e.worldToIndexBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.worldToIndex),Jn(i,a,t.worldToIndex),xt(o,i,r)},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),r=[],n=0;n<3;n++)r[n]=(t[2*n+1]+t[2*n])/2;return r},e.computeHistogram=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[0,0,0,0,0,0];e.worldToIndexBounds(t,n);var a=[0,0,0],o=[0,0,0];Hr.computeCornerPoints(n,a,o),nt(a,a),nt(o,o);var i=e.getDimensions();wt(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),wt(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],c=e.getPointData().getScalars().getData(),u=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!r||r([y,v,m],n)){var b=c[h];b>u&&(u=b),b0?p/g:0,S=g?Math.abs(f/g-T*T):0,C=Math.sqrt(S);return{minimum:d,maximum:u,average:T,variance:S,sigma:C,count:g}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=t,a=0;a<3;++a)r[a]=n,n*=e[2*a+1]-e[2*a]+1;return r},e.computeOffsetIndex=function(t){var r=u(t,3),n=r[0],a=r[1],o=r[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(n)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var r=e.getExtent(),n=e.worldToIndex(t),a=0;a<3;++a)if(n[a]r[2*a+1])return Yo("GetScalarPointer: Pixel ".concat(n," is not in memory. Current extent = ").concat(r)),NaN;return e.computeOffsetIndex(n)},e.getScalarValueFromWorld=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=n)return Yo("GetScalarPointer: Scalar Component ".concat(r," is not within bounds. Current Scalar numberOfComponents: ").concat(n)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,r)}}var Qo={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:gn.EMPTY};function $o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qo,r),pn.extend(e,t,r),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=xo(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),fe.get(e,t,["direction","indexToWorld","worldToIndex"]),fe.setGetArray(e,t,["origin","spacing"],3),fe.getArray(e,t,["extent"],6),Zo(e,t)}var Jo,ei={newInstance:fe.newInstance($o,"vtkImageData"),extend:$o};function ti(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function ri(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*a+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*a+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*a+r[11]*o+r[15]*i,e}function ni(){var e=new Tn(4);return Tn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ai(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function oi(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+i*s+a*c-o*l,e[1]=a*u+i*l+o*s-n*c,e[2]=o*u+i*c+n*l-a*s,e[3]=i*u-n*s-a*l-o*c,e}Jo=new Tn(4),Tn!=Float32Array&&(Jo[0]=0,Jo[1]=0,Jo[2]=0,Jo[3]=0);var ii=function(e,t,r,n){var a=new Tn(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a},si=function(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r*r+n*n+a*a+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=a*i,e[3]=o*i,e};function li(e){return function(){return fe.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}function ci(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,r=0;re&&(e=n)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=li("pick"),e.hasKey=li("hasKey"),e.getNestedVisibility=function(){return t.visibility&&(!t.parentProp||t.parentProp.getNestedVisibility())},e.getNestedPickable=function(){return t.pickable&&(!t.parentProp||t.parentProp.getNestedPickable())},e.getNestedDragable=function(){return t.dragable&&(!t.parentProp||t.parentProp.getNestedDragable())},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(r){r&&!e.hasTexture(r)&&(t.textures=t.textures.concat(r),e.modified())},e.removeTexture=function(r){var n=t.textures.filter((function(e){return e!==r}));t.textures.length!==n.length&&(t.textures=n,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}Pn(),An(1,0,0),An(0,1,0),ni(),ni(),ho();var ui={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function di(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ui,r),fe.obj(e,t),fe.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),fe.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier","parentProp"]),ci(e,t)}var fi={newInstance:fe.newInstance(di,"vtkProp"),extend:di};function pi(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(r){t.position=t.position.map((function(e,t){return e+r[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=ni();Ka(e,t.rotation);var r=new Float64Array(3),n=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>bn?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}(r,e);return[xe(n),r[0],r[1],r[2]]},e.rotateX=function(r){0!==r&&(Ba(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateY=function(r){0!==r&&(Va(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateZ=function(r){0!==r&&(La(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateWXYZ=function(r,n,a,o){if(0!==r&&(0!==n||0!==a||0!==o)){var i=Ce(r),s=ni();ai(s,[n,a,o],i);var l=new Float64Array(16);Ya(l,s),Ia(t.rotation,t.rotation,l),e.modified()}},e.setOrientation=function(r,n,a){return(r!==t.orientation[0]||n!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[r,n,a],Pa(t.rotation),e.rotateZ(a),e.rotateX(r),e.rotateY(n),e.modified(),!0)},e.setUserMatrix=function(r){Sa(t.userMatrix,r),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Pa(t.matrix),t.userMatrix&&Ia(t.matrix,t.matrix,t.userMatrix),Ra(t.matrix,t.matrix,t.origin),Ra(t.matrix,t.matrix,t.position),Ia(t.matrix,t.matrix,t.rotation),Ea(t.matrix,t.matrix,t.scale),Ra(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),wa(t.matrix,t.matrix),t.isIdentity=!0;for(var r=0;r<4;++r)for(var n=0;n<4;++n)(r===n?1:0)!==t.matrix[r+4*n]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Hr.getCenter(t.bounds)},e.getLength=function(){return Hr.getLength(t.bounds)},e.getXRange=function(){return Hr.getXRange(t.bounds)},e.getYRange=function(){return Hr.getYRange(t.bounds)},e.getZRange=function(){return Hr.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var gi={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 mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gi,r),fi.extend(e,t,r),t.matrixMTime={},fe.obj(t.matrixMTime),fe.get(e,t,["bounds","isIdentity"]),fe.getArray(e,t,["orientation"]),fe.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Pa(new Float64Array(16)),t.rotation=Pa(new Float64Array(16)),t.userMatrix=Pa(new Float64Array(16)),t.transform=null,pi(e,t)}var vi={newInstance:fe.newInstance(mi,"vtkProp3D"),extend:mi},hi={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},yi={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:hi},bi={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Ti={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:bi};function Si(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 Ci=yi.ScalarMappingTarget,xi=yi.VectorMode,Pi=qt.VtkDataTypes,wi=Ti.ColorMode,Oi=fe.vtkErrorMacro;function Ai(e){return e}function Mi(e){return Math.floor(255*e+.5)}function Ii(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(xi.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(xi.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(xi.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(r,n){if(!(r&&!n||!r&&n))if(r&&n&&r.length!==n.length)Oi("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],n&&r)for(var a=n.length,o=0;o=0?t.annotationArray[a].annotation!==n&&(t.annotationArray[a].annotation=n,o=!0):(t.annotationArray.push({value:r,annotation:n}),a=t.annotationArray.length-1,o=!0),o&&(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(r){return t.annotationArray.length?e.checkForAnnotatedValue(r):-1},e.removeAnnotation=function(r){var n=e.checkForAnnotatedValue(r),a=n>=0;return a&&(t.annotationArray.splice(n,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(r,n){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(r);e.getIndexedColor(a,n)}else e.getColor(parseFloat(r),n),n[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var r=t.annotationArray.length;return t.annotatedValueMap[e]%r}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,r=0;r1?e.mapVectorsThroughTable(t,o,Ci.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Ci.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,r){for(var n=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=c&&(l=c-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=c):(l<0&&(l=0),l>=c&&(l=c-1),l+s>c&&(s=c-l)),i!==xi.MAGNITUDE||1!==c&&1!==s||(i=xi.COMPONENT));var u=0;switch(l>0&&(u=l),i){case xi.COMPONENT:e.mapScalarsThroughTable(t,r,n,u);break;case xi.RGBCOLORS:break;case xi.MAGNITUDE:default:var d=qt.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,r,n,0)}},e.luminanceToRGBA=function(e,t,r,n){for(var a=n(r),o=t.getData(),i=e.getData(),s=o.length,l=0,c=0;c=1&&r.getDataType()===Pi.UNSIGNED_CHAR)return r;var i=qt.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Pi.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ai;switch(r.getDataType()!==Pi.FLOAT&&r.getDataType()!==Pi.DOUBLE||(s=Mi),n){case 1:e.luminanceToRGBA(i,r,o,s);break;case 2:e.luminanceAlphaToRGBA(i,r,s);break;case 3:e.rGBToRGBA(i,r,o,s);break;case 4:e.rGBAToRGBA(i,r,o,s);break;default:return Oi("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,r){return e.setMappingRange(t,r)},e.getRange=function(t,r){return e.getMappingRange()}}var Ri={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:xi.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Ei(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ri,r),fe.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],fe.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),fe.setArray(e,t,["mappingRange"],2),fe.getArray(e,t,["mappingRange"]),Ii(e,t)}var Di=function(e){for(var t=1;t.001?Math.acos(r/o):0,s=i>.001?Math.atan2(a,n):0;t[0]=o,t[1]=i,t[2]=s}function Wi(e,t){if(e[0]>=t-.1)return e[2];var r=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+r:e[2]-r}function ji(e,t,r,n){var a=[],o=[];bt(t,a),bt(r,o);var i=[],s=[];Ui(a,i),Ui(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var r=e-t;for(r<0&&(r=-r);r>=2*Math.PI;)r-=2*Math.PI;return r>Math.PI&&(r=2*Math.PI-r),r}(i[2],s[2])>.33*Math.PI){var c=Math.max(i[0],s[0]);c=Math.max(88,c),e<.5?(s[0]=c,s[1]=0,s[2]=0,l*=2):(i[0]=c,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Wi(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Wi(i,s[0]));var u=[];u[0]=(1-l)*i[0]+l*s[0],u[1]=(1-l)*i[1]+l*s[1],u[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var r=e[0],n=e[1],a=e[2];t[0]=r*Math.cos(n),t[1]=r*Math.sin(n)*Math.cos(a),t[2]=r*Math.sin(n)*Math.sin(a)}(u,d),Tt(d,n)}function zi(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,r,n,a){return e.addRGBPointLong(t,r,n,a,.5,0)},e.addRGBPointLong=function(r,n,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Gi("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Gi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var l={x:r,r:n,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[],l=[r,n,a];return gt(l,s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(r){if(t.nodes!==r){var n=JSON.stringify(t.nodes);t.nodes=r;var a=JSON.stringify(t.nodes);if(e.sortAndUpdateRange()||n!==a)return e.modified(),!0}return!1},e.sortAndUpdateRange=function(){var r=JSON.stringify(t.nodes);t.nodes.sort((function(e,t){return e.x-t.x}));var n=JSON.stringify(t.nodes),a=e.updateRange();return a||r===n?a:(e.modified(),!0)},e.updateRange=function(){var r=[2];r[0]=t.mappingRange[0],r[1]=t.mappingRange[1];var n=t.nodes.length;return n?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[n-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(r[0]!==t.mappingRange[0]||r[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(r){for(var n=0;n=t.nodes.length)return-1;var o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(r,n){if(r!==n){e.removePoint(n);for(var a=0;a=r&&t.nodes[u].x<=i?t.nodes.splice(u,1):u++;e.addRGBPointLong(r,n,a,o,.5,0),e.addRGBPointLong(i,s,l,c,.5,0),e.modified()},e.addHSVSegment=function(t,r,n,a,o,i,s,l){var c=[i,s,l],u=[],d=[];gt([r,n,a],u),gt(c,d),e.addRGBSegment(t,u[0],u[1],u[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var r=[];return e.getColor(t,r),[Math.floor(255*r[0]+.5),Math.floor(255*r[1]+.5),Math.floor(255*r[2]+.5),255]},e.getColor=function(r,n){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(r);if(o<0||0===a)e.getNanColor(n);else{var i=[];e.getNodeValue(o%a,i),n[0]=i.r,n[1]=i.g,n[2]=i.b}}else e.getTable(r,r,1,n)},e.getRedValue=function(t){var r=[];return e.getColor(t,r),r[0]},e.getGreenValue=function(t){var r=[];return e.getColor(t,r),r[1]},e.getBlueValue=function(t){var r=[];return e.getColor(t,r),r[2]},e.getTable=function(r,n,a,o){if(Et(r)||Et(n))for(var i=0;i0);var S=0,C=0,x=0;T&&(S=Math.log10(r),C=Math.log10(n));for(var P=0;P1?T?(x=S+P/(a-1)*(C-S),f=Math.pow(10,x)):f=r+P/(a-1)*(n-r):T?(x=.5*(S+C),f=Math.pow(10,x)):f=.5*(r+n),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var A=t.numberOfValues,M=O[1]-O[0];if(A<=1)f=O[0]+M/2;else{var I=(f-O[0])/M,R=we(A*I);f=O[0]+R/(A-1)*M}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[w]=0,o[w+1]=0,o[w+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[w]=t.aboveRangeColor[0],o[w+1]=t.aboveRangeColor[1],o[w+2]=t.aboveRangeColor[2]):(o[w]=c,o[w+1]=u,o[w+2]=d));else if(f0&&(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-r)<1e-6||t.discretize))l>0?(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b):(o[w]=0,o[w+1]=0,o[w+2]=0);else{var E=0;if(E=(E=T?(x-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[w]=m[0],o[w+1]=m[1],o[w+2]=m[2];continue}o[w]=v[0],o[w+1]=v[1],o[w+2]=v[2];continue}if(y<.01){if(t.colorSpace===Li.RGB)o[w]=(1-E)*m[0]+E*v[0],o[w+1]=(1-E)*m[1]+E*v[1],o[w+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Li.HSV){var D=[],B=[];pt(m,D),pt(v,B),t.hSVWrap&&(D[0]-B[0]>.5||B[0]-D[0]>.5)&&(D[0]>B[0]?D[0]-=1:B[0]-=1);var V=[];V[0]=(1-E)*D[0]+E*B[0],V[0]<0&&(V[0]+=1),V[1]=(1-E)*D[1]+E*B[1],V[2]=(1-E)*D[2]+E*B[2],gt(V,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var L=[],N=[];bt(m,L),bt(v,N);var k=[];k[0]=(1-E)*L[0]+E*N[0],k[1]=(1-E)*L[1]+E*N[1],k[2]=(1-E)*L[2]+E*N[2],Tt(k,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,W=G-2*F+E,j=G-F,z=void 0;if(t.colorSpace===Li.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[w+H]=_*m[H]+U*v[H]+W*z+j*z;else if(t.colorSpace===Li.HSV){var K=[],X=[];pt(m,K),pt(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+W*z+j*z,0===Y&&q[Y]<0&&(q[Y]+=1);gt(q,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var Z=[],Q=[];bt(m,Z),bt(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+W*z+j*z;Tt($,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[w+ee]=o[w+ee]<0?0:o[w+ee],o[w+ee]=o[w+ee]>1?1:o[w+ee]}}}},e.getUint8Table=function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Gi("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(r,n,a,s);for(var l=0;l1&&(i=(n-r)/(a-1));for(var s=0;s=t.nodes.length?(Gi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].r,r[2]=t.nodes[e].g,r[3]=t.nodes[e].b,r[4]=t.nodes[e].midpoint,r[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){if(r<0||r>=t.nodes.length)return Gi("Index out of range!"),-1;var a=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].r=n[1],t.nodes[r].g=n[2],t.nodes[r].b=n[3],t.nodes[r].midpoint=n[4],t.nodes[r].sharpness=n[5],a!==n[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,r){var n=e.getSize();if(n>0&&t>=0){var a=[];e.getNodeValue(t%n,a);for(var o=0;o<3;++o)r[o]=a[o+1];r[3]=1}else e.getNanColor(r),r[3]=1},e.fillFromDataPointer=function(t,r){if(!(t<=0)&&r){e.removeAllPoints();for(var n=0;nr[1]?(e.getColor(r[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])):(e.getColor(n[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=r[0]&&t.nodes[o].x<=r[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,r),Di.extend(e,t,r),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},fe.obj(t.buildTime),fe.get(e,t,["buildTime","mappingRange"]),fe.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),zi(e,t)}var Xi=function(e){for(var t=1;t0&&(r=t.nodes[0].y);for(var a=1;ar)switch(n){case 0:case 1:n=1;break;default:n=3}else switch(n){case 0:case 2:n=2;break;default:n=3}if(r=e,3===n)break}switch(n){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var r=0;r0?t.nodes[r-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,r){var n=t.nodes.length;return e<0||e>=n?(qi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].y,r[2]=t.nodes[e].midpoint,r[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){var a=t.nodes.length;if(r<0||r>=a)return qi("Index out of range!"),-1;var o=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].y=n[1],t.nodes[r].midpoint=n[2],t.nodes[r].sharpness=n[3],o!==n[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,r){return e.addPointLong(t,r,.5,0)},e.addPointLong=function(r,n,a,o){if(a<0||a>1)return qi("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return qi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var i,s={x:r,y:n,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=n,o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(r,n,a,o){e.sortAndUpdateRange();for(var i=0;i=r&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(r,n,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var r=[];return e.getTable(t,t,1,r),r[0]},e.adjustRange=function(r){if(r.length<2)return 0;var n=e.getRange();n[0]r[1]?e.addPoint(r[1],e.getValue(r[1])):e.addPoint(r[1],e.getValue(n[1])),e.sortAndUpdateRange();for(var a=0;a=r[0]&&t.nodes[a].x<=r[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var r=t.nodes[1].x-t.nodes[0].x,n=0;n4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,c=0;0!==l&&(c=t.nodes[l-1].y);var u=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(n-1)*(r-e):.5*(e+r);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?c:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(u-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,S=2*T-3*b+1,C=-2*T+3*b,x=T-2*b+y,P=T-b,w=g-p,O=(1-v)*w;a[h]=S*p+C*g+x*O+P*O;var A=pg?p:g;a[h]=a[h]M?M:a[h]}}}}var Zi={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function Qi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zi,r),fe.obj(e,t),t.nodes=[],fe.setGet(e,t,["allowDuplicateScalars","clamping"]),fe.setArray(e,t,["range"],2),fe.getArray(e,t,["range"]),Yi(e,t)}var $i={newInstance:fe.newInstance(Qi,"vtkPiecewiseFunction"),extend:Qi},Ji={NEAREST:0,LINEAR:1,FAST_LINEAR:2},es={FRACTIONAL:0,PROPORTIONAL:1},ts={InterpolationType:Ji,OpacityMode:es};function rs(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 ns=ts.InterpolationType,as=ts.OpacityMode,os=fe.vtkErrorMacro;function is(e,t){t.classHierarchy.push("vtkVolumeProperty"),e.getMTime=function(){for(var e,r=t.mtime,n=0;n<4;n++)1===t.componentData[n].colorChannels?t.componentData[n].grayTransferFunction&&(r=r>(e=t.componentData[n].grayTransferFunction.getMTime())?r:e):3===t.componentData[n].colorChannels&&t.componentData[n].rGBTransferFunction&&(r=r>(e=t.componentData[n].rGBTransferFunction.getMTime())?r:e),t.componentData[n].scalarOpacity&&(r=r>(e=t.componentData[n].scalarOpacity.getMTime())?r:e),t.componentData[n].gradientOpacity&&(t.componentData[n].disableGradientOpacity||(r=r>(e=t.componentData[n].gradientOpacity.getMTime())?r:e));return r},e.getColorChannels=function(e){return e<0||e>3?(os("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(r,n){var a=!1;return t.componentData[r].grayTransferFunction!==n&&(t.componentData[r].grayTransferFunction=n,a=!0),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(r){return null===t.componentData[r].grayTransferFunction&&(t.componentData[r].grayTransferFunction=$i.newInstance(),t.componentData[r].grayTransferFunction.addPoint(0,0),t.componentData[r].grayTransferFunction.addPoint(1024,1),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1),e.modified()),t.componentData[r].grayTransferFunction},e.setRGBTransferFunction=function(r,n){var a=!1;return t.componentData[r].rGBTransferFunction!==n&&(t.componentData[r].rGBTransferFunction=n,a=!0),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(r){return null===t.componentData[r].rGBTransferFunction&&(t.componentData[r].rGBTransferFunction=Xi.newInstance(),t.componentData[r].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[r].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3),e.modified()),t.componentData[r].rGBTransferFunction},e.setScalarOpacity=function(r,n){return t.componentData[r].scalarOpacity!==n&&(t.componentData[r].scalarOpacity=n,e.modified(),!0)},e.getScalarOpacity=function(r){return null===t.componentData[r].scalarOpacity&&(t.componentData[r].scalarOpacity=$i.newInstance(),t.componentData[r].scalarOpacity.addPoint(0,1),t.componentData[r].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[r].scalarOpacity},e.setComponentWeight=function(r,n){if(r<0||r>=4)return os("Invalid index"),!1;var a=Math.min(1,Math.max(0,n));return t.componentData[r].componentWeight!==a&&(t.componentData[r].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(os("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(ns.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(ns.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(ns.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return fe.enumToString(ns,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["set".concat(n)]=function(n,a){return t.componentData[n]["".concat(r)]!==a&&(t.componentData[n]["".concat(r)]=a,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["get".concat(n)]=function(e){return t.componentData[e]["".concat(r)]}}))}var ss={independentComponents:!0,interpolationType:ns.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function ls(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,ss,r),fe.obj(e,t),!t.componentData){t.componentData=[];for(var n=0;n<4;++n)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:as.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}fe.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),is(e,t)}var cs=function(e){for(var t=1;tn[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!(r=[n,t.mapperBounds],r[0].map((function(e,t){return r.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){us("Recomputing bounds..."),t.mapperBounds=n.map((function(e){return e}));var a=[];Hr.getCorners(n,a),e.computeMatrix();var o=new Float64Array(16);wa(o,t.matrix),a.forEach((function(e){return Jn(e,e,o)})),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,r){return e>r[t/2]?r[t/2]:e}),e):a.reduce((function(e,r){return ee?r:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e}}var fs={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function ps(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fs,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["mapper"]),fe.getArray(e,t,["bounds"],6),ds(e,t)}var gs={newInstance:fe.newInstance(ps,"vtkVolume"),extend:ps},ms={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4};function vs(e,t){t.classHierarchy.push("vtkAbstractMapper"),e.update=function(){e.getInputData()},e.addClippingPlane=function(r){return!!r.isA("vtkPlane")&&!t.clippingPlanes.includes(r)&&(t.clippingPlanes.push(r),e.modified(),!0)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(r){var n=t.clippingPlanes.indexOf(r);return-1!==n&&(t.clippingPlanes.splice(n,1),e.modified(),!0)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var r=t.length,n=0;n=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,r),fe.obj(e,t),fe.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),vs(e,t)},bs=ms,Ts={OFF:0,NORMALIZED:1,RAW:2};function Ss(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var r=e.getInputData();return r?(t.static||e.update(),t.bounds=r.getBounds()):t.bounds=Dt(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(bs.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(bs.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(bs.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(bs.AVERAGE_INTENSITY_BLEND)},e.setBlendModeToAdditiveIntensity=function(){e.setBlendMode(bs.ADDITIVE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return fe.enumToString(bs,t.blendMode)},e.setAverageIPScalarRange=function(t,r){console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),e.setIpScalarRange(t,r)},e.getFilterModeAsString=function(){return fe.enumToString(Ts,t.filterMode)},e.setFilterModeToOff=function(){e.setFilterMode(Ts.OFF)},e.setFilterModeToNormalized=function(){e.setFilterMode(Ts.NORMALIZED)},e.setFilterModeToRaw=function(){e.setFilterMode(Ts.RAW)}}var Cs={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:bs.COMPOSITE_BLEND,ipScalarRange:[-1e6,1e6],filterMode:Ts.OFF,preferSizeOverAccuracy:!1};function xs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cs,r),ys(e,t,r),fe.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode","filterMode","preferSizeOverAccuracy"]),fe.setGetArray(e,t,["ipScalarRange"],2),fe.event(e,t,"lightingActivated"),Ss(e,t)}var Ps={newInstance:fe.newInstance(xs,"vtkVolumeMapper"),extend:xs};function ws(e,t){const r=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(r[0]*r[1]*r[2]<1||r[1]<2||r[1]<2||r[2]<2)return;const n=ei.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);n.setDimensions(r),n.setOrigin(a),n.setSpacing(o);const i=qt.newInstance({name:"Scalars",values:t,numberOfComponents:1});return n.getPointData().setScalars(i),n.modified(),n}let Os=!1;function As(e,t,r){let n=[],a=0,o=function(){let t={knee:24,thorax:364,abdomen:147}[e],r=[];for(let n=1;n{t.resetImageParsing(),t.readFiles(n,(function(e,n){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),r&&setTimeout(r,3e3,a)}))}))}))}function Ms(e){return e*Math.PI/180}function Is(e){const t=gs.newInstance(),r=Ps.newInstance();r.setSampleDistance(1),t.setMapper(r),r.setInputData(e);const n=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(n[0],n[1]),t}r(666);var Rs=fe.vtkErrorMacro;function Es(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(r){var n=r.getTraverseOperation(),a=e[n];if(a)a(r);else{e.apply(r,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ds,r),fe.obj(e,t),fe.event(e,t,"event"),t._renderableChildMap=new Map,fe.get(e,t,["visited"]),fe.setGet(e,t,["parent","renderable","myFactory"]),fe.getArray(e,t,["children"]),Es(e,t)}var Vs={newInstance:fe.newInstance(Bs,"vtkViewNode"),extend:Bs,PASS_TYPES:["Build","Render"]};function Ls(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(r){if(r.isDeleted())return null;for(var n=0,a=r.getClassName(n++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=r.getClassName(n++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,r){t.overrides[e]=r}}var Ns={};function ks(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ns,r),fe.obj(e,t),Ls(e,t)}var Fs={newInstance:fe.newInstance(ks,"vtkViewNodeFactory"),extend:ks},Gs=Object.create(null);function _s(e,t){Gs[e]=t}function Us(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Ws={};function js(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ws,r),t.overrides=Gs,Fs.extend(e,t,r),Us(0,t)}var zs={newInstance:fe.newInstance(js,"vtkOpenGLViewNodeFactory"),extend:js};function Hs(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var r=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),t.context.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(r){if(r!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||r.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Sa(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),yo(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var n=t.openGLRenderer.getAspectRatio();Sa(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(n,-1,1)),wa(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Ia(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=r}return t.keyMatrices}}var Ks={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};var Xs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},te(e,t,["context","keyMatrixTime"]),Hs(e,t)}));_s("vtkCamera",Xs);var qs=k;function Ys(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(qs("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(r){if(r){var n=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),n|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),n|=a.DEPTH_BUFFER_BIT,t.context.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(n),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],a=e[1]-r[1],o=t.parent.normalizedDisplayToDisplay(n,a),i=Math.round(o[0]),s=Math.round(o[1]),l=e[2]-r[0],c=e[3]-r[1],u=t.parent.normalizedDisplayToDisplay(l,c),d=Math.round(u[0])-i,f=Math.round(u[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var r=0,n=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),r|=n.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,t.context.depthMask(!0)),n.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.clear(r),n.enable(n.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(t.context=t.openGLRenderWindow.getContext()))}}var Zs={context:null,openGLRenderWindow:null,selector:null};var Qs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zs,r),Vs.extend(e,t,r),Q(e,t,["shaderCache"]),te(e,t,["selector"]),Ys(e,t)}),"vtkOpenGLRenderer");_s("vtkRenderer",Qs);var $s={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},Js={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},el={ObjectType:Js};function tl(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}function rl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ol,r),fe.obj(e,t),fe.get(e,t,["openGLRenderWindow"]),al(e,t)}var sl=rl(rl({newInstance:fe.newInstance(il),extend:il},{}),el),ll={FLAT:0,GOURAUD:1,PHONG:2},cl={POINTS:0,WIREFRAME:1,SURFACE:2},ul={Shading:ll,Representation:cl,Interpolation:ll},dl=fe.vtkErrorMacro;function fl(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Js.ARRAY_BUFFER),e.createVBO=function(r,n,a,o){if(!r.getData()||!r.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=o.points.getData(),s=null,l=null,c=null,u=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.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())})),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,c=o.colors.getData(),t.colorBO||(t.colorBO=sl.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,r){for(var n=0;n2)for(var n=0;n2){for(var n=0;n1?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,r){return e>2?3*(e-2):0}},S=null,C=null;a===cl.POINTS||"verts"===n?(S=b.anythingToPoints,C=T.anythingToPoints):a===cl.WIREFRAME||"lines"===n?(S=b["".concat(n,"ToWireframe")],C=T["".concat(n,"ToWireframe")]):(S=b["".concat(n,"ToSurface")],C=T["".concat(n,"ToSurface")]);for(var x=r.getData(),P=x.length,w=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(M[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],M[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],M[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(M[I++]=i[p++],M[I++]=i[p++],M[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,M[I++]=s[g++],M[I++]=s[g++],M[I++]=s[g++]),t.customData.forEach((function(t){h=e*t.components;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pl,r),sl.extend(e,t,r),fe.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),fe.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),fl(e,t)}var ml={newInstance:fe.newInstance(gl),extend:gl},vl=fe.vtkErrorMacro;function hl(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;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,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 r=t.context.getShaderInfoLog(t.handle);return vl("Error compiling shader '".concat(t.source,"': ").concat(r)),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 yl={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function bl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yl,r),fe.obj(e,t),fe.setGet(e,t,["shaderType","source","error","handle","context"]),hl(e,t)}var Tl={newInstance:fe.newInstance(bl,"vtkShader"),extend:bl},Sl=fe.vtkErrorMacro;function Cl(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):(Sl("Links failed: ".concat(t.error)),0):(Sl(t.error),0):(Sl(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(t.fragmentShader.getError()),0):(Sl(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(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 r=t.context.getProgramInfoLog(t.handle);return Sl("Error linking shader ".concat(r)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1f(a,n),!0)},e.setUniformfv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1fv(a,n),!0)},e.setUniformi=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1i(a,n),!0)},e.setUniformiv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1iv(a,n),!0)},e.setUniform2f=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,n,a),!0},e.setUniform2fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2fv(a,n),!0)},e.setUniform2i=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,n,a),!0},e.setUniform2iv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2iv(a,n),!0)},e.setUniform3f=function(r,n,a,o){var i=e.findUniform(r);if(-1===i)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,n,a,o),!0},e.setUniform3fArray=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(!Array.isArray(n)||3!==n.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,n[0],n[1],n[2]),!0},e.setUniform3fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform3fv(a,n),!0)},e.setUniform3i=function(r){var n=e.findUniform(r);if(-1===n)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;for(var a=arguments.length,o=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,xl,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Tl.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Tl.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Tl.newInstance(),t.geometryShader.setShaderType("Geometry"),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),Cl(e,t)}var wl={newInstance:fe.newInstance(Pl,"vtkShaderProgram"),extend:Pl,substitute:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}}};function Ol(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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):r.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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):r.vertexAttribDivisor(i.index+l,0)),r.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,r,n,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,r,n,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(r,n,a,o,i,s,l,c,u,d){if(!r)return!1;if(!r.isBound()||0===n.getHandle()||n.getType()!==Js.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=c,p.isMatrix=d,p.divisor=u,-1===p.Index)return!1;if(n.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),u>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=n.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(r){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Al,r),t.buffers=[],fe.obj(e,t),fe.get(e,t,["supported"]),fe.setGet(e,t,["forceEmulation"]),Ol(e,t)}var Il={newInstance:fe.newInstance(Ml,"vtkOpenGLVertexArrayObject"),extend:Ml};function Rl(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 El={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function Dl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,El,r),fe.obj(e,t),t.shaderSourceTime={},fe.obj(t.shaderSourceTime),t.attributeUpdateTime={},fe.obj(t.attributeUpdateTime),fe.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=wl.newInstance(),t.VAO=Il.newInstance(),t.CABO=ml.newInstance(),Rl(e,t)}var Bl={newInstance:fe.newInstance(Dl),extend:Dl},Vl={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Ll={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Nl={Wrap:Vl,Filter:Ll},kl=new Float32Array(1),Fl=new Int32Array(kl.buffer),Gl=function(e){var t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))},_l=function(e){kl[0]=e;var t=Fl[0],r=t>>16&32768,n=t>>12&2047,a=t>>23&255;return a<103?r:a>142?(r|=31744,r|=(255===a?0:1)&&8388607&t):a<113?r|=((n|=2048)>>114-a)+(n>>113-a&1):(r|=a-112<<10|n>>1,r+=1&n)};function Ul(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 Wl=Nl.Wrap,jl=Nl.Filter,zl=qt.VtkDataTypes,Hl=k,Kl=F,Xl=G;function ql(e,t){var r=this;function n(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],o=t.width*t.height*t.components;if(n&&(o*=t.depth),e!==zl.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var i=0;i=a&&(b=a-1);var T=h-y,S=1-T;y=y*n*o,b=b*n*o;for(var C=0;C=n&&(O=n-1);var A=P-w;w*=o,O*=o;for(var M=0;Ma[l]&&(a[l]=r[i]),i++;for(var c=[],u=[],d=0;d2048||a<-2048||a>2048)return!1}return!0}(n,a)&&!o)}t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t.openGLRenderWindow=r:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(jl.LINEAR),e.setMagnificationFilter(jl.LINEAR)):(e.setMinificationFilter(jl.NEAREST),e.setMagnificationFilter(jl.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Wl.REPEAT),e.setWrapS(Wl.REPEAT),e.setWrapT(Wl.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR));var n=t.renderable.getCanvas();e.create2DFromRaw(n.width,n.height,4,zl.UNSIGNED_CHAR,n,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){var a=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw(a.width,a.height,4,zl.UNSIGNED_CHAR,a.data,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}var o=t.renderable.getInputData(0);if(o&&o.getPointData().getScalars()){for(var i=o.getExtent(),s=o.getPointData().getScalars(),l=[],c=0;ct.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:Xl("impossible case"),e=t.context.getIntegerv(r)===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(r,n){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||Hl("Unable to find suitable internal format for T=".concat(r," NC= ").concat(n)),t.internalFormat},e.getDefaultInternalFormat=function(e,n){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!1))||(a=r.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!0))||(Hl("Unsupported internal texture type!"),Hl("Unable to find suitable internal format for T=".concat(e," NC= ").concat(n))),a},e.setInternalFormat=function(r){r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=function(r,n){return t.format=e.getDefaultFormat(r,n),t.format},e.getDefaultFormat=function(e,r){if(t.openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.openGLRenderWindow.getWebgl2())switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case r&&zl.SHORT:case r&&zl.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case zl.FLOAT:case zl.VOID:default:return t.context.FLOAT}switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case zl.FLOAT:case zl.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;var n=t.context.getExtension("OES_texture_half_float");return n&&t.context.getExtension("OES_texture_half_float_linear")?n.HALF_FLOAT_OES:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.openGLDataType=e.getDefaultDataType(r,n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:e=(r=127.5)-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:e=(r=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:e=(r=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=function(e){switch(e){case jl.NEAREST:return t.context.NEAREST;case jl.LINEAR:return t.context.LINEAR;case jl.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case jl.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case jl.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case jl.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Wl.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Wl.REPEAT:return t.context.REPEAT;case Wl.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(r,o,i,s,l){var c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=[l],d=n(s,u),f=a(d);return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,c),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,f[0]),t.generateMipmap&&t.context.generateMipmap(t.target),c&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),e.deactivate(),!0},e.createCubeFromRaw=function(r,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var c=a(n(s,l)),u=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var S=null;y<=t.maxLevel&&(S=u[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,S),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(r,n,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===zl.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=r,t.height=n,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,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Kl("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(r){if(e.getOpenGLDataType(zl.UNSIGNED_CHAR),e.getInternalFormat(zl.UNSIGNED_CHAR,4),e.getFormat(zl.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=r.width,t.height=r.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var n=!Be(r.width)||!Be(r.height),a=document.createElement("canvas");a.width=n?De(r.width):r.width,a.height=n?De(r.height):r.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(r,0,0,r.width,r.height,0,0,a.width,a.height);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(r,o,i,s,l,c){if(e.getOpenGLDataType(l,!0),e.getInternalFormat(l,s),e.getFormat(l,s),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=s,t.width=r,t.height=o,t.depth=i,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(n(l,[c],!0));return t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFilterableFromRaw=function(r,n,a,s,l,c){for(var u=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=r*n*a,f=[],p=[],g=0;g4096&&(A===zl.FLOAT||s>=3)&&(I=4096);var R=1,E=1;d>I*I&&(E=R=Math.ceil(Math.sqrt(d/(I*I))));var D=Math.sqrt(d)/R;D=De(D);var B,V=Math.floor(D*R/r),L=Math.ceil(a/V),N=De(n*L/E);t.width=D,t.height=N,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=V,t.volumeInfo.yreps=L,t.volumeInfo.xstride=R,t.volumeInfo.ystride=E,t.volumeInfo.offset=w.offset,t.volumeInfo.scale=w.scale;var k=D*N*s;B=A===zl.FLOAT?new Float32Array(k):new Uint8Array(k);for(var F=0,G=Math.floor(r/R),_=Math.floor(n/E),U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yl,r),Vs.extend(e,t,r),t.sendParametersTime={},Z(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},Z(t.textureBuildTime,{mtime:0}),ee(e,t,["format","openGLDataType"]),te(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),Q(e,t,["width","height","volumeInfo","components","handle","target"]),ql(e,t)}var Ql=ie(Zl,"vtkOpenGLTexture"),$l=function(e){for(var t=1;t6&&(F("OpenGL has a limit of 6 clipping planes"),i=6),a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=wl.substitute(o,"//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=o},e.getNeedToRebuildShaders=function(e,r,n){var a=t.openGLTexture.getComponents(),o=n.getProperty().getIndependentComponents();return(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===e.getProgram()||t.lastTextureComponents!==a||t.lastIndependentComponents!==o)&&(t.lastHaveSeenDepthRequest=t.haveSeenDepthRequest,t.lastTextureComponents=a,t.lastIndependentComponents=o,!0)},e.updateShaders=function(r,n,a){if(t.lastBoundBO=r,e.getNeedToRebuildShaders(r,n,a)){var o={Vertex:null,Fragment:null,Geometry:null};e.buildShaders(o,n,a);var i=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);i!==r.getProgram()&&(r.setProgram(i),r.getVAO().releaseGraphicsResources()),r.getShaderSourceTime().modified()}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(r.getProgram());r.getVAO().bind(),e.setMapperShaderParameters(r,n,a),e.setCameraShaderParameters(r,n,a),e.setPropertyShaderParameters(r,n,a)},e.setMapperShaderParameters=function(r,n,a){r.getCABO().getElementCount()&&(t.VBOBuildTime>r.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(r.getProgram().isAttributeUsed("vertexMC")&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"vertexMC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||nc("Error setting vertexMC in shader VAO.")),r.getProgram().isAttributeUsed("tcoordMC")&&r.getCABO().getTCoordOffset()&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"tcoordMC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getTCoordComponents(),t.context.FALSE)||nc("Error setting tcoordMC in shader VAO.")),r.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();r.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l6&&(F("OpenGL has a limit of 6 clipping planes"),I=6);var R=t.currentInput.getWorldToIndex(),E=r.getCABO().getCoordShiftAndScaleEnabled()?r.getCABO().getInverseShiftAndScaleMatrix():null,D=E?Sa(t.imagematinv,a.getMatrix()):a.getMatrix();E&&(wa(D,D),Ia(D,D,E),wa(D,D)),Ia(t.imagematinv,D,R);for(var B=[],V=0;V1?1:0;var H=o.getData(),K=null;if(V===ac.I){K=new H.constructor(_[2]*_[1]*c);for(var X=0,q=0;q<_[2];q++)for(var Y=0;Y<_[1];Y++){var Z=(N+Y*_[0]+q*_[0]*_[1])*c;X=(q*_[1]+Y)*c,K.set(H.subarray(Z,Z+c),X)}_[0]=_[1],_[1]=_[2],W[0]=L,W[1]=F[2],W[2]=F[4],W[3]=L,W[4]=F[3],W[5]=F[4],W[6]=L,W[7]=F[2],W[8]=F[5],W[9]=L,W[10]=F[3],W[11]=F[5]}else if(V===ac.J){K=new H.constructor(_[2]*_[0]*c);for(var Q=0,$=0;$<_[2];$++)for(var J=0;J<_[0];J++){var ee=(J+N*_[0]+$*_[0]*_[1])*c;Q=($*_[0]+J)*c,K.set(H.subarray(ee,ee+c),Q)}_[1]=_[2],W[0]=F[0],W[1]=L,W[2]=F[4],W[3]=F[1],W[4]=L,W[5]=F[4],W[6]=F[0],W[7]=L,W[8]=F[5],W[9]=F[1],W[10]=L,W[11]=F[5]}else V===ac.K||V===ac.NONE?(K=H.subarray(N*U,(N+1)*U),W[0]=F[0],W[1]=F[2],W[2]=L,W[3]=F[1],W[4]=F[2],W[5]=L,W[6]=F[0],W[7]=F[3],W[8]=L,W[9]=F[1],W[10]=F[3],W[11]=L):nc("Reformat slicing not yet supported.");t.openGLTexture.create2DFromRaw(_[0],_[1],c,o.getDataType(),K),t.openGLTexture.activate(),t.openGLTexture.sendParameters(),t.openGLTexture.deactivate();var te=qt.newInstance({numberOfComponents:3,values:W});te.setName("points");var re=qt.newInstance({numberOfComponents:2,values:j});re.setName("tcoords");var ne=new Uint16Array(8);ne[0]=3,ne[1]=0,ne[2]=1,ne[3]=3,ne[4]=3,ne[5]=0,ne[6]=3,ne[7]=2;var ae=qt.newInstance({numberOfComponents:1,values:ne});t.tris.getCABO().createVBO(ae,"polys",cl.SURFACE,{points:te,tcoords:re,cellOffset:0}),t.VBOBuildTime.modified(),t.VBOBuildString=G}}}}}var sc={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};var lc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sc,r),Vs.extend(e,t,r),rc(e,t,r),t.tris=Bl.newInstance(),t.openGLTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.pwfTexture=$l.newInstance(),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),te(e,t,[]),t.VBOBuildTime={},Z(t.VBOBuildTime),ic(e,t)}),"vtkOpenGLImageMapper");function cc(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,r){return e.opaquePass(t,r)},e.opaquePass=function(e,r){e&&t.context.depthMask(!0)},e.translucentPass=function(e,r){t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}_s("vtkImageMapper",lc);var uc={context:null,keyMatrixTime:null,keyMatrices:null};var dc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),cc(e,t)}),"vtkOpenGLImageSlice");function fc(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementVolumeCount()}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.volumePass=function(e){t.renderable&&t.renderable.getVisibility()&&t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.MCWCMatrix,t.renderable.getMatrix()),wa(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?xo(t.normalMatrix):(yo(t.normalMatrix,t.MCWCMatrix),wo(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}_s("vtkImageSlice",dc);var pc={};var gc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),te(e,t,["context"]),fc(e,t)}),"vtkOpenGLVolume");function mc(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(r),e.saveCurrentBuffers(r)},e.saveCurrentBindings=function(e){var r=t.context;t.previousDrawBinding=r.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(r),e.restorePreviousBuffers(r)},e.restorePreviousBindings=function(e){var r=t.context;r.bindFramebuffer(r.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,r){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=r},e.setColorBuffer=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.context,a=n.COLOR_ATTACHMENT0;if(r>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");a+=r}t.colorTexture=e,n.framebufferTexture2D(n.FRAMEBUFFER,a,n.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=t.context,n=r.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");n+=e}r.framebufferTexture2D(r.FRAMEBUFFER,n,r.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var r=t.context;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,e.getHandle(),0)}else F("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 F("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(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 r=t.context,n=$l.newInstance();n.setOpenGLRenderWindow(t.openGLRenderWindow),n.setMinificationFilter(Ll.LINEAR),n.setMagnificationFilter(Ll.LINEAR),n.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,i.UNSIGNED_CHAR,null),e.setColorBuffer(n),t.depthTexture=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthTexture),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthTexture)}}_s("vtkVolume",gc);var vc={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function hc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vc,r),Z(e,t),te(e,t,["colorTexture"]),mc(e,t)}var yc={newInstance:ie(hc,"vtkFramebuffer"),extend:hc};function bc(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 Tc=G,Sc=F;function Cc(e,t){t.classHierarchy.push("vtkOpenGLVolumeMapper"),e.buildPass=function(){t.zBufferTexture=null},e.opaqueZBufferPass=function(e,r){if(e){var n=r.getZBufferTexture();n!==t.zBufferTexture&&(t.zBufferTexture=n)}},e.volumePass=function(r,n){if(r){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.jitterTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.framebuffer.setOpenGLRenderWindow(t.openGLRenderWindow),t.scalarTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.opacityTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLVolume=e.getFirstAncestorOfType("vtkOpenGLVolume");var a=t.openGLVolume.getRenderable();t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer");var o=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(o.getActiveCamera()),e.renderPiece(o,a)}},e.buildShaders=function(t,r,n){e.getShaderTemplate(t,r,n),e.replaceShaderValues(t,r,n)},e.getShaderTemplate=function(e,t,r){e.Vertex="//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 vertexDC;\n\nvarying vec3 vertexVCVSOutput;\nuniform mat4 PCVCMatrix;\n\nuniform float dcxmin;\nuniform float dcxmax;\nuniform float dcymin;\nuniform float dcymax;\n\nvoid main()\n{\n // dcsmall is the device coords reduced to the\n // x y area covered by the volume\n vec4 dcsmall = vec4(\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\n vertexDC.z,\n vertexDC.w);\n vec4 vcpos = PCVCMatrix * dcsmall;\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\n gl_Position = dcsmall;\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkVolumeFS.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 volume mappers fragment shader\n\n// the output of this shader\n//VTK::Output::Dec\n\nvarying vec3 vertexVCVSOutput;\n\n// first declare the settings from the mapper\n// that impact the code paths in here\n\n// always set vtkNumComponents 1,2,3,4\n//VTK::NumComponents\n\n// possibly define vtkTrilinearOn\n//VTK::TrilinearOn\n\n// possibly define vtkIndependentComponents\n//VTK::IndependentComponentsOn\n\n// possibly define any \"proportional\" components\n//VTK::vtkProportionalComponents\n\n// Define the blend mode to use\n#define vtkBlendMode //VTK::BlendMode\n\n// Possibly define vtkImageLabelOutlineOn\n//VTK::ImageLabelOutlineOn\n\n#ifdef vtkImageLabelOutlineOn\nuniform int outlineThickness;\nuniform float vpWidth;\nuniform float vpHeight;\nuniform float vpOffsetX;\nuniform float vpOffsetY;\nuniform mat4 PCWCMatrix;\nuniform mat4 vWCtoIDX;\n#endif\n\n// define vtkLightComplexity\n//VTK::LightComplexity\n#if vtkLightComplexity > 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\nuniform vec4 ipScalarRangeMin;\nuniform vec4 ipScalarRangeMax;\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 trilinear values from multiple z slices\n#ifdef vtkTrilinearOn\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 - vpOffsetX - 0.5) * 2.0,\n (fragCoord.y / vpHeight - vpOffsetY - 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\nbool valueWithinScalarRange(vec4 val, vec4 min, vec4 max) {\n bool withinRange = false;\n #if vtkNumComponents == 1\n if (val.r >= min.r && val.r <= max.r) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents == 2\n if (val.r >= min.r && val.r <= max.r &&\n val.g >= min.g && val.g <= max.g) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 3\n if (all(greaterThanEqual(val, ipScalarRangeMin)) &&\n all(lessThanEqual(val, ipScalarRangeMax))) {\n withinRange = true;\n }\n #endif\n return withinRange;\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 || vtkBlendMode == 4 //AVERAGE_INTENSITY_BLEND || ADDITIVE_BLEND\n vec4 sum = vec4(0.);\n\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\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 if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n // Sum the values across each step in the path\n sum += tValue;\n }\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 IPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n #if vtkBlendMode == 3 // Average\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n #endif\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 (abs(result) < 1e-6)\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(r,n,a){var o=r.Fragment;a.getProperty().getInterpolationType()===Ji.LINEAR&&(o=wl.substitute(o,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===a.getProperty().getUseLabelOutline()&&(o=wl.substitute(o,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();o=wl.substitute(o,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var s=a.getProperty().getIndependentComponents();if(s){o=wl.substitute(o,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var l=[],c=0;c0&&(o=wl.substitute(o,"//VTK::vtkProportionalComponents",l.join("\n")).result)}var u=t.currentInput.getExtent(),d=t.currentInput.getSpacing(),f=new Float64Array(3);In(f,(u[1]-u[0])*d[0],(u[3]-u[2])*d[1],(u[5]-u[4])*d[2]);var p=On(f)/t.renderable.getSampleDistance();o=wl.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(p))).result,o=wl.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var g=1;s&&!t.gopacity&&g0&&(a=wl.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=wl.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)}))}e.Fragment=a},e.replaceShaderClippingPlane=function(e,r,n){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=wl.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=wl.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; 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(r,n,a){var i=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===ms.COMPOSITE_BLEND&&(i=0,t.numberOfLights=0,n.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===i&&(i=1)),1===i&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(i=2),i<3&&e.getPositional()&&(i=3)})));var s=!1;t.lastLightComplexity!==i&&(t.lastLightComplexity=i,s=!0);var l=t.scalarTexture.getComponents(),c=a.getProperty().getIndependentComponents(),u=!1,d=[];if(c){for(var f=0;f0&&(u=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);In(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=On(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:u,iComps:c,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;rr.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(r.getVAO().addAttributeArray(o,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("Error setting vertexDC in shader VAO.")),r.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance());for(var i=t.scalarTexture.getVolumeInfo(),s=t.renderable.getIpScalarRange(),l=[],c=[],u=0;u<4;u++)l[u]=s[0]*i.dataComputedScale[u]+i.dataComputedOffset[u],c[u]=s[1]*i.dataComputedScale[u]+i.dataComputedOffset[u],l[u]=(l[u]-i.offset[u])/i.scale[u],c[u]=(c[u]-i.offset[u])/i.scale[u];if(o.setUniform4f("ipScalarRangeMin",l[0],l[1],l[2],l[3]),o.setUniform4f("ipScalarRangeMax",c[0],c[1],c[2],c[3]),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var d=e.getRenderTargetSize();o.setUniformf("vpWidth",d[0]),o.setUniformf("vpHeight",d[1])}},e.setCameraShaderParameters=function(r,n,a){var o=t.openGLCamera.getKeyMatrices(n),i=t.openGLVolume.getKeyMatrices();Ia(t.modelToView,o.wcvc,i.mcwc);var s=r.getProgram(),l=t.openGLCamera.getRenderable(),c=l.getClippingRange();s.setUniformf("camThick",c[1]-c[0]),s.setUniformf("camNear",c[0]),s.setUniformf("camFar",c[1]);for(var u=t.currentInput.getBounds(),d=t.currentInput.getDimensions(),f=new Float64Array(3),p=new Float64Array(3),g=1,m=-1,v=1,h=-1,y=0;y<8;++y)In(f,u[y%2],u[2+Math.floor(y/2)%2],u[4+Math.floor(y/4)]),Jn(f,f,t.modelToView),l.getParallelProjection()||(Kn(p,f),Gn(f,p,-c[0]/f[2])),Jn(f,f,o.vcpc),g=Math.min(f[0],g),m=Math.max(f[0],m),v=Math.min(f[1],v),h=Math.max(f[1],h);s.setUniformf("dcxmin",g),s.setUniformf("dcxmax",m),s.setUniformf("dcymin",v),s.setUniformf("dcymax",h),s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",l.getParallelProjection());var b=t.currentInput.getExtent(),T=t.currentInput.getSpacing(),S=new Float64Array(3);In(S,(b[1]-b[0]+1)*T[0],(b[3]-b[2]+1)*T[1],(b[5]-b[4]+1)*T[2]),s.setUniform3f("vSpacing",T[0],T[1],T[2]),In(f,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(f,f),Jn(f,f,t.modelToView),s.setUniform3f("vOriginVC",f[0],f[1],f[2]);var C=t.currentInput.getIndexToWorld();Ia(t.idxToView,t.modelToView,C),Mo(t.idxNormalMatrix,o.normalMatrix,i.normalMatrix),Mo(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var x=On(S)/t.renderable.getSampleDistance();x>t.renderable.getMaximumSamplesPerRay()&&Tc("The number of steps required ".concat(Math.ceil(x)," 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=new Float64Array(3);if(In(P,1,1,1),Bn(P,P,S),s.setUniform3f("vVCToIJK",P[0],P[1],P[2]),s.setUniform3i("volumeDimensions",d[0],d[1],d[2]),!t.openGLRenderWindow.getWebgl2()){var w=t.scalarTexture.getVolumeInfo();s.setUniformf("texWidth",t.scalarTexture.getWidth()),s.setUniformf("texHeight",t.scalarTexture.getHeight()),s.setUniformi("xreps",w.xreps),s.setUniformi("xstride",w.xstride),s.setUniformi("ystride",w.ystride)}for(var O=new Float64Array(3),A=new Float64Array(3),M=0;M<6;++M){switch(M){case 1:In(O,-1,0,0),In(A,b[0],b[2],b[4]);break;case 2:In(O,0,1,0),In(A,b[1],b[3],b[5]);break;case 3:In(O,0,-1,0),In(A,b[0],b[2],b[4]);break;case 4:In(O,0,0,1),In(A,b[1],b[3],b[5]);break;case 5:In(O,0,0,-1),In(A,b[0],b[2],b[4]);break;default:In(O,1,0,0),In(A,b[1],b[3],b[5])}ea(O,O,t.idxNormalMatrix),Jn(A,A,t.idxToView);var I=-1*Xn(A,O);if(s.setUniform3f("vPlaneNormal".concat(M),O[0],O[1],O[2]),s.setUniformf("vPlaneDistance".concat(M),I),a.getProperty().getUseLabelOutline()){var R=t.currentInput.getWorldToIndex();s.setUniformMatrix("vWCtoIDX",R),Oa(t.projectionToWorld,o.wcpc),s.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var E=e.getRenderTargetSize();s.setUniformf("vpWidth",E[0]),s.setUniformf("vpHeight",E[1]);var D=e.getRenderTargetOffset();s.setUniformf("vpOffsetX",D[0]/E[0]),s.setUniformf("vpOffsetY",D[1]/E[1])}}switch(Oa(t.projectionToView,o.vcpc),s.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){case 1:case 2:case 3:var B=0,V=[];n.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),r=e.getIntensity();V[0]=t[0]*r,V[1]=t[1]*r,V[2]=t[2]*r,s.setUniform3fArray("lightColor".concat(B),V);var n=e.getDirection();In(O,n[0],n[1],n[2]),ea(O,O,o.normalMatrix),s.setUniform3f("lightDirectionVC".concat(B),O[0],O[1],O[2]);var a=[-.5*O[0],-.5*O[1],-.5*(O[2]-1)];s.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}}))}},e.setPropertyShaderParameters=function(e,r,n){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=n.getProperty(),s=t.scalarTexture.getComponents(),l=n.getProperty().getIndependentComponents();if(l&&s>=2)for(var c=0;c0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,r,n){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(r),o=[],i=[],s=t.renderable.getClippingPlanes(),l=s.length,c=0;c1.5&&(t._useSmallViewport=!0),t._animationRateSubscription||(t._animationRateSubscription=a.onAnimationFrameRateUpdate((function(){if(t.renderable.getAutoAdjustSampleDistances()){var e=a.getRecentAnimationFrameRate(),r=a.getDesiredUpdateRate()/e;(r>1.15||r<.85)&&(t._lastScale*=r),t._lastScale>400&&(t._lastScale=400),t._lastScale<1.5&&(t._lastScale=1.5)}else t._lastScale=t.renderable.getImageSampleDistance()*t.renderable.getImageSampleDistance();var n=t.openGLRenderWindow.getFramebufferSize();t._smallViewportWidth=Math.ceil(n[0]/Math.sqrt(t._lastScale)),t._smallViewportHeight=Math.ceil(n[1]/Math.sqrt(t._lastScale))}))),t._useSmallViewport){var o=t.openGLRenderWindow.getFramebufferSize();if(t._smallViewportHeight>o[1]&&(t._smallViewportHeight=o[1]),t._smallViewportWidth>o[0]&&(t._smallViewportWidth=o[0]),t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer();else{var i=t.framebuffer.getSize();i[0]===o[0]&&i[1]===o[1]||(t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var s=t.context;s.clearColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clear(s.COLOR_BUFFER_BIT),s.viewport(0,0,t._smallViewportWidth,t._smallViewportHeight),t.fvp=[t._smallViewportWidth/o[0],t._smallViewportHeight/o[1]]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(r,n),n.getProperty().getInterpolationType()===Ji.NEAREST?(t.scalarTexture.setMinificationFilter(Ll.NEAREST),t.scalarTexture.setMagnificationFilter(Ll.NEAREST)):(t.scalarTexture.setMinificationFilter(Ll.LINEAR),t.scalarTexture.setMagnificationFilter(Ll.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(r,n){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,r,n),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,r){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t._useSmallViewport){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 n=t.copyShader;t.copyVAO=Il.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(n,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("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 o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.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()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(r,n){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)):Sc("No input!")},e.computeBounds=function(r,n){e.getInput()?t.bounds=e.getInput().getBounds():St(t.Bounds)},e.updateBufferObjects=function(t,r){e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r)},e.getNeedToRebuildBufferObjects=function(r,n){return t.VBOBuildTime.getMTime()1?1:-1,E[3*D+2]=-1;var B=new Uint16Array(8);B[0]=3,B[1]=0,B[2]=1,B[3]=3,B[4]=3,B[5]=0,B[6]=3,B[7]=2;var V=qt.newInstance({numberOfComponents:3,values:E});V.setName("points");var L=qt.newInstance({numberOfComponents:1,values:B});t.tris.getCABO().createVBO(L,"polys",cl.SURFACE,{points:V,cellOffset:0})}t.VBOBuildTime.modified()}}}}var xc={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};var Pc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xc,r),Vs.extend(e,t,r),t.VBOBuildTime={},Z(t.VBOBuildTime,{mtime:0}),t.tris=Bl.newInstance(),t.scalarTexture=$l.newInstance(),t.opacityTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.jitterTexture=$l.newInstance(),t.jitterTexture.setWrapS(Vl.REPEAT),t.jitterTexture.setWrapT(Vl.REPEAT),t.framebuffer=yc.newInstance(),t.idxToView=Pa(new Float64Array(16)),t.idxNormalMatrix=xo(new Float64Array(9)),t.modelToView=Pa(new Float64Array(16)),t.projectionToView=Pa(new Float64Array(16)),t.projectionToWorld=Pa(new Float64Array(16)),t._lastScale=1,te(e,t,["context"]),Cc(e,t)}),"vtkOpenGLVolumeMapper");_s("vtkVolumeMapper",Pc);var wc=k;function Oc(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=n.getZBufferTexture(),c=Math.floor(l.getWidth()),u=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():wc("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(c*u*4),d.viewport(0,0,c,u),d.readPixels(0,0,c,u,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,r){e&&t.renderable.getUseZValues()&&r.requestDepth()}}var Ac={};var Mc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ac,r),Vs.extend(e,t,r),Oc(e,t)}),"vtkOpenGLPixelSpaceCallbackMapper");_s("vtkPixelSpaceCallbackMapper",Mc);var Ic=Object.create(null);function Rc(e,t){Ic[e]=t}function Ec(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}var Dc={};function Bc(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getProjectionMatrix=function(e,r,n,a){if(Pa(e),t.renderable.getParallelProjection()){var o=t.renderable.getParallelScale(),i=o*r,s=o,l=(a[0]-1)*i,c=(a[0]+1)*i,u=(a[1]-1)*s,d=(a[1]+1)*s,f=1/(c-l),p=1/(d-u);e[0]=2*f,e[5]=2*p,e[10]=1/(n[1]-n[0]),e[12]=(c+l)*f,e[13]=(d+u)*p,e[14]=n[1]/(n[1]-n[0])}else{var g,m,v=Math.tan(Math.PI*t.renderable.getViewAngle()/360);!0===t.renderable.getUseHorizontalViewAngle()?(g=n[0]*v,m=n[0]*v/r):(g=n[0]*v*r,m=n[0]*v);var h=(a[0]-1)*g,y=(a[0]+1)*g,b=(a[1]-1)*m,T=(a[1]+1)*m;e[0]=2*n[0]/(y-h),e[5]=2*n[0]/(T-b),e[12]=(h+y)/(y-h),e[13]=(b+T)/(T-b),e[10]=0,e[14]=n[0],e[11]=-1,e[15]=0}},e.convertToOpenGLDepth=function(e){if(t.renderable.getParallelProjection())return 1-e;var r=t.renderable.getClippingRangeByReference(),n=-r[0]/e;return.5*(n=(r[0]+r[1])/(r[1]-r[0])+2*r[0]*r[1]/(n*(r[1]-r[0])))+.5},e.getKeyMatrices=function(r){var n=r.getRenderable(),a=r.getParent();if(Math.max(a.getMTime(),e.getMTime(),n.getMTime(),t.renderable.getMTime(),r.getStabilizedTime())>t.keyMatrixTime.getMTime()){var o=t.renderable.getViewMatrix();Sa(t.keyMatrices.normalMatrix,o),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,o);var i=r.getStabilizedCenterByReference();Ra(t.keyMatrices.scvc,t.keyMatrices.wcvc,i);var s=r.getAspectRatio(),l=t.renderable.getClippingRangeByReference();e.getProjectionMatrix(t.keyMatrices.vcpc,s,l,t.renderable.getWindowCenterByReference()),Ia(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),Oa(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dc,r),t.overrides=Ic,Fs.extend(e,t,r),Ec(0,t)}),"vtkWebGPUViewNodeFactory");var Vc={keyMatrixTime:null,keyMatrices:null};var Lc=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,r),Vs.extend(e,t,r),t.keyMatrixTime={},fe.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},fe.setGet(e,t,["keyMatrixTime"]),Bc(e,t)}));function Nc(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=function(r){if(t.bindables.length===r.length){for(var n=!0,a=0;an?o:n}if(n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kc,r),fe.obj(e,t),t.bindables=[],t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),fe.setGet(e,t,["label","device","arrayInformation","sourceTime"]),Nc(e,t)}var Gc={newInstance:fe.newInstance(Fc),extend:Fc};function _c(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,r){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}}var Uc={device:null,handle:null};function Wc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uc,r),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["device","handle"]),_c(e,t)}var jc={newInstance:fe.newInstance(Wc,"vtkWebGPUShaderModule"),extend:Wc};function zc(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var r=e.getType(),n=e.getHash(),a=t._shaderModules.keys(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hc,r),t._shaderModules=new Map,fe.obj(e,t),fe.setGet(e,t,["device","window"]),zc(e,t)}fe.newInstance(Kc,"vtkWebGPUShaderCache");var Xc=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}};function qc(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e,r){t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;for(var n=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yc,r),Z(e,t),t.layouts=[],t.shaderDescriptions=[],Q(e,t,["handle","pipelineDescription"]),te(e,t,["device","renderEncoder","topology","vertexState"]),qc(e,t)}var Qc={newInstance:ie(Zc,"vtkWebGPUPipeline"),extend:Zc};function $c(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=function(e,r){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=function(e,r){t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=function(e,r){var n=[],a=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=e.getOutputInterpolationsByReference(),c=0;c1&&(o.push("};"),a=o,n[n.length-1]+=",",n.push("input: ".concat(t.type,"Input")))}if(n.length&&(t.code=Xc(t.code,"//VTK::IOStructs::Input",n).result),t.outputNames.length+t.builtinOutputNames.length){for(var d=["struct ".concat(t.type,"Output\n{")],f=0;f ".concat(t.type,"Output")]).result}t.code=Xc(t.code,"//VTK::IOStructs::Dec",a).result}}var Jc={type:null,hash:null,code:null,outputNames:null,outputTypes:null};function eu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jc,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],fe.obj(e,t),fe.setGet(e,t,["type","hash","code"]),fe.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),$c(e,t)}var tu={newInstance:fe.newInstance(eu,"vtkWebGPUShaderDescription"),extend:eu},ru={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"},r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}},nu=function(e){return!e||e.length<6?0:e in ru==1?ru[e]:(F("unknown format ".concat(e)),null)},au=function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var r=1===t?e.length-1:e.length-3,n=Number(e[r]);return Number.isNaN(n)?(F("unknown format ".concat(e)),0):t*(5-n/2)},ou=function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void F("unknown format ".concat(e));t="Uint"}var r=e.split("x")[0],n=Number(r[r.length-1]);if(!Number.isNaN(n))return(t+=8*(5-n/2))+"Array";F("unknown format ".concat(e))},iu=function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void F("unknown format ".concat(e));t="u32"}var r=1;return"x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r?"vec4<".concat(t,">"):3===r?"vec3<".concat(t,">"):2===r?"vec2<".concat(t,">"):t},su=function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},lu=function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void F("unknown format ".concat(e))};function cu(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"vertex",a=r;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0}))},e.removeBufferIfPresent=function(e){for(var r=0;r0&&(e+=",\n"),e="".concat(e," @location(").concat(r,") ").concat(t.inputs[n].names[a]," : ").concat(i),r++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var r=[],n=0,a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,du,r),Z(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],te(e,t,["created","device","handle"]),uu(e,t)}var pu={newInstance:ie(fu,"vtkWebGPUVertexInput"),extend:fu},gu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",mu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function vu(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(r,n,a){var o=tu.newInstance({type:"vertex",hash:r,code:t.vertexShaderTemplate}),i=tu.newInstance({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),s=n.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,c=new RegExp("//VTK::[^:]*::","g"),u=l.match(c).filter((function(e,t,r){return r.indexOf(e)===t})),d=u.map((function(e){return"replaceShader".concat(e.substring(7,e.length-2))})),f=0;f","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,r){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),r.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(r,n){e.build(r,n),r.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(r),e.renderForPipeline(r)},e.getBindables=function(){var e=f(t.additionalBindables);t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hu,r),fe.obj(e,t),t.textureViews=[],t.vertexInput=pu.newInstance(),t.bindGroup=Gc.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||mu,t.vertexShaderTemplate=t.vertexShaderTemplate||gu,t.shaderReplacements=new Map,fe.get(e,t,["vertexInput"]),fe.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),vu(e,t)}var bu={newInstance:fe.newInstance(yu,"vtkWebGPUMapperHelper"),extend:yu};function Tu(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var r=e.build;e.build=function(e,n){var a=n.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,r(e,n)}}var Su={};function Cu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Su,r),bu.extend(e,t,r),Tu(e,t)}var xu={newInstance:fe.newInstance(Cu,"vtkWebGPUFullScreenQuad"),extend:Cu},Pu={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,CellIndex:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function wu(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 Ou=["getMappedRange","mapAsync","unmap"];function Au(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=function(e){!function(e,t,r,n){var a=n.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(n)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,0,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=e.byteLength,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var r=function(r){e[Ou[r]]=function(){var e;return(e=t.handle)[Ou[r]].apply(e,arguments)}},n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mu,r),fe.obj(e,t),fe.get(e,t,["handle","sizeInBytes","usage"]),fe.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),Au(e,t)}var Ru=function(e){for(var t=1;t0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var r=0;r<3;r++)t.color[r]=e*(t.ambient*t.ambientColor[r]+t.diffuse*t.diffuseColor[r]+t.specular*t.specularColor[r]);return[].concat(t.color)},e.addShaderVariable=Vu("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(Bu.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(Bu.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(Bu.PHONG)},e.getInterpolationAsString=function(){return fe.enumToString(Bu,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Du.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Du.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Du.POINTS)},e.getRepresentationAsString=function(){return fe.enumToString(Du,t.representation)}}var Nu={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:Bu.GOURAUD,representation:Du.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function ku(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nu,r),fe.obj(e,t),fe.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),fe.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),Lu(e,t)}var Fu=function(e){for(var t=1;t1?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,r){return numPoints>2?3*(e-2):0}};function Ku(e){switch(e){case Wu.Points:return"points";case Wu.Lines:return"lines";case Wu.Triangles:case Wu.TriangleEdges:return"polys";case Wu.TriangleStripEdges:case Wu.TriangleStrips:return"strips";default:return""}}function Xu(e,t,r){var n=null;n=t===ju.POINTS||"points"===r?Hu.anythingToPoints:t===ju.WIREFRAME||"lines"===r?Hu["".concat(r,"ToWireframe")]:Hu["".concat(r,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zu,r),Z(e,t),te(e,t,["device"]),Yu(e,t)}var $u=_u(_u({newInstance:ie(Qu),extend:Qu},{}),Pu),Ju=$u.BufferUsage,ed=fe.vtkErrorMacro;function td(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,r){t._bufferEntryNames.has(e)?ed("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:su(r),offset:-1,nativeType:lu(r),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,r=[],n=4,a=0;a4&&(P.packed=!0,P.offset=e,r.push(P),e+=P.sizeInBytes)}for(var w=0;w ").concat(t.label,": ").concat(t.label,"Struct;")),a.join("\n")}}var rd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function nd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},fe.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,fe.get(e,t,["binding","bindGroupTime"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),td(e,t)}var ad={newInstance:fe.newInstance(nd,"vtkWebGPUUniformBuffer"),extend:nd},od=k;function id(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;t.camera=t.renderable.getActiveCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.camera),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),t.webgpuCamera=e.getViewNodeFor(t.camera),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.camera.getClippingRange(),r=t.camera.getPositionByReference(),n=[],a=[];Gn(a,t.camera.getDirectionOfProjectionByReference(),.5*(e[0]+e[1])),Rn(n,r,a),da(a,n,t.stabilizedCenter),va(a)/(e[1]-e[0])>t.recenterThreshold&&(t.stabilizedCenter=n,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(od("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,r){for(var n=0;nr||e.getMTime()>r||t.camera.getMTime()>r||t.renderable.getMTime()>r){var n=t.webgpuCamera.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",n.wcvc),t.UBO.setArray("SCPCMatrix",n.scpc),t.UBO.setArray("PCSCMatrix",n.pcsc),t.UBO.setArray("SCVCMatrix",n.scvc),t.UBO.setArray("VCPCMatrix",n.vcpc),t.UBO.setArray("WCVCNormals",n.normalMatrix);var a=e.getYInvertedTiledSizeAndOrigin();t.UBO.setArray("viewportSize",[a.usize,a.vsize]),t.UBO.setValue("cameraParallel",t.camera.getParallelProjection());var o=t.parent.getDevice();t.UBO.sendIfNeeded(o)}},e.scissorAndViewport=function(t){var r=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize,0,1),t.getHandle().setScissorRect(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var n=0;n = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n");var r=ad.newInstance({label:"mapperUBO"});r.addEntry("BackgroundColor","vec4"),t.clearFSQ.setUBO(r)}var n=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",n),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sd,r),Vs.extend(e,t,r),t.UBO=ad.newInstance({label:"rendererUBO"}),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("viewportSize","vec2"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=Gc.newInstance({label:"rendererBG"}),t.bindGroup.setBindables([t.UBO]),t.tmpMat4=Pa(new Float64Array(16)),t.stabilizedTime={},Z(t.stabilizedTime,{mtime:0}),Q(e,t,["bindGroup","stabilizedTime"]),re(e,t,["stabilizedCenter"]),te(e,t,["renderEncoder","selector","suppressClear","UBO"]),id(e,t)}),"vtkWebGPURenderer");Rc("vtkRenderer",ld);var cd=$u.BufferUsage,ud=fe.vtkErrorMacro;function dd(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,r){if(t._bufferEntryNames.has(e))ud("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var n=su(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:lu(r)}),t.sizeInBytes+=n}},e.send=function(e){if(!t._buffer){var r={nativeArray:t.Float32Array,time:0,usage:cd.Storage,label:t.label};return t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=fe.newTypedArray(e,t.arrayBuffer))},e.setValue=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else ud("entry named ".concat(r," not found in UBO"))},e.setArray=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT,c=0;c;\n};\n@binding(").concat(e,") @group(").concat(r,") var ").concat(t.label,": ").concat(t.label,"Struct;\n")),n.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}var fd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function pd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},fe.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},fe.get(e,t,["bindGroupTime"]),fe.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),dd(e,t)}var gd={newInstance:fe.newInstance(pd,"vtkWebGPUStorageBuffer"),extend:pd};function md(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=function(e,r){return"@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}var vd={device:null,handle:null,label:null,options:null};function hd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vd,r),fe.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","options"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label"]),md(e,t)}var yd={newInstance:fe.newInstance(hd),extend:hd},bd=$s,Td="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n\n // var computedColor: vec4 = vec4(1.0,0.7, 0.5, 1.0);\n\n//VTK::RenderEncoder::Impl\n\n return output;\n}\n",Sd=new Float64Array(16),Cd=new Float64Array(16),xd=new Float64Array(16),Pd=new Float64Array(4),wd=new Float64Array(4);function Od(e,t){t.classHierarchy.push("vtkWebGPUImageMapper"),e.buildPass=function(r){if(r){t.WebGPUImageSlice=e.getFirstAncestorOfType("vtkWebGPUImageSlice"),t.WebGPURenderer=t.WebGPUImageSlice.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice();var n=t.WebGPURenderer.getRenderable();t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(n.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.render=function(){t.renderable.update(),t.currentInput=t.renderable.getInputData(),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.build(t.renderEncoder,t.device),e.updateUBO(t.device)},e.computePipelineHash=function(){var e=t.currentInput.getExtent();e[0]===e[1]||e[2]===e[3]||e[4]===e[5]?(t.dimensions=2,t.pipelineHash="img2"):(t.dimensions=3,t.pipelineHash="img3")},e.updateUBO=function(r){var n=t.UBO.getSendTime(),a=t.WebGPUImageSlice.getRenderable(),o=a.getMapper();if(e.getMTime()>n||t.renderable.getMTime()>n||a.getProperty().getMTime()>n){var i=o.getInputData(),s=t.WebGPURenderer.getStabilizedCenterByReference();Pa(Sd),Ra(Sd,Sd,s);var l=a.getMatrix();wa(Cd,l),Oa(Cd,Cd),Ia(Sd,Cd,Sd);var c=i.getWorldToIndex();Ia(Sd,c,Sd),Oa(xd,Sd);var u=i.getDimensions();Pa(Cd),Ea(Cd,Cd,[1/u[0],1/u[1],1/u[2]]),Ia(Sd,Cd,Sd),t.UBO.setArray("SCTCMatrix",Sd);var d=t.currentInput.getExtent(),f=t.renderable.getClosestIJKAxis().ijkMode,p=t.renderable.getSlice();f!==t.renderable.getSlicingMode()&&(p=t.renderable.getSliceAtPosition(p));var g=2,m=0,v=1;f===bd.I?(g=0,m=1,v=2):f===bd.J&&(g=1,m=2,v=0),Pd[g]=p,Pd[m]=d[2*m],Pd[v]=d[2*v],Pd[3]=1,ri(Pd,Pd,xd),t.UBO.setArray("Origin",Pd),wd[g]=p,wd[m]=d[2*m+1],wd[v]=d[2*v],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis1",wd),wd[g]=p,wd[m]=d[2*m],wd[v]=d[2*v+1],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis2",wd);for(var h=[1,1,1,1],y=[0,0,0,0],b=t.helper.getTextureViews()[0],T=b.getTexture().getScale(),S=b.getTexture().getNumberOfComponents(),C=0;C","@builtin(position) Position");var o=a.getCode(),i=["var pos: vec4 = mapperUBO.Origin +"," (vertexBC.x * 0.5 + 0.5) * mapperUBO.Axis1 + (vertexBC.y * 0.5 + 0.5) * mapperUBO.Axis2;","pos.w = 1.0;"];2===t.dimensions?i.push("var tcoord : vec2 = (mapperUBO.SCTCMatrix * pos).xy;"):i.push("var tcoord : vec3 = (mapperUBO.SCTCMatrix * pos).xyz;"),i.push("output.tcoordVS = tcoord;","output.Position = rendererUBO.SCPCMatrix * pos;"),o=Xc(o,"//VTK::Position::Impl",i).result,a.setCode(o)},r.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,r,n){var a=r.getShaderDescription("vertex");2===t.dimensions?a.addOutput("vec2","tcoordVS"):a.addOutput("vec3","tcoordVS")},r.set("replaceShaderTCoord",e.replaceShaderTCoord),e.replaceShaderImage=function(e,r,n){var a=r.getShaderDescription("fragment"),o=a.getCode();t.dimensions,o=Xc(o,"//VTK::Image::Sample",[" var computedColor: vec4 ="," textureSampleLevel(imgTexture, clampSampler, input.tcoordVS, 0.0);","//VTK::Image::Sample"]).result,o=Xc(o,"//VTK::Image::Sample",[" var coord: vec2 ="," vec2(computedColor.r * mapperUBO.cScale.r + mapperUBO.cShift.r, 0.5);"," computedColor = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);"]).result,a.setCode(o)},r.set("replaceShaderImage",e.replaceShaderImage)}var Ad={rowLength:1024};var Md=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,r),Vs.extend(e,t,r),t.helper=xu.newInstance(),t.helper.setFragmentShaderTemplate(Td),t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("SCTCMatrix","mat4x4"),t.UBO.addEntry("Origin","vec4"),t.UBO.addEntry("Axis2","vec4"),t.UBO.addEntry("Axis1","vec4"),t.UBO.addEntry("cScale","vec4"),t.UBO.addEntry("cShift","vec4"),t.helper.setUBO(t.UBO),t.SSBO=gd.newInstance({label:"volumeSSBO"}),t.componentSSBO=gd.newInstance({label:"componentSSBO"}),t.lutBuildTime={},Z(t.lutBuildTime,{mtime:0}),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),t.VBOBuildTime={},Z(t.VBOBuildTime),Od(e,t)}),"vtkWebGPUImageMapper");function Id(e,t){t.classHierarchy.push("vtkWebGPUImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageMapper",Md);var Rd={bufferShift:void 0,keyMatrixTime:null,keyMatrices:null,propID:void 0};var Ed=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rd,r),Vs.extend(e,t,r),t.keyMatricesTime={},Z(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},t.bufferShift=[0,0,0,0],Q(e,t,["propID","keyMatricesTime"]),Id(e,t)}),"vtkWebGPUImageSlice");function Dd(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),t.renderable.getMapper().update(),e.removeUnusedNodes())},e.queryPass=function(r,n){if(r){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;n.addVolume(e)}};var r=new Float64Array(3),n=new Float64Array(3);e.getBoundingCubePoints=function(e,a){var o=t.renderable.getMapper().getInputData();if(o)for(var i=o.getExtent(),s=t.renderable.getMatrix(),l=0,c=4;c<6;c++){r[2]=i[c];for(var u=2;u<4;u++){r[1]=i[u];for(var d=0;d<2;d++){r[0]=i[d],o.indexToWorld(r,n);var f=a+3*l;e[f++]=s[0]*n[0]+s[1]*n[1]+s[2]*n[2]+s[3],e[f++]=s[4]*n[0]+s[5]*n[1]+s[6]*n[2]+s[7],e[f++]=s[8]*n[0]+s[9]*n[1]+s[10]*n[2]+s[11],l++}}}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();wa(t.keyMatrices.bcwc,r),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageSlice",Ed);var Bd={propID:void 0,keyMatricesTime:null};var Vd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bd,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),Dd(e,t)}),"vtkWebGPUVolume");function Ld(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}Rc("vtkVolume",Vd);var Nd={};var kd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nd,r),Vs.extend(e,t,r),Ld(e,t)}),"vtkWebGPUPixelSpaceCallbackMapper");function Fd(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(r){if(r){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 n=0;nt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?xo(t.keyMatrices.normalMatrix):(yo(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Po(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}Rc("vtkPixelSpaceCallbackMapper",kd);var Gd={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};var _d=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gd,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),Fd(e,t)}));function Ud(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(r){if(r){if(!t.renderable)return;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 n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wd,r),Vs.extend(e,t,r),te(e,t,["context"]),Q(e,t,["activeTextures"]),Ud(e,t)}));_s("vtkActor2D",jd);var zd=Math.sqrt(50),Hd=Math.sqrt(10),Kd=Math.sqrt(2);function Xd(e,t,r){var n=(t-e)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,a);return a>=0?(o>=zd?10:o>=Hd?5:o>=Kd?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=zd?10:o>=Hd?5:o>=Kd?2:1)}function qd(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function Yd(e){let t=e,r=e,n=e;function a(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<0?a=r+1:o=r}while(ae(t)-r,r=qd,n=(t,r)=>qd(e(t),r)),{left:a,center:function(e,r,n=0,o=e.length){const i=a(e,r,n,o-1);return i>n&&t(e[i-1],r)>-t(e[i],r)?i-1:i},right:function(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<=0?a=r+1:o=r}while(a>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Tf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Tf(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=cf.exec(e))?new xf(t[1],t[2],t[3],1):(t=uf.exec(e))?new xf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=df.exec(e))?Tf(t[1],t[2],t[3],t[4]):(t=ff.exec(e))?Tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pf.exec(e))?Af(t[1],t[2]/100,t[3]/100,1):(t=gf.exec(e))?Af(t[1],t[2]/100,t[3]/100,t[4]):mf.hasOwnProperty(e)?bf(mf[e]):"transparent"===e?new xf(NaN,NaN,NaN,0):null}function bf(e){return new xf(e>>16&255,e>>8&255,255&e,1)}function Tf(e,t,r,n){return n<=0&&(e=t=r=NaN),new xf(e,t,r,n)}function Sf(e){return e instanceof tf||(e=yf(e)),e?new xf((e=e.rgb()).r,e.g,e.b,e.opacity):new xf}function Cf(e,t,r,n){return 1===arguments.length?Sf(e):new xf(e,t,r,null==n?1:n)}function xf(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Pf(){return"#"+Of(this.r)+Of(this.g)+Of(this.b)}function wf(){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 Of(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Af(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new If(e,t,r,n)}function Mf(e){if(e instanceof If)return new If(e.h,e.s,e.l,e.opacity);if(e instanceof tf||(e=yf(e)),!e)return new If;if(e instanceof If)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(i=t===o?(r-n)/s+6*(r0&&l<1?0:i,new If(i,s,l,e.opacity)}function If(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Rf(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function Ef(e,t,r,n,a){var o=e*e,i=o*e;return((1-3*e+3*o-i)*t+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*n+i*a)/6}Jd(tf,yf,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:vf,formatHex:vf,formatHsl:function(){return Mf(this).formatHsl()},formatRgb:hf,toString:hf}),Jd(xf,Cf,ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new xf(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new xf(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:Pf,formatHex:Pf,formatRgb:wf,toString:wf})),Jd(If,(function(e,t,r,n){return 1===arguments.length?Mf(e):new If(e,t,r,null==n?1:n)}),ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new If(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new If(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new xf(Rf(e>=240?e-240:e+120,a,n),Rf(e,a,n),Rf(e<120?e+240:e-120,a,n),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+")")}}));const Df=e=>()=>e;function Bf(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Df(isNaN(e)?t:e)}const Vf=function e(t){var r=function(e){return 1==(e=+e)?Bf:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Df(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Cf(e)).r,(t=Cf(t)).r),a=r(e.g,t.g),o=r(e.b,t.b),i=Bf(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=a(t),e.b=o(t),e.opacity=i(t),e+""}}return n.gamma=e,n}(1);function Lf(e){return function(t){var r,n,a=t.length,o=new Array(a),i=new Array(a),s=new Array(a);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],i=n>0?e[n-1]:2*a-o,s=no&&(a=t.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(r=r[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,l.push({i,x:Ff(r,n)})),o=Uf.lastIndex;return ot&&(r=e,e=t,t=r),c=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?Qf:Zf,a=o=null,d}function d(t){return null==t||isNaN(t=+t)?r:(a||(a=n(i.map(e),s,l)))(e(c(t)))}return d.invert=function(r){return c(t((o||(o=n(s,i.map(e),Ff)))(r)))},d.domain=function(e){return arguments.length?(i=Array.from(e,Kf),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Hf,u()},d.clamp=function(e){return arguments.length?(c=!!e||qf,u()):c!==qf},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,u()}}()(qf,qf)}function ep(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var tp,rp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=rp.exec(e)))throw new Error("invalid format: "+e);var t;return new ap({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 ap(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 op(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ip(e){return(e=op(Math.abs(e)))?e[1]:NaN}function sp(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}np.prototype=ap.prototype,ap.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};const lp={"%":(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)=>sp(100*e,t),r:sp,s:function(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(tp=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=n.length;return o===i?n:o>i?n+new Array(o-i+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+op(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cp(e){return e}var up,dp,fp,pp=Array.prototype.map,gp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mp(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,a,o,i,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t0){let r=Math.round(e/i),n=Math.round(t/i);for(r*it&&--n,o=new Array(a=n-r+1);++st&&--n,o=new Array(a=n-r+1);++s=zd?a*=10:o>=Hd?a*=5:o>=Kd&&(a*=2),t0;){if((a=Xd(l,c,r))===n)return o[i]=l,o[s]=c,t(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a}n=a}return e},e}function vp(){var e=Jf();return e.copy=function(){return $f(e,vp())},ep.apply(e,arguments),mp(e)}function hp(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}up=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?cp:(t=pp.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var a=e.length,o=[],i=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(a-=s,a+s)),!((l+=s+1)>n));)s=t[i=(i+1)%t.length];return o.reverse().join(r)}),a=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?cp:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(pp.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=np(e)).fill,r=e.align,d=e.sign,f=e.symbol,p=e.zero,g=e.width,m=e.comma,v=e.precision,h=e.trim,y=e.type;"n"===y?(m=!0,y="g"):lp[y]||(void 0===v&&(v=12),h=!0,y="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===f?a:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",T="$"===f?o:/[%p]/.test(y)?l:"",S=lp[y],C=/[defgprs%]/.test(y);function x(e){var a,o,l,f=b,x=T;if("c"===y)x=S(e)+x,e="";else{var P=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),v),h&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),P&&0==+e&&"+"!==d&&(P=!1),f=(P?"("===d?d:c:"-"===d||"("===d?"":d)+f,x=("s"===y?gp[8+tp/3]:"")+x+(P&&"("===d?")":""),C)for(a=-1,o=e.length;++a(l=e.charCodeAt(a))||l>57){x=(46===l?i+e.slice(a+1):e.slice(a))+x,e=e.slice(0,a);break}}m&&!p&&(e=n(e,1/0));var w=f.length+e.length+x.length,O=w>1)+f+e+x+O.slice(w);break;default:e=O+f+e+x}return s(e)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),x.toString=function(){return e+""},x}return{format:d,formatPrefix:function(e,t){var r=d(((e=np(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(ip(t)/3))),a=Math.pow(10,-n),o=gp[8+n/3];return function(e){return r(a*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),dp=up.format,fp=up.formatPrefix;var yp=fe.vtkDebugMacro;function bp(e,t){t.classHierarchy.push("vtkActor");var r=function(e){for(var t=1;t=1;return(r=r&&(!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=Fu.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 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||r[0]!==t.mapperBounds[0]||r[1]!==t.mapperBounds[1]||r[2]!==t.mapperBounds[2]||r[3]!==t.mapperBounds[3]||r[4]!==t.mapperBounds[4]||r[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){yp("Recomputing bounds..."),t.mapperBounds=r.concat();var n=[];Hr.getCorners(r,n),e.computeMatrix();var a=new Float64Array(16);wa(a,t.matrix),n.forEach((function(e){return Jn(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?n.reduce((function(e,r){return e>r[t/2]?r[t/2]:e}),e):n.reduce((function(e,r){return ee?n: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 r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var Tp={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function Sp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tp,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),bp(e,t)}var Cp={newInstance:fe.newInstance(Sp,"vtkActor"),extend:Sp};function xp(e,t){e.getBounds=function(){return 0},e.getBounds=function(r){e.getBounds();for(var n=0;n<6;n++)r[n]=t.bounds[n]},e.getCenter=function(){e.getBounds();for(var r=0;r<3;r++)t.center[r]=(t.bounds[2*r+1]+t.bounds[2*r])/2;return t.center.slice()},e.getLength=function(){var r=0,n=0;e.getBounds();for(var a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return Math.sqrt(n)}}var Pp={bounds:[1,-1,1,-1,1,-1],center:[0,0,0]},wp=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,r),ys(e,t,r),t.bounds||St(t.bounds),t.center||(t.center=[0,0,0]),xp(e,t)},Op=fe.vtkErrorMacro;function Ap(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+1+1.5:(r=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(r,n,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var c=e.getAlpha(),u=r.getNumberOfTuples(),d=r.getNumberOfComponents(),f=n.getData(),p=r.getData();if(c>=1){if(a===hi.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Mp={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 Ip(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mp,r),Di.extend(e,t,r),t.table||(t.table=[]),t.buildTime={},fe.obj(t.buildTime),t.opaqueFlagBuildTime={},fe.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},fe.obj(t.insertTime,{mtime:0}),fe.get(e,t,["buildTime"]),fe.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),fe.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),Ap(e,t)}var Rp={newInstance:fe.newInstance(Ip,"vtkLookupTable"),extend:Ip},Ep=1,Dp=0,Bp=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Vp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Dp=e}var Lp={getResolveCoincidentTopologyAsString:function(){return Bp[Dp]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Ep},getResolveCoincidentTopology:function(){return Dp},setResolveCoincidentTopology:Vp,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Ep=e},setResolveCoincidentTopologyToDefault:function(){Vp(0)},setResolveCoincidentTopologyToOff:function(){Vp(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Vp(1)}};function Np(e,t,r){r.forEach((function(r){e["get".concat(r.method)]=function(){return t[r.key]},e["set".concat(r.method)]=function(e,n){t[r.key]={factor:e,offset:n}}}))}var kp=["Polygon","Line","Point"],Fp={};Np(Fp,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},kp.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var Gp={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),fe.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Lp).forEach((function(t){e[t]=Lp[t]})),Object.keys(Fp).forEach((function(t){e[t]=Fp[t]})),Np(e,t.topologyOffset,kp.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyPolygonOffsetParameters(),r=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyLineOffsetParameters(),r=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Fp.getResolveCoincidentTopologyPointOffsetParameters(),r=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}}},staticOffsetAPI:Fp,otherStaticMethods:Lp,CATEGORIES:kp};function _p(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}function Up(e){for(var t=1;t1e3?n=1e3:n<-1e3&&(n=-1e3)),{texCoordS:n,texCoordT:a}},e.createColorTextureCoordinates=function(t,r,n,a,o,i,s,l,c){var u=(i[1]-i[0])/l,d=[];d[0]=i[0]-u,d[1]=i[1]+u;var f=1/(d[1]-d[0]),p=r.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==n){t.lookupTable.setAlpha(n),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),c=new Float64Array(2*s),u=0;ut.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=r.getNumberOfComponents(),g=r.getNumberOfTuples();t.colorCoordinates=qt.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===Xp.MAGNITUDE&&r.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(r,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(r){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var n=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=n.scalars;return!(!a||n.cellFlag||t.colorMode===zp.DEFAULT&&a.getDataType()===qp.UNSIGNED_CHAR||t.colorMode===zp.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 r=t.lookupTable.getMTime();e=r>e?r: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=Yp("AcquireInvertibleLookupTable"),e.valueToColor=Yp("ValueToColor"),e.colorToValue=Yp("ColorToValue"),e.useInvertibleColorFor=Yp("UseInvertibleColorFor"),e.clearInvertibleColor=Yp("ClearInvertibleColor")}var Qp={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 $p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qp,r),wp(e,t,r),fe.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),fe.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Gp.implementCoincidentTopologyMethods(e,t),Zp(e,t)}var Jp=Up(Up(Up({newInstance:fe.newInstance($p,"vtkMapper"),extend:$p},Wp),jp),Ti);function eg(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}function tg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};qt.extend(e,t,og(r)),ag(e,t)}var sg=tg({newInstance:fe.newInstance(ig,"vtkCellArray"),extend:ig},ng),lg=fe.vtkErrorMacro,cg=[1,-1,1,-1,1,-1];function ug(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==r&&(t.size=r*n,t.values=fe.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(n),e.modified())},e.setPoint=function(e){for(var r=e*t.numberOfComponents,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dg,r),qt.extend(e,t,r),ug(e,t)}var pg={newInstance:fe.newInstance(fg,"vtkPoints"),extend:fg};function gg(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){t.pointsIds=r;var n=t.points.getData();n.length!==3*t.pointsIds.length&&(n=fe.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach((function(e,t){var r=3*e,o=3*t;n[o]=a[r],n[++o]=a[++r],n[++o]=a[++r]})),t.points.setData(n)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),r=[];if(e){t.points.getPoint(0,r),t.bounds[0]=r[0],t.bounds[1]=r[0],t.bounds[2]=r[1],t.bounds[3]=r[1],t.bounds[4]=r[2],t.bounds[5]=r[2];for(var n=1;nt.bounds[1]?r[0]:t.bounds[1],t.bounds[2]=r[1]t.bounds[3]?r[1]:t.bounds[3],t.bounds[4]=r[2]t.bounds[5]?r[2]:t.bounds[5]}else St(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var r=0,n=0,a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return r},e.getParametricDistance=function(e){for(var t,r=0,n=0;n<3;n++)(t=e[n]<0?-e[n]:e[n]>1?e[n]-1:0)>r&&(r=t);return r},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,r,n,a,o,i){},e.evaluatePosition=function(e,t,r,n,a,o){}}var mg={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function vg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mg,r),fe.obj(e,t),t.points||(t.points=pg.newInstance()),fe.get(e,t,["points","pointsIds"]),gg(e,t)}var hg={newInstance:fe.newInstance(vg,"vtkCell"),extend:vg};function yg(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(r){var n=r.getPoints().getNumberOfPoints(),a=r.getNumberOfCells(),o=new Uint32Array(n);if(r.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=r,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,r){t.array[e].cells[t.array[e].ncells++]=r},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,r){t.array[r].cells=t.array[r].cells.filter((function(t){return t!==e})),t.array[r].ncells=t.array[r].cells.length},e.addCellReference=function(e,r){t.array[r].cells[t.array[r].ncells++]=e},e.resizeCellList=function(e,r){t.array[e].cells.length=r},e.squeeze=function(){!function(e,t){var r=t;for(t>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=f(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bg,r),fe.obj(e,t),yg(e,t)}var Sg={newInstance:fe.newInstance(Tg,"vtkCellLinks"),extend:Tg},Cg=0,xg=1,Pg=2,wg=3,Og=4,Ag=5,Mg=6,Ig=7,Rg=9,Eg=21,Dg=41,Bg=42,Vg=["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 Lg(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 Ng={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]=Cg},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(t,Fg,r),fe.obj(e,t),fe.get(e,t,["size","maxId","extend"]),fe.getArray(e,t,["typeArray","locationArray"]),kg(e,t)}var _g=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=Ge(i,i),c=1e-5*s;return 0!==l&&(o.t=s/l),c<0&&(c=-c),-c1?n=r:(n=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=n[0],a[1]=n[1],a[2]=n[2]),o.distance=ze(n,e),o}function Kg(e,t,r,n,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=n[0]-r[0],s[1]=n[1]-r[1],s[2]=n[2]-r[2],l[0]=r[0]-e[0],l[1]=r[1]-e[1],l[2]=r[2]-e[2];var c=[];c[0]=[Ge(i,i),-Ge(i,s)],c[1]=[c[0][1],Ge(s,s)];var u=[];if(u[0]=Ge(i,l),u[1]=-Ge(s,l),0===ut(c,u,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,r,n],g=[r,r,e,e],m=[n,n,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Hg(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?zg.YES_INTERSECTION:zg.NO_INTERSECTION}var Xg={distanceToLine:Hg,intersection:Kg};function qg(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,r,n,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],c=[];t.points.getPoint(0,l),t.points.getPoint(1,c);var u,d=[],f=[],p=Kg(e,r,l,c,d,f);if(i.t=d[0],i.betweenPoints=(u=i.t)>=0&&u<=1,o[0]=f[0],p===zg.YES_INTERSECTION){for(var g=0;g<3;g++)a[g]=l[g]+o[0]*(c[g]-l[g]),s[g]=e[g]+i.t*(r[g]-e[g]);if(ze(a,s)<=n*n)return i.intersect=1,i}else{var m;if(i.t<0)return(m=Hg(e,l,c,a)).distance<=n*n?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(m=Hg(r,l,c,a)).distance<=n*n?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,m=Hg(l,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,m=Hg(c,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,r,n,a,o){}}var Yg={};function Zg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,r),hg.extend(e,t,r),qg(e,t)}var Qg=jg(jg({newInstance:fe.newInstance(Zg,"vtkLine"),extend:Zg},Xg),Ug);function $g(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=T(t.points):t.points=pg.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var r=e.shallowCopy;e.shallowCopy=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r(e,n),t.points=pg.newInstance(),t.points.shallowCopy(e.getPoints())}}var Jg={};function em(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,r),pn.extend(e,t,r),fe.setGet(e,t,["points"]),$g(e,t)}var tm={newInstance:fe.newInstance(em,"vtkPointSet"),extend:em};function rm(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}function nm(e,t,r,n){var a=r[0]-t[0],o=r[1]-t[1],i=r[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],c=e[2]-t[2];n[0]=o*c-i*l,n[1]=i*s-a*c,n[2]=a*l-o*s}function am(e,t,r,n){nm(e,t,r,n);var a=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==a&&(n[0]/=a,n[1]/=a,n[2]/=a)}var om={computeNormalDirection:nm,computeNormal:am};function im(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(r,n,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,c=[],u=[],d=[];t.points.getPoint(0,c),t.points.getPoint(1,u),t.points.getPoint(2,d);var f=[];if(am(c,u,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=cr.intersectWithLine(r,n,c,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=ze(c,u),v=ze(u,d),h=ze(d,c);t.line||(t.line=Qg.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,u)):v>h&&v>m?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,c));var y=t.line.intersectWithLine(r,n,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],S=[],C=0;C<3;C++)b[C]=c[C]-d[C],T[C]=u[C]-d[C],S[C]=o[C]-d[C];return i[0]=Ge(S,b)/h,i[1]=Ge(S,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,r,n,a){var o,i,s,l,c,u,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,S=[],C=[],x=[],P=[],w=[];f.subId=0,n[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),nm(p,g,m,v),cr.generalizedProjectPoint(e,p,v,w);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(S[i++]=o);for(o=0;o<2;o++)h[o]=w[S[o]]-m[S[o]],y[o]=p[S[o]]-m[S[o]],b[o]=g[S[o]]-m[S[o]];if(0===(l=qe(y,b)))return n[0]=0,n[1]=0,f.evaluation=-1,f;if(n[0]=qe(h,b)/l,n[1]=qe(y,h)/l,a[0]=1-(n[0]+n[1]),a[1]=n[0],a[2]=n[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)r&&(f.dist2=ze(w,e),r[0]=w[0],r[1]=w[1],r[2]=w[2]),f.evaluation=1;else{var A;if(r)if(a[1]<0&&a[2]<0)for(c=ze(e,m),u=Qg.distanceToLine(e,p,m,A,x),d=Qg.distanceToLine(e,m,g,A,P),c1?n[a]-1:0)>r&&(r=t);return r}}var sm={};function lm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sm,r),hg.extend(e,t,r),im(e,t)}var cm,um=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),dm.forEach((function(r){t[r]=sg.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))},e.buildCells=function(){var r=e.getNumberOfVerts(),n=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=r+n+a+o,s=new Uint8Array(i),l=s,c=new Uint32Array(i),u=c;if(r){var d=0;t.verts.getCellSizes().forEach((function(e,t){u[t]=d,l[t]=e>1?Pg:xg,d+=e+1})),u=u.subarray(r),l=l.subarray(r)}if(n){var f=0;t.lines.getCellSizes().forEach((function(e,t){u[t]=f,l[t]=e>2?Og:wg,1===e&&fm("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1})),u=u.subarray(n),l=l.subarray(n)}if(a){var p=0;t.polys.getCellSizes().forEach((function(e,t){switch(u[t]=p,e){case 3:l[t]=Ag;break;case 4:l[t]=Rg;break;default:l[t]=Ig}e<3&&fm("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1})),u+=u.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Mg,0,o),t.strips.getCellSizes().forEach((function(e,t){u[t]=g,g+=e+1}))}t.cells=_g.newInstance(),t.cells.setCellTypes(i,s,c)},e.buildLinks=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Sg.newInstance(),r>0?t.links.allocate(r):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var r=t.cells.getCellType(e),n=null;switch(r){case xg:case Pg:n=t.verts;break;case wg:case Og:n=t.lines;break;case Ag:case Rg:case Ig:n=t.polys;break;case Mg:n=t.strips;break;default:return n=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:r,cellPointIds:n.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,r,n){var a=t.links.getLink(r),o=t.links.getLink(n);return a.cells.filter((function(t){return t!==e&&-1!==o.cells.indexOf(t)}))},e.getCell=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.getCellPoints(t),a=r||pm[n.cellType].newInstance();return a.initialize(e.getPoints(),n.cellPointIds),a}}var mm={};function vm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mm,r),tm.extend(e,t,r),fe.get(e,t,["cells","links"]),fe.setGet(e,t,["verts","lines","polys","strips"]),gm(e,t)}var hm={newInstance:fe.newInstance(vm,"vtkPolyData"),extend:vm};function ym(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setJsImageData=function(r){t.jsImageData!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null),t.jsImageData=r,t.imageLoaded=!0,e.modified())},e.setCanvas=function(r){t.canvas!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.jsImageData=null),t.canvas=r,e.modified())},e.setImage=function(r){t.image!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.canvas=null,t.jsImageData=null),t.image=r,t.imageLoaded=!1,r.complete?e.imageLoaded():r.addEventListener("load",e.imageLoaded),e.modified())}}var bm={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,canvas:null,imageLoaded:!1,jsImageData:null};function Tm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,r),fe.obj(e,t),fe.algo(e,t,6,0),fe.get(e,t,["canvas","image","jsImageData","imageLoaded"]),fe.setGet(e,t,["repeat","edgeClamp","interpolate"]),ym(e,t)}var Sm={newInstance:fe.newInstance(Tm,"vtkTexture"),extend:Tm};function Cm(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}function xm(e){for(var t=1;t.5?Gn(Em,Bm,o[0]*i):Gn(Em,Bm,o[0]*i-l.width/2),Rn(Im,Im,Em),Gn(Em,Vm,o[1]*i-l.height/2),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[0],s.tcoords[2*f+1]=l.tcoords[1],f++,Gn(Em,Bm,l.width),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[2],s.tcoords[2*f+1]=l.tcoords[3],f++,Gn(Em,Vm,l.height),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[4],s.tcoords[2*f+1]=l.tcoords[5],f++,Gn(Em,Bm,l.width),En(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[6],s.tcoords[2*f+1]=l.tcoords[7],f++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-3,s.polys[4*p+3]=f-2,p++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-2,s.polys[4*p+3]=f-1,s.ptIdx+=4,s.cellIdx+=2}},e.updateTexturePolyData=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r);var n=t.renderable.getTextValues().length,a=4*n,o=2*n,i=new Float64Array(3*a),s=new Uint16Array(4*o),l=new Float32Array(2*a);Oa(Lm,r);for(var c={ptIdx:0,cellIdx:0,polys:s,points:i,tcoords:l},u=0,d=0,f=0,p=t.renderable.getTextPolyData().getPoints().getData(),g=t.renderable.getTextValues();u2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),fe.setGet(e,t,["renderable"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.lastTickBounds=[],km(e,t)}),"vtkCubeAxesActorHelper");function Gm(e,t){t.classHierarchy.push("vtkCubeAxesActor"),e.setCamera=function(r){t.camera!==r&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=r,r&&(t.cameraModifiedSub=r.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=function(){var e=t.camera.getViewMatrix();wa(e,e);for(var r=!1,n=Hr.getDiagonalLength(t.dataBounds),a=Math.sin(t.faceVisibilityAngle*Math.PI/180),o=0;o<6;o++){var i=!1,s=Math.floor(o/2),l=(s+1)%3,c=(s+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*c]!==t.dataBounds[2*c+1]&&(Im[s]=t.dataBounds[o]-.1*n*Pm[o][s],Im[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),Im[c]=.5*(t.dataBounds[2*c]+t.dataBounds[2*c+1]),Jn(Em,Im,e),Im[s]=t.dataBounds[o],Jn(Dm,Im,e),En(Em,Dm,Em),Kn(Em,Em),i=Em[2]>a,t.camera.getParallelProjection()||(Kn(Dm,Dm),i=Xn(Dm,Em)>a)),i!==t.lastFacesToDraw[o]&&(t.lastFacesToDraw[o]=i,r=!0)}return r},e.updatePolyData=function(e,r,n){var a=0,o=0;a+=8;for(var i=0,s=0;s<12;s++)r[s]>0&&i++;if(o+=i,t.gridLines)for(var l=0;l<6;l++)e[l]&&(a+=2*n[Mm[l][0]].length+2*n[Mm[l][1]].length,o+=n[Mm[l][0]].length+n[Mm[l][1]].length);for(var c=new Float64Array(3*a),u=new Uint32Array(3*o),d=0,f=0,p=0;p<2;p++)for(var g=0;g<2;g++)for(var m=0;m<2;m++)c[3*d]=t.dataBounds[m],c[3*d+1]=t.dataBounds[2+g],c[3*d+2]=t.dataBounds[4+p],d++;for(var v=0;v<12;v++)r[v]>0&&(u[3*f]=2,u[3*f+1]=Om[v][0],u[3*f+2]=Om[v][1],f++);if(t.gridLines)for(var h=0;h<6;h++)if(e[h]){for(var y=Math.floor(h/2),b=n[Mm[h][0]],T=0;T2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_m(r)),Cp.extend(e,t,r),t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.gridMapper=Jp.newInstance(),t.polyData=hm.newInstance(),t.gridMapper.setInputData(t.polyData),t.gridActor=Cp.newInstance(),t.gridActor.setMapper(t.gridMapper),t.gridActor.setProperty(e.getProperty()),t.gridActor.setParentProp(e),t.textPolyData=hm.newInstance(),fe.setGet(e,t,["axisTitlePixelOffset","faceVisibilityAngle","gridLines","tickLabelPixelOffset"]),fe.setGetArray(e,t,["dataBounds"],6),fe.setGetArray(e,t,["axisLabels"],3),fe.get(e,t,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","_tmAtlas","tickCounts","gridActor"]),Gm(e,t)}var Wm={newInstance:fe.newInstance(Um,"vtkCubeAxesActor"),extend:Um,newCubeAxesActorHelper:Fm};function jm(e,t){t.classHierarchy.push("vtkOpenGLCubeAxesActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var zm={};var Hm=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zm,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),jm(e,t)}),"vtkOpenGLCubeAxesActor");_s("vtkCubeAxesActor",Hm);var Km={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},Xm=Fu.Representation,qm=Fu.Shading,Ym=Jp.ScalarMode,Zm=$l.Filter,Qm=$l.Wrap,$m=F,Jm={type:"StartEvent"},ev={type:"EndEvent"};function tv(e,r){function n(e,t,r){return t.identity(r),e.reduce((function(e,r,n){return 0===n?r?t.copy(e,r):t.identity(e):r?t.multiply(e,e,r):e}),r)}r.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(t){t&&(r.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),r.openGLRenderer=r.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(t){t&&(r.haveSeenDepthRequest=!0,r.renderDepth=!0,e.render(),r.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=Km.Start;n= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=wl.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:$m("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(t,n,a){if(r.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=t.Vertex,i=t.Geometry,s=t.Fragment;r.lastBoundBO.getCABO().getNormalOffset()?(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=wl.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=wl.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=wl.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):r.haveCellNormals?(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=wl.substitute(s,"//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(),r.lastBoundBO.getPrimitiveType())===r.context.LINES?(s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//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),t.Vertex=o,t.Geometry=i,t.Fragment=s}},e.replaceShaderPositionVC=function(e,t,n){var a=e.Vertex,o=e.Geometry,i=e.Fragment;n.getProperty().getRepresentation()!==Xm.POINTS&&r.lastBoundBO.getPrimitiveType()!==Km.Points||(a=wl.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(n.getProperty().getPointSize(),".0;")],!1).result),r.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=wl.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=wl.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=wl.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,t,n){if(r.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(r.drawingEdges)return;a=wl.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=r.openGLActor.getActiveTextures(),l=2,c=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===r.context.TEXTURE_CUBE_MAP&&(c=3)),r.renderable.getColorTextureMap()&&(l=r.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),c=2),2===c){if(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,t,n){var a=e.Vertex,o=e.Fragment;if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes();a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[".concat(i,"];"),"varying float clipDistancesVSOutput[".concat(i,"];")]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[".concat(i,"];")]).result,o=wl.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,t){var n=null,a=t.getProperty();if(r.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===Xm.SURFACE){var o=r.lastBoundBO.getPrimitiveType();o===Km.Points||a.getRepresentation()===Xm.POINTS?n=r.renderable.getCoincidentTopologyPointOffsetParameter():o===Km.Lines||a.getRepresentation()===Xm.WIREFRAME?n=r.renderable.getCoincidentTopologyLineOffsetParameters():o!==Km.Tris&&o!==Km.TriStrips||(n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==Km.TrisEdges&&o!==Km.TriStripsEdges||((n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,n.offset/=2)}return n},e.replaceShaderPicking=function(e,t,r){var n=e.Fragment;n=wl.substitute(n,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,n=wl.substitute(n,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=n},e.replaceShaderValues=function(t,n,a){if(e.replaceShaderColor(t,n,a),e.replaceShaderNormal(t,n,a),e.replaceShaderLight(t,n,a),e.replaceShaderTCoord(t,n,a),e.replaceShaderPicking(t,n,a),e.replaceShaderClip(t,n,a),e.replaceShaderCoincidentOffset(t,n,a),e.replaceShaderPositionVC(t,n,a),r.haveSeenDepthRequest){var o=t.Fragment;o=wl.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=wl.substitute(o,"//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,t.Fragment=o}},e.getNeedToRebuildShaders=function(t,n,a){var o=0,i=0,s=t.getPrimitiveType(),l=r.currentInput,c=!1,u=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===qm.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===r.context.TRIANGLES||d&&!u||!f&&u?c=!0:f||g!==r.context.LINES||(c=!0),a.getProperty().getLighting()&&c){o=0;for(var m=n.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=r.lastBoundBO.getReferenceByName("lastLightComplexity"),T=r.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(r.lastBoundBO.set({lastLightComplexity:o},!0),r.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(r.lastHaveSeenDepthRequest!==r.haveSeenDepthRequest||0===t.getProgram()||t.getShaderSourceTime().getMTime()t.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){var o=r.lastBoundBO.getReferenceByName("lastLightComplexity");t.getProgram().isAttributeUsed("vertexMC")&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"vertexMC",t.getCABO().getVertexOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting vertexMC in shader VAO.")),t.getProgram().isAttributeUsed("normalMC")&&t.getCABO().getNormalOffset()&&o>0?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"normalMC",t.getCABO().getNormalOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting normalMC in shader VAO."):t.getVAO().removeAttributeArray("normalMC"),r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||$m("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||$m("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),t.getProgram().isAttributeUsed("scalarColor")&&t.getCABO().getColorComponents()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO().getColorBO(),"scalarColor",t.getCABO().getColorOffset(),t.getCABO().getColorBOStride(),r.context.UNSIGNED_BYTE,4,!0)||$m("Error setting scalarColor in shader VAO."):t.getVAO().removeAttributeArray("scalarColor"),t.getAttributeUpdateTime().modified()}if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes(),s=[],l=t.getCABO().getCoordShiftAndScaleEnabled()?t.getCABO().getInverseShiftAndScaleMatrix():null,c=l?Sa(r.tmpMat4,a.getMatrix()):a.getMatrix();l&&(wa(c,c),Ia(c,c,l),wa(c,c));for(var u=0;u0){var u=c.getColorByReference(),d=c.getIntensity();r.lightColor[0]=u[0]*d,r.lightColor[1]=u[1]*d,r.lightColor[2]=u[2]*d;var p=c.getDirection(),g=t.getActiveCamera().getViewMatrix(),m=f(p);c.lightTypeIsSceneLight()&&(m[0]=g[0]*p[0]+g[1]*p[1]+g[2]*p[2],m[1]=g[4]*p[0]+g[5]*p[1]+g[6]*p[2],m[2]=g[8]*p[0]+g[9]*p[1]+g[10]*p[2],We(m)),r.lightDirection[0]=m[0],r.lightDirection[1]=m[1],r.lightDirection[2]=m[2],r.lightHalfAngle[0]=-r.lightDirection[0],r.lightHalfAngle[1]=-r.lightDirection[1],r.lightHalfAngle[2]=1-r.lightDirection[2],We(r.lightDirection),o.setUniform3fArray("lightColor".concat(i),r.lightColor),o.setUniform3fArray("lightDirectionVC".concat(i),r.lightDirection),o.setUniform3fArray("lightHalfAngleVC".concat(i),r.lightHalfAngle),i++}}if(!(a<3)){var v=t.getActiveCamera().getViewMatrix();wa(v,v),i=0;for(var h=0;h0){var b=y.getTransformedPosition(),T=new Float64Array(3);Jn(T,b,v),o.setUniform3fArray("lightAttenuation".concat(i),y.getAttenuationValuesByReference()),o.setUniformi("lightPositional".concat(i),y.getPositional()),o.setUniformf("lightExponent".concat(i),y.getExponent()),o.setUniformf("lightConeAngle".concat(i),y.getConeAngle()),o.setUniform3fArray("lightPositionVC".concat(i),[T[0],T[1],T[2]]),i++}}}}},e.setCameraShaderParameters=function(e,o,i){var s=e.getProgram(),l=r.openGLCamera.getKeyMatrices(o),c=o.getActiveCamera(),u=r.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:r.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,r.tmpMat3)),d!==u&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",c.getParallelProjection()),s.setLastCameraMTime(u)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,t,n){var a=e.getProgram(),o=n.getProperty(),i=o.getOpacity(),s=r.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=r.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),c=r.drawingEdges?1:o.getAmbient(),u=r.drawingEdges?0:o.getDiffuse(),d=r.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",c),a.setUniformf("diffuse",u);var p=r.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.setUniformf("specular",d),a.isUniformUsed("ambientIntensityBF")){if(i=(o=n.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),c=o.getAmbient(),l=o.getDiffuseColor(),u=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",c),a.setUniformf("diffuseIntensityBF",u),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(t,n){r.primitiveIDOffset=0,r.openGLRenderer.getSelector()&&(r.openGLRenderer.getSelector().getCurrentPass(),r.openGLRenderer.getSelector().renderProp(n)),e.updateBufferObjects(t,n),r.renderable.getColorTextureMap()&&r.internalColorTexture.activate(),r.lastBoundBO=null},e.renderPieceDraw=function(t,n){var a=n.getProperty().getRepresentation(),o=r.context,i=n.getProperty().getEdgeVisibility()&&a===Xm.SURFACE;o.lineWidth(n.getProperty().getLineWidth());for(var s=Km.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=Km,t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16));for(var n=Km.Start;ne?r:e}return e},e.mapScalars=function(r,n){var a=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(a){var o="".concat(e.getMTime()).concat(a.getMTime()).concat(n);if(t.colorBuildString!==o){t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]);var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,t.fieldDataTupleId)),t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(n)}}else t.colorMapColors=null}}var uv={static:!1,lookupTable:null,scalarVisibility:!1,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,transformCoordinate:null,viewSpecificProperties:null,customShaderAttributes:[]};function dv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uv,r),ys(e,t,r),fe.get(e,t,["colorMapColors"]),fe.setGet(e,t,["arrayAccessMode","colorByArrayName","colorMode","lookupTable","renderTime","scalarMode","scalarVisibility","static","transformCoordinate","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),cv(e,t)}var fv={newInstance:fe.newInstance(dv,"vtkMapper2D"),extend:dv},pv=1,gv=ov.primTypes,mv=fv.ScalarMode,vv=F,hv={type:"StartEvent"},yv={type:"EndEvent"};function bv(e,r){r.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),e.buildPass=function(t){t&&(r.openGLActor2D=e.getFirstAncestorOfType("vtkOpenGLActor2D"),r.openGLRenderer=r.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.overlayPass=function(t){t&&e.render()},e.getShaderTemplate=function(e,t,n){var a=r.renderable.getViewSpecificProperties().OpenGL,o="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.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// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n";if(a){var i=a.VertexShaderCode;void 0!==i&&""!==i&&(o=i)}e.Vertex=o;var s="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.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\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n";if(a){var l=a.FragmentShaderCode;void 0!==l&&""!==l&&(s=l)}e.Fragment=s;var c="";if(a){var u=a.GeometryShaderCode;void 0!==u&&(c=u)}e.Geometry=c},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=gv.Start;nt.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||vv("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||vv("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),r.internalColorTexture&&t.getProgram().isUniformUsed("texture1")&&t.getProgram().setUniformi("texture1",r.internalColorTexture.getTextureUnit());var o=r.openGLActor2D.getActiveTextures();if(o)for(var i=0;i=u[0]?l[0]:u[0],d[1]=l[1]>=u[1]?l[1]:u[1],d[2]=l[2]>=u[2]?l[2]:u[2],d[3]=l[3]>=u[3]?l[3]:u[3],!(d[0]>=d[2]||d[1]>=d[3])){s.usize=Pe(s.usize*(d[2]-d[0])/(l[2]-l[0])),s.vsize=Pe(s.vsize*(d[3]-d[1])/(l[3]-l[1]));var f=r.openGLRenderer.getParent().getSize(),p=Pe(c[0]-(d[0]-l[0])*f[0]),g=Pe(c[1]-(d[1]-l[1])*f[1]),m=-p,v=-p+s.usize,h=-g,y=-g+s.vsize;m===v&&(v=m+1),h===y&&(y=h+1);var b,T,S,C=Pa(new Float64Array(16));C[0]=2/(v-m),C[5]=2/(y-h),C[3]=-1*(v+m)/(v-m),C[7]=-1*(y+h)/(y-h),C[10]=0,C[11]=a.getProperty().getDisplayLocation()===pv?-1:1,C[15]=1,wa(C,C),o.setUniformMatrix("WCVCMatrix",(b=[C,i],T=t,S=r.tmpMat4,T.identity(S),b.reduce((function(e,t,r){return 0===r?t?T.copy(e,t):T.identity(e):t?T.multiply(e,e,t):e}),S)))}},e.haveWideLines=function(e,t){return r.lastBoundBO===r.lines&&t.getProperty().getLineWidth()>1}}var Tv={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};var Sv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=gv,t.tmpMat4=Pa(new Float64Array(16));for(var n=gv.Start;n1?s.fontSize=Math.max(20*o,10):s.fontSize=Math.max(16*o,10);var l=e.updateTextureAtlas();e.setTopTitle(!1);var c=e.getBoxSizeByReference();if(e.getLastAspectRatio()>1){e.setTickLabelPixelOffset(.4*s.fontSize);var u=2*(l.tickWidth+e.getTickLabelPixelOffset())/r[0];e.setAxisTitlePixelOffset(.8*i.fontSize);var d=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[0];u+.4*d>2*l.titleWidth/r[0]?(e.setTopTitle(!0),c[0]=u+.4*d,e.setBoxPosition([.98-c[0],-.92])):(c[0]=u+1.4*d,e.setBoxPosition([.99-c[0],-.92])),c[1]=Math.max(1.2,Math.min(1.84/a,1.84))}else{e.setAxisTitlePixelOffset(2*s.fontSize),e.setTickLabelPixelOffset(.5*s.fontSize);var f=2*(l.tickHeight+e.getTickLabelPixelOffset())/r[1],p=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[1],g=2*l.tickWidth/r[0];c[0]=Math.min(1.9,Math.max(1.4,1.4*g*(e.getTicks().length+3))),c[1]=f+p,e.setBoxPosition([-.5*c[0],-.97])}e.recomputeBarSegments(l)}}function Vv(e,t){t.classHierarchy.push("vtkScalarBarActorHelper"),e.setRenderable=function(r){t.renderable!==r&&(t.renderable=r,t.barActor.setProperty(r.getProperty()),t.barActor.setParentProp(r),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),t.axisTextStyle=xv({},r.getAxisTextStyle()),t.tickTextStyle=xv({},r.getTickTextStyle()),e.modified())},e.updateAPISpecificData=function(r,n,a){t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0);var o=t.renderable.getScalarsToColors();if(o&&t.renderable.getVisibility()){if(t.barMapper.setLookupTable(o),t.camera=n,t.renderWindow=a,t.forceUpdate||Math.max(o.getMTime(),e.getMTime())>t.lastRebuildTime.getMTime()){var i=o.getMappingRange();t.lastTickBounds=f(i),t.barMapper.setScalarRange(t.lastTickBounds);var s=vp().domain([t.lastTickBounds[0],t.lastTickBounds[1]]);t.ticks=s.ticks(5);var l=s.tickFormat(5);if(t.tickstrings=t.ticks.map(l),t.renderable.getAutomated())t.renderable.getAutoLayout()(e);else{t.axisTextStyle=xv({},t.renderable.getAxisTextStyle()),t.tickTextStyle=xv({},t.renderable.getTickTextStyle()),t.barPosition=f(t.renderable.getBarPosition()),t.barSize=f(t.renderable.getBarSize()),t.boxPosition=f(t.renderable.getBoxPosition()),t.boxSize=f(t.renderable.getBoxSize()),t.axisTitlePixelOffset=t.renderable.getAxisTitlePixelOffset(),t.tickLabelPixelOffset=t.renderable.getTickLabelPixelOffset();var c=e.updateTextureAtlas();e.recomputeBarSegments(c)}t.forceViewUpdate=!0,t.lastRebuildTime.modified(),t.forceUpdate=!1}(t.forceViewUpdate||t.camera.getMTime()>t.lastRedrawTime.getMTime())&&(e.updatePolyDataForLabels(),e.updatePolyDataForBarSegments(),t.lastRedrawTime.modified(),t.forceViewUpdate=!1)}},e.updateTextureAtlas=function(){t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left";var e={},r=new Map,n=0,a=1;Dv(t.tmContext,t.axisTextStyle);var o=t.tmContext.measureText(t.renderable.getAxisLabel()),i={height:o.actualBoundingBoxAscent+2,startingHeight:a,width:o.width+2,textStyle:t.axisTextStyle};r.set(t.renderable.getAxisLabel(),i),a+=i.height,n=i.width,e.titleWidth=i.width,e.titleHeight=i.height,e.tickWidth=0,e.tickHeight=0,Dv(t.tmContext,t.tickTextStyle);for(var s=[].concat(f(t.tickstrings),["NaN","Below","Above"]),l=0;lt.boxSize[0];var r=2*e.tickHeight/t.lastSize[1],n=[1,1];if(t.vertical){var a=2*(e.tickWidth+t.tickLabelPixelOffset)/t.lastSize[0];if(t.topTitle){var o=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0]-a,t.barSize[1]=t.boxSize[1]-o}else{var i=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[0];t.barSize[0]=t.boxSize[0]-i-a,t.barSize[1]=t.boxSize[1]}t.barPosition[0]=t.boxPosition[0]+a,t.barPosition[1]=t.boxPosition[1],n[1]=r}else{var s=(2*e.tickWidth-8)/t.lastSize[0],l=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0],t.barPosition[0]=t.boxPosition[0],t.barSize[1]=t.boxSize[1]-l-r,t.barPosition[1]=t.boxPosition[1],n[0]=s}return n},e.recomputeBarSegments=function(r){var n,a,o,i,s=e.computeBarSize(r);t.barSegments=[];var l=[0,0],c=t.vertical?1:0,u=t.vertical?.01:.02;function d(e,r){t.barSegments.push({corners:[[].concat(l),[l[0]+s[0],l[1]],[l[0]+s[0],l[1]+s[1]],[l[0],l[1]+s[1]]],scalars:r,title:e}),l[c]+=s[c]+u}t.renderable.getDrawNanAnnotation()&&t.renderable.getScalarsToColors().getNanColor()&&d("NaN",[NaN,NaN,NaN,NaN]),t.renderable.getDrawBelowRangeSwatch()&&null!==(n=(a=t.renderable.getScalarsToColors()).getUseBelowRangeColor)&&void 0!==n&&n.call(a)&&d("Below",[-.1,-.1,-.1,-.1]);var f=null===(o=(i=t.renderable.getScalarsToColors()).getUseAboveRangeColor)||void 0===o?void 0:o.call(i);l[c]+=u;var p=s[c];s[c]=f?1-2*u-s[c]-l[c]:1-u-l[c],d("ticks",t.vertical?[0,0,.995,.995]:[0,.995,.995,0]),t.renderable.getDrawAboveRangeSwatch()&&f&&(s[c]=p,l[c]+=u,d("Above",[1.1,1.1,1.1,1.1]))},e.createPolyDataForOneLabel=function(e,r,n,a,o,i,s){var l=t._tmAtlas.get(e);if(l){var c=s.ptIdx,u=s.cellIdx;wv[0]=r[0],wv[1]=r[1],wv[2]=r[2],o[0]<-.5?Gn(Av,n,o[0]*i-l.width):o[0]>.5?Gn(Av,n,o[0]*i):Gn(Av,n,o[0]*i-l.width/2),Rn(wv,wv,Av),Gn(Av,a,o[1]*i-l.height/2),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[0],s.tcoords[2*c+1]=l.tcoords[1],c++,Gn(Av,n,l.width),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[2],s.tcoords[2*c+1]=l.tcoords[3],c++,Gn(Av,a,l.height),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[4],s.tcoords[2*c+1]=l.tcoords[5],c++,Gn(Av,n,l.width),En(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[6],s.tcoords[2*c+1]=l.tcoords[7],c++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-3,s.polys[4*u+3]=c-2,u++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-2,s.polys[4*u+3]=c-1,s.ptIdx+=4,s.cellIdx+=2}},e.updatePolyDataForLabels=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r),Oa(Ev,r);var n=t.lastSize;Av[0]=0,Av[1]=0,Av[2]=-.99,Jn(wv,Av,Ev),Av[0]+=.1,Jn(Ov,Av,Ev),En(Iv,Ov,wv),Av[0]-=.1,Av[1]+=.1,Jn(Ov,Av,Ev),En(Rv,Ov,wv);for(var a=0;a<3;a++)Iv[a]/=.05*n[0],Rv[a]/=.05*n[1];var o=t.tickstrings.length+t.barSegments.length,i=4*o,s=2*o,l=new Float64Array(3*i),c=new Uint16Array(4*s),u=new Float32Array(2*i),d={ptIdx:0,cellIdx:0,polys:c,points:l,tcoords:u},f=t.vertical?0:1,p=t.vertical?1:0,g=[0,1];t.vertical?(t.topTitle?(Av[0]=t.boxPosition[0]+.5*t.boxSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,[0,1],t.axisTitlePixelOffset,d)):(Av[0]=t.barPosition[0]+t.barSize[0],Av[1]=t.barPosition[1]+.5*t.barSize[1],Jn(wv,Av,Ev),Gn(Iv,Iv,-1),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Rv,Iv,[0,-1],t.axisTitlePixelOffset,d),Gn(Iv,Iv,-1)),g=[-1,0]):(Av[0]=t.barPosition[0]+.5*t.barSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,g,t.axisTitlePixelOffset,d)),Mv[2]=-.99,Mv[f]=t.barPosition[f]+(.5*g[f]+.5)*t.barSize[f],Mv[p]=t.barPosition[p]+.5*t.barSize[p];for(var m=null,v=0;v2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),fe.setGet(e,t,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","barActor","tmActor","ticks"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.barMapper=Jp.newInstance(),t.barMapper.setInterpolateScalarsBeforeMapping(!0),t.polyData=hm.newInstance(),t.barMapper.setInputData(t.polyData),t.barActor=Cp.newInstance(),t.barActor.setMapper(t.barMapper),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.barPosition=[0,0],t.barSize=[0,0],t.boxPosition=[.88,-.92],t.boxSize=[.1,1.1],t.lastTickBounds=[],Vv(e,t)}),"vtkScalarBarActorHelper");function Nv(e,t){t.classHierarchy.push("vtkScalarBarActor"),e.setTickTextStyle=function(r){t.tickTextStyle=xv(xv({},t.tickTextStyle),r),e.modified()},e.setAxisTextStyle=function(r){t.axisTextStyle=xv(xv({},t.axisTextStyle),r),e.modified()},e.resetAutoLayoutToDefault=function(){t.autoLayout=Bv(0,t)}}function kv(e){return xv({automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif"},drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0},e)}function Fv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv(r)),t.autoLayout||(t.autoLayout=Bv(0,t)),Cp.extend(e,t,r),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),fe.setGet(e,t,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch"]),fe.get(e,t,["axisTextStyle","tickTextStyle"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),Nv(e,t)}var Gv={newInstance:fe.newInstance(Fv,"vtkScalarBarActor"),extend:Fv,newScalarBarActorHelper:Lv};function _v(e,t){t.classHierarchy.push("vtkOpenGLScalarBarActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var Uv={};var Wv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),_v(e,t)}),"vtkOpenGLScalarBarActor");_s("vtkScalarBarActor",Wv);var jv=F;function zv(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(r){if(r){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 n=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(n.getActiveCamera())}},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOpaqueActorCount()}},e.opaquePass=function(r,n){if(r&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.context.depthMask(!0),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var o=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(o),s=new Float64Array(16);if(Oa(s,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),"box"===t.lastFormat){var l=o.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),r=0;r<4;r++)e[3*r]=r%2*2-1,e[3*r+1]=r>1?1:-1,e[3*r+2]=1;var n=qt.newInstance({numberOfComponents:3,values:e});n.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 o=qt.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",cl.SURFACE,{points:n,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)||jv("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||jv("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var Hv={context:null};var Kv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hv,r),Vs.extend(e,t,r),t.openGLTexture=$l.newInstance(),t.tris=Bl.newInstance(),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),zv(e,t)}));function Xv(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}_s("vtkSkybox",Kv);var qv={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};var Yv=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],Xv(e,t)}));function Zv(e,t){t.classHierarchy.push("vtkWebGPUCubeAxesActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,a=t.WebGPURenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.WebGPURenderWindow.getRenderable())}}}Rc("vtkActor",Yv);var Qv={};var $v=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),Zv(e,t)}),"vtkWebGPUCubeAxesActor");Rc("vtkCubeAxesActor",$v);var Jv=$u.BufferUsage,eh=$u.PrimitiveTypes,th=Fu.Representation,rh=Jp.ScalarMode,nh={type:"StartEvent"},ah={type:"EndEvent"},oh="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",ih="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::Position::Impl\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function sh(e){return e.indexOf("edge")>=0}function lh(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(r){r&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var r=t.WebGPUActor.getRenderable().getProperty(),n=t.UBO.getSendTime();if(e.getMTime()>n||r.getMTime()>n||t.renderable.getMTime()>n){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=r.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",r.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",r.getDiffuse()),o=r.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",r.getSpecular()),t.UBO.setValue("SpecularPower",r.getSpecularPower()),o=r.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),o=r.getEdgeColorByReference(),t.UBO.setArray("EdgeColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",r.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(nh),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(ah),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();sh(e)?(n.addBuiltinInput("u32","@builtin(instance_index) instanceIndex"),a=Xc(a,"//VTK::Position::Impl",[" var tmpPos: vec4 = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"," var tmpPos2: vec3 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 1.4*(f32(input.instanceIndex % 2u) - 0.5)/rendererUBO.viewportSize.x;"," tmpPos2.y = tmpPos2.y + 1.4*(f32(input.instanceIndex / 2u) - 0.5)/rendererUBO.viewportSize.y;"," tmpPos2.z = tmpPos2.z + 0.00001;"," output.Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"]).result):a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var n=t.getShaderDescription("vertex");n.addOutput("vec3","normalVC");var a=n.getCode();a=Xc(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,r){var n=t.getShaderDescription("fragment"),a=n.getCode();a.includes("var normal")?(a=Xc(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a)):(a=Xc(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a))},e.replaceShaderColor=function(e,t,r){if(sh(e)){var n=t.getShaderDescription("fragment"),a=n.getCode();return a=Xc(a,"//VTK::Color::Impl",["ambientColor = mapperUBO.EdgeColor;","diffuseColor = mapperUBO.EdgeColor;"]).result,void n.setCode(a)}if(r.hasAttribute("colorVI")){var o=t.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,o.setCode(i);var s=t.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}},e.replaceShaderTCoord=function(e,r,n){if(n.hasAttribute("tcoord")){var a=r.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=Xc(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=r.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=Xc(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("fragment"),a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,n.setCode(a)}},e.getUsage=function(e,t){return e===th.POINTS||t===eh.Points?Jv.Verts:t===eh.Lines?Jv.Lines:e===th.WIREFRAME?t===eh.Triangles?Jv.LinesFromTriangles:Jv.LinesFromStrips:t===eh.Triangles?Jv.Triangles:t===eh.TriangleStrips?Jv.Strips:t===eh.TriangleEdges?Jv.LinesFromTriangles:Jv.LinesFromStrips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case Jv.Triangles:return"triangle-list";case Jv.Verts:return"point-list";case Jv.Lines:default:return"line-list"}},e.buildVertexInput=function(r,n,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=!1;a===eh.TriangleEdges&&(s=!0,o=th.WIREFRAME);var l=t.primitives[a].getVertexInput(),c="R".concat(o,"P").concat(a),u=r.getPoints();if(u){var d=t.WebGPUActor.getBufferShift(t.WebGPURenderer),f={owner:u,usage:Jv.PointArray,format:"float32x4",time:Math.max(u.getMTime(),n.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),hash:c,dataArray:u,cells:n,primitiveType:a,representation:o,shift:d,packExtra:!0},p=i.getBufferManager().getBuffer(f);l.addBuffer(p,["vertexBC"])}else l.removeBufferIfPresent("vertexBC");var g=e.getUsage(o,a);if(g===Jv.Triangles||g===Jv.Strips){var m=r.getPointData().getNormals(),v={format:"snorm8x4",hash:c,cells:n,representation:o,primitiveType:a,packExtra:!0,shift:0,scale:127};if(m){v.owner=m,v.dataArray=m,v.time=Math.max(m.getMTime(),n.getMTime()),v.usage=Jv.PointArray;var h=i.getBufferManager().getBuffer(v);l.addBuffer(h,["normalMC"])}else if(a===eh.Triangles){v.owner=u,v.dataArray=u,v.time=Math.max(u.getMTime(),n.getMTime()),v.usage=Jv.NormalsFromPoints;var y=i.getBufferManager().getBuffer(v);l.addBuffer(y,["normalMC"])}else l.removeBufferIfPresent("normalMC")}else l.removeBufferIfPresent("normalMC");var b=!1;if(t.renderable.getScalarVisibility()){var T=t.renderable.getColorMapColors();if(T&&!s){var S=t.renderable.getScalarMode(),C=!1;S!==rh.USE_CELL_DATA&&S!==rh.USE_CELL_FIELD_DATA&&S!==rh.USE_FIELD_DATA&&r.getPointData().getScalars()||S===rh.USE_POINT_FIELD_DATA||!T||(C=!0);var x={owner:T,usage:Jv.PointArray,format:"unorm8x4",time:Math.max(T.getMTime(),n.getMTime(),u.getMTime()),hash:c+C,dataArray:T,cells:n,primitiveType:a,representation:o,cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(x);l.addBuffer(P,["colorVI"]),b=!0}}b||l.removeBufferIfPresent("colorVI");var w=null;if((w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():r.getPointData().getTCoords())&&!s){var O={owner:w,usage:Jv.PointArray,format:"float32x2",time:Math.max(w.getMTime(),n.getMTime()),hash:c,dataArray:w,cells:n,primitiveType:a,representation:o},A=i.getBufferManager().getBuffer(O);l.addBuffer(A,["tcoord"])}else l.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],r=[],n=t.renderable.getColorTextureMap();n&&(t.colorTexture||(t.colorTexture=Sm.newInstance({label:"polyDataColor"})),t.colorTexture.setInputData(n),r.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(r,n,a){var o="pd";return a?o+="edge":(r.hasAttribute("normalMC")&&(o+="n"),r.hasAttribute("colorVI")&&(o+="c"),r.hasAttribute("tcoord")&&(o+="t"),t.textures.length&&(o+="tx".concat(t.textures.length))),t.SSBO&&(o+="ssbo"),(o+=e.getHashFromUsage(n))+t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var r=t.currentInput,n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(r,1),e.updateTextures();for(var o=t.WebGPUActor.getRenderable(),i=o.getProperty().getRepresentation(),s=o.getProperty().getEdgeVisibility(),l=eh.Points;l<=eh.Triangles;l++)if(n[l].getNumberOfValues()>0){var c=e.getUsage(i,l),u=t.primitives[l];e.buildVertexInput(t.currentInput,n[l],l),u.setPipelineHash(e.computePipelineHash(u.getVertexInput(),c,!1)),u.setTextureViews(t.textureViews),u.setWebGPURenderer(t.WebGPURenderer),u.setNumberOfInstances(1);var d=u.getVertexInput().getBuffer("vertexBC");if(u.setNumberOfVertices(d.getSizeInBytes()/d.getStrideInBytes()),u.setTopology(e.getTopologyFromUsage(c)),u.build(t.renderEncoder,a),u.registerToDraw(),s&&i===th.SURFACE&&l===eh.Triangles){var f=t.primitives[eh.TriangleEdges],p=e.getUsage(i,eh.TriangleEdges);e.buildVertexInput(t.currentInput,n[eh.Triangles],eh.TriangleEdges),f.setPipelineHash(e.computePipelineHash(f.getVertexInput(),p,!0)),f.setWebGPURenderer(t.WebGPURenderer),f.setNumberOfInstances(4);var g=f.getVertexInput().getBuffer("vertexBC");f.setNumberOfVertices(g.getSizeInBytes()/g.getStrideInBytes()),f.setTopology(e.getTopologyFromUsage(p)),f.build(t.renderEncoder,a),f.registerToDraw()}}},e.setShaderReplacement=function(e,r){for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ch,r),Vs.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||ih,t.vertexShaderTemplate=t.vertexShaderTemplate||oh,t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("EdgeColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),Q(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),te(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],lh(e,t);for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gh,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),ph(e,t)}),"vtkWebGPUScalarBarActor");function vh(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,r){t.texture=e,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;var n=nu(t.texture.getFormat());t.bindGroupLayoutEntry.texture.sampleType=n.sampleType},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,r){var n="f32";"sint"===t.bindGroupLayoutEntry.texture.sampleType?n="i32":"uint"===t.bindGroupLayoutEntry.texture.sampleType&&(n="u32");var a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_").concat(t.options.dimension,"<").concat(n,">;");return"depth"===t.bindGroupLayoutEntry.texture.sampleType&&(a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_depth_").concat(t.options.dimension,";")),a},e.addSampler=function(r,n){var a=yd.newInstance({label:"".concat(t.label,"Sampler")});a.create(r,n),e.setSampler(a)},e.getBindGroupTime=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.bindGroupTime},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}Rc("vtkScalarBarActor",mh);var hh={texture:null,handle:null,sampler:null,label:null};function yh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hh,r),fe.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","texture"]),fe.setGet(e,t,["bindGroupLayoutEntry","label","sampler"]),vh(e,t)}var bh={newInstance:fe.newInstance(yh),extend:yh},Th=$u.BufferUsage;function Sh(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,r){t.device=e,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1;var n=1===t.depth?"2d":"3d";t.format=r.format?r.format:"rgba8unorm",t.usage=r.usage?r.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label,dimension:n})},e.assignFromHandle=function(e,r,n){t.device=e,t.handle=r,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1,t.format=n.format?n.format:"rgba8unorm",t.usage=n.usage?n.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){if(e.canvas)return t.device.getHandle().queue.copyExternalImageToTexture({source:e.canvas,flipY:e.flip},{texture:t.handle,premultipliedAlpha:!0},[t.width,t.height,t.depth]),void(t.ready=!0);e.jsImageData&&!e.nativeArray&&(e.width=e.jsImageData.width,e.height=e.jsImageData.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.nativeArray=e.jsImageData.data);var r=nu(t.format),n=t.width*r.stride;if(e.nativeArray){var a={usage:Th.Texture};e.dataArray&&(a.dataArray=e.dataArray,a.time=e.dataArray.getMTime()),a.nativeArray=e.nativeArray;var o=e.nativeArray.length/(t.height*t.depth)*e.nativeArray.BYTES_PER_ELEMENT,i=2===r.elementSize&&"float"===r.sampleType;if(i||o%256){for(var s=e.nativeArray,l=o/s.BYTES_PER_ELEMENT,c=r.elementSize,u=256*Math.floor((l*c+255)/256),d=u/c,f=fe.newTypedArray(i?"Uint16Array":s.constructor.name,d*t.height*t.depth),p=0;p2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&r===t.height&&n===t.depth||(t.width=e,t.height=r,t.depth=n,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.createView=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.dimension||(n.dimension=1===t.depth?"2d":"3d");var a=bh.newInstance({label:r});return a.create(e,n),a}}var Ch={device:null,handle:null,buffer:null,ready:!1,label:null};function xh(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Ph(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xh(o,n,a,i,s,"next",e)}function s(e){xh(o,n,a,i,s,"throw",e)}i(void 0)}))}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ch,r),fe.obj(e,t),fe.get(e,t,["handle","ready","width","height","depth","format","usage"]),fe.setGet(e,t,["device","label"]),Sh(e,t)}));var wh=r(757),Oh=r.n(wh),Ah={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function Mh(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=Ph(Oh().mark((function e(t,r,n,a,o){return Oh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,r,n,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=Ph(Oh().mark((function t(r,n,a,o,i){var s;return Oh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(r,n,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(n,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)})));return function(e,r,n,a,o){return t.apply(this,arguments)}}()}var Ih={fieldAssociation:pn.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function Rh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ih,r),fe.obj(e,t),fe.setGet(e,t,["fieldAssociation","captureZValues"]),Mh(e,t)}var Eh={newInstance:fe.newInstance(Rh,"vtkHardwareSelector"),extend:Rh};function Dh(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}function Bh(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}var Vh={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function Lh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vh,r),fe.obj(e,t),t.properties={},fe.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Bh(e,t)}var Nh=function(e){for(var t=1;te.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=zh(o[0],o[1],e.pixBuffer[Fh.ACTOR_PASS],e.area);if(i<=0||i-1>=e.props.length)return null;var s={valid:!0};s.propID=i-1,s.prop=e.props[s.propID];var l=zh(o[0],o[1],e.pixBuffer[Fh.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-1,e.captureZValues){var c=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[c]+e.zBuffer[c+1])/65535,s.displayPosition=t}return s}var u=[t[0],t[1]],d=[0,0],f=Hh(e,t,0,n);if(f&&f.valid)return f;for(var p=1;pp?u[1]-p:0;g<=u[1]+p;++g){if(d[1]=g,u[0]>=p&&(d[0]=u[0]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[0]=u[0]+p,(f=Hh(e,d,0,n))&&f.valid)return f}for(var m=u[0]>=p?u[0]-(p-1):0;m<=u[0]+(p-1);++m){if(d[0]=m,u[1]>=p&&(d[1]=u[1]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[1]=u[1]+p,(f=Hh(e,d,0,n))&&f.valid)return f}}return n[0]=t[0],n[1]=t[1],null}function Kh(e,t,r,n,a){var o=[],i=0;return t.forEach((function(t,s){var l=Nh.newInstance();switch(l.setContentType(Gh.INDICES),e){case Uh.FIELD_ASSOCIATION_CELLS:l.setFieldType(_h.CELL);break;case Uh.FIELD_ASSOCIATION_POINTS:l.setFieldType(_h.POINT);break;default:Wh("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,r&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,n)),l.setSelectionList(t.attributeIDs),o[i]=l,i++})),o}function Xh(e,t,r,n,a){for(var o=Math.floor(t),i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=new Map,u=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Hh(e,[f,d],0,u);if(p&&p.valid){var g=jh(p);if(c.has(g)){var m=c.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(r){t.currentPass===Fh.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+1),t.props.push(r))},e.renderCompositeIndex=function(r){t.currentPass===Fh.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(r+1)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return fe.enumToString(Fh,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(r,n,a){var o=n<0?0:n;if(0===o){if(a[0]=r[0],a[1]=r[1],r[0]t.area[2]||r[1]t.area[3])return null;var i=[r[0]-t.area[0],r[1]-t.area[1]],s=zh(i[0],i[1],t.pixBuffer[Fh.ACTOR_PASS],t.area);if(s<=0||s-1>=t.props.length)return null;var l={valid:!0};l.propID=s-1,l.prop=t.props[l.propID];var c=zh(i[0],i[1],t.pixBuffer[Fh.COMPOSITE_INDEX_PASS],t.area);if((c<0||c>16777215)&&(c=0),l.compositeID=c-1,t.captureZValues){var u=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[u]+t.zBuffer[u+1])/65535,l.displayPosition=r}return l}var d=[r[0],r[1]],f=[0,0],p=e.getPixelInformation(r,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=r[0],a[1]=r[1],null},e.generateSelection=function(r,n,a,o){for(var i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=Math.floor(o),u=new Map,d=[0,0],f=s;f<=c;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=jh(m);if(u.has(v)){var h=u.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yh,r),Eh.extend(e,t,r),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),fe.setGetArray(e,t,["area"],4),fe.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),fe.setGetArray(e,t,["propColorValue"],3),fe.event(e,t,"event"),qh(e,t)}var Qh=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}r.replaceShaderNormal(e,n,a)},e.replaceShaderColor=function(e,n,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),c=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(c=c.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(c=c.concat(["varying vec4 vertexColorVSOutput;"]),o=wl.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=wl.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=wl.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=wl.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=wl.substitute(s,"//VTK::Color::Impl",u).result,s=wl.substitute(s,"//VTK::Color::Dec",c).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}r.replaceShaderColor(e,n,a)},e.replaceShaderPositionVC=function(e,n,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}r.replaceShaderPositionVC(e,n,a)},e.replaceShaderPicking=function(e,n,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=wl.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=wl.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=wl.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=wl.substitute(o,"//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=o}else r.replaceShaderPicking(e,n,a)},e.updateGlyphShaderParameters=function(r,n,a,o,i,s,l,c){var u=a.getProgram();if(r){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],S=d[6],C=d[7],x=d[8],P=f[p],w=f[p+1],O=f[p+2],A=f[p+3],M=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=P*m+w*y+O*S,g[1]=P*v+w*b+O*C,g[2]=P*h+w*T+O*x,g[3]=A*m+M*y+I*S,g[4]=A*v+M*b+I*C,g[5]=A*h+M*T+I*x,g[6]=R*m+E*y+D*S,g[7]=R*v+E*b+D*C,g[8]=R*h+E*T+D*x,u.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),u.setUniformMatrix("MCPCMatrix",t.tmpMat4),n&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),u.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var B=o.getData();t.tmpColor[0]=B[4*l]/255,t.tmpColor[1]=B[4*l+1]/255,t.tmpColor[2]=B[4*l+2]/255,u.setUniform3fArray("ambientColorUniform",t.tmpColor),u.setUniform3fArray("diffuseColorUniform",t.tmpColor)}c&&u.setUniform3fArray("mapperIndex",c.getPropColorValue())},e.renderPieceDraw=function(r,n){var a=n.getProperty().getRepresentation(),o=t.context,i=n.getProperty().getEdgeVisibility()&&a===ey.SURFACE,s=t.openGLCamera.getKeyMatrices(r),l=t.openGLActor.getKeyMatrices();Mo(t.normalMatrix,s.normalMatrix,l.normalMatrix),Ia(t.mcpcMatrix,s.wcpc,l.mcwc),Ia(t.mcvcMatrix,s.wcvc,l.mcwc);var c=t.renderable.getMatrixArray(),u=t.renderable.getNormalArray(),d=t.renderable.getColorArray(),f=c.length/16,p=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===ry.COMPOSITE_INDEX_PASS&&(p=!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)||Jh("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)||Jh("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)||Jh("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)||Jh("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),r.setMapperShaderParameters(e,n,a),void e.getAttributeUpdateTime().modified();r.setMapperShaderParameters(e,n,a)},e.getNeedToRebuildBufferObjects=function(e,n){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,ty.ARRAY_BUFFER),t.normalBuffer.upload(o,ty.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),ty.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),c=0;c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,iy,r),ov.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.normalMatrix=xo(new Float64Array(9)),t.mcpcMatrix=Pa(new Float64Array(16)),t.mcvcMatrix=Pa(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),oy(e,t)}),"vtkOpenGLGlyph3DMapper");function ly(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}_s("vtkGlyph3DMapper",sy);var cy=$u.PrimitiveTypes;function uy(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var r=function(e){for(var t=1;t","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=Xc(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}r.replaceShaderNormal(e,t,n)},e.replaceShaderColor=function(e,n,a){if(t.carray){var o=n.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=n.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else r.replaceShaderColor(e,n,a)},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("vertex");n.addOutput("u32","compositeID","flat");var a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),n=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",n),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}r.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dy,r),fh.extend(e,t,r),t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),t.SSBO=gd.newInstance({label:"glyphSSBO"}),uy(e,t);for(var n=cy.Start;n1&&void 0!==arguments[1]?arguments[1]:{};return gy[e]&&gy[e](t)}function hy(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(r){e.hasRenderer(r)||(r.setRenderWindow(e),t.renderers.push(r),e.modified())},e.removeRenderer=function(r){t.renderers=t.renderers.filter((function(e){return e!==r})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vy(e||t.defaultViewAPI,r)},e.addView=function(r){e.hasView(r)||(r.setRenderable(e),t.views.push(r),e.modified())},e.removeView=function(r){t.views=t.views.filter((function(e){return e!==r})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.preRender=function(){t.renderers.forEach((function(e){e.isActiveCameraCreated()||e.resetCamera()}))},e.render=function(){e.preRender(),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 r=t.getMapper&&t.getMapper();if(r&&r.getPrimitiveCount){var n=r.getPrimitiveCount();Object.keys(n).forEach((function(t){e[t]||(e[t]=0),e[t]+=n[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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fe.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(r,n):void 0})).filter((function(e){return!!e}))}}var yy={defaultViewAPI:py,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function by(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yy,r),fe.obj(e,t),fe.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),fe.get(e,t,["neverRendered"]),fe.getArray(e,t,["renderers"]),fe.event(e,t,"completion"),hy(e,t)}var Ty={newInstance:fe.newInstance(by,"vtkRenderWindow"),extend:by,registerViewConstructor:my,listViewAPIs:function(){return Object.keys(gy)},newAPISpecificView:vy};function Sy(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(fe.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=n,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})),t.delegates.forEach((function(t){t.traverse(r,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})))}}var Cy={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function xy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cy,r),fe.obj(e,t),fe.get(e,t,["currentOperation"]),fe.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),Sy(e,t)}var Py={newInstance:fe.newInstance(xy,"vtkRenderPass"),extend:xy};function wy(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e);for(var a=r.getRenderable().getNumberOfLayers(),o=r.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var u=r.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=yc.newInstance()),t.framebuffer.setOpenGLRenderWindow(r),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===u[0]&&d[1]===u[1]||(t.framebuffer.create(u[0],u[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)),t.overlayActorCount>0&&(e.setCurrentOperation("overlayPass"),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++},e.incrementOverlayActorCount=function(){return t.overlayActorCount++}}var Oy={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function Ay(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Oy,r),Py.extend(e,t,r),fe.get(e,t,["framebuffer"]),wy(e,t)}var My={newInstance:fe.newInstance(Ay,"vtkForwardPass"),extend:Ay},Iy=r(322),Ry=r.n(Iy),Ey=["lastShaderBound","context","openGLRenderWindow"];function Dy(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,r,n){var a=r;n.length>0&&(a=wl.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#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=wl.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#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=wl.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=wl.substitute(l,"varying","out").result,a=wl.substitute(a,"varying","in").result,a=wl.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=wl.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:wl.substitute(n,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,r,n){var a=e.replaceShaderValues(t,r,n),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,r,n){var a="".concat(e).concat(r).concat(n),o=Ry().hash(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=wl.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(r),n&&i.getGeometryShader().setSource(n),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(r){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(r)}))},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 By={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function Vy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,By,r),t.shaderPrograms={},fe.obj(e,t),fe.setGet(e,t,Ey),Dy(e,t)}var Ly={newInstance:fe.newInstance(Vy,"vtkShaderCache"),extend:Vy},Ny=fe.vtkErrorMacro;function ky(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fy,r),fe.obj(e,t),t.textureUnits=[],fe.get(e,t,["numberOfTextureUnits"]),fe.setGet(e,t,["context"]),ky(e,t)}var _y={newInstance:fe.newInstance(Gy,"vtkOpenGLTextureUnitManager"),extend:Gy};function Uy(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var r=e.getViewportByReference();return t.size[0]*(r[2]-r[0])/((r[3]-r[1])*t.size[1])},e.isInViewport=function(t,r,n){var a=n.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=r&&a[3]*o[1]>=r},e.getViewportSize=function(t){var r=t.getViewportByReference(),n=e.getFramebufferSize();return[(r[2]-r[0])*n[0],(r[3]-r[1])*n[1]]},e.getViewportCenter=function(t){var r=e.getViewportSize(t);return[.5*r[0],.5*r[1]]},e.displayToNormalizedDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t/a[0],r/a[1],n]},e.normalizedDisplayToDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t*a[0],r*a[1],n]},e.worldToView=function(e,t,r,n){return n.worldToView(e,t,r)},e.viewToWorld=function(e,t,r,n){return n.viewToWorld(e,t,r)},e.worldToDisplay=function(t,r,n,a){var o=a.worldToView(t,r,n),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,r,n,a){var o=e.displayToNormalizedDisplay(t,r,n),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,r,n,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,r,n);return[i[0]-o[0]-.5,i[1]-o[1]-.5,n]},e.viewportToNormalizedViewport=function(t,r,n,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),r/(o[1]-1),n]:[t,r,n]},e.normalizedViewportToViewport=function(t,r,n,a){var o=e.getViewportSize(a);return[t*(o[0]-1),r*(o[1]-1),n]},e.displayToLocalDisplay=function(t,r,n){return[t,e.getFramebufferSize()[1]-r-1,n]},e.viewportToNormalizedDisplay=function(t,r,n,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=r+o[1]+.5;return e.displayToNormalizedDisplay(i,s,n)},e.getPixelData=function(e,t,r,n){fe.vtkErrorMacro("not implemented")},e.createSelector=function(){fe.vtkErrorMacro("not implemented")}}var Wy={size:void 0,selector:void 0};function jy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,r),t.size||(t.size=[300,300]),fe.getArray(e,t,["size"],2),fe.get(e,t,["selector"]),Vs.extend(e,t,r),Uy(e,t)}var zy={newInstance:fe.newInstance(jy,"vtkRenderWindowViewNode"),extend:jy},Hy=fe.vtkDebugMacro,Ky=fe.vtkErrorMacro,Xy={position:"absolute",top:0,left:0,width:"100%",height:"100%"},qy=1,Yy=-.7,Zy=.25,Qy=-.5;function $y(e,t,r){var n=e.createFramebuffer(),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,r,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),o===e.FRAMEBUFFER_COMPLETE}var Jy=0,eb=[];function tb(){Jy++,eb.forEach((function(e){return e(Jy)}))}function rb(){Jy--,eb.forEach((function(e){return e(Jy)}))}function nb(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow"),e.getViewNodeFactory=function(){return t.myFactory};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(r){if(r){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=_y.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var r=t.context;r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),r.depthFunc(r.LEQUAL),r.enable(r.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(r){t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&Ky("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!==r&&(t.el=r,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(),r=e.width,n=e.height;t.containerSize=[r,n]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.getPixelData=function(e,r,n,a){var o=new Uint8Array((n-e+1)*(a-r+1)*4);return t.context.readPixels(e,r,n-e+1,a-r+1,t.context.RGBA,t.context.UNSIGNED_BYTE,o),o},e.get3DContext=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},n=null;void 0!==navigator.xr&&navigator.xr.isSessionSupported("immersive-vr")&&e.invokeHaveVRDisplay();var a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(n=t.canvas.getContext("webgl2",r))&&(t.webgl2=!0,Hy("using webgl2")),n||(Hy("using webgl1"),n=t.canvas.getContext("webgl",r)||t.canvas.getContext("experimental-webgl",r)),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),n},e.startXR=function(r){if(void 0===navigator.xr)throw new Error("WebXR is not available");t.xrSessionIsAR=r;var n=r?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(n))throw r?new Error("Device does not support AR session"):new Error("VR display is not available");if(null!==t.xrSession)throw new Error("XR Session already exists!");navigator.xr.requestSession(n).then(e.enterXR,(function(){throw new Error("Failed to create XR session!")}))},e.enterXR=function(){var n=Ph(Oh().mark((function n(a){var o,i;return Oh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.xrSession=a,t.oldCanvasSize=t.size.slice(),null===t.xrSession){n.next=15;break}return o=e.get3DContext(),n.next=6,o.makeXRCompatible();case 6:i=new r.g.XRWebGLLayer(t.xrSession,o),e.setSize(i.framebufferWidth,i.framebufferHeight),t.xrSession.updateRenderState({baseLayer:i}),t.xrSession.requestReferenceSpace("local").then((function(e){t.xrReferenceSpace=e})),e.resetXRScene(),t.renderable.getInteractor().switchToXRAnimation(),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),n.next=16;break;case 15:throw new Error("Failed to enter VR with a null xrSession.");case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),e.resetXRScene=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qy,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yy,n=e,a=r;t.xrSessionIsAR&&n===qy&&(n=Zy),t.xrSessionIsAR&&a===Yy&&(a=Qy);var o=t.renderable.getRenderers()[0];o.resetCamera();var i=o.getActiveCamera(),s=i.getPhysicalScale(),l=i.getPhysicalTranslation();a*=s/=n,l[2]+=a,i.setPhysicalScale(s),i.setPhysicalTranslation(l)},e.stopXR=Ph(Oh().mark((function r(){var n,a;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==navigator.xr){r.next=2;break}return r.abrupt("return");case 2:if(null===t.xrSession){r.next=10;break}return t.xrSession.cancelAnimationFrame(t.xrSceneFrame),t.renderable.getInteractor().returnFromXRAnimation(),(n=e.get3DContext()).bindFramebuffer(n.FRAMEBUFFER,null),r.next=9,t.xrSession.end().catch((function(e){if(!(e instanceof DOMException))throw e}));case 9:t.xrSession=null;case 10:void 0!==t.oldCanvasSize&&e.setSize.apply(e,f(t.oldCanvasSize)),(a=t.renderable.getRenderers()[0]).getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.traverseAllPasses();case 16:case"end":return r.stop()}}),r)}))),e.xrRender=function(){var r=Ph(Oh().mark((function r(n,a){var o,i,s,l,c;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=a.session,t.renderable.getInteractor().updateXRGamepads(o,a,t.xrReferenceSpace),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),(i=a.getViewerPose(t.xrReferenceSpace))&&(s=e.get3DContext(),t.xrSessionIsAR&&void 0!==t.oldCanvasSize&&(s.canvas.width=t.oldCanvasSize[0],s.canvas.height=t.oldCanvasSize[1]),l=o.renderState.baseLayer,s.bindFramebuffer(s.FRAMEBUFFER,l.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),c=t.renderable.getRenderers()[0],i.views.forEach((function(r){var n=l.getViewport(r);if(s.viewport(n.x,n.y,n.width,n.height),!t.xrSessionIsAR)if("left"===r.eye)c.setViewport(0,0,.5,1);else{if("right"!==r.eye)return;c.setViewport(.5,0,1,1)}c.getActiveCamera().computeViewParametersFromPhysicalMatrix(r.transform.inverse.matrix),c.getActiveCamera().setProjectionMatrix(r.projectionMatrix),e.traverseAllPasses()})));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.restoreContext=function(){var t=Py.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(r){var n=t._textureResourceIds.get(r);if(void 0===n){var a=e.getTextureUnitManager().allocate();a<0?Ky("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(r,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+n)},e.deactivateTexture=function(r){var n=t._textureResourceIds.get(r);void 0!==n&&(e.getTextureUnitManager().free(n),t._textureResourceIds.delete(r))},e.getTextureUnitForTexture=function(e){var r=t._textureResourceIds.get(e);return void 0!==r?r:-1},e.getDefaultTextureInternalFormat=function(e,r,n){if(t.webgl2){if(e===i.UNSIGNED_CHAR)switch(r){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;default:return t.context.RGBA8}switch(r){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;default:return t.context.RGBA16F}}switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.resetCamera,o=void 0!==a&&a,i=n.size,s=void 0===i?null:i,l=n.scale,c=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=r;var u=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==c?s||t.size.map((function(e){return e*c})):null},new Promise((function(r,n){var a=e.onImageReady((function(n){if(null===t._screenshot.size)t.notifyStartCaptureImage=u,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach((function(e){return(0,e.restoreParamsFn)(e.arg)})),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(n);else{var i=document.createElement("img");if(i.style=Xy,i.src=n,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o){var s=!0!==o;t._screenshot.cameras=t.renderable.getRenderers().map((function(e){var t=e.getActiveCamera(),r=t.get("focalPoint","position","parallelScale");return{resetCameraArgs:s?{renderer:e}:void 0,resetCameraFn:s?o:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(r))}})),t._screenshot.cameras.forEach((function(e){return(0,e.resetCameraFn)(e.resetCameraArgs)}))}e.traverseAllPasses()}}))}))},e.getGLInformations=function(){for(var r=e.get3DContext(),n=r.getExtension("OES_texture_float"),a=r.getExtension("OES_texture_half_float"),o=r.getExtension("WEBGL_debug_renderer_info"),i=r.getExtension("WEBGL_draw_buffers"),s=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",r.getParameter(r.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",r.getParameter(r.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",r.getParameter(r.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&r.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",r.getParameter(r.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",r.getParameter(r.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",r.getParameter(r.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",r.getParameter(r.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",r.getParameter(r.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",r.getParameter(r.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",r.getParameter(r.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",r.getParameter(r.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",r.getParameter(r.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",r.getParameter(r.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",r.getParameter(r.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",r.getParameter(r.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",r.getParameter(r.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.UNSIGNED_BYTE)?"RGBA":"",n&&$y(r,r.RGB,r.UNSIGNED_BYTE)?"RGB":"",n&&$y(r,r.LUMINANCE,r.UNSIGNED_BYTE)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.UNSIGNED_BYTE)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&$y(r,r.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&$y(r,r.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&$y(r,r.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&$y(r,r.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&$y(r,r.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.FLOAT)?"RGBA":"",n&&$y(r,r.RGB,r.FLOAT)?"RGB":"",n&&$y(r,r.LUMINANCE,r.FLOAT)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.FLOAT)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?r.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",r.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",r.getParameter(r.RENDERER)],["WebGL Vendor","VENDOR",r.getParameter(r.VENDOR)],["WebGL Version","VERSION",r.getParameter(r.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",r.getParameter(r.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&r.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],c={};l.length;){var d=u(l.pop(),3),f=d[0],p=d[1],g=d[2];p&&(c[p]={label:f,value:g})}return c},e.traverseAllPasses=function(){if(t.renderPasses)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,n=document.createElement("canvas"),a=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,r),zy.extend(e,t,r),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",tb(),t.selector||(t.selector=Qh.newInstance(),t.selector.setOpenGLRenderWindow(e)),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,t.myFactory=zs.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",ib),t.shaderCache=Ly.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=My.newInstance(),fe.event(e,t,"imageReady"),fe.event(e,t,"haveVRDisplay"),fe.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage","xrSupported"]),fe.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen","activeFramebuffer"]),fe.setGetArray(e,t,["size"],2),nb(e,t)}var ib=fe.newInstance(ob,"vtkOpenGLRenderWindow");my("WebGL",ib);var sb={newInstance:ib,extend:ob,pushMonitorGLContextCount:function(e){eb.push(e)},popMonitorGLContextCount:function(e){return eb.pop()}},lb=fe.vtkDebugMacro;function cb(e,t){t.classHierarchy.push("vtkCamera");var r=new Float64Array(3),n=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),o=Pa(new Float64Array(16)),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3),c=Pa(new Float64Array(16)),u=Pa(new Float64Array(16)),d=new Float64Array(3),p=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 r=e.getViewMatrix();t.viewUp[0]=r[4],t.viewUp[1]=r[5],t.viewUp[2]=r[6],e.modified()},e.setPosition=function(r,n,a){r===t.position[0]&&n===t.position[1]&&a===t.position[2]||(t.position[0]=r,t.position[1]=n,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(r,n,a){r===t.focalPoint[0]&&n===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=r,t.focalPoint[1]=n,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(r){if(t.distance!==r){t.distance=r,t.distance<1e-20&&(t.distance=1e-20,lb("Distance is set to minimum."));var n=t.directionOfProjection;t.focalPoint[0]=t.position[0]+n[0]*t.distance,t.focalPoint[1]=t.position[1]+n[1]*t.distance,t.focalPoint[2]=t.position[2]+n[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],r=t.focalPoint[1]-t.position[1],n=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+r*r+n*n),t.distance<1e-20){t.distance=1e-20,lb("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]=r/t.distance,t.directionOfProjection[2]=n/t.distance,g()},e.dolly=function(r){if(!(r<=0)){var n=t.distance/r;e.setPosition(t.focalPoint[0]-n*t.directionOfProjection[0],t.focalPoint[1]-n*t.directionOfProjection[1],t.focalPoint[2]-n*t.directionOfProjection[2])}},e.roll=function(r){var n=t.position,a=t.focalPoint,o=t.viewUp,i=new Float64Array([o[0],o[1],o[2],0]);Pa(c);var s=new Float64Array([a[0]-n[0],a[1]-n[1],a[2]-n[2]]);Da(c,c,Ce(r),s),ri(i,i,c),t.viewUp[0]=i[0],t.viewUp[1]=i[1],t.viewUp[2]=i[2],e.modified()},e.azimuth=function(r){var n=t.focalPoint;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.yaw=function(r){var n=t.position;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint(p[0],p[1],p[2])},e.elevation=function(r){var n=t.focalPoint,a=e.getViewMatrix(),o=[-a[0],-a[1],-a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.pitch=function(r){var n=t.position,a=e.getViewMatrix(),o=[a[0],a[1],a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint.apply(e,f(p))},e.zoom=function(r){r<=0||(t.parallelProjection?t.parallelScale/=r:t.viewAngle/=r,e.modified())},e.translate=function(r,n,a){var o=[r,n,a];Le(t.position,o,t.position),Le(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(r){var n=[].concat(f(t.viewUp),[1]),a=[],o=[],i=[];n[0]+=t.position[0],n[1]+=t.position[1],n[2]+=t.position[2],ri(a,[].concat(f(t.position),[1]),r),ri(o,[].concat(f(t.focalPoint),[1]),r),ri(i,n,r),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,f(a.slice(0,3))),e.setFocalPoint.apply(e,f(o.slice(0,3))),e.setViewUp.apply(e,f(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+n)},e.setThicknessFromFocalPoint=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.distance-n/2,t.distance+n/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,r,n=ii(e[0],e[1],e[2],e[3]),a=ni(),o=ii(0,0,1,0);return r=n,(t=a)[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],oi(o,n,o),oi(o,o,a),[o[0],o[1],o[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),Oa(t,t)},e.getWorldToPhysicalMatrix=function(e){Pa(e);var r=[3];_e(t.physicalViewNorth,t.physicalViewUp,r),e[0]=r[0],e[1]=r[1],e[2]=r[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],wa(e,e),In(i,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),Ea(e,e,i),Ra(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(c){Oa(o,c),Jn(i,r,o),e.computeDistance();var u=t.distance;e.setPosition(i[0],i[1],i[2]),Jn(s,n,o),En(s,s,i),Kn(s,s),e.setDirectionOfProjection(s[0],s[1],s[2]),Jn(l,a,o),En(l,l,i),Kn(l,l),e.setViewUp(l[0],l[1],l[2]),e.setDistance(u)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(o),Ia(o,t,o),e.computeViewParametersFromViewMatrix(o)},e.setViewMatrix=function(r){t.viewMatrix=r,t.viewMatrix&&(Sa(o,t.viewMatrix),e.computeViewParametersFromViewMatrix(o),wa(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;ao(o,t.position,t.focalPoint,t.viewUp),wa(o,o);var e=new Float64Array(16);return Sa(e,o),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,r,n){var a=new Float64Array(16);if(Pa(a),t.projectionMatrix){var s=1/t.physicalScale;return In(i,s,s,s),Sa(a,t.projectionMatrix),Ea(a,a,i),wa(a,a),a}Pa(o);var l=t.clippingRange[1]-t.clippingRange[0],c=[t.clippingRange[0]+(r+1)*l/2,t.clippingRange[0]+(n+1)*l/2];if(t.parallelProjection){var u=t.parallelScale*e,d=t.parallelScale,f=(t.windowCenter[0]-1)*u,p=(t.windowCenter[0]+1)*u,g=(t.windowCenter[1]-1)*d,m=(t.windowCenter[1]+1)*d;ro(o,f,p,g,m,c[0],c[1]),wa(o,o)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var v,h,y=Math.tan(Ce(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(v=t.clippingRange[0]*y,h=t.clippingRange[0]*y/e):(v=t.clippingRange[0]*y*e,h=t.clippingRange[0]*y);var b=(t.windowCenter[0]-1)*v,T=(t.windowCenter[0]+1)*v,S=(t.windowCenter[1]-1)*h,C=(t.windowCenter[1]+1)*h,x=c[0],P=c[1];o[0]=2*x/(T-b),o[5]=2*x/(C-S),o[2]=(b+T)/(T-b),o[6]=(S+C)/(C-S),o[10]=-(x+P)/(P-x),o[14]=-1,o[11]=-2*x*P/(P-x),o[15]=0}return Sa(a,o),a},e.getCompositeProjectionMatrix=function(t,r,n){var a=e.getViewMatrix(),o=e.getProjectionMatrix(t,r,n);return Ia(o,a,o),o},e.setDirectionOfProjection=function(e,r,n){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==r||t.directionOfProjection[2]!==n){t.directionOfProjection[0]=e,t.directionOfProjection[1]=r,t.directionOfProjection[2]=n;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(r,n,a,o){var i=[3];_e(t.physicalViewNorth,t.physicalViewUp,i);var s=Pa(new Float64Array(16));Da(s,s,Ce(r),t.physicalViewUp),Da(s,s,Ce(n),i),Da(s,s,Ce(a),t.physicalViewNorth),Da(s,s,Ce(-o),t.physicalViewUp);var l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),c=new Float64Array(t.physicalViewNorth);Jn(l,l,s),Jn(c,c,s),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(c[0],c[1],c[2]),e.modified()},e.setOrientationWXYZ=function(t,r,n,a){var o=Pa(new Float64Array(16));if(0!==t&&(0!==r||0!==n||0!==a)){var i=Ce(t),s=ni();ai(s,[r,n,a],i),Ya(o,s)}var l=new Float64Array(3);Jn(l,[0,0,-1],o);var c=new Float64Array(3);Jn(c,[0,1,0],o),e.setDirectionOfProjection.apply(e,f(l)),e.setViewUp.apply(e,f(c)),e.modified()},e.computeClippingRange=function(e){var r,n;r=t.viewPlaneNormal,n=t.position;for(var a=-r[0],o=-r[1],i=-r[2],s=-(a*n[0]+o*n[1]+i*n[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],c=0;c<2;c++)for(var u=0;u<2;u++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+u]+i*e[4+c]+s;l[0]=fl[1]?f:l[1]}return l}}var ub={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 db(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ub,r),fe.obj(e,t),fe.get(e,t,["distance"]),fe.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),fe.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),fe.setGetArray(e,t,["clippingRange","windowCenter"],2),fe.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),cb(e,t)}var fb={newInstance:fe.newInstance(db,"vtkCamera"),extend:db};function pb(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,gb,r),fe.obj(e,t),fe.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),fe.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),pb(e,t)}var vb={newInstance:fe.newInstance(mb,"vtkLight"),extend:mb,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},hb=fe.vtkErrorMacro;function yb(e,t){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var n=e.getNestedProps();if(n&&n.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bb,r),fe.obj(e,t),fe.event(e,t,"event"),fe.setGetArray(e,t,["viewport"],4),fe.setGetArray(e,t,["background","background2"],3),yb(e,t)}var Sb={newInstance:fe.newInstance(Tb,"vtkViewport"),extend:Tb},Cb=k,xb=F,Pb=G;function wb(e){return function(){return xb("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function Ob(e,t){t.classHierarchy.push("vtkRenderer");var r={type:"ComputeVisiblePropBoundsEvent",renderer:e},n={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(Cb("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var r=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(r.getPositionByReference()),e.setFocalPointFrom(r.getFocalPointByReference()),e.modified(r.getMTime())):xb("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=wb("allocateTime"),e.updateGeometry=wb("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(r){Cb(e.getClassName(),e,"setting Layer to ",r),t.layer!==r&&(t.layer=r,e.modified()),e.setPreserveColorBuffer(!!r)},e.setActiveCamera=function(r){return t.activeCamera!==r&&(t.activeCamera=r,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:r}),!0)},e.makeCamera=function(){var t=fb.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(r){t.actors=t.actors.filter((function(e){return e!==r})),e.removeViewProp(r),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(r){t.volumes=t.volumes.filter((function(e){return e!==r})),e.removeViewProp(r),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(r){t.lights=[].concat(t.lights,r),e.modified()},e.removeLight=function(r){t.lights=t.lights.filter((function(e){return e!==r})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(r){t.lights=r,e.modified()},e.makeLight=vb.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,r,n,a){var o=e.normalizedDisplayToProjection(t,r,n);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,r,n,a){var o=e.worldToView(t,r,n);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,r,n){if(null===t.activeCamera)return xb("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Oa(a,a),wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.projectionToView=function(e,r,n,a){if(null===t.activeCamera)return xb("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);Oa(o,o),wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.worldToView=function(e,r,n){if(null===t.activeCamera)return xb("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.viewToProjection=function(e,r,n,a){if(null===t.activeCamera)return xb("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.computeVisiblePropBounds=function(){t.allBounds[0]=Hr.INIT_BOUNDS[0],t.allBounds[1]=Hr.INIT_BOUNDS[1],t.allBounds[2]=Hr.INIT_BOUNDS[2],t.allBounds[3]=Hr.INIT_BOUNDS[3],t.allBounds[4]=Hr.INIT_BOUNDS[4],t.allBounds[5]=Hr.INIT_BOUNDS[5];var n=!0;e.invokeEvent(r);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 n&&(St(t.allBounds),Cb("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=r||e.computeVisiblePropBounds(),o=[0,0,0];if(!Ct(n))return Cb("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return xb("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),o[0]=(n[0]+n[1])/2,o[1]=(n[2]+n[3])/2,o[2]=(n[4]+n[5])/2;var s=n[1]-n[0],l=n[3]-n[2],c=n[5]-n[4],u=(s*=s)+(l*=l)+(c*=c);u=0===u?1:u,u=.5*Math.sqrt(u);var d=Ce(t.activeCamera.getViewAngle()),f=u,p=u/Math.sin(.5*d),g=t.activeCamera.getViewUp();return Math.abs(Ge(g,i))>.999&&(Pb("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(o[0],o[1],o[2]),t.activeCamera.setPosition(o[0]+p*i[0],o[1]+p*i[1],o[2]+p*i[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(f),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-o[0],-o[1],-o[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=r||e.computeVisiblePropBounds();if(!Ct(a))return Cb("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return xb("Trying to reset clipping range of non-existent camera"),!1;var o=t.activeCamera.computeClippingRange(a),i=0;if(t.activeCamera.getParallelProjection())i=.2*t.activeCamera.getParallelScale();else{var s=Ce(t.activeCamera.getViewAngle());i=.2*Math.tan(s/2)*o[1]}return o[1]-o[0]=o[1]?.01*o[1]:o[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),o[0]e&&(e=r);var n=t.createdLight?t.createdLight.getMTime():0;return n>e&&(e=n),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var Ab={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:Dt(),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 Mb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Object.assign(t,Ab,r),Sb.extend(e,t,r),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1),Q(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),te(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),re(e,t,["actors","volumes","lights"]),ae(e,t,["background"],4,1),Ob(e,t)}var Ib={newInstance:ie(Mb,"vtkRenderer"),extend:Mb},Rb={Unknown:0,LeftController:1,RightController:2},Eb={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},Db={Device:Rb,Input:Eb,Axis:{Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4}};function Bb(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}function Vb(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],o=document,i=r?"addEventListener":"removeEventListener",s=r?"removeEventListener":"addEventListener";!a&&!r&&n>0&&--n,n&&!a||(n=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&r&&++n}function u(){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){Fb("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(r){t.interactorStyle!==r&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=r,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 kb("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||a(0,0),t.currentRenderer},e.bindEvents=function(r){t.container=r,r.addEventListener("contextmenu",jb),r.addEventListener("wheel",e.handleWheel),r.addEventListener("DOMMouseScroll",e.handleWheel),r.addEventListener("mouseenter",e.handleMouseEnter),r.addEventListener("mouseleave",e.handleMouseLeave),r.addEventListener("mousemove",e.handleMouseMove),r.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),r.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){c(!1,!0),t.container.removeEventListener("contextmenu",jb),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.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var r=l(t);e.keyPressEvent(r)},e.handleKeyDown=function(t){var r=l(t);e.keyDownEvent(r)},e.handleKeyUp=function(t){var r=l(t);e.keyUpEvent(r)},e.handleMouseDown=function(t){if(!(t.button>2)){c(!0),jb(t);var r=Vb(Vb({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(r);break;case 1:e.middleButtonPressEvent(r);break;case 2:e.rightButtonPressEvent(r);break;default:Fb("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(n){void 0!==n?r.has(n)?kb("requester is already registered for animating"):(r.add(n),t.animationRequest||1!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Fb("undefined requester, can not start animating")},e.extendAnimation=function(n){var a=Date.now()+n;t._animationExtendedEnd=Math.max(t._animationExtendedEnd,a),t.animationRequest||0!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())},e.isAnimating=function(){return t.xrAnimation||null!==t.animationRequest},e.cancelAnimation=function(n){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.has(n))r.delete(n),t.animationRequest&&0===r.size&&Date.now()>t._animationExtendedEnd&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=n&&n.getClassName?n.getClassName():n;kb("".concat(o," did not request an animation"))}},e.switchToXRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.xrAnimation=!0},e.returnFromXRAnimation=function(){t.xrAnimation=!1,0!==r.size&&(t.recentAnimationFrameRate=10,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateXRGamepads=function(r,n,a){r.inputSources.forEach((function(r){var o=null==r.gripSpace?null:n.getPose(r.gripSpace,a),i=r.gamepad,s=r.handedness;if(i){i.index in t.lastGamepadValues||(t.lastGamepadValues[i.index]={left:{buttons:{}},right:{buttons:{}}});for(var l=0;l1e3&&t._animationFrameCount>1&&(t.recentAnimationFrameRate=1e3*(t._animationFrameCount-1)/(n-t._animationStartTime),t.lastFrameTime=1/t.recentAnimationFrameRate,e.animationFrameRateUpdateEvent(),t._animationStartTime=n,t._animationFrameCount=1),e.animationEvent(),u(),r.size>0||Date.now()1){var n=i(r.touches);if(2===r.touches.length){var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",n)}else{var s={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(r){if(jb(r),t.recognizeGestures&&r.touches.length>1){var n=i(r.touches);e.recognizeGesture("TouchMove",n)}else{var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(r){if(jb(r),t.recognizeGestures)if(0===r.touches.length)if(1===r.changedTouches.length){var n={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(n),c(!1)}else{var a=i(r.changedTouches);e.recognizeGesture("TouchEnd",a),c(!1)}else if(1===r.touches.length){var s=i(r.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var u=i(r.touches);e.recognizeGesture("TouchMove",u)}else{var d={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),c(!1)}},e.setView=function(r){t.view!==r&&(t.view=r,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){var e,r,n;return null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r||null===(n=r.getRenderersByReference())||void 0===n?void 0:n[0]},e.findPokedRenderer=function(){var e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var o=null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r?void 0:r.getRenderers();if(!o)return null;o.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var i=null,s=null,l=null,c=o.length;c--;){var u=o[c];if(t.view.isInViewport(n,a,u)&&u.getInteractive()){l=u;break}null===i&&u.getInteractive()&&(i=u),null===s&&t.view.isInViewport(n,a,u)&&(s=u)}return null===l&&(l=i),null===l&&(l=s),null==l&&(l=o[0]),l},e.render=function(){e.isAnimating()||t.inRender||u()},Wb.forEach((function(r){var n=r.charAt(0).toLowerCase()+r.slice(1);e["".concat(n,"Event")]=function(n){if(t.enabled)if(e.getCurrentRenderer()){var a=Vb({type:r,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},n);e["invoke".concat(r)](a)}else _b("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(r,n){if(!(Object.keys(n).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===r)return Object.keys(n).forEach((function(e){t.startingEventPositions[e]=n[e]})),void(t.currentGesture="Start");if("TouchEnd"===r)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,o=[],i=[];Object.keys(n).forEach((function(e){o[a]=n[e],i[a]=t.startingEventPositions[e],a++}));var s=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((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),c=xe(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),u=xe(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=u-c;u=u+180>=360?u-180:u+180,c=c+180>=360?c-180:c+180,Math.abs(u-c)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:n};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:n};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:n};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:n};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var S={scale:l/s,touches:n};e.pinchEvent(S)}if("Pan"===t.currentGesture){var C={translation:f,touches:n};e.panEvent(C)}}}},e.handleVisibilityChange=function(){t._animationStartTime=Date.now(),t._animationFrameCount=0},e.setCurrentRenderer=function(e){t._forcedRenderer=!!e,t.currentRenderer=e};var d=e.delete;e.delete=function(){for(;r.size;)e.cancelAnimation(r.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var Hb={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,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function Kb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hb,r),fe.obj(e,t),t._animationExtendedEnd=0,fe.event(e,t,"RenderEvent"),Wb.forEach((function(r){return fe.event(e,t,r)})),fe.get(e,t,["initialized","container","interactorStyle","lastFrameTime","recentAnimationFrameRate","view"]),fe.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),zb(e,t)}var Xb=Vb({newInstance:fe.newInstance(Kb,"vtkRenderWindowInteractor"),extend:Kb,handledEvents:Wb},Db);function qb(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}function Yb(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jb,r),fe.obj(e,t),fe.event(e,t,"InteractionEvent"),fe.event(e,t,"StartInteractionEvent"),fe.event(e,t,"EndInteractionEvent"),fe.get(e,t,["interactor","enabled"]),fe.setGet(e,t,["priority","processEvents"]),$b(e,t)}var tT=Yb({newInstance:fe.newInstance(eT,"vtkInteractorObserver"),extend:eT},{computeWorldToDisplay:function(e,t,r,n){return e.getRenderWindow().getViews()[0].worldToDisplay(t,r,n,e)},computeDisplayToWorld:function(e,t,r,n){return e.getRenderWindow().getViews()[0].displayToWorld(t,r,n,e)}}),rT={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 nT(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 aT=rT.States,oT={Rotate:aT.IS_ROTATE,Pan:aT.IS_PAN,Spin:aT.IS_SPIN,Dolly:aT.IS_DOLLY,CameraPose:aT.IS_CAMERA_POSE,WindowLevel:aT.IS_WINDOW_LEVEL,Slice:aT.IS_SLICE};function iT(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(oT).forEach((function(r){fe.event(e,t,"Start".concat(r,"Event")),e["start".concat(r)]=function(){t.state===aT.IS_NONE&&(t.state=oT[r],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(r,"Event")]({type:"Start".concat(r,"Event")}))},fe.event(e,t,"End".concat(r,"Event")),e["end".concat(r)]=function(){t.state===oT[r]&&(t.state=aT.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(r,"Event")]({type:"End".concat(r,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var r=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),r.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),r.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),r.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),r.render()}}}var sT={state:aT.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function lT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sT,r),tT.extend(e,t,r),iT(e,t)}var cT=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fT,r),cT.extend(e,t,r),fe.setGet(e,t,["motionFactor","zoomFactor"]),dT(e,t)}var gT={newInstance:fe.newInstance(pT,"vtkInteractorStyleTrackballCamera"),extend:pT};function mT(e,t){var r=e.invokeResize;delete e.invokeResize,t.renderWindow=Ty.newInstance(),t.renderer=Ib.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=sb.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Xb.newInstance(),t.interactor.setInteractorStyle(gT.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,f(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),n=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*n),Math.floor(e.height*n)),r(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=fe.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}var vT={background:[.32,.34,.43],listenWindowResize:!0,container:null};function hT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vT,r),fe.obj(e,t),fe.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),fe.event(e,t,"resize"),mT(e,t)}var yT={newInstance:fe.newInstance(hT),extend:hT},bT={PICKING_BUFFER:0,FRONT_BUFFER:1},TT={ViewTypes:{DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},RenderingTypes:bT,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}};function ST(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(r){var n=r.selectedState,a=r.representation;t.widgetState.activateOnly(n),t.activeState=n,n&&n.updateManipulator&&n.updateManipulator(),e.invokeActivateHandle({selectedState:n,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CT,r),fi.extend(e,t,r),tT.extend(e,t,r),fe.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),fe.get(e,t,["representations","widgetState"]),fe.event(e,t,"ActivateHandle"),ST(e,t)}var PT={newInstance:fe.newInstance(xT,"vtkAbstractWidget"),extend:xT};function wT(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,r,n,a,o){if(t.callback){var i=r.getCompositeProjectionMatrix(n,-1,1);wa(i,i);for(var s=e.getPoints(),l=new Float64Array(3),c=a.usize,u=a.vsize,d=c/2,f=u/2,p=[],g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OT,r),Jp.extend(e,t,r),fe.setGet(e,t,["callback","useZValues"]),wT(e,t)}var MT={newInstance:fe.newInstance(AT,"vtkPixelSpaceCallbackMapper"),extend:AT},IT=0,RT=1,ET=fe.vtkErrorMacro,DT=fe.vtkWarningMacro;function BT(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var r={mtimes:{},states:[]};function n(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),kp.forEach((function(r){if(t[r]){var n="setRelativeCoincidentTopology".concat(r,"OffsetParameters");if(e[n]){var a=t[r],o=a.factor,i=a.offset;e[n](o,i)}}})))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var r=arguments.length,n=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return r.mtimes.representation===e.getMTime()&&r.mtimes.input===n.getMTime()||(r.mtimes.representation=e.getMTime(),r.mtimes.input=n.getMTime(),r.states=[],t.labels.forEach((function(e){r.states=r.states.concat(n.getStatesWithLabel(e)||[])}))),r.states},e.getSelectedState=function(t,r){var n=e.getRepresentationStates();return r0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!0;switch(t.behavior){case IT:a=e===bT.PICKING_BUFFER||n;break;case RT:a=r;break;default:a=!0}for(var o=a,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,r),fi.extend(e,t,r),fe.algo(e,t,1,1),fe.get(e,t,["labels","coincidentTopologyParameters"]),fe.set(e,t,["displayScaleParams"]),fe.setGet(e,t,["scaleInPixels"]),BT(e,t)};var NT=function(e){return{name:e,attrs:{},eventListeners:{},textContent:null,children:[],setAttribute:function(e,t){this.attrs[e]=t},removeAttribute:function(e){delete this.attrs[e]},appendChild:function(e){this.children.push(e)},addEventListeners:function(e,t){this.eventListeners[e]=t}}};function kT(e){for(var t=document.createElementNS("http://www.w3.org/2000/svg",e.name),r=Object.keys(e.attrs),n=0;n=s;g--)p(g)}return r}var GT=TT.ViewTypes,_T=TT.RenderingTypes,UT=TT.CaptureOn,WT=fe.vtkErrorMacro,jT=fe.vtkWarningMacro,zT=NT,HT=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},KT=1;function XT(e){var t=e.getActiveCamera(),r=e.getRenderWindow(),n=r.getInteractor(),a=n.getView();return{renderer:e,renderWindow:r,interactor:n,apiSpecificRenderWindow:a,camera:t}}function qT(e,t){t.viewId||(t.viewId="view-".concat(KT++)),t.classHierarchy.push("vtkWidgetManager");var r,n=new WeakMap,a=new WeakMap,o=new WeakMap,i=[];function s(e){return e&&(e.isA("vtkAbstractWidget")?e:e.getWidgetForView({viewId:t.viewId}))}t.svgRoot=(t.viewId,(r=HT("svg")).setAttribute("style","position: absolute; top: 0; left: 0; width: 100%; height: 100%;"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r);var l=new WeakMap;function c(){var e=t.apiSpecificRenderWindow.getReferenceByName("el"),r=t.apiSpecificRenderWindow.getCanvas();e.insertBefore(t.svgRoot,r.nextSibling),"static"===window.getComputedStyle(e).position&&(e.style.position="relative")}function d(){var e=u(t.apiSpecificRenderWindow.getSize(),2),r=e[0],n=e[1],a=window.devicePixelRatio||1,o=String(r/a),i=String(n/a),s="0 0 ".concat(r," ").concat(n),l=t.svgRoot.getAttribute("width"),c=t.svgRoot.getAttribute("height"),d=t.svgRoot.getAttribute("viewBox");l!==o&&t.svgRoot.setAttribute("width",o),c!==i&&t.svgRoot.setAttribute("height",i),d!==s&&t.svgRoot.setAttribute("viewBox",s)}function f(){if(t.useSvgLayer)for(var e=function(e){var r=t.widgets[e],n=r.getRepresentations().filter((function(e){return e.isA("vtkSVGRepresentation")})),i=[];r.getVisibility()&&(i=n.filter((function(e){return e.getVisibility()})).map((function(e){return e.render()})));var s=Promise.all(i),c=l.get(r)||[];c.push(s),l.set(r,c),s.then((function(e){var n=l.get(r)||[],i=n.indexOf(s);if(!t.deleted&&!r.isDeleted()&&-1!==i){n=n.slice(i+1),l.set(r,n);for(var c=o.get(r),u=zT("g"),d=0;dc[2]||ac[3])){r.next=23;break}return r.next=23,h(n,a,n,a);case 23:t.selections=t._capturedBuffers.generateSelection(n,a,n,a);case 24:return r.abrupt("return",e.getSelectedData());case 25:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.updateSelectionFromXY=function(e,r){if(jT("updateSelectionFromXY is deprecated, please use getSelectedDataForXY"),t.pickingEnabled){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,YT,r),fe.obj(e,t),fe.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:GT}]),fe.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),qT(e,t)}var QT={newInstance:fe.newInstance(ZT,"vtkWidgetManager"),extend:ZT,Constants:TT};function $T(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}function JT(e){for(var t=1;t1&&(m[e]=fe.chain.apply(fe,f(t)))}))})),m.delete=fe.chain((function(){delete r[a]}),m.delete),m.setInteractor(u);var h=Object.freeze(m);return r[a]=h,h}return r[a]},e.getViewIds=function(){return Object.keys(r)},e.setVisibility=function(e){for(var t=Object.keys(r),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oS,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),aS(e,t)}var sS={intersectDisplayWithPlane:nS,extend:iS,newInstance:fe.newInstance(iS,"vtkPlaneManipulator")};function lS(e,t,r,n,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Ne(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];_e(n,s,l),_e(l,s,l);var c=Ge([i[0]-r[0],i[1]-r[1],i[2]-r[2]],l),u=Ge(l,n),d=n.slice();return ke(d,c/u),Le(r,d,d),d}function cS(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,r){return lS(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,r)}}var uS={origin:[0,0,0],normal:[0,0,1]};function dS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uS,r),fe.obj(e,t),fe.setGetArray(e,t,["origin","normal"],3),cS(e,t)}var fS={projectDisplayToLine:lS,extend:dS,newInstance:fe.newInstance(dS,"vtkLineManipulator")},pS={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function gS(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 mS=pS.OrientationModes,vS=pS.ScaleModes,hS=fe.vtkErrorMacro;function yS(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return fe.enumToString(mS,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode(mS.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode(mS.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode(mS.MATRIX)},e.getOrientationArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.orientationArray?r.getPointData().getArray(t.orientationArray):r.getPointData().getVectors():null},e.getScaleModeAsString=function(){return fe.enumToString(vS,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(vS.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(vS.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(vS.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.scaleArray?r.getPointData().getArray(t.scaleArray):r.getPointData().getScalars():null},e.getBounds=function(){var r=e.getInputData(0),n=e.getInputData(1);return r&&n?(e.buildArrays(),t.bounds):Dt()},e.buildArrays=function(){var r=e.getInputData(0),n=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=u[0]),u[1]>t.bounds[3]&&(t.bounds[3]=u[1]),u[2]>t.bounds[5]&&(t.bounds[5]=u[2]);var M=new Float32Array(y,36*T,9);yo(M,S),wo(M,M),Po(M,M)}var I=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var R=e.getLookupTable();R&&I&&(R.build(),t.colorArray=R.mapScalars(I,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),r=e.getInputData().getPoints().getNumberOfValues()/3;return{points:r*t.getPoints().getNumberOfValues()/3,verts:r*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:r*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:r*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var bS={orient:!0,orientationMode:mS.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:vS.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function TS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bS,r),Jp.extend(e,t,r),fe.algo(e,t,2,0),t.buildTime={},fe.obj(t.buildTime,{mtime:0}),t.boundsTime={},fe.obj(t.boundsTime,{mtime:0}),fe.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),fe.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),yS(e,t)}var SS=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=xS(xS({},wS),r);LT(e,t,n),fe.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),PS(0,t)};function AS(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,r){if(!t.deleted){var n=r[0],a=n?n.getPoints().getDataType():t.pointType;n=hm.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var c=t.startPhit.startPhi?t.endPhi:t.startPhi;u*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=fe.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var S=t.phiResolution-o,C=(u-c)/(t.phiResolution-1),x=0;x=180)for(var E=S-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,MS,r),fe.obj(e,t),fe.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),fe.setGetArray(e,t,["center"],3),fe.algo(e,t,0,1),AS(e,t)}var RS={newInstance:fe.newInstance(IS,"vtkSphereSource"),extend:IS};function ES(e,t){function r(r){if(t.displayCallback){for(var n=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DS,r),OS(e,t,r),fe.get(e,t,["glyph","mapper","actor"]),ES(e,t)}var VS={newInstance:fe.newInstance(BS,"vtkSphereHandleRepresentation"),extend:BS};function LS(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}function NS(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=NS(NS({},FS),r);LT(e,t,n),kS(0,t)},_S=fe.vtkErrorMacro,US=[2,0,1,2,0,2,2,0,4,2,1,3,2,1,5,2,2,3,2,2,6,2,3,7,2,4,5,2,4,6,2,5,7,2,6,7];function WS(e,t){var r;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=hm.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(US)),t.mapper=Jp.newInstance({scalarVisibility:!1}),t.actor=Cp.newInstance({parentProp:e}),(r=t.actor.getProperty()).setEdgeColor.apply(r,f(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(r,n){var a=e.getRepresentationStates(r[0]).filter((function(e){return e.getOrigin&&e.getOrigin()}));if(8===a.length){for(var o=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jS,r),GS(e,t,r),fe.setGetArray(e,t,["edgeColor"],3),fe.get(e,t,["mapper","actor"]),WS(e,t)}var HS={newInstance:fe.newInstance(zS,"vtkCroppingOutlineRepresentation"),extend:zS},KS=["-","=","+"];function XS(e,t){var r=new Float64Array(3);return Jn(r,e,t),r}function qS(e,t){var r=Pn(),n=ni();return Ka(n,t),ta(r,e,n),r}function YS(e){var t=u(e.split("").map((function(e){return KS.indexOf(e)-1})),3),r=t[0],n=t[1],a=t[2];return r*n*a!=0?"corners":r*n!=0||n*a!=0||a*r!=0?"edges":"faces"}function ZS(e,t){var r=null;e.setDisplayCallback=function(e){return t.representations[0].setDisplayCallback(e)},e.handleLeftButtonPress=function(){return t.activeState&&t.activeState.getActive()&&t.pickable?(r=!0,t.interactor.requestAnimation(e),fe.EVENT_ABORT):fe.VOID},e.handleMouseMove=function(n){return r&&t.pickable&&t.dragable?e.handleEvent(n):fe.VOID},e.handleLeftButtonRelease=function(){r&&t.pickable&&(r=!1,t.interactor.cancelAnimation(e),t.widgetState.deactivate())},e.handleEvent=function(e){if(t.pickable&&t.activeState&&t.activeState.getActive()){var r=t.activeState.getManipulator();if(r){var n=t.activeState.getName(),a=YS(n),o=n.split("").map((function(e){return KS.indexOf(e)})),i=t.widgetState.getCroppingPlanes().getPlanes(),s=t.widgetState.getIndexToWorldT(),l=[];if("corners"===a&&(r.setNormal(t.camera.getDirectionOfProjection()),l=r.handleEvent(e,t.apiSpecificRenderWindow)),"faces"===a){var c=[1-o[0],1-o[1],1-o[2]],u=[(i[0]+i[1])/2,(i[2]+i[3])/2,(i[4]+i[5])/2];r.setOrigin(XS(u,s)),r.setNormal(qS(c,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if("edges"===a){var d=o.map((function(e){return 1===e?e:0}));r.setNormal(qS(d,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if(l.length){for(var p,g,m=XS(l,t.widgetState.getWorldToIndexT()),v=0;v<3;v++)0===o[v]?i[2*v]=m[v]:2===o[v]&&(i[2*v+1]=m[v]);return(p=t.activeState).setOrigin.apply(p,f(l)),(g=t.widgetState.getCroppingPlanes()).setPlanes.apply(g,f(i)),fe.EVENT_ABORT}}}return fe.VOID},t.camera=t.renderer.getActiveCamera(),t.classHierarchy.push("vtkImageCroppingWidgetProp")}var QS="default";function $S(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}function JS(e,t){t.classHierarchy.push("vtkWidgetState");var r=[];t.labels={},t.nestedStates=[],e.bindState=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[QS];if(t.nestedStates.push(n),r.push(n.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,eC,r),fe.obj(e,t),fe.setGet(e,t,["active"]),JS(e,t)};function rC(e,t){var r=[],n=f(Hr.INIT_BOUNDS);e.containsPoint=function(e,t,r){return Array.isArray(e)?Hr.containsPoint(n,e[0],e[1],e[2]):Hr.containsPoint(n,e,t,r)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];r[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(r[0]+r[1])/2,(r[2]+r[3])/2,(r[4]+r[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(r[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}var nC={bounds:[-1,1,-1,1,-1,1],placeFactor:1},aC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nC,r),fe.setGetArray(e,t,["bounds"],6),fe.get(e,t,["placeFactor"]),fe.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),rC(e,t)}},oC={color:.5},iC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oC,r),fe.setGet(e,t,["color"])}};function sC(e,t){e.translate=function(t,r,n){var a=u(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+r,s+n)}}var lC={corner:[0,0,0]},cC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lC,r),fe.setGetArray(e,t,["corner"],3),sC(e)}},uC=function(e){return e},dC=Pa(new Float64Array(16)),fC=1e-6,pC=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];S(this,t),this.matrix=Pa(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?xn:uC}return x(t,[{key:"rotateFromDirections",value:function(e,t){var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(16);In(r,e[0],e[1],e[2]),In(n,t[0],t[1],t[2]),Kn(r,r),Kn(n,n);var o=Xn(r,n);return o>=1||(qn(this.tmp,r,n),On(this.tmp)1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(tt(dC,this.matrix))return this;for(var n=-1===r?e.length:t+3*r,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hC,r),fe.setGetArray(e,t,["direction"],3),vC(e,t)}};function bC(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,r=t.normal,n=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),n&&l?l(n):n&&!r&&s?s(n):r&&l&&l(r)}}}var TC={manipulator:null},SC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,TC,r),fe.setGet(e,t,["manipulator"]),bC(e,t)}},CC={name:""},xC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CC,r),fe.setGet(e,t,["name"])}};function PC(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function wC(e,t){var r={o:[],p1:[],p2:[]};e.normalize=function(){We(t.up),We(t.right),We(t.direction),e.modified()},e.updateFromOriginRightUp=function(n,a,o){(function(e,t,r,n){return PC(e,n.o)&&PC(t,n.p1)&&PC(r,n.p2)})(n,a,o,r)||(r.o=n.slice(),r.p1=a.slice(),r.p2=o.slice(),t.up=[o[0]-n[0],o[1]-n[1],o[2]-n[2]],t.right=[a[0]-n[0],a[1]-n[1],a[2]-n[2]],_e(t.up,t.right,t.direction),_e(t.direction,t.up,t.right),e.normalize(),e.modified())}}var OC={up:[0,1,0],right:[1,0,0],direction:[0,0,1]},AC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,r),fe.setGetArray(e,t,["up","right","direction"],3),wC(e,t)}};function MC(e,t){e.translate=function(t,r,n){var a=u(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+r,s+n)}}var IC={origin:null},RC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,IC,r),fe.setGetArray(e,t,["origin"],3),MC(e)}},EC={scale1:.5},DC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EC,r),fe.setGet(e,t,["scale1"])}},BC={scale3:[1,1,1]},VC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BC,r),fe.setGetArray(e,t,["scale3"],3)}},LC={text:"DefaultText"},NC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,r),fe.setGet(e,t,["text"])}},kC={visible:!0},FC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kC,r),fe.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},GC={shape:""},_C={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,GC,r),fe.setGet(e,t,["shape"])}},UC=fe.vtkErrorMacro,WC={bounds:aC,color:iC,corner:cC,direction:yC,manipulator:SC,name:xC,orientation:AC,origin:RC,scale1:DC,scale3:VC,text:NC,visible:FC,shape:_C};function jC(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];a||tC(r,n,t);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ex,r),rS.extend(e,t,r),JC(e,t)}var rx={newInstance:fe.newInstance(tx,"vtkImageCroppingWidget"),extend:tx},nx=fe.vtkErrorMacro;function ax(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,f(t.getExtent()))},e.requestData=function(e,r){var n=e[0];if(n){var a=n.getPointData().getScalars();if(a){var o=n.getExtent(),i=t.croppingPlanes&&6===t.croppingPlanes.length?o.map((function(e,r){return r%2==0?Math.max(e,Math.round(t.croppingPlanes[r])):Math.min(e,Math.round(t.croppingPlanes[r]))})):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=ei.newInstance();return s.shallowCopy(n),void(r[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var c=[i[2*l+1],i[2*l]];i[2*l]=c[0],i[2*l+1]=c[1]}for(var u=0;u<6;u+=2)i[u]=Math.max(i[u],o[u]),i[u+1]=Math.min(i[u+1],o[u+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=n.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,S=i[4];S<=i[5];++S)for(var C=i[2];C<=i[3];++C){var x=h+(C-o[2])*m+(S-o[4])*v,P=x+y,w=p.subarray(x,P);b.set(w,T),T+=w.length}var O=ei.newInstance({extent:i,origin:n.getOrigin(),direction:n.getDirection(),spacing:n.getSpacing()}),A=qt.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(A),r[0]=O}else nx("No scalars from input")}else nx("Invalid or missing input")},e.isResetAvailable=function(){if(null==t.croppingPlanes||0===t.croppingPlanes.length)return!1;var r=e.getInputData();if(r){var n=r.getExtent().find((function(e,r){return Math.abs(t.croppingPlanes[r]-e)>Number.EPSILON}));return void 0!==n}return!1}}var ox={};fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ox,r),fe.obj(e,t),fe.algo(e,t,1,1),fe.setGetArray(e,t,["croppingPlanes"],6),ax(e,t)}),"vtkImageCropFilter");var ix=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){ix[e.Name]=e}));var sx=Object.keys(ix);sx.sort();var lx,cx,ux={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(ix[e.Name]||(sx.push(e.Name),sx.sort()),ix[e.Name]=e)},removePresetByName:function(e){var t=sx.indexOf(e);t>-1&&sx.splice(t,1),delete ix[e]},getPresetByName:function(e){return ix[e]},rgbPresetNames:sx},dx=r(146),fx=r.n(dx),px=(lx=function(){!function(){var e={exports:{}},t=function(){function e(e,t){for(var r=0;r1?t-1:0),n=1;n1?t-1:0),a=1;a1?r-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:[];r([0,e,t,n],a)},v=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([1,e,t,n])};return self.addEventListener("message",(function(e){var t=e.data;Array.isArray(t)?p.apply(void 0,s(t)):t&&t.eventName&&n.emitLocally.apply(n,[t.eventName].concat(s(t.args)))})),n},e.exports.TransferableResponse=f;var p=e.exports;p((function(e,t){var r=e.array,n=e.min,a=e.max,o=e.component||0,i=e.numberOfComponents||1,s=e.numberOfBins,l=a-n,c=new Float32Array(s);c.fill(0);for(var u=r.length,d=o;d1&&void 0!==arguments[1]?arguments[1]:256,r=[];r.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=1,h=i*(c<1?c*m+(1-c)*g:(2-c)*m+(c-1)*v);h>r[u]&&(r[u]=h)}}return r}function Sx(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(r.length-1),i=!!n.fillStyle,s=a+t[1];e.lineWidth=n.lineWidth,e.strokeStyle=n.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[n[0]+(e-r[0])/r[2]*(n[1]-n[0]),(t-r[1])/r[3]]}function xx(e,t){var r=t.map((function(t){return Math.abs(t.position-e)})),n=Math.min.apply(Math,f(r));return r.indexOf(n)}function Px(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(r){var n=r.offsetX,a=r.offsetY;t&&r.preventDefault(),e(n,a)}}function wx(){yx.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,f(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function Ox(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,(function(e){return[e.pageX-o.left,e.pageY-o.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(yx[e].timeout),yx[e].ts=a.timeStamp,yx[e].singleTouche=i,yx[e].touches=a.touches.length):"touchmove"===a.type?(yx[e].ts=0,yx[e].count=0,yx[e].ready=!1):"touchend"===a.type&&(a.timeStamp-yx[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=n.numberOfBinToConsiders,o=void 0===a?1:a,i=n.numberOfBinsToSkip,s=void 0===i?1:i,l=n.numberOfComponents,c=void 0===l?1:l,d=n.component,f=void 0===d?0:d;t.histogram=null,t.histogramArray=r,t.dataRange=Ie(r,f,c);var p=u(t.dataRange,2),g=p[0],m=p[1],v=4,h=Math.floor(r.length/v)||1;h+=h%c;for(var y=0,b=[],T=[];yn;)a.shift();for(var l=a.reduce((function(e,t){return e+t}),0)/n,c=0,u=t.histogram.length;c1){for(var s=t.style.iconSize+t.style.padding,l=s,c=0;n>l;)c+=1,l+=s;switch(c){case 0:var d=e.addGaussian(0,1,.1,0,0),f=t.gaussians[d],p=mx({},f),g=bx.adjustPosition;t.activeGaussian=d,t.selectedGaussian=d,fe.setImmediate((function(){e.onDown(r,n),t.dragAction={originalXY:[0,0],action:g,gaussian:f,originalGaussian:p}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var m=xx(o,t.gaussians);m!==t.selectedGaussian&&(t.selectedGaussian=m,e.modified())}return!0},e.onHover=function(r,n){var a=20/t.canvas.height,o=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=u(Cx(r,n,t.graphArea),1)[0],c=i<0?t.selectedGaussian:xx(i,t.gaussians);t.canvas.style.cursor="default";var d=t.gaussians[c];if(t.enableRangeZoom&&l>=0&&nt.rangeZoom[1]-f?t.canvas.style.cursor=hx.adjustZoom:t.canvas.style.cursor=hx.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:bx.adjustZoom}}else if(d&&l>=0){var p,g=1-s;p=g>d.height+a?"adjustPosition":g>d.height-a?Math.abs(i-d.position).5*d.height+a?"adjustPosition":g>.5*d.height-a?Math.abs(i-d.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=hx[p];var m=bx[p],v=mx({},d);t.dragAction={originalXY:[i,s],action:m,gaussian:d,originalGaussian:v}}return c!==t.activeGaussian&&(t.activeGaussian=c,e.modified()),!0},e.onDown=function(r,n){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(r,n){if(t.dragAction){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,mx({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=Tx(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(r,n){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(r,n){return e.onUp(r,n),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(r,n){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(r,n){var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var r=function(){return!!t.mouseIsDown},n=function(){for(var e=yx.length,t=arguments.length,r=new Array(t),n=0;n1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),c=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(c-o/2,c,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c),e.stroke(),e.moveTo(c-o/2,c-l+t.style.strokeWidth+2),e.lineTo(c-o/2,c+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(c-o/2,c+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c+o/2+t.style.iconSize),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&Sx(e,i,Mx(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),Sx(e,i,Mx(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var d=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,r,n){var a=n||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(r[0],r[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var c=256*t*4,u=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[r[0]+a*n,r[0]+o*n]};var r=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var n=r(e);return n&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),n};var n=e.setRangeZoom;e.setRangeZoom=function(){var e=n.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,f(t.size))}var Ex={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 Dx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ex,r),fe.obj(e,t),fe.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),fe.setGetArray(e,t,["rangeZoom"],2),fe.get(e,t,["size","canvas","gaussians"]),fe.event(e,t,"opacityChange"),fe.event(e,t,"animation"),fe.event(e,t,"zoomChange"),Rx(e,t)}var Bx=mx({newInstance:fe.newInstance(Dx,"vtkPiecewiseGaussianWidget"),extend:Dx},Ix);function Vx(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,r){var n=e.computeWorldToDisplay(r,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=n[0],t.displayCenter[1]=n[1]}}var Lx={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]},Nx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lx,r),fe.setGet(e,t,["rotationFactor"]),fe.setGetArray(e,t,["displayCenter"],2),fe.setGetArray(e,t,["center"],3),Vx(e,t)};function kx(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,r){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,r){},e.onStartScroll=function(e,t,r){},e.onScroll=function(e,t,r){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var Fx={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1},Gx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fx,r),fe.setGet(e,t,["button","shift","control","alt"]),fe.set(e,t,["dragEnabled","scrollEnabled"]),kx(e,t)};function _x(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(3),o=new Float64Array(16),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,c,u){if(u){var d=c.getActiveCamera(),f=d.getPosition(),p=d.getFocalPoint();Pa(o);var g=t.center,m=t.rotationFactor;t.useFocalPointAsCenterOfRotation&&(g[0]=p[0],g[1]=p[1],g[2]=p[2]);var v=t.previousPosition.x-u.x,h=t.previousPosition.y-u.y,y=e.getView().getSize(),b=d.getViewUp();if(t.useWorldUpVec){var T=new Float64Array(3);Mn(T,t.worldUpVec),ke(T,Ge(f,t.worldUpVec)/Ge(t.worldUpVec,t.worldUpVec)),Le(g,T,T),Ra(o,o,T),Da(o,o,Ce(360*v/y[0]*m),t.worldUpVec),T[0]=-T[0],T[1]=-T[1],T[2]=-T[2],Ra(o,o,T),Ra(o,o,g)}else Ra(o,o,g),Da(o,o,Ce(360*v/y[0]*m),b);_e(d.getDirectionOfProjection(),b,i),Da(o,o,Ce(-360*h/y[1]*m),i),s[0]=-g[0],s[1]=-g[1],s[2]=-g[2],Ra(o,o,s),Jn(r,f,o),Jn(n,p,o),l[0]=b[0]+f[0],l[1]=b[1]+f[1],l[2]=b[2]+f[2],Jn(a,l,o),d.setPosition(r[0],r[1],r[2]),d.setFocalPoint(n[0],n[1],n[2]),d.setViewUp(a[0]-r[0],a[1]-r[1],a[2]-r[2]),d.orthogonalizeViewUp(),c.resetCameraClippingRange(),e.getLightFollowCamera()&&c.updateLightsGeometryToFollowCamera(),t.previousPosition=u}}}var Ux={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function Wx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ux,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["useWorldUpVec"]),fe.setGetArray(e,t,["worldUpVec"],3),fe.setGet(e,t,["useFocalPointAsCenterOfRotation"]),_x(e,t)}var jx={newInstance:fe.newInstance(Wx,"vtkMouseCameraTrackballRotateManipulator"),extend:Wx};function zx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,r,n){if(n){var a=n,o=t.previousPosition;t.previousPosition=n;var i=r.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var c=i.getViewUp(),u=[0,0,0];_e(i.getViewPlaneNormal(),c,u);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=u[0]*(f*=2*g)+c[0]*p;s[0]+=m,l[0]+=m,m=u[1]*f+c[1]*p,s[1]+=m,l[1]+=m,m=u[2]*f+c[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(r,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(r,a.x,a.y,y),T=h.computeDisplayToWorld(r,o.x,o.y,y),S=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],C=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(S[0],S[1],S[2]),i.setFocalPoint(C[0],C[1],C[2])}r.resetCameraClippingRange(),e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}}var Hx={};function Kx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hx,r),fe.obj(e,t),Nx(e,t,r),Gx(e,t,r),zx(e,t)}var Xx={newInstance:fe.newInstance(Kx,"vtkMouseCameraTrackballPanManipulator"),extend:Kx};function qx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView().getSize(),o=r.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,r,n){if(n){var a=t.previousPosition.y-n.y,o=r.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),c=o.getDirectionOfProjection(),u=a*t.zoomScale,d=u*c[0];s[0]+=d,l[0]+=d,d=u*c[1],s[1]+=d,l[1]+=d,d=u*c[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),r.resetCameraClippingRange()}e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),t.previousPosition=n}},e.onScroll=function(e,t,r){if(r){var n=t.getActiveCamera(),a=1-r/10;n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var Yx={zoomScale:0,flipDirection:!1};function Zx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yx,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["flipDirection"]),qx(e,t)}var Qx={newInstance:fe.newInstance(Zx,"vtkMouseCameraTrackballZoomManipulator"),extend:Zx};function $x(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var r=new Map;function n(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var n=e.getValue(),a=t*e.scale+r.get(e),o=n+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==n?(e.setValue(o),r.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?r.set(e,0):r.set(e,a)}e.setHorizontalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(r.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(r.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(r.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(r);t.containerSize=i.map((function(e){return e*o}))},e.onMouseMove=function(e,r,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=n(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],c=n(t.verticalListener,l);a(t.verticalListener,c)}t.previousPosition=o}},e.onScroll=function(e,r,n){t.scrollListener&&n&&a(t.scrollListener,n*t.scrollListener.step)},e.onStartScroll=e.onScroll}var Jx={horizontalListener:null,verticalListener:null,scrollListener:null};function eP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jx,r),fe.obj(e,t),Gx(e,t,r),$x(e,t)}var tP={newInstance:fe.newInstance(eP,"vtkMouseRangeManipulator"),extend:eP};function rP(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 nP=fe.vtkDebugMacro,aP=cT.States,oP={type:"StartInteractionEvent"},iP={type:"InteractionEvent"},sP={type:"EndInteractionEvent"};function lP(e,t,r,n,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],c=t.getInteractorStyle().computeDisplayToWorld(e,r,n,l),u=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[u[0]-c[0],u[1]-c[1],u[2]-c[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var cP={dollyToPosition:function(e,t,r,n){var a=r.getActiveCamera();if(a.getParallelProjection()){var o=n.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,c=t.y;lP(r,n,i,s,l,c),a.setParallelScale(a.getParallelScale()/e),lP(r,n,l,c,i,s)}else{var u=a.getFocalPoint(),d=a.getViewPlaneNormal();u=n.getInteractorStyle().computeWorldToDisplay(r,u[0],u[1],u[2]);var f=n.getInteractorStyle().computeDisplayToWorld(r,t.x,t.y,u[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),r.resetCameraClippingRange();var p=a.getPosition();u=a.getFocalPoint();var g=[0,0,0],m=d[0]*(u[0]-p[0])+d[1]*(u[1]-p[1])+d[2]*(u[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),r.resetCameraClippingRange()}},translateCamera:lP,dollyByFactor:function(e,t,r){if(!Number.isNaN(r)){var n=t.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/r):(n.dolly(r),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};function uP(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var r=function(t,r){var n=r.indexOf(t);return-1!==n&&(r.splice(n,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return r(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return r(e,t.gestureManipulators)};var n=function(t,r){return-1===r.indexOf(t)&&(r.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return n(e,t.vrManipulators)},e.addGestureManipulator=function(e){return n(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(1,r)},e.handleMiddleButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(2,r)},e.handleRightButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(3,r)},e.handleButton3D=function(r){r&&(t.currentManipulator=e.findVRManipulator(r.device,r.input,r.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,r.pokedRenderer,t.state,r.device,r.input,r.pressed),r.pressed?e.startCameraPose():e.endCameraPose()):nP("No manipulator found"))},e.handleMove3D=function(r){t.currentManipulator&&t.state===aP.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,r.pokedRenderer,t.state,r)},e.onButtonDown=function(r,n){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(r,n.shiftKey,n.controlKey,n.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,n.pokedRenderer,n.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(oP)):nP("No manipulator found"))},e.findMouseManipulator=function(e,r,n,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===r&&s.getControl()===n&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,r){for(var n=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===r&&(n=o)}return n},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(r){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===r&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(sP))},e.handleStartMouseWheel=function(r){if(!t.currentWheelManipulator){for(var n=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===r.shiftKey&&o.getControl()===r.controlKey&&o.getAlt()===r.altKey&&(n=o)}n?(t.currentWheelManipulator=n,t.currentWheelManipulator.onStartScroll(t.interactor,r.pokedRenderer,r.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(oP)):nP("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(sP))},e.handleMouseWheel=function(r){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,r.pokedRenderer,r.spinY,t.cachedMousePosition),e.invokeInteractionEvent(iP))},e.handleMouseMove=function(r){t.cachedMousePosition=r.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,r.pokedRenderer,r.position),e.invokeInteractionEvent(iP))},e.handleKeyPress=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyPress})).forEach((function(n){n.onKeyPress(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyDown=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyDown})).forEach((function(n){n.onKeyDown(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyUp=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyUp})).forEach((function(n){n.onKeyUp(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleStartPinch=function(r){e.startDolly();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,r.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(oP)},e.handleEndPinch=function(){e.endDolly();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPinchEnabled()&&(n.onEndPinch(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(sP)},e.handleStartRotate=function(r){e.startRotate();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,r.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(oP)},e.handleEndRotate=function(){e.endRotate();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isRotateEnabled()&&(n.onEndRotate(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(sP)},e.handleStartPan=function(r){e.startPan();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,r.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(oP)},e.handleEndPan=function(){e.endPan();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPanEnabled()&&(n.onEndPan(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(sP)},e.handlePinch=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,r.pokedRenderer,r.scale),a++)}a&&e.invokeInteractionEvent(iP)},e.handlePan=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPanEnabled()&&(o.onPan(t.interactor,r.pokedRenderer,r.translation),a++)}a&&e.invokeInteractionEvent(iP)},e.handleRotate=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,r.pokedRenderer,r.rotation),a++)}a&&e.invokeInteractionEvent(iP)}}var dP={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function fP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dP,r),cT.extend(e,t,r),fe.setGet(e,t,["rotationFactor"]),fe.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),fe.setGetArray(e,t,["centerOfRotation"],3),uP(e,t)}var pP=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mP,r),fe.obj(e,t),fe.get(e,t,["renderer"]),fe.getArray(e,t,["selectionPoint","pickPosition"]),fe.setGet(e,t,["pickFromList","pickList"]),gP(e,t)}var hP={newInstance:fe.newInstance(vP,"vtkAbstractPicker"),extend:vP};function yP(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 bP=fe.vtkErrorMacro,TP=fe.vtkWarningMacro;function SP(e,t){t.classHierarchy.push("vtkPicker");var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CP,r),hP.extend(e,t,r),fe.setGet(e,t,["tolerance"]),fe.setGetArray(e,t,["mapperPosition"],3),fe.get(e,t,["mapper","dataSet","actors","pickedPositions"]),fe.event(e,t,"pickChange"),SP(e,t)}var PP={newInstance:fe.newInstance(xP,"vtkPicker"),extend:xP},wP=fe.vtkErrorMacro;function OP(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(r,n,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(r,n);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(r,n,a,o));return i},e.intersectActorWithLine=function(e,r,n,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],c=0;c<3;c++)l[c]=r[c]-e[c];var u,d=Ge(l,l);if(0===d)return wP("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=o.getPoints();if(t.useCells)for(var y=o.getPolys().getData(),b=y[0],T=o.getPolys().getNumberOfCells(),S=0;S=0&&u<=1&&u<=p+t.tolerance){for(var O=0,A=0;A<3;A++){m[A]=e[A]+u*l[A];var M=Math.abs(v[A]-m[A]);M>O&&(O=M)}O<=n&&O=0&&u<=1&&u<=p+t.tolerance){for(var I=0,R=0;R<3;R++){m[R]=e[R]+u*l[R];var E=Math.abs(v[R]-m[R]);E>I&&(I=E)}I<=n&&I2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,AP,r),PP.extend(e,t,r),fe.getArray(e,t,["pointIJK"]),fe.get(e,t,["pointId"]),fe.setGet(e,t,["useCells"]),OP(e,t)}var IP={newInstance:fe.newInstance(MP,"vtkPointPicker"),extend:MP},RP=fe.vtkWarningMacro;function EP(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(r,n){if(!t.deleted){var a=n[0],o=a?a.getPoints().getDataType():t.pointType,i=hm.newInstance(),s=[],l=[];if(Ne(t.point1,t.origin,s),Ne(t.point2,t.origin,l),e.updatePlane(s,l)){var c=t.xResolution,u=t.yResolution,d=(c+1)*(u+1),f=c*u,p=fe.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=qt.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=qt.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,S=0;S2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DP,r),t.normal=[0,0,1],t.center=[0,0,0],fe.obj(e,t),fe.setGet(e,t,["xResolution","yResolution"]),fe.setGetArray(e,t,["origin"],3),fe.getArray(e,t,["point1","point2","normal","center"],3),fe.algo(e,t,0,1),EP(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}var VP={newInstance:fe.newInstance(BP,"vtkPlaneSource"),extend:BP},LP={Coordinate:{DISPLAY:0,NORMALIZED_DISPLAY:1,VIEWPORT:2,NORMALIZED_VIEWPORT:3,PROJECTION:4,VIEW:5,WORLD:6}};function NP(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 kP=LP.Coordinate,FP=fe.vtkErrorMacro;function GP(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return FP("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_P,r),fe.obj(e,t),fe.set(e,t,["property"]),fe.get(e,t,["value"]),fe.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),fe.getArray(e,t,["value"],3),GP(e,t)}var WP=function(e){for(var t=1;t1?1e3*e:1e3;this.actor.getMapper().setMaximumSamplesPerRay(t),this.renderWindow.render()}get resolution(){return Math.round(1/this._raysDistance)}get presetsList(){return ux.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,r=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(r,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set rangeLUT([e,t]){this._rangeLUT=[e,t],this.actor.getProperty().getRGBTransferFunction(0).setMappingRange(e,t)}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Xi.newInstance();let r;t.applyColorMap(ux.getPresetByName(e)),r=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...r),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const n=$i.newInstance();this.actor.getProperty().setScalarOpacity(0,n),this.ctfun=t,this.ofun=n,this.updateWidget()}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),r=this.actor.getMapper();e?(t.onLeftButtonPress((()=>{r.setSampleDistance(5*this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))):(t.onLeftButtonPress((()=>{r.setSampleDistance(this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})))}initVR(){const e=yT.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize((()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)})),window.addEventListener("resize",(t=>{e.resize()})),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=Is(e);this.actor=t,this.lut="Grayscale",this.resolution=2,this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setActorProperties(),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return ux.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(.3),this.actor.getProperty().setDiffuse(.7),this.actor.getProperty().setSpecular(.3),this.actor.getProperty().setSpecularPower(.8)}setupCropWidget(){const e=QT.newInstance();e.setRenderer(this.renderer);const t=rx.newInstance(),r=(e.addWidget(t),t.getWidgetState().getCroppingPlanes());r.onModified((()=>{const e=function(e,t){const r=ni();Ka(r,e.getIndexToWorld());const n=e=>{const t=[0,0,0];return ta(t,e,r),t},[a,o,i,s,l,c]=t,u=e.indexToWorld([a,i,l]),d=e.indexToWorld([o,s,c]);return[cr.newInstance({normal:n([1,0,0]),origin:u}),cr.newInstance({normal:n([-1,0,0]),origin:d}),cr.newInstance({normal:n([0,1,0]),origin:u}),cr.newInstance({normal:n([0,-1,0]),origin:d}),cr.newInstance({normal:n([0,0,1]),origin:u}),cr.newInstance({normal:n([0,0,-1]),origin:d})]}(a,r.getPlanes());n.removeAllClippingPlanes(),e.forEach((e=>{n.addClippingPlane(e)})),n.modified()}));let n=this.actor.getMapper(),a=n.getInputData();t.copyImageDataDescription(a),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const r=Bx.newInstance({numberOfBins:256,size:[e,t]});r.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",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:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),r.setContainer(this.PGwidgetElement),window.addEventListener("resize",(e=>{r.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),r.render()})),this.PGwidget=r}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,r=1.8;this.PGwidget.addGaussian(this.wl,e,this.ww,t,r)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified((()=>{this.PGwidget.render(),this.renderWindow.render()})),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation((e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)})),this.PGwidget.onOpacityChange((e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}}))}setupInteractor(){const e=jx.newInstance({button:1}),t=Xx.newInstance({button:3,control:!0}),r=Qx.newInstance({button:3,scrollEnabled:!0}),n=tP.newInstance({button:1,shift:!0});let a=this;n.setVerticalListener(-1,1,.001,(function(){return a.wl}),(function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let r=a.PGwidget.getGaussians().slice();r[0].position=a.wl,a.PGwidget.setGaussians(r)})),n.setHorizontalListener(.1,2.1,.001,(function(){return a.ww}),(function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let r=a.PGwidget.getGaussians().slice();r[0].width=a.ww,a.PGwidget.setGaussians(r)}));const o=pP.newInstance();o.addMouseManipulator(n),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(r),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel((()=>this.resetMeasurementState())),this.renderWindow.getInteractor().onRightButtonPress((()=>this.resetMeasurementState()))}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,r){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(r,e);break;case"Rotation":this.resetMeasurementState(r),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let r=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter((e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName())).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(r);const n=IP.newInstance();if(n.setPickFromList(1),n.initializePickList(),!this._pickingPlane){const e=VP.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const r=Jp.newInstance();r.setInputConnection(e.getOutputPort());const n=Cp.newInstance();n.setMapper(r),n.getProperty().setOpacity(.01),this.renderer.addActor(n),this._pickingPlane=e,this._planeActor=n}n.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress((r=>{if(this.renderer!==r.pokedRenderer)return;const a=r.position,o=[a.x,a.y,0];if(n.pick(o,this.renderer),0===n.getActors().length){const e=n.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const r=n.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${r}`);const a=WP.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...r);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,r,n){jP[n](e,t,r)}(e,o,r,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()}))}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor&&(this.actor.getMapper().delete(),this.actor.delete(),this.actor=null),this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.getCanvas().remove(),this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}const qP=fe;const YP={slabThickness:.1};function ZP(e,t,r={}){Object.assign(t,YP,r),pP.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onScroll"]),qP.get(e,t,["slabThickness","viewUp"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulator=Xx.newInstance({button:1,shift:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function n(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=r=>{if(i(r),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),r){const i=r.getCurrentRenderer().getActiveCamera();a=i.onModified((()=>{n(),e.modified()})),o=r.onAnimation((()=>{const{slabThickness:e}=t,r=i.getDistance(),n=r-e/2,a=r+e/2;i.setClippingRange(n,a)}))}},e.handleMouseMove=qP.chain(e.handleMouseMove,(()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:r}=t,n=e.getActiveCamera(),a=n.getDistance(),o=a-r/2,i=a+r/2;n.setClippingRange(o,i)}));const s=e.setVolumeMapper;e.setVolumeMapper=e=>{if(s(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.getSlice=()=>{const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=e.getSliceNormal(),a=gC().identity().rotateFromDirections(n,[1,0,0]),o=r.getFocalPoint();return a.apply(o),o[0]},e.setSlice=r=>{const n=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,r){return er?r:e}(r,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=n.getDistance(),c=n.getDirectionOfProjection();Lt.normalize(c);const u=(a[1]+a[0])/2,d=[s[0]-c[0]*u,s[1]-c[1]*u,s[2]-c[2]*u],f=[d[0]+c[0]*i,d[1]+c[1]*i,d[2]+c[2]*i],p=[f[0]-c[0]*l,f[1]-c[1]*l,f[2]-c[2]*l];n.setPosition(...p),n.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}},e.getSliceRange=()=>{if(t.volumeMapper){const n=e.getSliceNormal();if(n[0]===r.sliceNormal[0]&&n[1]===r.sliceNormal[1]&&n[2]===r.sliceNormal[2])return r.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=gC().identity().rotateFromDirections(n,[1,0,0]);a.forEach((e=>o.apply(e)));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),tt.volumeMapper&&t.interactor?t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection():[0,0,0],e.setSliceNormal=(r,n=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...r],t.viewUp=[...n];const o=[...r],i=[...n];if(t.volumeMapper){Lt.normalize(o);let r=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(r=t.volumeMapper.getMapper());let n=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(r.getInputData().getDirection());Lt.transpose3x3(n,n),Lt.multiply3x3_vect3(n,o,o);let s=a.getFocalPoint(),l=a.getDistance(),c=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),r=Math.sqrt(Lt.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],c=90,l=r/(2*Math.tan(c/360*Math.PI))}const u=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Lt.multiply3x3_vect3(n,i,i);const{slabThickness:d}=t;a.setPosition(...u),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(c),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}},e.setSlabThickness=e=>{t.slabThickness=e;const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=r.getDistance();r.setClippingRange(n-e/2,n+e/2)},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),n()}(e,t)}const QP=qP.newInstance(ZP,"vtkInteractorStyleMPRSlice"),$P=Object.assign({newInstance:QP,extend:ZP}),{States:JP}=rT;const ew={wlStartPos:[0,0],levelScale:1};function tw(e,t,r={}){Object.assign(t,ew,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=n=>{const a=[n.position.x,n.position.y];t.state===JP.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),r&&r(n)};const n=e.setVolumeMapper;e.setVolumeMapper=e=>{if(n(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.windowLevelFromMouse=([r,n])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(r-t.wlStartPos[0])*o,s=(n-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:c}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),c=Math.round(c+s),e.setWindowLevel(l,c),t.wlStartPos=[r,n];const u=e.getOnLevelsChanged();u&&u({windowCenter:c,windowWidth:l})},e.getWindowLevel=()=>function(e,t){const r=Math.abs(e-t);return{windowWidth:r,windowCenter:e+r/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice()),e.setWindowLevel=(e,r)=>{const n=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,r);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(n.lower,n.upper)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=r=>{t.wlStartPos=[r.position.x,r.position.y],r.shiftKey||r.controlKey?a&&a(r):e.startWindowLevel()},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===JP.IS_WINDOW_LEVEL?e.endWindowLevel():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const rw=qP.newInstance(tw,"vtkInteractorStyleMPRWindowLevel"),nw=Object.assign({newInstance:rw,extend:tw}),{States:aw}=rT;const ow={};function iw(e,t,r={}){Object.assign(t,ow,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onClickCallback"]),function(e,t){function r(t){const r=[t.position.x,t.position.y],n=t.pokedRenderer,a=e.getOnClickCallback(),o=WP.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(r[0],r[1],0);const i=o.getComputedWorldValue(n);i.length&&a({worldPos:i,displayPos:r}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=e=>{t.state===aw.IS_SLICE&&r(e),n&&n(e)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=n=>{n.shiftKey||n.controlKey?a&&a(n):t.volumeMapper&&(r(n),e.startSlice())};const o=e.setVolumeMapper;e.setVolumeMapper=e=>{if(o(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===aw.IS_SLICE?e.endSlice():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const sw=qP.newInstance(iw,"vtkInteractorStyleMPRCrosshairs"),lw=Object.assign({newInstance:sw,extend:iw}),{States:cw}=rT;const uw={wlStartPos:[0,0],levelScale:1};function dw(e,t,r={}){Object.assign(t,uw,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),function(e,t){function r(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=e=>{"zoom"==e?t.leftManipulator=Qx.newInstance({button:1}):"pan"==e?t.leftManipulator=Xx.newInstance({button:1}):console.error("No tool found for",e),r()},t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),r();const n=e.setInteractor;e.setInteractor=r=>{if(n(r),null===r)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();r.onAnimation(a)}}(e,t)}const fw=qP.newInstance(dw,"vtkInteractorStyleMPRPanZoom"),pw=Object.assign({newInstance:fw,extend:dw}),gw=[[0,0,1],[-1,0,0],[0,1,0]],mw=[[0,-1,0],[0,0,1],[0,0,1]];class vw{constructor(e,t,r){this.VERBOSE=!1,this._key=e,this._element=r,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=gw[t],this.sliceViewUp=mw[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=yT.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(r),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,r,n){this._volume=e;const a=$P.newInstance();a.setOnScroll(r),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),n()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,r=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let n=[];qn(n,e.sliceViewUp,e.slicePlaneNormal),Kn(n,n);let a=e.sliceViewUp;const o=ba();Da(o,o,Ms(e.slicePlaneYRotation),a),Da(o,o,Ms(e.slicePlaneXRotation),n),this.VERBOSE&&console.log(t,e.slicePlaneNormal,o),Jn(t,e.slicePlaneNormal,o);const i=ni();ai(i,t,Ms(-e.viewRotation)),si(i,i);const s=ni();ai(s,n,Ms(e.slicePlaneXRotation)),si(s,s);(function(e,t,r){e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3]})(ni(),s,i),ta(r,e.sliceViewUp,i);const l=this._genericRenderWindow.getRenderWindow(),c=l.getInteractor().getInteractorStyle();c&&c.setSliceNormal&&c.setSliceNormal(t,r),l.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],r=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let n,a;"left"===this._key?(n=t[1],a=t[2]):"front"===this._key?(n=t[0],a=t[2]):"top"===this._key&&(n=t[0],a=t[1]),r>=n/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(n/r+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),r=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&r.getSliceNormal()&&e.setSliceNormal(r.getSliceNormal(),r.getViewUp()),e.setSlabThickness&&r.getSlabThickness()&&e.setSlabThickness(r.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class hw{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const r=t-e/2,n=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(r,n),Object.keys(this.elements).forEach(((r,n)=>{this.mprViews[r].wwwl=[e,t]}))}initMPR(){Object.keys(this.elements).forEach(((e,t)=>{try{this.mprViews[e]=new vw(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}})),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce(((e,t)=>{let{slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:c}=e[t];return e[t]={slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:c},e}),Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce(((e,t)=>({...e,[t]:[0,0]})),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let r=Is(t);this.volume=r,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(r.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach((t=>{this.mprViews[t].initView(r,e,(()=>{this.onScrolled.call(this,e)}),(()=>{this.onScrolled.call(this,e)}))})),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"pan"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnPanChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"zoom"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnZoomChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach((([t])=>{const r=nw.newInstance();r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnLevelsChanged((r=>{this.updateLevels({...r,srcKey:t},e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach((([r])=>{const n=lw.newInstance();n.setOnScroll((()=>{t.onScrolled(e)})),n.setOnClickCallback((({worldPos:n})=>{t.onCrosshairPointSelected({worldPos:n,srcKey:r},e)})),this.mprViews[r].setInteractor(n)})),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},r){Object.keys(this.elements).forEach((n=>{if(n!==e){const e=this.mprViews[n]._genericRenderWindow.getRenderWindow(),r=e.getInteractor().getInteractorStyle(),a=r.getSliceNormal(),o=gC().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];r.setSlice(s),e.render()}this.updateInteractorCenters(r)})),this.sliceIntersection=[...t],r.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:r},n){n.views[r].window.center=e,n.views[r].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter((e=>e!==r)).forEach((r=>{this.mprViews[r].wwwl=[t,e]}))}onScrolled(e){let t=[];Object.keys(this.elements).forEach((e=>{const r=this.mprViews[e].camera;t.push({position:r.getFocalPoint(),normal:r.getDirectionOfProjection()})}));const r=((e,t,r)=>{try{let n=cr.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(n.intersection){const{l0:e,l1:t}=n,a=cr.intersectWithLine(e,t,r.position,r.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN})(...t);return Number.isNaN(r)||r.some((e=>Number.isNaN(e)))||(this.sliceIntersection=[...r],e.sliceIntersection=[...r],this.VERBOSE&&console.log("updating slice intersection",r)),this.updateInteractorCenters(e),r}onRotate(e,t,r,n){switch(e){case"top":"x"===t?n.views.front.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneYRotation=r);break;case"left":"x"===t?n.views.top.slicePlaneXRotation=r:"y"===t&&(n.views.front.slicePlaneXRotation=r);break;case"front":"x"===t?n.views.top.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneXRotation=r)}Object.keys(this.elements).filter((t=>t!==e)).forEach((e=>{this.mprViews[e].updateSlicePlane(n.views[e])})),this.VERBOSE&&console.log("afterOnRotate",n)}onThickness(e,t,r,n){const a=r>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",n.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=r,n.views[o].sliceThickness=r}updateInteractorCenters(e){Object.keys(this.elements).forEach((t=>{const r=this.mprViews[t]._genericRenderWindow.getRenderer(),n=WP.newInstance();n.setCoordinateSystemToWorld(),n.setValue(...this.sliceIntersection);const a=n.getComputedDisplayValue(r);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a}))}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach((e=>{e.onResize()})),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach((e=>{this.mprViews[e].destroy()}))}}console.groupCollapsed("%c** dtk **","background: #0aa658; color: #000000; line-height: 1.6"),console.log("Version 1.0.0"),console.log("Detected graphic card:"),console.log(function(){const e=document.createElement("canvas").getContext("webgl");if(!e)return{error:"no webgl"};const t=e.getExtension("WEBGL_debug_renderer_info");return t?{vendor:e.getParameter(t.UNMASKED_VENDOR_WEBGL),renderer:e.getParameter(t.UNMASKED_RENDERER_WEBGL)}:{error:"no WEBGL_debug_renderer_info"}}()),console.groupEnd("dtk")})(),n})()})); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(self,(function(){return(()=>{var e={757:(e,t,r)=>{e.exports=r(666)},289:(e,t,r)=>{"use strict";var n=r(215),a="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,i=Array.prototype.concat,s=Object.defineProperty,l=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,r,n){var a;(!(t in e)||"function"==typeof(a=n)&&"[object Function]"===o.call(a)&&n())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);a&&(o=i.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,r)=>{"use strict";var n=r(289),a=r(221),o=r(168),i=r(471),s=o(),l=function(){return s};n(l,{getPolyfill:o,implementation:a,shim:i}),e.exports=l},168:(e,t,r)=>{"use strict";var n=r(221);e.exports=function(){return"object"==typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},471:(e,t,r)=>{"use strict";var n=r(289),a=r(168);e.exports=function(){var e=a();if(n.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=r(414),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&a.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=i(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var g=c&&r;if(s&&e.length>0&&!a.call(e,0))for(var m=0;m0)for(var v=0;v{"use strict";var n=Array.prototype.slice,a=r(414),o=Object.keys,i=o?function(e){return o(e)}:r(987),s=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return a(e)?s(n.call(e)):s(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),i=new M(n||[]);return o._invoke=function(e,t,r){var n=d;return function(a,o){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===a)throw o;return R()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=w(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=g,r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function v(){}function h(){}function y(){}var b={};l(b,o,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(I([])));S&&S!==r&&n.call(S,o)&&(b=S);var C=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(a,o,i,s){var l=u(e[a],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(l.arg)}var a;this._invoke=function(e,n){function o(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(o,o):o()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function I(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},377:(e,t,r)=>{var n=r(832),a=r(652),o=r(801),i=r(30),s=r(618),l=r(49),c=r(971);c.alea=n,c.xor128=a,c.xorwow=o,c.xorshift7=i,c.xor4096=s,c.tychei=l,e.exports=c},832:function(e,t,r){var n;!function(e,a,o){function i(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new i(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},49:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>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):r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},652:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},618:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,o=t.i;return t.w=n=n+1640531527|0,r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,a,o,i,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(i=i+1640531527|0,a=0==(r=s[127&o]^=n+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=i,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},30:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},801:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>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 l(e,t){var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},971:function(e,t,r){var n;!function(a,o,i){var s,l=256,c=i.pow(l,6),u=i.pow(2,52),d=2*u,f=255;function p(e,t,r){var n=[],f=h(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,r=t&&t.plugins;return[+new Date,a,r,a.screen,y(o)]}}():e,3),n),p=new g(n),b=function(){for(var e=p.g(6),t=c,r=0;e=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|p.g(4)},b.quick=function(){return p.g(4)/4294967296},b.double=b,h(y(p.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,p),e.state=function(){return m(p,{})}),r?(i.random=e,t):e})(b,f,"global"in t?t.global:this==i,t.state)}function g(e){var t,r=e.length,n=this,a=0,o=n.i=n.j=0,i=n.S=[];for(r||(e=[r++]);a{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],a=e[2],o=e[3];n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&a)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+t[2]+606105819|0)<<17|a>>>15)+o|0)&o|~a&r)+t[3]-1044525330|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&a)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+t[6]-1473231341|0)<<17|a>>>15)+o|0)&o|~a&r)+t[7]-45705983|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&a)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+t[10]-42063|0)<<17|a>>>15)+o|0)&o|~a&r)+t[11]-1990404162|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&a)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+t[14]-1502002290|0)<<17|a>>>15)+o|0)&o|~a&r)+t[15]+1236535329|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[1]-165796510|0)<<5|r>>>27)+n|0)&a|n&~a)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|a>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[5]-701558691|0)<<5|r>>>27)+n|0)&a|n&~a)+t[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|a>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[9]+568446438|0)<<5|r>>>27)+n|0)&a|n&~a)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|a>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&a|n&~a)+t[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|a>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^a)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|a>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^a)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|a>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^a)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|a>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^a)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|a>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|n>>>9)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~a))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[14]-1416354905|0)<<15|a>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~a))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[10]-1051523|0)<<15|a>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~a))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[6]-1560198380|0)<<15|a>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~a))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[2]+718787259|0)<<15|a>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+a|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=a+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function a(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var t,a,o,i,s,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,n(e.substring(t-64,t)));for(a=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}function i(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;tc?new ArrayBuffer(0):(n=c-l,a=new ArrayBuffer(n),o=new Uint8Array(a),i=new Uint8Array(this,l,n),o.set(i),a)}}(),u.prototype.append=function(e){return this.appendBinary(l(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,a=this._buff.length;for(t=64;t<=a;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.prototype.end=function(e){var t,r,n=this._buff,a=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var n,a,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(r(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=a,e[15]=o,r(this._hash,e)},u.hash=function(e,t){return u.hashBinary(l(e),t)},u.hashBinary=function(e,t){var r=s(o(e));return t?c(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var t,n,o,i,s,l=(n=this._buff.buffer,o=e,i=!0,(s=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(o),n.byteLength),i?s:s.buffer),c=l.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)r(this._hash,a(l.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,a=new ArrayBuffer(n),o=new Uint8Array(a);for(r=0;r>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}(new Uint8Array(e)));return t?c(n):n},u}()},146:(e,t,r)=>{const n=r(544);e.exports=class extends n{constructor(e){super(),this._messageId=1,this._messages=new Map,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._id=Math.ceil(1e7*Math.random())}terminate(){this._worker.terminate()}isFree(){return 0===this._messages.size}jobsLength(){return this._messages.size}exec(e,t=null,r=[],n){return new Promise(((a,o)=>{const i=this._messageId++;this._messages.set(i,[a,o,n]),this._worker.postMessage([i,t,e],r||[])}))}postMessage(e=null,t=[],r){return new Promise(((n,a)=>{const o=this._messageId++;this._messages.set(o,[n,a,r]),this._worker.postMessage([o,e],t||[])}))}emit(e,...t){this._worker.postMessage({eventName:e,args:t})}_onMessage(e){if(!Array.isArray(e.data)&&e.data.eventName)return super.emit(e.data.eventName,...e.data.args);const[t,...r]=e.data;if(1===t)this._onEvent(...r);else{if(0!==t)throw new Error(`Wrong message type '${t}'`);this._onResult(...r)}}_onResult(e,t,r){const[n,a]=this._messages.get(e);return this._messages.delete(e),1===t?n(r):a(r)}_onEvent(e,t,r){const[,,n]=this._messages.get(e);n&&n(t,r)}}},544:e=>{e.exports=class{constructor(){Object.defineProperty(this,"__listeners",{value:{},enumerable:!1,writable:!1})}emit(e,...t){if(!this.__listeners[e])return this;for(const r of this.__listeners[e])r(...t);return this}once(e,t){const r=(...n)=>{this.off(e,r),t(...n)};return this.on(e,r)}on(e,t){return this.__listeners[e]||(this.__listeners[e]=[]),this.__listeners[e].push(t),this}off(e,t){return this.__listeners[e]=t?this.__listeners[e].filter((e=>e!==t)):[],this}}},42:()=>{}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{MPRManager:()=>hw,VRView:()=>XP,buildVtkVolume:()=>ws,loadDemoSerieWithLarvitar:()=>As});var e={};r.r(e),r.d(e,{add:()=>Rn,angle:()=>oa,bezier:()=>Qn,ceil:()=>Vn,clone:()=>wn,copy:()=>Mn,create:()=>Pn,cross:()=>qn,dist:()=>ga,distance:()=>Un,div:()=>pa,divide:()=>Bn,dot:()=>Xn,equals:()=>ca,exactEquals:()=>la,floor:()=>Ln,forEach:()=>ya,fromValues:()=>An,hermite:()=>Zn,inverse:()=>Hn,len:()=>va,length:()=>On,lerp:()=>Yn,max:()=>kn,min:()=>Nn,mul:()=>fa,multiply:()=>Dn,negate:()=>zn,normalize:()=>Kn,random:()=>$n,rotateX:()=>ra,rotateY:()=>na,rotateZ:()=>aa,round:()=>Fn,scale:()=>Gn,scaleAndAdd:()=>_n,set:()=>In,sqrDist:()=>ma,sqrLen:()=>ha,squaredDistance:()=>Wn,squaredLength:()=>jn,str:()=>sa,sub:()=>da,subtract:()=>En,transformMat3:()=>ea,transformMat4:()=>Jn,transformQuat:()=>ta,zero:()=>ia});var t={};r.r(t),r.d(t,{add:()=>lo,adjoint:()=>Aa,clone:()=>Ta,copy:()=>Sa,create:()=>ba,determinant:()=>Ma,equals:()=>go,exactEquals:()=>po,frob:()=>so,fromQuat:()=>Ya,fromQuat2:()=>ja,fromRotation:()=>Fa,fromRotationTranslation:()=>Wa,fromRotationTranslationScale:()=>Xa,fromRotationTranslationScaleOrigin:()=>qa,fromScaling:()=>ka,fromTranslation:()=>Na,fromValues:()=>Ca,fromXRotation:()=>Ga,fromYRotation:()=>_a,fromZRotation:()=>Ua,frustum:()=>Za,getRotation:()=>Ka,getScaling:()=>Ha,getTranslation:()=>za,identity:()=>Pa,invert:()=>Oa,lookAt:()=>ao,mul:()=>mo,multiply:()=>Ia,multiplyScalar:()=>uo,multiplyScalarAndAdd:()=>fo,ortho:()=>ro,orthoNO:()=>to,orthoZO:()=>no,perspective:()=>$a,perspectiveFromFieldOfView:()=>eo,perspectiveNO:()=>Qa,perspectiveZO:()=>Ja,rotate:()=>Da,rotateX:()=>Ba,rotateY:()=>Va,rotateZ:()=>La,scale:()=>Ea,set:()=>xa,str:()=>io,sub:()=>vo,subtract:()=>co,targetTo:()=>oo,translate:()=>Ra,transpose:()=>wa});var a={};function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{add:()=>Uo,adjoint:()=>Oo,clone:()=>bo,copy:()=>To,create:()=>ho,determinant:()=>Ao,equals:()=>Ko,exactEquals:()=>Ho,frob:()=>_o,fromMat2d:()=>Lo,fromMat4:()=>yo,fromQuat:()=>No,fromRotation:()=>Bo,fromScaling:()=>Vo,fromTranslation:()=>Do,fromValues:()=>So,identity:()=>xo,invert:()=>wo,mul:()=>Xo,multiply:()=>Mo,multiplyScalar:()=>jo,multiplyScalarAndAdd:()=>zo,normalFromMat4:()=>ko,projection:()=>Fo,rotate:()=>Ro,scale:()=>Eo,set:()=>Co,str:()=>Go,sub:()=>qo,subtract:()=>Wo,translate:()=>Io,transpose:()=>Po});var i={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:i.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:i};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?t-1:0),n=1;n1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(t);var r=[];function n(e){r[e]=null}function a(e){return Object.freeze({unsubscribe:function(){n(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++D),"classHierarchy"in t?t.classHierarchy instanceof I||(t.classHierarchy=I.from(t.classHierarchy)):t.classHierarchy=new I("vtkObject"),e.isDeleted=function(){return!!t.deleted},e.modified=function(n){t.deleted?F("instance deleted - cannot call any method"):n&&n0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(r).forEach((function(i){var s=a?null:e["set".concat(H(i))];s&&Array.isArray(r[i])&&s.length>1?o=s.apply(void 0,f(r[i]))||o:s?o=s(r[i])||o:(-1!==["mtime"].indexOf(i)||n||G("Warning: Set value to model directly ".concat(i,", ").concat(r[i])),o=t[i]!==r[i]||o,t[i]=r[i])})),o},e.get=function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&void 0!==arguments[1]&&arguments[1];if(r.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(r.getClassName()," into ").concat(e.getClassName()));var a=r.get(),o=Object.keys(t).sort(),i=Object.keys(a).sort();i.forEach((function(e){var r=o.indexOf(e);-1===r?n&&k("add ".concat(e," in shallowCopy")):o.splice(r,1),t[e]=a[e]})),o.length&&n&&k("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function Q(e,t,r){r.forEach((function(r){"object"===d(r)?e["get".concat(H(r.name))]=function(){return t[r.name]}:e["get".concat(H(r))]=function(){return t[r]}}))}W.Float32Array=Float32Array,W.Float64Array=Float64Array,W.Uint8Array=Uint8Array,W.Int8Array=Int8Array,W.Uint16Array=Uint16Array,W.Int16Array=Int16Array,W.Uint32Array=Uint32Array,W.Int32Array=Int32Array,W.Uint8ClampedArray=Uint8ClampedArray;var $={enum:function(e,t,r){return function(n){if("string"==typeof n){if(void 0!==r.enum[n])return t[r.name]!==r.enum[n]&&(t[r.name]=r.enum[n],e.modified(),!0);throw F("Set Enum with invalid argument ".concat(r,", ").concat(n)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof n){if(t[r.name]!==n){if(-1!==Object.keys(r.enum).map((function(e){return r.enum[e]})).indexOf(n))return t[r.name]=n,e.modified(),!0;throw F("Set Enum outside numeric range ".concat(r,", ").concat(n)),new RangeError("Set Enum outside numeric range")}return!1}throw F("Set Enum with invalid argument (String/Number) ".concat(r,", ").concat(n)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function J(e){if("object"===d(e)){var t=$[e.type];if(t)return function(r,n){return t(r,n,e)};throw F("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,r){return function(n){return r.deleted?(F("instance deleted - cannot call any method"),!1):r[e]!==n&&(r[e]=n,t.modified(),!0)}}}function ee(e,t,r){r.forEach((function(r){"object"===d(r)?e["set".concat(H(r.name))]=J(r)(e,t):e["set".concat(H(r))]=J(r)(e,t)}))}function te(e,t,r){Q(e,t,r),ee(e,t,r)}function re(e,t,r){r.forEach((function(r){e["get".concat(H(r))]=function(){return t[r]?[].concat(t[r]):t[r]},e["get".concat(H(r),"ByReference")]=function(){return t[r]}}))}function ne(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;r.forEach((function(r){if(t[r]&&n&&t[r].length!==n)throw new RangeError("Invalid initial number of values for array (".concat(r,")"));e["set".concat(H(r))]=function(){if(t.deleted)return F("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s=0)&&(c=c[0],u=!0),null==c)l=t[r]!==c;else{if(n&&c.length!==n){if(!(c.length4&&void 0!==arguments[4]?arguments[4]:void 0;re(e,t,r),ne(e,t,r,n,a)}var oe=Symbol("Event abort");function ie(e,t){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},n={};return e(n,r,t),Object.freeze(n)};return t&&T.register(t,r),r}function se(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},r),e.setKey=function(e,r){t.keystore[e]=r},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 ue=1,de="__root__",fe={algo:function(e,t,r,n){function a(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?F("instance deleted - cannot call any method"):n>=t.numberOfInputs?F("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[n]!==r||t.inputConnection[n])&&(t.inputData[n]=r,t.inputConnection[n]=null,e.modified&&e.modified())}function o(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)F("instance deleted - cannot call any method");else{if(n>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void F(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[n]=null,t.inputConnection[n]=r}}function i(){for(var e=t.numberOfInputs;e&&!t.inputData[e-1]&&!t.inputConnection[e-1];)e--;return e===t.numberOfInputs&&t.numberOfInputs++,e}function s(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(F("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[r])}if(t.inputData?t.inputData=t.inputData.map(T):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(T):t.inputConnection=[],t.output?t.output=t.output.map(T):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(T):t.inputArrayToProcess=[],t.numberOfInputs=r,e.shouldUpdate=function(){for(var r=e.getMTime(),a=1/0,o=n;o--;){if(!t.output[o]||t.output[o].isDeleted())return!0;var i=t.output[o].getMTime();if(ia)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=o,e.addInputData=function(e){t.deleted?F("instance deleted - cannot call any method"):a(e,i())},e.addInputConnection=function(e){t.deleted?F("instance deleted - cannot call any method"):o(e,i())},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]}}n&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=function(){return s(t)};return r.filter=e,r}),e.update=function(){var r=[];if(t.numberOfInputs)for(var n=0;n3&&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(r)),null;if(t.deleted)return F("instance deleted - cannot call any method"),null;var i=o++;return n.push([i,e,a]),n.sort((function(e,t){return t[2]-e[2]})),s(i)},e.delete=function(){a(),n.forEach((function(e){return i(u(e,1)[0])}))}},EVENT_ABORT:oe,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=["TB","GB","MB","KB"],a=Number(e),o="B";a>r;)a/=r,o=n.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=[],n=e;n>1e3;)r.push("000".concat(n%1e3).slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(t)},get:Q,getArray:re,getCurrentGlobalMTime:function(){return D},getStateArrayMapFunc:q,isVtkObject:le,keystore:ce,newInstance:ie,newTypedArray:j,newTypedArrayFrom:z,normalizeWheel:function(e){var t=0,r=0,n=0,a=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,a=10*r,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||a)&&e.deltaMode&&(1===e.deltaMode?(n*=40,a*=40):(n*=800,a*=800)),n&&!t&&(t=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:a}},obj:Z,proxy:function(e,t){ce(e,t);var r=e.delete;t.proxyId="".concat(ue++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),Q(e,t,["proxyId","proxyGroup","proxyName"]),te(e,t,["proxyManager"]);var n={},a={};function i(e,t){a[t]||(a[t]=[]);for(var r=a[t],o=0;o0&&void 0!==arguments[0]?arguments[0]:de;return a[e]}function l(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,n=[],a=t.proxyId,o=s(r)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var n=null,a=[],i=0,s=!1;function l(r){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(s)return null;var c=[],u=null;for(i=a.length;i--;){var d=a[i];d.instance===r?u=d:c.push(d)}if(!u)return null;var f=u.instance["get".concat(H(u.propertyName))]();if(!X(f,n)||l){for(n=f,s=!0;c.length;){var p=c.pop();p.instance.set(o({},p.propertyName,n))}s=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=f),f}function c(e,t){var r=[];for(i=a.length;i--;){var n=a[i];n.instance!==e||n.propertyName!==t&&void 0!==t||(n.subscription.unsubscribe(),r.push(i))}for(;r.length;)a.splice(r.pop(),1)}function u(r,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=r.onModified(l),u=a[0];return a.push({instance:r,propertyName:n,subscription:s}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?r.set(o({},n,t.propertyLinkMap[e].value)):u&&l(u.instance,!0)),{unsubscribe:function(){return c(r,n)}}}function d(){for(;a.length;)a.pop().subscription.unsubscribe()}var f={bind:u,unbind:c,unsubscribe:d,persistent:r};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(n[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},e.delete=function(){for(var n=Object.keys(t.propertyLinkMap),a=n.length;a--;)t.propertyLinkMap[n[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),r()},Y((function(){if(t.links)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function a(e){for(var r=Object.keys(e),n=r.length;n--;){var a=r[n];t[a].set(e[a])}}t.this=e;for(var o=Object.keys(n),i=o.length,s=function(){var s=o[i];t[s]=n[s];var l=r[s];e["set".concat(H(s))]=function(r){r!==t[s]&&(t[s]=r,a(l[r]),e.modified())}};i--;)s();o.length&&Q(e,t,o)},safeArrays:K,set:ee,setArray:ne,setGet:te,setGetArray:ae,setImmediate:Y,setLoggerFunction:function(e,t){N[e]&&(N[e]=t||L)},throttle:function(e,t){var r=!1,n=null;function a(){r=!1,null!==n&&(o.apply(void 0,f(n)),n=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(le(t)){if(a.indexOf(t)>=0)return n;a.push(t);var o=r(t);void 0!==o&&n.push(o);var i=t.get();Object.keys(i).forEach((function(t){var o=i[t];Array.isArray(o)?o.forEach((function(t){e(t,r,n,a)})):e(o,r,n,a)}))}return n},TYPED_ARRAYS:W,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:B,vtkDebugMacro:k,vtkErrorMacro:F,vtkInfoMacro:function(){N.info.apply(N,arguments)},vtkLogMacro:function(){N.log.apply(N,arguments)},vtkOnceErrorMacro:function(e){U[e]||(N.error(e),U[e]=!0)},vtkWarningMacro:G},pe=r(377),ge=r.n(pe),me=fe.vtkErrorMacro,ve=fe.vtkWarningMacro,he=0,ye=1e-12;function be(e){return function(){return me("vtkMath::".concat(e," - NOT IMPLEMENTED"))}}function Te(e,t){for(var r=0;r<3;r++){var n=e[r];e[r]=t[r],t[r]=n}}function Se(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=-1/0,o=t,i=e.length;o1&&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 r=0,n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;function n(e,n){return Math.abs(e-t[n])<=r}return e.every(n)}var tt=et;function rt(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 r="".concat(e).split("e"),n="";return+r[1]+t>0&&(n="+"),+"".concat(Math.round("".concat(+r[0],"e").concat(n).concat(+r[1]+t)),"e-").concat(t)}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=rt(e[0],r),t[1]=rt(e[1],r),t[2]=rt(e[2],r),t}function at(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g,m,v,h,y,b,T=Se(t),S=Se(t),C=function(e,t,r,n,a){h=e[t][r],v=e[n][a],e[t][r]=h-m*(v+h*p),e[n][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(r[l])+h===Math.abs(r[l])&&Math.abs(r[s])+h===Math.abs(r[s]))e[l][s]=0;else if(Math.abs(e[l][s])>u){for(v=r[s]-r[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],S[l]-=v,S[s]+=v,r[l]-=v,r[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)C(e,o,l,o,s);for(o=l+1;o<=s-1;o++)C(e,l,o,o,s);for(o=s+1;o=20)return ve("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=r[i=a]);if(i!==o)for(r[i]=r[o],r[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&c++;if(c(n=l>s?l:s)?c:n,a[i]=1,0!==n&&(a[i]/=n)}var u=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(n=u)&&(n=d,o[0]=1),f>=n&&(o[0]=2),0!==o[0]&&(Te(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(n=p)&&(o[1]=2,Te(t[2],t[1])),o[2]=2;var m=0;if($e(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Se(4);if(ot(t,h),Je(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Te(t[o[1]],t[1]),0!==o[0]&&Te(t[o[0]],t[0])}function st(e,t,r){var n,a,o,i,s,l,c=[Se(3),Se(3),Se(3)],u=Se(3),d=Se(3);for(n=0;n<3;n++)c[n][0]=e[n][0],c[n][1]=e[n][1],c[n][2]=e[n][2],u[n]=c[n],d[n]=r[n];if(at(u,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(Ze(r,r),n=0;n<3;n++)if(t[(n+1)%3]===t[(n+2)%3]){for(l=Math.abs(r[n][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(r[n][a]))&&(l=s,i=a);return i!==n&&(s=t[i],t[i]=t[n],t[n]=s,Te(r[n],r[i])),r[i][i]<0&&(r[i][0]=-r[i][0],r[i][1]=-r[i][1],r[i][2]=-r[i][2]),o=(i+2)%3,r[a=(i+1)%3][0]=0,r[a][1]=0,r[a][2]=0,r[a][a]=1,_e(r[i],r[a],r[o]),We(r[o]),_e(r[o],r[i],r[a]),void Ze(r,r)}for(l=Math.abs(r[0][0]),i=0,n=1;n<3;n++)l<(s=Math.abs(r[n][0]))&&(l=s,i=n);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Te(r[i],r[0])),Math.abs(r[1][1])i&&(i=c);if(0===i)return ve("Unable to factor linear system"),0;d[n]=1/i}for(a=0;a=i&&(i=l,u=n)}if(a!==u){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*r[o];else 0!==l&&(i=a);r[a]=l}for(a=n-1;a>=0;a--){for(l=r[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=n||Se(r),i=a||Se(r);if(0===lt(e,o,r))return 0;for(var s=0;sc?c=i:ic?c=s:s0?(c-d)/c:0)>0?(r=o===c?l*(i-s)/(c-d):i===c?1/3+l*(s-o)/(c-d):2/3+l*(o-i)/(c-d))<0&&(r+=1):r=0,t[0]=r,t[1]=n,t[2]=f}function gt(e,t){var r,n,a,o=u(e,3),i=o[0],s=o[1],l=o[2],c=1/3,d=1/6,f=2/3,p=5/6;i>d&&i<=c?(n=1,r=(c-i)/d,a=0):i>c&&i<=.5?(n=1,a=(i-c)/d,r=0):i>.5&&i<=f?(a=1,n=(f-i)/d,r=0):i>f&&i<=p?(a=1,r=(i-f)/d,n=0):i>p&&i<=1?(r=1,a=(1-i)/d,n=0):(r=1,n=i/d,a=0),r=s*r+(1-s),n=s*n+(1-s),a=s*a+(1-s),r*=l,n*=l,a*=l,t[0]=r,t[1]=n,t[2]=a}function mt(e,t){var r=u(e,3),n=(r[0]+16)/116,a=r[1]/500+n,o=n-r[2]/200;n=Math.pow(n,3)>.008856?Math.pow(n,3):(n-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787,t[0]=.9505*a,t[1]=1*n,t[2]=1.089*o}function vt(e,t){var r=u(e,3),n=r[0]/.9505,a=r[1]/1,o=r[2]/1.089;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(n-a),t[2]=200*(a-o)}function ht(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2],i=3.2406*n+-1.5372*a+-.4986*o,s=-.9689*n+1.8758*a+.0415*o,l=.0557*n+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var c=i;c1&&(i/=c,s/=c,l/=c),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function yt(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2];n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*n+.3576*a+.1805*o,t[1]=.2126*n+.7152*a+.0722*o,t[2]=.0193*n+.1192*a+.9505*o}function bt(e,t){var r=[0,0,0];yt(e,r),vt(r,t)}function Tt(e,t){var r=[0,0,0];mt(e,r),ht(r,t)}function St(e){return e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1,e}function Ct(e){return!(e[1]-e[0]<0)}function xt(e,t,r){return r[0]=Math.min(e[0],t[0]),r[1]=Math.max(e[0],t[0]),r[2]=Math.min(e[1],t[1]),r[3]=Math.max(e[1],t[1]),r[4]=Math.min(e[2],t[2]),r[5]=Math.max(e[2],t[2]),r}function Pt(e,t,r){return er?r:e}function wt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0,0];return n[0]=Pt(e[0],t[0],r[0]),n[1]=Pt(e[1],t[1],r[1]),n[2]=Pt(e[2],t[2],r[2]),n}var Ot=be("GetScalarTypeFittingRange"),At=be("GetAdjustedScalarRange");var Mt=function(e){return!Number.isFinite(e)},It=Number.isFinite,Rt=Number.isNaN,Et=Rt;function Dt(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Bt(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function Vt(e){return Math.round(255*e)}var Lt={Pi:function(){return Math.PI},radiansFromDegrees:Ce,degreesFromRadians:xe,round:Pe,floor:we,ceil:Oe,ceilLog2:Re,min:Ae,max:Me,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=-1/0,a=t,o=e.length;a=0;--a)if(r[a]0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=t-e;return e+r*Math.random()},gaussian:Ve,add:Le,subtract:Ne,multiplyScalar:ke,multiplyScalar2D:Fe,multiplyAccumulate:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n},multiplyAccumulate2D:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n},dot:Ge,outer:function(e,t,r){for(var n=0;n<3;n++)for(var a=0;a<3;a++)r[n][a]=e[n]*t[a]},cross:_e,norm:Ue,normalize:We,perpendiculars:function(e,t,r,n){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],c=e[2]*e[2],u=Math.sqrt(s+l+c);s>l&&s>c?(a=0,o=1,i=2):l>c?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/u,f=e[o]/u,p=e[i]/u,g=Math.sqrt(d*d+p*p);if(0!==n){var m=Math.sin(n),v=Math.cos(n);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),r&&(r[a]=(-p*m-d*f*v)/g,r[o]=v*g,r[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),r&&(r[a]=-d*f/g,r[o]=g,r[i]=-f*p/g)},projectVector:function(e,t,r){var n=Ge(t,t);if(0===n)return r[0]=0,r[1]=0,r[2]=0,!1;for(var a=Ge(e,t)/n,o=0;o<3;o++)r[o]=t[o];return ke(r,a),!0},projectVector2D:function(e,t,r){var n=je(t,t);if(0===n)return r[0]=0,r[1]=0,!1;for(var a=je(e,t)/n,o=0;o<2;o++)r[o]=t[o];return Fe(r,a),!0},distance2BetweenPoints:ze,angleBetweenVectors:He,gaussianAmplitude:function(e,t,r){var n=Math.abs(e-r);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(n,2)/(2*t))},gaussianWeight:function(e,t,r){var n=Math.abs(e-r);return Math.exp(-Math.pow(n,2)/(2*t))},dot2D:je,outer2D:function(e,t,r){for(var n=0;n<2;n++)for(var a=0;a<2;a++)r[n][a]=e[n]*t[a]},norm2D:Ke,normalize2D:Xe,determinant2x2:qe,LUFactor3x3:function(e,t){for(var r,n,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(n=Math.abs(e[i][1]))>a&&(a=n),(n=Math.abs(e[i][2]))>a&&(a=n),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),r=0,(n=o[1]*Math.abs(e[1][0]))>=a&&(a=n,r=1),(n=o[2]*Math.abs(e[2][0]))>=a&&(r=2),0!==r&&(Te(e[r],e[0]),o[r]=o[0]),t[0]=r,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),r=1,(n=o[2]*Math.abs(e[2][1]))>=a&&(r=2,Te(e[2],e[1]),o[2]=o[1]),t[1]=r,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,r){var n=r[t[0]];r[t[0]]=r[0],r[0]=n,n=r[t[1]],r[t[1]]=r[1],r[1]=n-e[1][0]*r[0],n=r[t[2]],r[t[2]]=r[2],r[2]=n-e[2][0]*r[0]-e[2][1]*r[1],r[2]/=e[2][2],r[1]=(r[1]-e[1][2]*r[2])/e[1][1],r[0]=(r[0]-e[0][1]*r[1]-e[0][2]*r[2])/e[0][0]},linearSolve3x3:function(e,t,r){var n=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],u=e[2][1],d=e[2][2],f=+qe(s,u,l,d),p=-qe(i,c,l,d),g=+qe(i,c,s,u),m=-qe(a,u,o,d),v=+qe(n,c,o,d),h=-qe(n,c,a,u),y=+qe(a,s,o,l),b=-qe(n,i,o,l),T=+qe(n,i,a,s),S=n*f+a*p+o*g,C=f*t[0]+m*t[1]+y*t[2],x=p*t[0]+v*t[1]+b*t[2],P=g*t[0]+h*t[1]+T*t[2];r[0]=C/S,r[1]=x/S,r[2]=P/S},multiply3x3_vect3:function(e,t,r){var n=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];r[0]=n,r[1]=a,r[2]=o},multiply3x3_mat3:Ye,multiplyMatrix:function(e,t,r,n,a,o,i){n!==a&&me("Number of columns of A must match number of rows of B.");for(var s=0;sMe&&(n=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eye&&(f=0,d[c]=0);if(f&&1===a)return ve("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),ft(e,t,r,o);if(f)g=1;else for(c=0;c1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:pt,hsv2rgb:gt,lab2xyz:mt,xyz2lab:vt,xyz2rgb:ht,rgb2xyz:yt,rgb2lab:bt,lab2rgb:Tt,uninitializeBounds:St,areBoundsInitialized:Ct,computeBoundsFromPoints:xt,clampValue:Pt,clampVector:wt,clampAndNormalizeValue:function(e,t){var r=0;return t[0]!==t[1]&&(r=((r=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),r},getScalarTypeFittingRange:Ot,getAdjustedScalarRange:At,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]t[r+1]||e[r+1]t[r+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,r){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]+r[n/2]t[n+1]||e[n+1]+r[n/2]t[n+1])return 0;return 1},pointIsWithinBounds:function(e,t,r){if(!e||!t||!r)return 0;for(var n=0;n<3;n++)if(e[n]+r[n]t[2*n+1])return 0;return 1},solve3PointCircle:function(e,t,r,n){for(var a=Se(3),o=Se(3),i=Se(3),s=Se(3),l=Se(3),c=Se(3),u=0;u<3;++u)a[u]=e[u]-t[u],o[u]=t[u]-r[u],i[u]=r[u]-e[u],s[u]=-a[u],l[u]=-o[u],c[u]=-i[u];var d=Ue(s),f=Ue(l),p=Ue(i),g=Se(3);_e(a,o,g);for(var m=Ue(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*Ge(a,c)/h,b=p*p*Ge(s,o)/h,T=d*d*Ge(i,l)/h,S=0;S<3;++S)n[S]=y*e[S]+b*t[S]+T*r[S];return v},inf:1/0,negInf:-1/0,isInf:Mt,isNan:Rt,isNaN:Rt,isFinite:It,createUninitializedBounds:Dt,getMajorAxisIndex:function(e){for(var t=-1,r=-1,n=0;nt&&(r=n,t=a)}return r},floatToHex2:Bt,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Bt).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(Vt).join(", "),")"):"rgba(".concat(Vt(e[0]||0),", ").concat(Vt(e[1]||0),", ").concat(Vt(e[2]||0),", ").concat(e[3]||0,")")}};function Nt(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}function kt(e){for(var t=1;ta&&(a=o);return{min:n,max:a}}function _t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<0&&r>1){for(var n=e.length,a=n/r,o=new Float64Array(a),i=0,s=0;i1&&void 0!==arguments[1]?arguments[1]:0,r=e||[];r.length<=t;)r.push(null);return r}function Wt(e){return Object.prototype.toString.call(e).slice(8,-1)}var jt={computeRange:_t,createRangeHelper:function(){var e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=0,n=0;return{add:function(a){e>a&&(e=a),tr&&(r=a)}return r}};function zt(e,t){function r(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=function(e,n,a){a!==t.values[e*t.numberOfComponents+n]&&(t.values[e*t.numberOfComponents+n]=a,r())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,r=e<0?t.numberOfComponents:e,n=null;return t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents)),(n=t.ranges[r])?(t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple):(n=_t(t.values,e,t.numberOfComponents),t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple)},e.setRange=function(e,r){t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents));var n={min:e.min,max:e.max};return t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple},e.setTuple=function(e,r){for(var n=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:Ft,n=t.numberOfComponents||1;r.length!==n&&(r.length=n);var a=e*n;if(1===n)r[0]=t.values[a];else if(2===n)r[0]=t.values[a],r[1]=t.values[a+1];else if(3===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2];else if(4===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2],r[3]=t.values[a+3];else for(var o=0;o0&&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 Xt({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,n){t.values=e,t.size=e.length,t.dataType=Wt(e),n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),r()},e.getState=function(){var r=kt(kt({},t),{},{vtkClass:e.getClassName()});r.values=Array.from(r.values),delete r.buffer,Object.keys(r).forEach((function(e){r[e]||delete r[e]}));var n={};return Object.keys(r).sort().forEach((function(e){n[e]=r[e]})),n.mtime&&delete n.mtime,n}}var Ht={name:"",numberOfComponents:1,size:0,dataType:s.DefaultDataType,rangeTuple:[0,0]};function Kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Ht,r),!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=z(t.dataType,t.values)):t.values=j(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=Wt(t.values)),Z(e,t),ee(e,t,["name","numberOfComponents"]),zt(e,t)}var Xt=ie(Kt,"vtkDataArray"),qt=kt(kt({newInstance:Xt,extend:Kt},jt),s);function Yt(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 Zt=1e-6,Qt="coincide",$t="disjoint";function Jt(e,t,r){var n=r[0]*(e[0]-t[0])+r[1]*(e[1]-t[1])+r[2]*(e[2]-t[2]);return Math.abs(n)}function er(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a);n[0]=e[0]-o*r[0],n[1]=e[1]-o*r[1],n[2]=e[2]-o*r[2]}function tr(e,t,r){var n=Ge(e,t),a=Ge(t,t);return 0===a&&(a=1),r[0]=e[0]-n*t[0]/a,r[1]=e[1]-n*t[1]/a,r[2]=e[2]-n*t[2]/a,r}function rr(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a),i=Ge(r,r);0!==i?(n[0]=e[0]-o*r[0]/i,n[1]=e[1]-o*r[1]/i,n[2]=e[2]-o*r[2]/i):(n[0]=e[0],n[1]=e[1],n[2]=e[2])}function nr(e,t,r,n){var a={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},o=[],i=[];Ne(t,e,o),Ne(r,e,i);var s=Ge(n,i),l=Ge(n,o);return(l<0?-l:l)<=(s<0?-s*Zt:s*Zt)||(a.t=s/l,a.x[0]=e[0]+a.t*o[0],a.x[1]=e[1]+a.t*o[1],a.x[2]=e[2]+a.t*o[2],a.intersection=!0,a.betweenPoints=a.t>=0&&a.t<=1),a}function ar(e,t,r,n){var a={intersection:!1,l0:[],l1:[],error:null},o=[];_e(t,n,o);var i,s=o.map((function(e){return Math.abs(e)}));if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var c=[],u=-Ge(t,e),d=-Ge(n,r);switch(i){case"x":c[0]=0,c[1]=(d*t[2]-u*n[2])/o[0],c[2]=(u*n[1]-d*t[1])/o[0];break;case"y":c[0]=(u*n[2]-d*t[2])/o[1],c[1]=0,c[2]=(d*t[0]-u*n[0])/o[1];break;case"z":c[0]=(d*t[1]-u*n[1])/o[2],c[1]=(u*n[0]-d*t[0])/o[2],c[2]=0}return a.l0=c,Le(c,o,a.l1),a.intersection=!0,a}var or={evaluate:function(e,t,r){return e[0]*(r[0]-t[0])+e[1]*(r[1]-t[1])+e[2]*(r[2]-t[2])},distanceToPlane:Jt,projectPoint:er,projectVector:tr,generalizedProjectPoint:rr,intersectWithLine:nr,intersectWithPlane:ar,DISJOINT:$t,COINCIDE:Qt};function ir(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return Jt(e,t.origin,t.normal)},e.projectPoint=function(e,r){er(e,t.origin,t.normal,r)},e.projectVector=function(e,r){return tr(e,t.normal,r)},e.push=function(e){if(0!==e)for(var r=0;r<3;r++)t.origin[r]+=e*t.normal[r]},e.generalizedProjectPoint=function(e,r){rr(e,t.origin,t.normal,r)},e.evaluateFunction=function(e,r,n){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]*(r-t.origin[1])+t.normal[2]*(n-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,r){return nr(e,r,t.origin,t.normal)},e.intersectWithPlane=function(e,r){return ar(e,r,t.origin,t.normal)}}var sr={normal:[0,0,1],origin:[0,0,0]};function lr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sr,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),ir(e,t)}var cr=function(e){for(var t=1;t(arguments.length<=1?void 0:arguments[1])?n: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]=o>(arguments.length<=2?void 0:arguments[2])?o: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]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function hr(e,t,r,n,a,o,i){var s=u(e,6),l=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],c),e[2]=Math.min(t[2],d),e[3]=Math.max(t[3],f),e[4]=Math.min(t[4],p),e[5]=Math.max(t[5],g)):(e[0]=Math.min(t,l),e[1]=Math.max(r,c),e[2]=Math.min(n,d),e[3]=Math.max(a,f),e[4]=Math.min(o,p),e[5]=Math.max(i,g))}function yr(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=r,e[3]=r>l?r:l,e[4]=n,e[5]=n>d?n:d,o!==t||s!==r||c!==n}function br(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),r>=0?(e[2]*=r,e[3]*=r):(e[2]=r*e[3],e[3]=r*e[2]),n>=0?(e[4]*=n,e[5]*=n):(e[4]=n*e[5],e[5]=n*e[4]),!0)}function Cr(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function xr(e,t){return e[2*t+1]-e[2*t]}function Pr(e){return[xr(e,0),xr(e,1),xr(e,2)]}function wr(e){return e.slice(0,2)}function Or(e){return e.slice(2,4)}function Ar(e){return e.slice(4,6)}function Mr(e){var t=Pr(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function Ir(e){if(pr(e)){var t=Pr(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Rr(e){return[e[0],e[2],e[4]]}function Er(e){return[e[1],e[3],e[5]]}function Dr(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Br(e,t){for(var r=0,n=0;n<2;n++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[r]=[e[n],e[a],e[o]],r++}function Vr(e,t,r){t[0]=e[0],t[1]=e[2],t[2]=e[4],r[0]=e[1],r[1]=e[3],r[2]=e[5]}function Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Cr(e);return t[0]=e[1]-r[0],t[1]=e[3]-r[1],t[2]=e[5]-r[2],t}function Nr(e,t,r,n){for(var a=[].concat(dr),o=e.getData(),i=0;ie[2*u+1]?(i[u]=0,c[u]=e[2*u+1],o=!1):i[u]=2;if(o)return n[0]=t[0],n[1]=t[1],n[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==r[d]?l[d]=(c[d]-t[d])/r[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(n[p]=t[p]+l[s]*r[p],n[p]e[2*p+1])return 0}else n[p]=c[p];return 1}function Fr(e,t,r){for(var n=[],a=0,o=1,i=1,s=4;s<=5;++s){n[2]=e[s];for(var l=2;l<=3;++l){n[1]=e[l];for(var c=0;c<=1;++c)if(n[0]=e[c],a=cr.evaluate(r,t,n),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Gr(e,t){if(!pr(e)||!pr(t))return!1;for(var r,n=[0,0,0,0,0,0],a=0;a<3;a++)if(r=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(r=!0,n[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(r=!0,n[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(r=!0,n[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(r=!0,n[2*a+1]=e[2*a+1]),!r)return!1;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],!0}function _r(e,t){if(!pr(e)||!pr(t))return!1;for(var r=0;r<3;r++)if(!(t[2*r]>=e[2*r]&&t[2*r]<=e[2*r+1]||e[2*r]>=t[2*r]&&e[2*r]<=t[2*r+1]||t[2*r+1]>=e[2*r]&&t[2*r+1]<=e[2*r+1]||e[2*r+1]>=t[2*r]&&e[2*r+1]<=t[2*r+1]))return!1;return!0}function Ur(e,t,r,n){return!(te[1]||re[3]||ne[5])}function Wr(e,t,r){for(var n=[[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],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var c=[e[i],e[s],e[l]];a[o++]=cr.evaluate(r,t,c)}for(var u=2;u--&&!(Dr(a[n[u][0]],a[n[u][4]])&&Dr(a[n[u][1]],a[n[u][5]])&&Dr(a[n[u][2]],a[n[u][6]])&&Dr(a[n[u][3]],a[n[u][7]])););if(u<0)return!1;for(var d=Math.sign(r[u]),f=Math.abs((e[2*u+1]-e[2*u])*r[u]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[n[u][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*u]+p*e[2*u+1];return d>0?e[2*u]=v:e[2*u+1]=v,!0}var jr=function(){function e(t){S(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),gr(this.bounds,dr))}return x(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return fr(this.bounds,e)}},{key:"isValid",value:function(){return pr(this.bounds)}},{key:"setBounds",value:function(e){return gr(this.bounds,e)}},{key:"reset",value:function(){return mr(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r=0&&e=0},e.getArrayName=function(e){var r=t.arrays[e];return r?r.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r.getArrays().forEach((function(r){var o=e.getFlag(r.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&r){var i=e.getArrayByName(r.getName());if(i){if(r.getNumberOfComponents()===i.getNumberOfComponents())if(n>-1&&n-1?a:n;i.setTuple(s,r.getTuple(n))}else for(var l=0;lr.getNumberOfTuples())e.addArray(r);else{var c=r.getNumberOfComponents(),u=r.getNumberOfValues(),d=a>-1?a:n;ue?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=r();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var Xr={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function qr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xr,r),fe.obj(e,t),Kr(e,t)}var Yr={newInstance:fe.newInstance(qr,"vtkFieldData"),extend:qr},Zr={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Qr(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 $r=Zr.AttributeTypes,Jr=Zr.AttributeCopyOperations,en=fe.vtkWarningMacro;function tn(e,t){var r=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(e){var t=r.find((function(t){return $r[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(r,a){var o=n(a);if(r&&"PEDIGREEIDS"===o.toUpperCase()&&!r.isA("vtkDataArray"))return en("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(r&&!e.checkNumberOfComponents(r,o))return en("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rn,r),Yr.extend(e,t,r),fe.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),tn(e,t)}var an=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),cn.forEach((function(r){t[r]=an.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))}}var dn={};function fn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dn,r),fe.obj(e,t),fe.setGet(e,t,cn),un(e,t)}var pn=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?hn.EMPTY:3===t?hn.XYZ_GRID:2===t?e[0]===e[1]?hn.YZ_PLANE:e[2]===e[3]?hn.XZ_PLANE:hn.XY_PLANE:1===t?e[0]0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Xn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[0],s=r[1],l=r[2];return e[0]=a*l-o*s,e[1]=o*i-n*l,e[2]=n*s-a*i,e}function Yn(e,t,r,n){var a=t[0],o=t[1],i=t[2];return e[0]=a+n*(r[0]-a),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function Zn(e,t,r,n,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,c=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*s+r[0]*l+n[0]*c+a[0]*u,e[1]=t[1]*s+r[1]*l+n[1]*c+a[1]*u,e[2]=t[2]*s+r[2]*l+n[2]*c+a[2]*u,e}function Qn(e,t,r,n,a,o){var i=1-o,s=i*i,l=o*o,c=s*i,u=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*d+a[0]*f,e[1]=t[1]*c+r[1]*u+n[1]*d+a[1]*f,e[2]=t[2]*c+r[2]*u+n[2]*d+a[2]*f,e}function $n(e,t){t=t||1;var r=2*Sn()*Math.PI,n=2*Sn()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}function Jn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[3]*n+r[7]*a+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*a+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*a+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*a+r[10]*o+r[14])/i,e}function ea(e,t,r){var n=t[0],a=t[1],o=t[2];return e[0]=n*r[0]+a*r[3]+o*r[6],e[1]=n*r[1]+a*r[4]+o*r[7],e[2]=n*r[2]+a*r[5]+o*r[8],e}function ta(e,t,r){var n=r[0],a=r[1],o=r[2],i=r[3],s=t[0],l=t[1],c=t[2],u=a*c-o*l,d=o*s-n*c,f=n*l-a*s,p=a*f-o*d,g=o*u-n*f,m=n*d-a*u,v=2*i;return u*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+u+p,e[1]=l+d+g,e[2]=c+f+m,e}function ra(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0],o[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),o[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function na(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),o[1]=a[1],o[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function aa(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),o[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),o[2]=a[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function oa(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(r*r+n*n+a*a)*Math.sqrt(o*o+i*i+s*s),c=l&&Xn(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function ia(e){return e[0]=0,e[1]=0,e[2]=0,e}function sa(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function la(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ca(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(r-o)<=bn*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=bn*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-s)<=bn*Math.max(1,Math.abs(a),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ua,da=En,fa=Dn,pa=Bn,ga=Un,ma=Wn,va=On,ha=jn,ya=(ua=Pn(),function(e,t,r,n,a,o){var i,s;for(t||(t=3),r||(r=0),s=n?Math.min(n*t+r,e.length):e.length,i=r;i0?(r[0]=2*(s*i+u*n+l*o-c*a)/d,r[1]=2*(l*i+u*a+c*n-s*o)/d,r[2]=2*(c*i+u*o+s*a-l*n)/d):(r[0]=2*(s*i+u*n+l*o-c*a),r[1]=2*(l*i+u*a+c*n-s*o),r[2]=2*(c*i+u*o+s*a-l*n)),Wa(e,t,r),e}function za(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ha(e,t){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,c,u),e}function Ka(e,t){var r=new Tn(3);Ha(r,t);var n=1/r[0],a=1/r[1],o=1/r[2],i=t[0]*n,s=t[1]*a,l=t[2]*o,c=t[4]*n,u=t[5]*a,d=t[6]*o,f=t[8]*n,p=t[9]*a,g=t[10]*o,m=i+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),e[3]=.25*v,e[0]=(d-p)/v,e[1]=(f-l)/v,e[2]=(s-c)/v):i>u&&i>g?(v=2*Math.sqrt(1+i-u-g),e[3]=(d-p)/v,e[0]=.25*v,e[1]=(s+c)/v,e[2]=(f+l)/v):u>g?(v=2*Math.sqrt(1+u-i-g),e[3]=(f-l)/v,e[0]=(s+c)/v,e[1]=.25*v,e[2]=(d+p)/v):(v=2*Math.sqrt(1+g-i-u),e[3]=(s-c)/v,e[0]=(f+l)/v,e[1]=(d+p)/v,e[2]=.25*v),e}function Xa(e,t,r,n){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,c=o+o,u=i+i,d=a*l,f=a*c,p=a*u,g=o*c,m=o*u,v=i*u,h=s*l,y=s*c,b=s*u,T=n[0],S=n[1],C=n[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*S,e[5]=(1-(d+v))*S,e[6]=(m+h)*S,e[7]=0,e[8]=(p+y)*C,e[9]=(m-h)*C,e[10]=(1-(d+g))*C,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function qa(e,t,r,n,a){var o=t[0],i=t[1],s=t[2],l=t[3],c=o+o,u=i+i,d=s+s,f=o*c,p=o*u,g=o*d,m=i*u,v=i*d,h=s*d,y=l*c,b=l*u,T=l*d,S=n[0],C=n[1],x=n[2],P=a[0],w=a[1],O=a[2],A=(1-(m+h))*S,M=(p+T)*S,I=(g-b)*S,R=(p-T)*C,E=(1-(f+h))*C,D=(v+y)*C,B=(g+b)*x,V=(v-y)*x,L=(1-(f+m))*x;return e[0]=A,e[1]=M,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=B,e[9]=V,e[10]=L,e[11]=0,e[12]=r[0]+P-(A*P+R*w+B*O),e[13]=r[1]+w-(M*P+E*w+V*O),e[14]=r[2]+O-(I*P+D*w+L*O),e[15]=1,e}function Ya(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=u+h,e[2]=f-v,e[3]=0,e[4]=u-h,e[5]=1-c-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Za(e,t,r,n,a,o,i){var s=1/(r-t),l=1/(a-n),c=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*l,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function Qa(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=(a+n)*o,e[14]=2*a*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=Qa;function Ja(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=a*o,e[14]=a*n*o):(e[10]=-1,e[14]=-n),e}function eo(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),c=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function to(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(i+o)*c,e[15]=1,e}var ro=to;function no(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=o*c,e[15]=1,e}function ao(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g=t[0],m=t[1],v=t[2],h=n[0],y=n[1],b=n[2],T=r[0],S=r[1],C=r[2];return Math.abs(g-T)0&&(u*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-c*d,m=c*u-s*f,v=s*d-l*u;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-u*v,e[6]=u*m-d*g,e[7]=0,e[8]=u,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function io(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]+")"}function so(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])}function lo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function co(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function uo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function fo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function po(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]}function go(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],h=e[15],y=t[0],b=t[1],T=t[2],S=t[3],C=t[4],x=t[5],P=t[6],w=t[7],O=t[8],A=t[9],M=t[10],I=t[11],R=t[12],E=t[13],D=t[14],B=t[15];return Math.abs(r-y)<=bn*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-b)<=bn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-T)<=bn*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(o-S)<=bn*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-C)<=bn*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-x)<=bn*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-P)<=bn*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-w)<=bn*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(u-O)<=bn*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(d-A)<=bn*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-M)<=bn*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(p-I)<=bn*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=bn*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=bn*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=bn*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-B)<=bn*Math.max(1,Math.abs(h),Math.abs(B))}var mo=Ia,vo=co;function ho(){var e=new Tn(9);return Tn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function yo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function bo(e){var t=new Tn(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function To(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}function So(e,t,r,n,a,o,i,s,l){var c=new Tn(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=a,c[5]=o,c[6]=i,c[7]=s,c[8]=l,c}function Co(e,t,r,n,a,o,i,s,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i,e[6]=s,e[7]=l,e[8]=c,e}function xo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Po(e,t){if(e===t){var r=t[1],n=t[2],a=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=a}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function wo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*i-s*c,f=-u*o+s*l,p=c*o-i*l,g=r*d+n*f+a*p;return g?(g=1/g,e[0]=d*g,e[1]=(-u*n+a*c)*g,e[2]=(s*n-a*i)*g,e[3]=f*g,e[4]=(u*r-a*l)*g,e[5]=(-s*r+a*o)*g,e[6]=p*g,e[7]=(-c*r+n*l)*g,e[8]=(i*r-n*o)*g,e):null}function Oo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=i*u-s*c,e[1]=a*c-n*u,e[2]=n*s-a*i,e[3]=s*l-o*u,e[4]=r*u-a*l,e[5]=a*o-r*s,e[6]=o*c-i*l,e[7]=n*l-r*c,e[8]=r*i-n*o,e}function Ao(e){var t=e[0],r=e[1],n=e[2],a=e[3],o=e[4],i=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-i*l)+r*(-c*a+i*s)+n*(l*a-o*s)}function Mo(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],h=r[5],y=r[6],b=r[7],T=r[8];return e[0]=f*n+p*i+g*c,e[1]=f*a+p*s+g*u,e[2]=f*o+p*l+g*d,e[3]=m*n+v*i+h*c,e[4]=m*a+v*s+h*u,e[5]=m*o+v*l+h*d,e[6]=y*n+b*i+T*c,e[7]=y*a+b*s+T*u,e[8]=y*o+b*l+T*d,e}function Io(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1];return e[0]=n,e[1]=a,e[2]=o,e[3]=i,e[4]=s,e[5]=l,e[6]=f*n+p*i+c,e[7]=f*a+p*s+u,e[8]=f*o+p*l+d,e}function Ro(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=Math.sin(r),p=Math.cos(r);return e[0]=p*n+f*i,e[1]=p*a+f*s,e[2]=p*o+f*l,e[3]=p*i-f*n,e[4]=p*s-f*a,e[5]=p*l-f*o,e[6]=c,e[7]=u,e[8]=d,e}function Eo(e,t,r){var n=r[0],a=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Do(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Bo(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Vo(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function No(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[3]=u-h,e[6]=f+v,e[1]=u+h,e[4]=1-c-g,e[7]=p-m,e[2]=f-v,e[5]=p+m,e[8]=1-c-d,e}function ko(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],h=t[15],y=r*s-n*i,b=r*l-a*i,T=r*c-o*i,S=n*l-a*s,C=n*c-o*s,x=a*c-o*l,P=u*m-d*g,w=u*v-f*g,O=u*h-p*g,A=d*v-f*m,M=d*h-p*m,I=f*h-p*v,R=y*I-b*M+T*A+S*O-C*w+x*P;return R?(R=1/R,e[0]=(s*I-l*M+c*A)*R,e[1]=(l*O-i*I-c*w)*R,e[2]=(i*M-s*O+c*P)*R,e[3]=(a*M-n*I-o*A)*R,e[4]=(r*I-a*O+o*w)*R,e[5]=(n*O-r*M-o*P)*R,e[6]=(m*x-v*C+h*S)*R,e[7]=(v*T-g*x-h*b)*R,e[8]=(g*C-m*T+h*y)*R,e):null}function Fo(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Go(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function _o(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Uo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Wo(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function jo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function zo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function Ho(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]}function Ko(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=t[0],f=t[1],p=t[2],g=t[3],m=t[4],v=t[5],h=t[6],y=t[7],b=t[8];return Math.abs(r-d)<=bn*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-f)<=bn*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=bn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=bn*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-m)<=bn*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-v)<=bn*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-h)<=bn*Math.max(1,Math.abs(l),Math.abs(h))&&Math.abs(c-y)<=bn*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=bn*Math.max(1,Math.abs(u),Math.abs(b))}var Xo=Mo,qo=Wo,Yo=fe.vtkErrorMacro;function Zo(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&(r*=t[n]-1)}return r},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(r){var n=e.getDimensions();if(0===n[0]||0===n[1]||0===n[2])return Yo("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case gn.EMPTY:return null;case gn.SINGLE_POINT:break;case gn.X_LINE:a[0]=r;break;case gn.Y_LINE:a[1]=r;break;case gn.Z_LINE:a[2]=r;break;case gn.XY_PLANE:a[0]=r%n[0],a[1]=r/n[0];break;case gn.YZ_PLANE:a[1]=r%n[1],a[2]=r/n[1];break;case gn.XZ_PLANE:a[0]=r%n[0],a[2]=r/n[0];break;case gn.XYZ_GRID:a[0]=r%n[0],a[1]=r/n[0]%n[1],a[2]=r/(n[0]*n[1]);break;default:Yo("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var r=[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]],n=new Float64Array([r[0],r[1],r[2]]),a=new Float64Array(3);e.indexToWorld(n,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],i=3;i<24;i+=3)In(n,r[i],r[i+1],r[i+2]),e.indexToWorld(n,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){Na(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],Ea(t.indexToWorld,t.indexToWorld,t.spacing),Oa(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.indexToWorld),r},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.worldToIndex),r},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.indexToWorld),Jn(i,a,t.indexToWorld),xt(o,i,r)},e.worldToIndexBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.worldToIndex),Jn(i,a,t.worldToIndex),xt(o,i,r)},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),r=[],n=0;n<3;n++)r[n]=(t[2*n+1]+t[2*n])/2;return r},e.computeHistogram=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[0,0,0,0,0,0];e.worldToIndexBounds(t,n);var a=[0,0,0],o=[0,0,0];Hr.computeCornerPoints(n,a,o),nt(a,a),nt(o,o);var i=e.getDimensions();wt(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),wt(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],c=e.getPointData().getScalars().getData(),u=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!r||r([y,v,m],n)){var b=c[h];b>u&&(u=b),b0?p/g:0,S=g?Math.abs(f/g-T*T):0,C=Math.sqrt(S);return{minimum:d,maximum:u,average:T,variance:S,sigma:C,count:g}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=t,a=0;a<3;++a)r[a]=n,n*=e[2*a+1]-e[2*a]+1;return r},e.computeOffsetIndex=function(t){var r=u(t,3),n=r[0],a=r[1],o=r[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(n)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var r=e.getExtent(),n=e.worldToIndex(t),a=0;a<3;++a)if(n[a]r[2*a+1])return Yo("GetScalarPointer: Pixel ".concat(n," is not in memory. Current extent = ").concat(r)),NaN;return e.computeOffsetIndex(n)},e.getScalarValueFromWorld=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=n)return Yo("GetScalarPointer: Scalar Component ".concat(r," is not within bounds. Current Scalar numberOfComponents: ").concat(n)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,r)}}var Qo={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:gn.EMPTY};function $o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qo,r),pn.extend(e,t,r),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=xo(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),fe.get(e,t,["direction","indexToWorld","worldToIndex"]),fe.setGetArray(e,t,["origin","spacing"],3),fe.getArray(e,t,["extent"],6),Zo(e,t)}var Jo,ei={newInstance:fe.newInstance($o,"vtkImageData"),extend:$o};function ti(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function ri(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*a+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*a+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*a+r[11]*o+r[15]*i,e}function ni(){var e=new Tn(4);return Tn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ai(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function oi(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+i*s+a*c-o*l,e[1]=a*u+i*l+o*s-n*c,e[2]=o*u+i*c+n*l-a*s,e[3]=i*u-n*s-a*l-o*c,e}Jo=new Tn(4),Tn!=Float32Array&&(Jo[0]=0,Jo[1]=0,Jo[2]=0,Jo[3]=0);var ii=function(e,t,r,n){var a=new Tn(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a},si=function(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r*r+n*n+a*a+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=a*i,e[3]=o*i,e};function li(e){return function(){return fe.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}function ci(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,r=0;re&&(e=n)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=li("pick"),e.hasKey=li("hasKey"),e.getNestedVisibility=function(){return t.visibility&&(!t.parentProp||t.parentProp.getNestedVisibility())},e.getNestedPickable=function(){return t.pickable&&(!t.parentProp||t.parentProp.getNestedPickable())},e.getNestedDragable=function(){return t.dragable&&(!t.parentProp||t.parentProp.getNestedDragable())},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(r){r&&!e.hasTexture(r)&&(t.textures=t.textures.concat(r),e.modified())},e.removeTexture=function(r){var n=t.textures.filter((function(e){return e!==r}));t.textures.length!==n.length&&(t.textures=n,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}Pn(),An(1,0,0),An(0,1,0),ni(),ni(),ho();var ui={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function di(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ui,r),fe.obj(e,t),fe.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),fe.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier","parentProp"]),ci(e,t)}var fi={newInstance:fe.newInstance(di,"vtkProp"),extend:di};function pi(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(r){t.position=t.position.map((function(e,t){return e+r[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=ni();Ka(e,t.rotation);var r=new Float64Array(3),n=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>bn?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}(r,e);return[xe(n),r[0],r[1],r[2]]},e.rotateX=function(r){0!==r&&(Ba(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateY=function(r){0!==r&&(Va(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateZ=function(r){0!==r&&(La(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateWXYZ=function(r,n,a,o){if(0!==r&&(0!==n||0!==a||0!==o)){var i=Ce(r),s=ni();ai(s,[n,a,o],i);var l=new Float64Array(16);Ya(l,s),Ia(t.rotation,t.rotation,l),e.modified()}},e.setOrientation=function(r,n,a){return(r!==t.orientation[0]||n!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[r,n,a],Pa(t.rotation),e.rotateZ(a),e.rotateX(r),e.rotateY(n),e.modified(),!0)},e.setUserMatrix=function(r){Sa(t.userMatrix,r),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Pa(t.matrix),t.userMatrix&&Ia(t.matrix,t.matrix,t.userMatrix),Ra(t.matrix,t.matrix,t.origin),Ra(t.matrix,t.matrix,t.position),Ia(t.matrix,t.matrix,t.rotation),Ea(t.matrix,t.matrix,t.scale),Ra(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),wa(t.matrix,t.matrix),t.isIdentity=!0;for(var r=0;r<4;++r)for(var n=0;n<4;++n)(r===n?1:0)!==t.matrix[r+4*n]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Hr.getCenter(t.bounds)},e.getLength=function(){return Hr.getLength(t.bounds)},e.getXRange=function(){return Hr.getXRange(t.bounds)},e.getYRange=function(){return Hr.getYRange(t.bounds)},e.getZRange=function(){return Hr.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var gi={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 mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gi,r),fi.extend(e,t,r),t.matrixMTime={},fe.obj(t.matrixMTime),fe.get(e,t,["bounds","isIdentity"]),fe.getArray(e,t,["orientation"]),fe.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Pa(new Float64Array(16)),t.rotation=Pa(new Float64Array(16)),t.userMatrix=Pa(new Float64Array(16)),t.transform=null,pi(e,t)}var vi={newInstance:fe.newInstance(mi,"vtkProp3D"),extend:mi},hi={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},yi={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:hi},bi={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Ti={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:bi};function Si(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 Ci=yi.ScalarMappingTarget,xi=yi.VectorMode,Pi=qt.VtkDataTypes,wi=Ti.ColorMode,Oi=fe.vtkErrorMacro;function Ai(e){return e}function Mi(e){return Math.floor(255*e+.5)}function Ii(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(xi.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(xi.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(xi.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(r,n){if(!(r&&!n||!r&&n))if(r&&n&&r.length!==n.length)Oi("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],n&&r)for(var a=n.length,o=0;o=0?t.annotationArray[a].annotation!==n&&(t.annotationArray[a].annotation=n,o=!0):(t.annotationArray.push({value:r,annotation:n}),a=t.annotationArray.length-1,o=!0),o&&(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(r){return t.annotationArray.length?e.checkForAnnotatedValue(r):-1},e.removeAnnotation=function(r){var n=e.checkForAnnotatedValue(r),a=n>=0;return a&&(t.annotationArray.splice(n,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(r,n){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(r);e.getIndexedColor(a,n)}else e.getColor(parseFloat(r),n),n[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var r=t.annotationArray.length;return t.annotatedValueMap[e]%r}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,r=0;r1?e.mapVectorsThroughTable(t,o,Ci.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Ci.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,r){for(var n=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=c&&(l=c-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=c):(l<0&&(l=0),l>=c&&(l=c-1),l+s>c&&(s=c-l)),i!==xi.MAGNITUDE||1!==c&&1!==s||(i=xi.COMPONENT));var u=0;switch(l>0&&(u=l),i){case xi.COMPONENT:e.mapScalarsThroughTable(t,r,n,u);break;case xi.RGBCOLORS:break;case xi.MAGNITUDE:default:var d=qt.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,r,n,0)}},e.luminanceToRGBA=function(e,t,r,n){for(var a=n(r),o=t.getData(),i=e.getData(),s=o.length,l=0,c=0;c=1&&r.getDataType()===Pi.UNSIGNED_CHAR)return r;var i=qt.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Pi.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ai;switch(r.getDataType()!==Pi.FLOAT&&r.getDataType()!==Pi.DOUBLE||(s=Mi),n){case 1:e.luminanceToRGBA(i,r,o,s);break;case 2:e.luminanceAlphaToRGBA(i,r,s);break;case 3:e.rGBToRGBA(i,r,o,s);break;case 4:e.rGBAToRGBA(i,r,o,s);break;default:return Oi("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,r){return e.setMappingRange(t,r)},e.getRange=function(t,r){return e.getMappingRange()}}var Ri={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:xi.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Ei(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ri,r),fe.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],fe.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),fe.setArray(e,t,["mappingRange"],2),fe.getArray(e,t,["mappingRange"]),Ii(e,t)}var Di=function(e){for(var t=1;t.001?Math.acos(r/o):0,s=i>.001?Math.atan2(a,n):0;t[0]=o,t[1]=i,t[2]=s}function Wi(e,t){if(e[0]>=t-.1)return e[2];var r=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+r:e[2]-r}function ji(e,t,r,n){var a=[],o=[];bt(t,a),bt(r,o);var i=[],s=[];Ui(a,i),Ui(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var r=e-t;for(r<0&&(r=-r);r>=2*Math.PI;)r-=2*Math.PI;return r>Math.PI&&(r=2*Math.PI-r),r}(i[2],s[2])>.33*Math.PI){var c=Math.max(i[0],s[0]);c=Math.max(88,c),e<.5?(s[0]=c,s[1]=0,s[2]=0,l*=2):(i[0]=c,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Wi(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Wi(i,s[0]));var u=[];u[0]=(1-l)*i[0]+l*s[0],u[1]=(1-l)*i[1]+l*s[1],u[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var r=e[0],n=e[1],a=e[2];t[0]=r*Math.cos(n),t[1]=r*Math.sin(n)*Math.cos(a),t[2]=r*Math.sin(n)*Math.sin(a)}(u,d),Tt(d,n)}function zi(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,r,n,a){return e.addRGBPointLong(t,r,n,a,.5,0)},e.addRGBPointLong=function(r,n,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Gi("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Gi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var l={x:r,r:n,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[],l=[r,n,a];return gt(l,s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(r){if(t.nodes!==r){var n=JSON.stringify(t.nodes);t.nodes=r;var a=JSON.stringify(t.nodes);if(e.sortAndUpdateRange()||n!==a)return e.modified(),!0}return!1},e.sortAndUpdateRange=function(){var r=JSON.stringify(t.nodes);t.nodes.sort((function(e,t){return e.x-t.x}));var n=JSON.stringify(t.nodes),a=e.updateRange();return a||r===n?a:(e.modified(),!0)},e.updateRange=function(){var r=[2];r[0]=t.mappingRange[0],r[1]=t.mappingRange[1];var n=t.nodes.length;return n?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[n-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(r[0]!==t.mappingRange[0]||r[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(r){for(var n=0;n=t.nodes.length)return-1;var o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(r,n){if(r!==n){e.removePoint(n);for(var a=0;a=r&&t.nodes[u].x<=i?t.nodes.splice(u,1):u++;e.addRGBPointLong(r,n,a,o,.5,0),e.addRGBPointLong(i,s,l,c,.5,0),e.modified()},e.addHSVSegment=function(t,r,n,a,o,i,s,l){var c=[i,s,l],u=[],d=[];gt([r,n,a],u),gt(c,d),e.addRGBSegment(t,u[0],u[1],u[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var r=[];return e.getColor(t,r),[Math.floor(255*r[0]+.5),Math.floor(255*r[1]+.5),Math.floor(255*r[2]+.5),255]},e.getColor=function(r,n){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(r);if(o<0||0===a)e.getNanColor(n);else{var i=[];e.getNodeValue(o%a,i),n[0]=i.r,n[1]=i.g,n[2]=i.b}}else e.getTable(r,r,1,n)},e.getRedValue=function(t){var r=[];return e.getColor(t,r),r[0]},e.getGreenValue=function(t){var r=[];return e.getColor(t,r),r[1]},e.getBlueValue=function(t){var r=[];return e.getColor(t,r),r[2]},e.getTable=function(r,n,a,o){if(Et(r)||Et(n))for(var i=0;i0);var S=0,C=0,x=0;T&&(S=Math.log10(r),C=Math.log10(n));for(var P=0;P1?T?(x=S+P/(a-1)*(C-S),f=Math.pow(10,x)):f=r+P/(a-1)*(n-r):T?(x=.5*(S+C),f=Math.pow(10,x)):f=.5*(r+n),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var A=t.numberOfValues,M=O[1]-O[0];if(A<=1)f=O[0]+M/2;else{var I=(f-O[0])/M,R=we(A*I);f=O[0]+R/(A-1)*M}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[w]=0,o[w+1]=0,o[w+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[w]=t.aboveRangeColor[0],o[w+1]=t.aboveRangeColor[1],o[w+2]=t.aboveRangeColor[2]):(o[w]=c,o[w+1]=u,o[w+2]=d));else if(f0&&(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-r)<1e-6||t.discretize))l>0?(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b):(o[w]=0,o[w+1]=0,o[w+2]=0);else{var E=0;if(E=(E=T?(x-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[w]=m[0],o[w+1]=m[1],o[w+2]=m[2];continue}o[w]=v[0],o[w+1]=v[1],o[w+2]=v[2];continue}if(y<.01){if(t.colorSpace===Li.RGB)o[w]=(1-E)*m[0]+E*v[0],o[w+1]=(1-E)*m[1]+E*v[1],o[w+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Li.HSV){var D=[],B=[];pt(m,D),pt(v,B),t.hSVWrap&&(D[0]-B[0]>.5||B[0]-D[0]>.5)&&(D[0]>B[0]?D[0]-=1:B[0]-=1);var V=[];V[0]=(1-E)*D[0]+E*B[0],V[0]<0&&(V[0]+=1),V[1]=(1-E)*D[1]+E*B[1],V[2]=(1-E)*D[2]+E*B[2],gt(V,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var L=[],N=[];bt(m,L),bt(v,N);var k=[];k[0]=(1-E)*L[0]+E*N[0],k[1]=(1-E)*L[1]+E*N[1],k[2]=(1-E)*L[2]+E*N[2],Tt(k,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,W=G-2*F+E,j=G-F,z=void 0;if(t.colorSpace===Li.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[w+H]=_*m[H]+U*v[H]+W*z+j*z;else if(t.colorSpace===Li.HSV){var K=[],X=[];pt(m,K),pt(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+W*z+j*z,0===Y&&q[Y]<0&&(q[Y]+=1);gt(q,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var Z=[],Q=[];bt(m,Z),bt(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+W*z+j*z;Tt($,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[w+ee]=o[w+ee]<0?0:o[w+ee],o[w+ee]=o[w+ee]>1?1:o[w+ee]}}}},e.getUint8Table=function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Gi("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(r,n,a,s);for(var l=0;l1&&(i=(n-r)/(a-1));for(var s=0;s=t.nodes.length?(Gi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].r,r[2]=t.nodes[e].g,r[3]=t.nodes[e].b,r[4]=t.nodes[e].midpoint,r[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){if(r<0||r>=t.nodes.length)return Gi("Index out of range!"),-1;var a=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].r=n[1],t.nodes[r].g=n[2],t.nodes[r].b=n[3],t.nodes[r].midpoint=n[4],t.nodes[r].sharpness=n[5],a!==n[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,r){var n=e.getSize();if(n>0&&t>=0){var a=[];e.getNodeValue(t%n,a);for(var o=0;o<3;++o)r[o]=a[o+1];r[3]=1}else e.getNanColor(r),r[3]=1},e.fillFromDataPointer=function(t,r){if(!(t<=0)&&r){e.removeAllPoints();for(var n=0;nr[1]?(e.getColor(r[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])):(e.getColor(n[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=r[0]&&t.nodes[o].x<=r[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,r),Di.extend(e,t,r),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},fe.obj(t.buildTime),fe.get(e,t,["buildTime","mappingRange"]),fe.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),zi(e,t)}var Xi=function(e){for(var t=1;t0&&(r=t.nodes[0].y);for(var a=1;ar)switch(n){case 0:case 1:n=1;break;default:n=3}else switch(n){case 0:case 2:n=2;break;default:n=3}if(r=e,3===n)break}switch(n){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var r=0;r0?t.nodes[r-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,r){var n=t.nodes.length;return e<0||e>=n?(qi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].y,r[2]=t.nodes[e].midpoint,r[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){var a=t.nodes.length;if(r<0||r>=a)return qi("Index out of range!"),-1;var o=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].y=n[1],t.nodes[r].midpoint=n[2],t.nodes[r].sharpness=n[3],o!==n[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,r){return e.addPointLong(t,r,.5,0)},e.addPointLong=function(r,n,a,o){if(a<0||a>1)return qi("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return qi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var i,s={x:r,y:n,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=n,o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(r,n,a,o){e.sortAndUpdateRange();for(var i=0;i=r&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(r,n,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var r=[];return e.getTable(t,t,1,r),r[0]},e.adjustRange=function(r){if(r.length<2)return 0;var n=e.getRange();n[0]r[1]?e.addPoint(r[1],e.getValue(r[1])):e.addPoint(r[1],e.getValue(n[1])),e.sortAndUpdateRange();for(var a=0;a=r[0]&&t.nodes[a].x<=r[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var r=t.nodes[1].x-t.nodes[0].x,n=0;n4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,c=0;0!==l&&(c=t.nodes[l-1].y);var u=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(n-1)*(r-e):.5*(e+r);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?c:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(u-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,S=2*T-3*b+1,C=-2*T+3*b,x=T-2*b+y,P=T-b,w=g-p,O=(1-v)*w;a[h]=S*p+C*g+x*O+P*O;var A=pg?p:g;a[h]=a[h]M?M:a[h]}}}}var Zi={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function Qi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zi,r),fe.obj(e,t),t.nodes=[],fe.setGet(e,t,["allowDuplicateScalars","clamping"]),fe.setArray(e,t,["range"],2),fe.getArray(e,t,["range"]),Yi(e,t)}var $i={newInstance:fe.newInstance(Qi,"vtkPiecewiseFunction"),extend:Qi},Ji={NEAREST:0,LINEAR:1,FAST_LINEAR:2},es={FRACTIONAL:0,PROPORTIONAL:1},ts={InterpolationType:Ji,OpacityMode:es};function rs(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 ns=ts.InterpolationType,as=ts.OpacityMode,os=fe.vtkErrorMacro;function is(e,t){t.classHierarchy.push("vtkVolumeProperty"),e.getMTime=function(){for(var e,r=t.mtime,n=0;n<4;n++)1===t.componentData[n].colorChannels?t.componentData[n].grayTransferFunction&&(r=r>(e=t.componentData[n].grayTransferFunction.getMTime())?r:e):3===t.componentData[n].colorChannels&&t.componentData[n].rGBTransferFunction&&(r=r>(e=t.componentData[n].rGBTransferFunction.getMTime())?r:e),t.componentData[n].scalarOpacity&&(r=r>(e=t.componentData[n].scalarOpacity.getMTime())?r:e),t.componentData[n].gradientOpacity&&(t.componentData[n].disableGradientOpacity||(r=r>(e=t.componentData[n].gradientOpacity.getMTime())?r:e));return r},e.getColorChannels=function(e){return e<0||e>3?(os("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(r,n){var a=!1;return t.componentData[r].grayTransferFunction!==n&&(t.componentData[r].grayTransferFunction=n,a=!0),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(r){return null===t.componentData[r].grayTransferFunction&&(t.componentData[r].grayTransferFunction=$i.newInstance(),t.componentData[r].grayTransferFunction.addPoint(0,0),t.componentData[r].grayTransferFunction.addPoint(1024,1),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1),e.modified()),t.componentData[r].grayTransferFunction},e.setRGBTransferFunction=function(r,n){var a=!1;return t.componentData[r].rGBTransferFunction!==n&&(t.componentData[r].rGBTransferFunction=n,a=!0),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(r){return null===t.componentData[r].rGBTransferFunction&&(t.componentData[r].rGBTransferFunction=Xi.newInstance(),t.componentData[r].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[r].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3),e.modified()),t.componentData[r].rGBTransferFunction},e.setScalarOpacity=function(r,n){return t.componentData[r].scalarOpacity!==n&&(t.componentData[r].scalarOpacity=n,e.modified(),!0)},e.getScalarOpacity=function(r){return null===t.componentData[r].scalarOpacity&&(t.componentData[r].scalarOpacity=$i.newInstance(),t.componentData[r].scalarOpacity.addPoint(0,1),t.componentData[r].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[r].scalarOpacity},e.setComponentWeight=function(r,n){if(r<0||r>=4)return os("Invalid index"),!1;var a=Math.min(1,Math.max(0,n));return t.componentData[r].componentWeight!==a&&(t.componentData[r].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(os("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(ns.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(ns.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(ns.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return fe.enumToString(ns,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["set".concat(n)]=function(n,a){return t.componentData[n]["".concat(r)]!==a&&(t.componentData[n]["".concat(r)]=a,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["get".concat(n)]=function(e){return t.componentData[e]["".concat(r)]}}))}var ss={independentComponents:!0,interpolationType:ns.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function ls(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,ss,r),fe.obj(e,t),!t.componentData){t.componentData=[];for(var n=0;n<4;++n)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:as.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}fe.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),is(e,t)}var cs=function(e){for(var t=1;tn[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!(r=[n,t.mapperBounds],r[0].map((function(e,t){return r.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){us("Recomputing bounds..."),t.mapperBounds=n.map((function(e){return e}));var a=[];Hr.getCorners(n,a),e.computeMatrix();var o=new Float64Array(16);wa(o,t.matrix),a.forEach((function(e){return Jn(e,e,o)})),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,r){return e>r[t/2]?r[t/2]:e}),e):a.reduce((function(e,r){return ee?r:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e}}var fs={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function ps(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fs,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["mapper"]),fe.getArray(e,t,["bounds"],6),ds(e,t)}var gs={newInstance:fe.newInstance(ps,"vtkVolume"),extend:ps},ms={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4};function vs(e,t){t.classHierarchy.push("vtkAbstractMapper"),e.update=function(){e.getInputData()},e.addClippingPlane=function(r){return!!r.isA("vtkPlane")&&!t.clippingPlanes.includes(r)&&(t.clippingPlanes.push(r),e.modified(),!0)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(r){var n=t.clippingPlanes.indexOf(r);return-1!==n&&(t.clippingPlanes.splice(n,1),e.modified(),!0)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var r=t.length,n=0;n=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,r),fe.obj(e,t),fe.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),vs(e,t)},bs=ms,Ts={OFF:0,NORMALIZED:1,RAW:2};function Ss(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var r=e.getInputData();return r?(t.static||e.update(),t.bounds=r.getBounds()):t.bounds=Dt(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(bs.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(bs.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(bs.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(bs.AVERAGE_INTENSITY_BLEND)},e.setBlendModeToAdditiveIntensity=function(){e.setBlendMode(bs.ADDITIVE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return fe.enumToString(bs,t.blendMode)},e.setAverageIPScalarRange=function(t,r){console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),e.setIpScalarRange(t,r)},e.getFilterModeAsString=function(){return fe.enumToString(Ts,t.filterMode)},e.setFilterModeToOff=function(){e.setFilterMode(Ts.OFF)},e.setFilterModeToNormalized=function(){e.setFilterMode(Ts.NORMALIZED)},e.setFilterModeToRaw=function(){e.setFilterMode(Ts.RAW)}}var Cs={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:bs.COMPOSITE_BLEND,ipScalarRange:[-1e6,1e6],filterMode:Ts.OFF,preferSizeOverAccuracy:!1};function xs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cs,r),ys(e,t,r),fe.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode","filterMode","preferSizeOverAccuracy"]),fe.setGetArray(e,t,["ipScalarRange"],2),fe.event(e,t,"lightingActivated"),Ss(e,t)}var Ps={newInstance:fe.newInstance(xs,"vtkVolumeMapper"),extend:xs};function ws(e,t){const r=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(r[0]*r[1]*r[2]<1||r[1]<2||r[1]<2||r[2]<2)return;const n=ei.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);n.setDimensions(r),n.setOrigin(a),n.setSpacing(o);const i=qt.newInstance({name:"Scalars",values:t,numberOfComponents:1});return n.getPointData().setScalars(i),n.modified(),n}let Os=!1;function As(e,t,r){let n=[],a=0,o=function(){let t={knee:24,thorax:364,abdomen:147}[e],r=[];for(let n=1;n{t.resetImageParsing(),t.readFiles(n,(function(e,n){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),r&&setTimeout(r,3e3,a)}))}))}))}function Ms(e){return e*Math.PI/180}function Is(e){const t=gs.newInstance(),r=Ps.newInstance();r.setSampleDistance(1),t.setMapper(r),r.setInputData(e);const n=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(n[0],n[1]),t}r(666);var Rs=fe.vtkErrorMacro;function Es(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(r){var n=r.getTraverseOperation(),a=e[n];if(a)a(r);else{e.apply(r,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ds,r),fe.obj(e,t),fe.event(e,t,"event"),t._renderableChildMap=new Map,fe.get(e,t,["visited"]),fe.setGet(e,t,["parent","renderable","myFactory"]),fe.getArray(e,t,["children"]),Es(e,t)}var Vs={newInstance:fe.newInstance(Bs,"vtkViewNode"),extend:Bs,PASS_TYPES:["Build","Render"]};function Ls(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(r){if(r.isDeleted())return null;for(var n=0,a=r.getClassName(n++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=r.getClassName(n++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,r){t.overrides[e]=r}}var Ns={};function ks(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ns,r),fe.obj(e,t),Ls(e,t)}var Fs={newInstance:fe.newInstance(ks,"vtkViewNodeFactory"),extend:ks},Gs=Object.create(null);function _s(e,t){Gs[e]=t}function Us(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Ws={};function js(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ws,r),t.overrides=Gs,Fs.extend(e,t,r),Us(0,t)}var zs={newInstance:fe.newInstance(js,"vtkOpenGLViewNodeFactory"),extend:js};function Hs(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var r=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),t.context.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(r){if(r!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||r.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Sa(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),yo(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var n=t.openGLRenderer.getAspectRatio();Sa(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(n,-1,1)),wa(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Ia(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=r}return t.keyMatrices}}var Ks={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};var Xs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},te(e,t,["context","keyMatrixTime"]),Hs(e,t)}));_s("vtkCamera",Xs);var qs=k;function Ys(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(qs("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(r){if(r){var n=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),n|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),n|=a.DEPTH_BUFFER_BIT,t.context.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(n),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],a=e[1]-r[1],o=t.parent.normalizedDisplayToDisplay(n,a),i=Math.round(o[0]),s=Math.round(o[1]),l=e[2]-r[0],c=e[3]-r[1],u=t.parent.normalizedDisplayToDisplay(l,c),d=Math.round(u[0])-i,f=Math.round(u[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var r=0,n=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),r|=n.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,t.context.depthMask(!0)),n.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.clear(r),n.enable(n.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(t.context=t.openGLRenderWindow.getContext()))}}var Zs={context:null,openGLRenderWindow:null,selector:null};var Qs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zs,r),Vs.extend(e,t,r),Q(e,t,["shaderCache"]),te(e,t,["selector"]),Ys(e,t)}),"vtkOpenGLRenderer");_s("vtkRenderer",Qs);var $s={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},Js={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},el={ObjectType:Js};function tl(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}function rl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ol,r),fe.obj(e,t),fe.get(e,t,["openGLRenderWindow"]),al(e,t)}var sl=rl(rl({newInstance:fe.newInstance(il),extend:il},{}),el),ll={FLAT:0,GOURAUD:1,PHONG:2},cl={POINTS:0,WIREFRAME:1,SURFACE:2},ul={Shading:ll,Representation:cl,Interpolation:ll},dl=fe.vtkErrorMacro;function fl(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Js.ARRAY_BUFFER),e.createVBO=function(r,n,a,o){if(!r.getData()||!r.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=o.points.getData(),s=null,l=null,c=null,u=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.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())})),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,c=o.colors.getData(),t.colorBO||(t.colorBO=sl.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,r){for(var n=0;n2)for(var n=0;n2){for(var n=0;n1?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,r){return e>2?3*(e-2):0}},S=null,C=null;a===cl.POINTS||"verts"===n?(S=b.anythingToPoints,C=T.anythingToPoints):a===cl.WIREFRAME||"lines"===n?(S=b["".concat(n,"ToWireframe")],C=T["".concat(n,"ToWireframe")]):(S=b["".concat(n,"ToSurface")],C=T["".concat(n,"ToSurface")]);for(var x=r.getData(),P=x.length,w=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(M[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],M[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],M[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(M[I++]=i[p++],M[I++]=i[p++],M[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,M[I++]=s[g++],M[I++]=s[g++],M[I++]=s[g++]),t.customData.forEach((function(t){h=e*t.components;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pl,r),sl.extend(e,t,r),fe.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),fe.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),fl(e,t)}var ml={newInstance:fe.newInstance(gl),extend:gl},vl=fe.vtkErrorMacro;function hl(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;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,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 r=t.context.getShaderInfoLog(t.handle);return vl("Error compiling shader '".concat(t.source,"': ").concat(r)),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 yl={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function bl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yl,r),fe.obj(e,t),fe.setGet(e,t,["shaderType","source","error","handle","context"]),hl(e,t)}var Tl={newInstance:fe.newInstance(bl,"vtkShader"),extend:bl},Sl=fe.vtkErrorMacro;function Cl(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):(Sl("Links failed: ".concat(t.error)),0):(Sl(t.error),0):(Sl(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(t.fragmentShader.getError()),0):(Sl(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(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 r=t.context.getProgramInfoLog(t.handle);return Sl("Error linking shader ".concat(r)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1f(a,n),!0)},e.setUniformfv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1fv(a,n),!0)},e.setUniformi=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1i(a,n),!0)},e.setUniformiv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1iv(a,n),!0)},e.setUniform2f=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,n,a),!0},e.setUniform2fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2fv(a,n),!0)},e.setUniform2i=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,n,a),!0},e.setUniform2iv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2iv(a,n),!0)},e.setUniform3f=function(r,n,a,o){var i=e.findUniform(r);if(-1===i)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,n,a,o),!0},e.setUniform3fArray=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(!Array.isArray(n)||3!==n.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,n[0],n[1],n[2]),!0},e.setUniform3fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform3fv(a,n),!0)},e.setUniform3i=function(r){var n=e.findUniform(r);if(-1===n)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;for(var a=arguments.length,o=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,xl,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Tl.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Tl.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Tl.newInstance(),t.geometryShader.setShaderType("Geometry"),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),Cl(e,t)}var wl={newInstance:fe.newInstance(Pl,"vtkShaderProgram"),extend:Pl,substitute:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}}};function Ol(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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):r.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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):r.vertexAttribDivisor(i.index+l,0)),r.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,r,n,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,r,n,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(r,n,a,o,i,s,l,c,u,d){if(!r)return!1;if(!r.isBound()||0===n.getHandle()||n.getType()!==Js.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=c,p.isMatrix=d,p.divisor=u,-1===p.Index)return!1;if(n.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),u>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=n.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(r){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Al,r),t.buffers=[],fe.obj(e,t),fe.get(e,t,["supported"]),fe.setGet(e,t,["forceEmulation"]),Ol(e,t)}var Il={newInstance:fe.newInstance(Ml,"vtkOpenGLVertexArrayObject"),extend:Ml};function Rl(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 El={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function Dl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,El,r),fe.obj(e,t),t.shaderSourceTime={},fe.obj(t.shaderSourceTime),t.attributeUpdateTime={},fe.obj(t.attributeUpdateTime),fe.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=wl.newInstance(),t.VAO=Il.newInstance(),t.CABO=ml.newInstance(),Rl(e,t)}var Bl={newInstance:fe.newInstance(Dl),extend:Dl},Vl={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Ll={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Nl={Wrap:Vl,Filter:Ll},kl=new Float32Array(1),Fl=new Int32Array(kl.buffer),Gl=function(e){var t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))},_l=function(e){kl[0]=e;var t=Fl[0],r=t>>16&32768,n=t>>12&2047,a=t>>23&255;return a<103?r:a>142?(r|=31744,r|=(255===a?0:1)&&8388607&t):a<113?r|=((n|=2048)>>114-a)+(n>>113-a&1):(r|=a-112<<10|n>>1,r+=1&n)};function Ul(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 Wl=Nl.Wrap,jl=Nl.Filter,zl=qt.VtkDataTypes,Hl=k,Kl=F,Xl=G;function ql(e,t){var r=this;function n(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],o=t.width*t.height*t.components;if(n&&(o*=t.depth),e!==zl.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var i=0;i=a&&(b=a-1);var T=h-y,S=1-T;y=y*n*o,b=b*n*o;for(var C=0;C=n&&(O=n-1);var A=P-w;w*=o,O*=o;for(var M=0;Ma[l]&&(a[l]=r[i]),i++;for(var c=[],u=[],d=0;d2048||a<-2048||a>2048)return!1}return!0}(n,a)&&!o)}t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t.openGLRenderWindow=r:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(jl.LINEAR),e.setMagnificationFilter(jl.LINEAR)):(e.setMinificationFilter(jl.NEAREST),e.setMagnificationFilter(jl.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Wl.REPEAT),e.setWrapS(Wl.REPEAT),e.setWrapT(Wl.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR));var n=t.renderable.getCanvas();e.create2DFromRaw(n.width,n.height,4,zl.UNSIGNED_CHAR,n,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){var a=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw(a.width,a.height,4,zl.UNSIGNED_CHAR,a.data,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}var o=t.renderable.getInputData(0);if(o&&o.getPointData().getScalars()){for(var i=o.getExtent(),s=o.getPointData().getScalars(),l=[],c=0;ct.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:Xl("impossible case"),e=t.context.getIntegerv(r)===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(r,n){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||Hl("Unable to find suitable internal format for T=".concat(r," NC= ").concat(n)),t.internalFormat},e.getDefaultInternalFormat=function(e,n){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!1))||(a=r.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!0))||(Hl("Unsupported internal texture type!"),Hl("Unable to find suitable internal format for T=".concat(e," NC= ").concat(n))),a},e.setInternalFormat=function(r){r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=function(r,n){return t.format=e.getDefaultFormat(r,n),t.format},e.getDefaultFormat=function(e,r){if(t.openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.openGLRenderWindow.getWebgl2())switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case r&&zl.SHORT:case r&&zl.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case zl.FLOAT:case zl.VOID:default:return t.context.FLOAT}switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case zl.FLOAT:case zl.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;var n=t.context.getExtension("OES_texture_half_float");return n&&t.context.getExtension("OES_texture_half_float_linear")?n.HALF_FLOAT_OES:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.openGLDataType=e.getDefaultDataType(r,n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:e=(r=127.5)-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:e=(r=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:e=(r=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=function(e){switch(e){case jl.NEAREST:return t.context.NEAREST;case jl.LINEAR:return t.context.LINEAR;case jl.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case jl.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case jl.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case jl.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Wl.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Wl.REPEAT:return t.context.REPEAT;case Wl.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(r,o,i,s,l){var c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=[l],d=n(s,u),f=a(d);return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,c),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,f[0]),t.generateMipmap&&t.context.generateMipmap(t.target),c&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),e.deactivate(),!0},e.createCubeFromRaw=function(r,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var c=a(n(s,l)),u=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var S=null;y<=t.maxLevel&&(S=u[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,S),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(r,n,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===zl.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=r,t.height=n,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,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Kl("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(r){if(e.getOpenGLDataType(zl.UNSIGNED_CHAR),e.getInternalFormat(zl.UNSIGNED_CHAR,4),e.getFormat(zl.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=r.width,t.height=r.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var n=!Be(r.width)||!Be(r.height),a=document.createElement("canvas");a.width=n?De(r.width):r.width,a.height=n?De(r.height):r.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(r,0,0,r.width,r.height,0,0,a.width,a.height);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(r,o,i,s,l,c){if(e.getOpenGLDataType(l,!0),e.getInternalFormat(l,s),e.getFormat(l,s),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=s,t.width=r,t.height=o,t.depth=i,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(n(l,[c],!0));return t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFilterableFromRaw=function(r,n,a,s,l,c){for(var u=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=r*n*a,f=[],p=[],g=0;g4096&&(A===zl.FLOAT||s>=3)&&(I=4096);var R=1,E=1;d>I*I&&(E=R=Math.ceil(Math.sqrt(d/(I*I))));var D=Math.sqrt(d)/R;D=De(D);var B,V=Math.floor(D*R/r),L=Math.ceil(a/V),N=De(n*L/E);t.width=D,t.height=N,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=V,t.volumeInfo.yreps=L,t.volumeInfo.xstride=R,t.volumeInfo.ystride=E,t.volumeInfo.offset=w.offset,t.volumeInfo.scale=w.scale;var k=D*N*s;B=A===zl.FLOAT?new Float32Array(k):new Uint8Array(k);for(var F=0,G=Math.floor(r/R),_=Math.floor(n/E),U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yl,r),Vs.extend(e,t,r),t.sendParametersTime={},Z(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},Z(t.textureBuildTime,{mtime:0}),ee(e,t,["format","openGLDataType"]),te(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),Q(e,t,["width","height","volumeInfo","components","handle","target"]),ql(e,t)}var Ql=ie(Zl,"vtkOpenGLTexture"),$l=function(e){for(var t=1;t6&&(F("OpenGL has a limit of 6 clipping planes"),i=6),a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=wl.substitute(o,"//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=o},e.getNeedToRebuildShaders=function(e,r,n){var a=t.openGLTexture.getComponents(),o=n.getProperty().getIndependentComponents();return(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===e.getProgram()||t.lastTextureComponents!==a||t.lastIndependentComponents!==o)&&(t.lastHaveSeenDepthRequest=t.haveSeenDepthRequest,t.lastTextureComponents=a,t.lastIndependentComponents=o,!0)},e.updateShaders=function(r,n,a){if(t.lastBoundBO=r,e.getNeedToRebuildShaders(r,n,a)){var o={Vertex:null,Fragment:null,Geometry:null};e.buildShaders(o,n,a);var i=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);i!==r.getProgram()&&(r.setProgram(i),r.getVAO().releaseGraphicsResources()),r.getShaderSourceTime().modified()}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(r.getProgram());r.getVAO().bind(),e.setMapperShaderParameters(r,n,a),e.setCameraShaderParameters(r,n,a),e.setPropertyShaderParameters(r,n,a)},e.setMapperShaderParameters=function(r,n,a){r.getCABO().getElementCount()&&(t.VBOBuildTime>r.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(r.getProgram().isAttributeUsed("vertexMC")&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"vertexMC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||nc("Error setting vertexMC in shader VAO.")),r.getProgram().isAttributeUsed("tcoordMC")&&r.getCABO().getTCoordOffset()&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"tcoordMC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getTCoordComponents(),t.context.FALSE)||nc("Error setting tcoordMC in shader VAO.")),r.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();r.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l6&&(F("OpenGL has a limit of 6 clipping planes"),I=6);var R=t.currentInput.getWorldToIndex(),E=r.getCABO().getCoordShiftAndScaleEnabled()?r.getCABO().getInverseShiftAndScaleMatrix():null,D=E?Sa(t.imagematinv,a.getMatrix()):a.getMatrix();E&&(wa(D,D),Ia(D,D,E),wa(D,D)),Ia(t.imagematinv,D,R);for(var B=[],V=0;V1?1:0;var H=o.getData(),K=null;if(V===ac.I){K=new H.constructor(_[2]*_[1]*c);for(var X=0,q=0;q<_[2];q++)for(var Y=0;Y<_[1];Y++){var Z=(N+Y*_[0]+q*_[0]*_[1])*c;X=(q*_[1]+Y)*c,K.set(H.subarray(Z,Z+c),X)}_[0]=_[1],_[1]=_[2],W[0]=L,W[1]=F[2],W[2]=F[4],W[3]=L,W[4]=F[3],W[5]=F[4],W[6]=L,W[7]=F[2],W[8]=F[5],W[9]=L,W[10]=F[3],W[11]=F[5]}else if(V===ac.J){K=new H.constructor(_[2]*_[0]*c);for(var Q=0,$=0;$<_[2];$++)for(var J=0;J<_[0];J++){var ee=(J+N*_[0]+$*_[0]*_[1])*c;Q=($*_[0]+J)*c,K.set(H.subarray(ee,ee+c),Q)}_[1]=_[2],W[0]=F[0],W[1]=L,W[2]=F[4],W[3]=F[1],W[4]=L,W[5]=F[4],W[6]=F[0],W[7]=L,W[8]=F[5],W[9]=F[1],W[10]=L,W[11]=F[5]}else V===ac.K||V===ac.NONE?(K=H.subarray(N*U,(N+1)*U),W[0]=F[0],W[1]=F[2],W[2]=L,W[3]=F[1],W[4]=F[2],W[5]=L,W[6]=F[0],W[7]=F[3],W[8]=L,W[9]=F[1],W[10]=F[3],W[11]=L):nc("Reformat slicing not yet supported.");t.openGLTexture.create2DFromRaw(_[0],_[1],c,o.getDataType(),K),t.openGLTexture.activate(),t.openGLTexture.sendParameters(),t.openGLTexture.deactivate();var te=qt.newInstance({numberOfComponents:3,values:W});te.setName("points");var re=qt.newInstance({numberOfComponents:2,values:j});re.setName("tcoords");var ne=new Uint16Array(8);ne[0]=3,ne[1]=0,ne[2]=1,ne[3]=3,ne[4]=3,ne[5]=0,ne[6]=3,ne[7]=2;var ae=qt.newInstance({numberOfComponents:1,values:ne});t.tris.getCABO().createVBO(ae,"polys",cl.SURFACE,{points:te,tcoords:re,cellOffset:0}),t.VBOBuildTime.modified(),t.VBOBuildString=G}}}}}var sc={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};var lc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sc,r),Vs.extend(e,t,r),rc(e,t,r),t.tris=Bl.newInstance(),t.openGLTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.pwfTexture=$l.newInstance(),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),te(e,t,[]),t.VBOBuildTime={},Z(t.VBOBuildTime),ic(e,t)}),"vtkOpenGLImageMapper");function cc(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,r){return e.opaquePass(t,r)},e.opaquePass=function(e,r){e&&t.context.depthMask(!0)},e.translucentPass=function(e,r){t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}_s("vtkImageMapper",lc);var uc={context:null,keyMatrixTime:null,keyMatrices:null};var dc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),cc(e,t)}),"vtkOpenGLImageSlice");function fc(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementVolumeCount()}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.volumePass=function(e){t.renderable&&t.renderable.getVisibility()&&t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.MCWCMatrix,t.renderable.getMatrix()),wa(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?xo(t.normalMatrix):(yo(t.normalMatrix,t.MCWCMatrix),wo(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}_s("vtkImageSlice",dc);var pc={};var gc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),te(e,t,["context"]),fc(e,t)}),"vtkOpenGLVolume");function mc(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(r),e.saveCurrentBuffers(r)},e.saveCurrentBindings=function(e){var r=t.context;t.previousDrawBinding=r.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(r),e.restorePreviousBuffers(r)},e.restorePreviousBindings=function(e){var r=t.context;r.bindFramebuffer(r.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,r){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=r},e.setColorBuffer=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.context,a=n.COLOR_ATTACHMENT0;if(r>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");a+=r}t.colorTexture=e,n.framebufferTexture2D(n.FRAMEBUFFER,a,n.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=t.context,n=r.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");n+=e}r.framebufferTexture2D(r.FRAMEBUFFER,n,r.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var r=t.context;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,e.getHandle(),0)}else F("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 F("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(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 r=t.context,n=$l.newInstance();n.setOpenGLRenderWindow(t.openGLRenderWindow),n.setMinificationFilter(Ll.LINEAR),n.setMagnificationFilter(Ll.LINEAR),n.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,i.UNSIGNED_CHAR,null),e.setColorBuffer(n),t.depthTexture=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthTexture),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthTexture)}}_s("vtkVolume",gc);var vc={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function hc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vc,r),Z(e,t),te(e,t,["colorTexture"]),mc(e,t)}var yc={newInstance:ie(hc,"vtkFramebuffer"),extend:hc};function bc(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 Tc=G,Sc=F;function Cc(e,t){t.classHierarchy.push("vtkOpenGLVolumeMapper"),e.buildPass=function(){t.zBufferTexture=null},e.opaqueZBufferPass=function(e,r){if(e){var n=r.getZBufferTexture();n!==t.zBufferTexture&&(t.zBufferTexture=n)}},e.volumePass=function(r,n){if(r){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.jitterTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.framebuffer.setOpenGLRenderWindow(t.openGLRenderWindow),t.scalarTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.opacityTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLVolume=e.getFirstAncestorOfType("vtkOpenGLVolume");var a=t.openGLVolume.getRenderable();t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer");var o=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(o.getActiveCamera()),e.renderPiece(o,a)}},e.buildShaders=function(t,r,n){e.getShaderTemplate(t,r,n),e.replaceShaderValues(t,r,n)},e.getShaderTemplate=function(e,t,r){e.Vertex="//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 vertexDC;\n\nvarying vec3 vertexVCVSOutput;\nuniform mat4 PCVCMatrix;\n\nuniform float dcxmin;\nuniform float dcxmax;\nuniform float dcymin;\nuniform float dcymax;\n\nvoid main()\n{\n // dcsmall is the device coords reduced to the\n // x y area covered by the volume\n vec4 dcsmall = vec4(\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\n vertexDC.z,\n vertexDC.w);\n vec4 vcpos = PCVCMatrix * dcsmall;\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\n gl_Position = dcsmall;\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkVolumeFS.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 volume mappers fragment shader\n\n// the output of this shader\n//VTK::Output::Dec\n\nvarying vec3 vertexVCVSOutput;\n\n// first declare the settings from the mapper\n// that impact the code paths in here\n\n// always set vtkNumComponents 1,2,3,4\n//VTK::NumComponents\n\n// possibly define vtkTrilinearOn\n//VTK::TrilinearOn\n\n// possibly define vtkIndependentComponents\n//VTK::IndependentComponentsOn\n\n// possibly define any \"proportional\" components\n//VTK::vtkProportionalComponents\n\n// Define the blend mode to use\n#define vtkBlendMode //VTK::BlendMode\n\n// Possibly define vtkImageLabelOutlineOn\n//VTK::ImageLabelOutlineOn\n\n#ifdef vtkImageLabelOutlineOn\nuniform int outlineThickness;\nuniform float vpWidth;\nuniform float vpHeight;\nuniform float vpOffsetX;\nuniform float vpOffsetY;\nuniform mat4 PCWCMatrix;\nuniform mat4 vWCtoIDX;\n#endif\n\n// define vtkLightComplexity\n//VTK::LightComplexity\n#if vtkLightComplexity > 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\nuniform vec4 ipScalarRangeMin;\nuniform vec4 ipScalarRangeMax;\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 trilinear values from multiple z slices\n#ifdef vtkTrilinearOn\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 - vpOffsetX - 0.5) * 2.0,\n (fragCoord.y / vpHeight - vpOffsetY - 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\nbool valueWithinScalarRange(vec4 val, vec4 min, vec4 max) {\n bool withinRange = false;\n #if vtkNumComponents == 1\n if (val.r >= min.r && val.r <= max.r) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents == 2\n if (val.r >= min.r && val.r <= max.r &&\n val.g >= min.g && val.g <= max.g) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 3\n if (all(greaterThanEqual(val, ipScalarRangeMin)) &&\n all(lessThanEqual(val, ipScalarRangeMax))) {\n withinRange = true;\n }\n #endif\n return withinRange;\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 || vtkBlendMode == 4 //AVERAGE_INTENSITY_BLEND || ADDITIVE_BLEND\n vec4 sum = vec4(0.);\n\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\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 if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n // Sum the values across each step in the path\n sum += tValue;\n }\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 IPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n #if vtkBlendMode == 3 // Average\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n #endif\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 (abs(result) < 1e-6)\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(r,n,a){var o=r.Fragment;a.getProperty().getInterpolationType()===Ji.LINEAR&&(o=wl.substitute(o,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===a.getProperty().getUseLabelOutline()&&(o=wl.substitute(o,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();o=wl.substitute(o,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var s=a.getProperty().getIndependentComponents();if(s){o=wl.substitute(o,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var l=[],c=0;c0&&(o=wl.substitute(o,"//VTK::vtkProportionalComponents",l.join("\n")).result)}var u=t.currentInput.getExtent(),d=t.currentInput.getSpacing(),f=new Float64Array(3);In(f,(u[1]-u[0])*d[0],(u[3]-u[2])*d[1],(u[5]-u[4])*d[2]);var p=On(f)/t.renderable.getSampleDistance();o=wl.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(p))).result,o=wl.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var g=1;s&&!t.gopacity&&g0&&(a=wl.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=wl.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)}))}e.Fragment=a},e.replaceShaderClippingPlane=function(e,r,n){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=wl.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=wl.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; 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(r,n,a){var i=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===ms.COMPOSITE_BLEND&&(i=0,t.numberOfLights=0,n.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===i&&(i=1)),1===i&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(i=2),i<3&&e.getPositional()&&(i=3)})));var s=!1;t.lastLightComplexity!==i&&(t.lastLightComplexity=i,s=!0);var l=t.scalarTexture.getComponents(),c=a.getProperty().getIndependentComponents(),u=!1,d=[];if(c){for(var f=0;f0&&(u=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);In(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=On(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:u,iComps:c,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;rr.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(r.getVAO().addAttributeArray(o,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("Error setting vertexDC in shader VAO.")),r.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance());for(var i=t.scalarTexture.getVolumeInfo(),s=t.renderable.getIpScalarRange(),l=[],c=[],u=0;u<4;u++)l[u]=s[0]*i.dataComputedScale[u]+i.dataComputedOffset[u],c[u]=s[1]*i.dataComputedScale[u]+i.dataComputedOffset[u],l[u]=(l[u]-i.offset[u])/i.scale[u],c[u]=(c[u]-i.offset[u])/i.scale[u];if(o.setUniform4f("ipScalarRangeMin",l[0],l[1],l[2],l[3]),o.setUniform4f("ipScalarRangeMax",c[0],c[1],c[2],c[3]),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var d=e.getRenderTargetSize();o.setUniformf("vpWidth",d[0]),o.setUniformf("vpHeight",d[1])}},e.setCameraShaderParameters=function(r,n,a){var o=t.openGLCamera.getKeyMatrices(n),i=t.openGLVolume.getKeyMatrices();Ia(t.modelToView,o.wcvc,i.mcwc);var s=r.getProgram(),l=t.openGLCamera.getRenderable(),c=l.getClippingRange();s.setUniformf("camThick",c[1]-c[0]),s.setUniformf("camNear",c[0]),s.setUniformf("camFar",c[1]);for(var u=t.currentInput.getBounds(),d=t.currentInput.getDimensions(),f=new Float64Array(3),p=new Float64Array(3),g=1,m=-1,v=1,h=-1,y=0;y<8;++y)In(f,u[y%2],u[2+Math.floor(y/2)%2],u[4+Math.floor(y/4)]),Jn(f,f,t.modelToView),l.getParallelProjection()||(Kn(p,f),Gn(f,p,-c[0]/f[2])),Jn(f,f,o.vcpc),g=Math.min(f[0],g),m=Math.max(f[0],m),v=Math.min(f[1],v),h=Math.max(f[1],h);s.setUniformf("dcxmin",g),s.setUniformf("dcxmax",m),s.setUniformf("dcymin",v),s.setUniformf("dcymax",h),s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",l.getParallelProjection());var b=t.currentInput.getExtent(),T=t.currentInput.getSpacing(),S=new Float64Array(3);In(S,(b[1]-b[0]+1)*T[0],(b[3]-b[2]+1)*T[1],(b[5]-b[4]+1)*T[2]),s.setUniform3f("vSpacing",T[0],T[1],T[2]),In(f,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(f,f),Jn(f,f,t.modelToView),s.setUniform3f("vOriginVC",f[0],f[1],f[2]);var C=t.currentInput.getIndexToWorld();Ia(t.idxToView,t.modelToView,C),Mo(t.idxNormalMatrix,o.normalMatrix,i.normalMatrix),Mo(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var x=On(S)/t.renderable.getSampleDistance();x>t.renderable.getMaximumSamplesPerRay()&&Tc("The number of steps required ".concat(Math.ceil(x)," 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=new Float64Array(3);if(In(P,1,1,1),Bn(P,P,S),s.setUniform3f("vVCToIJK",P[0],P[1],P[2]),s.setUniform3i("volumeDimensions",d[0],d[1],d[2]),!t.openGLRenderWindow.getWebgl2()){var w=t.scalarTexture.getVolumeInfo();s.setUniformf("texWidth",t.scalarTexture.getWidth()),s.setUniformf("texHeight",t.scalarTexture.getHeight()),s.setUniformi("xreps",w.xreps),s.setUniformi("xstride",w.xstride),s.setUniformi("ystride",w.ystride)}for(var O=new Float64Array(3),A=new Float64Array(3),M=0;M<6;++M){switch(M){case 1:In(O,-1,0,0),In(A,b[0],b[2],b[4]);break;case 2:In(O,0,1,0),In(A,b[1],b[3],b[5]);break;case 3:In(O,0,-1,0),In(A,b[0],b[2],b[4]);break;case 4:In(O,0,0,1),In(A,b[1],b[3],b[5]);break;case 5:In(O,0,0,-1),In(A,b[0],b[2],b[4]);break;default:In(O,1,0,0),In(A,b[1],b[3],b[5])}ea(O,O,t.idxNormalMatrix),Jn(A,A,t.idxToView);var I=-1*Xn(A,O);if(s.setUniform3f("vPlaneNormal".concat(M),O[0],O[1],O[2]),s.setUniformf("vPlaneDistance".concat(M),I),a.getProperty().getUseLabelOutline()){var R=t.currentInput.getWorldToIndex();s.setUniformMatrix("vWCtoIDX",R),Oa(t.projectionToWorld,o.wcpc),s.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var E=e.getRenderTargetSize();s.setUniformf("vpWidth",E[0]),s.setUniformf("vpHeight",E[1]);var D=e.getRenderTargetOffset();s.setUniformf("vpOffsetX",D[0]/E[0]),s.setUniformf("vpOffsetY",D[1]/E[1])}}switch(Oa(t.projectionToView,o.vcpc),s.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){case 1:case 2:case 3:var B=0,V=[];n.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),r=e.getIntensity();V[0]=t[0]*r,V[1]=t[1]*r,V[2]=t[2]*r,s.setUniform3fArray("lightColor".concat(B),V);var n=e.getDirection();In(O,n[0],n[1],n[2]),ea(O,O,o.normalMatrix),s.setUniform3f("lightDirectionVC".concat(B),O[0],O[1],O[2]);var a=[-.5*O[0],-.5*O[1],-.5*(O[2]-1)];s.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}}))}},e.setPropertyShaderParameters=function(e,r,n){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=n.getProperty(),s=t.scalarTexture.getComponents(),l=n.getProperty().getIndependentComponents();if(l&&s>=2)for(var c=0;c0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,r,n){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(r),o=[],i=[],s=t.renderable.getClippingPlanes(),l=s.length,c=0;c1.5&&(t._useSmallViewport=!0),t._animationRateSubscription||(t._animationRateSubscription=a.onAnimationFrameRateUpdate((function(){if(t.renderable.getAutoAdjustSampleDistances()){var e=a.getRecentAnimationFrameRate(),r=a.getDesiredUpdateRate()/e;(r>1.15||r<.85)&&(t._lastScale*=r),t._lastScale>400&&(t._lastScale=400),t._lastScale<1.5&&(t._lastScale=1.5)}else t._lastScale=t.renderable.getImageSampleDistance()*t.renderable.getImageSampleDistance();var n=t.openGLRenderWindow.getFramebufferSize();t._smallViewportWidth=Math.ceil(n[0]/Math.sqrt(t._lastScale)),t._smallViewportHeight=Math.ceil(n[1]/Math.sqrt(t._lastScale))}))),t._useSmallViewport){var o=t.openGLRenderWindow.getFramebufferSize();if(t._smallViewportHeight>o[1]&&(t._smallViewportHeight=o[1]),t._smallViewportWidth>o[0]&&(t._smallViewportWidth=o[0]),t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer();else{var i=t.framebuffer.getSize();i[0]===o[0]&&i[1]===o[1]||(t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var s=t.context;s.clearColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clear(s.COLOR_BUFFER_BIT),s.viewport(0,0,t._smallViewportWidth,t._smallViewportHeight),t.fvp=[t._smallViewportWidth/o[0],t._smallViewportHeight/o[1]]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(r,n),n.getProperty().getInterpolationType()===Ji.NEAREST?(t.scalarTexture.setMinificationFilter(Ll.NEAREST),t.scalarTexture.setMagnificationFilter(Ll.NEAREST)):(t.scalarTexture.setMinificationFilter(Ll.LINEAR),t.scalarTexture.setMagnificationFilter(Ll.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(r,n){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,r,n),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,r){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t._useSmallViewport){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 n=t.copyShader;t.copyVAO=Il.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(n,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("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 o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.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()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(r,n){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)):Sc("No input!")},e.computeBounds=function(r,n){e.getInput()?t.bounds=e.getInput().getBounds():St(t.Bounds)},e.updateBufferObjects=function(t,r){e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r)},e.getNeedToRebuildBufferObjects=function(r,n){return t.VBOBuildTime.getMTime()1?1:-1,E[3*D+2]=-1;var B=new Uint16Array(8);B[0]=3,B[1]=0,B[2]=1,B[3]=3,B[4]=3,B[5]=0,B[6]=3,B[7]=2;var V=qt.newInstance({numberOfComponents:3,values:E});V.setName("points");var L=qt.newInstance({numberOfComponents:1,values:B});t.tris.getCABO().createVBO(L,"polys",cl.SURFACE,{points:V,cellOffset:0})}t.VBOBuildTime.modified()}}}}var xc={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};var Pc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xc,r),Vs.extend(e,t,r),t.VBOBuildTime={},Z(t.VBOBuildTime,{mtime:0}),t.tris=Bl.newInstance(),t.scalarTexture=$l.newInstance(),t.opacityTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.jitterTexture=$l.newInstance(),t.jitterTexture.setWrapS(Vl.REPEAT),t.jitterTexture.setWrapT(Vl.REPEAT),t.framebuffer=yc.newInstance(),t.idxToView=Pa(new Float64Array(16)),t.idxNormalMatrix=xo(new Float64Array(9)),t.modelToView=Pa(new Float64Array(16)),t.projectionToView=Pa(new Float64Array(16)),t.projectionToWorld=Pa(new Float64Array(16)),t._lastScale=1,te(e,t,["context"]),Cc(e,t)}),"vtkOpenGLVolumeMapper");_s("vtkVolumeMapper",Pc);var wc=k;function Oc(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=n.getZBufferTexture(),c=Math.floor(l.getWidth()),u=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():wc("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(c*u*4),d.viewport(0,0,c,u),d.readPixels(0,0,c,u,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,r){e&&t.renderable.getUseZValues()&&r.requestDepth()}}var Ac={};var Mc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ac,r),Vs.extend(e,t,r),Oc(e,t)}),"vtkOpenGLPixelSpaceCallbackMapper");_s("vtkPixelSpaceCallbackMapper",Mc);var Ic=Object.create(null);function Rc(e,t){Ic[e]=t}function Ec(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}var Dc={};function Bc(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getProjectionMatrix=function(e,r,n,a){if(Pa(e),t.renderable.getParallelProjection()){var o=t.renderable.getParallelScale(),i=o*r,s=o,l=(a[0]-1)*i,c=(a[0]+1)*i,u=(a[1]-1)*s,d=(a[1]+1)*s,f=1/(c-l),p=1/(d-u);e[0]=2*f,e[5]=2*p,e[10]=1/(n[1]-n[0]),e[12]=(c+l)*f,e[13]=(d+u)*p,e[14]=n[1]/(n[1]-n[0])}else{var g,m,v=Math.tan(Math.PI*t.renderable.getViewAngle()/360);!0===t.renderable.getUseHorizontalViewAngle()?(g=n[0]*v,m=n[0]*v/r):(g=n[0]*v*r,m=n[0]*v);var h=(a[0]-1)*g,y=(a[0]+1)*g,b=(a[1]-1)*m,T=(a[1]+1)*m;e[0]=2*n[0]/(y-h),e[5]=2*n[0]/(T-b),e[12]=(h+y)/(y-h),e[13]=(b+T)/(T-b),e[10]=0,e[14]=n[0],e[11]=-1,e[15]=0}},e.convertToOpenGLDepth=function(e){if(t.renderable.getParallelProjection())return 1-e;var r=t.renderable.getClippingRangeByReference(),n=-r[0]/e;return.5*(n=(r[0]+r[1])/(r[1]-r[0])+2*r[0]*r[1]/(n*(r[1]-r[0])))+.5},e.getKeyMatrices=function(r){var n=r.getRenderable(),a=r.getParent();if(Math.max(a.getMTime(),e.getMTime(),n.getMTime(),t.renderable.getMTime(),r.getStabilizedTime())>t.keyMatrixTime.getMTime()){var o=t.renderable.getViewMatrix();Sa(t.keyMatrices.normalMatrix,o),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,o);var i=r.getStabilizedCenterByReference();Ra(t.keyMatrices.scvc,t.keyMatrices.wcvc,i);var s=r.getAspectRatio(),l=t.renderable.getClippingRangeByReference();e.getProjectionMatrix(t.keyMatrices.vcpc,s,l,t.renderable.getWindowCenterByReference()),Ia(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),Oa(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dc,r),t.overrides=Ic,Fs.extend(e,t,r),Ec(0,t)}),"vtkWebGPUViewNodeFactory");var Vc={keyMatrixTime:null,keyMatrices:null};var Lc=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,r),Vs.extend(e,t,r),t.keyMatrixTime={},fe.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},fe.setGet(e,t,["keyMatrixTime"]),Bc(e,t)}));function Nc(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=function(r){if(t.bindables.length===r.length){for(var n=!0,a=0;an?o:n}if(n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kc,r),fe.obj(e,t),t.bindables=[],t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),fe.setGet(e,t,["label","device","arrayInformation","sourceTime"]),Nc(e,t)}var Gc={newInstance:fe.newInstance(Fc),extend:Fc};function _c(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,r){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}}var Uc={device:null,handle:null};function Wc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uc,r),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["device","handle"]),_c(e,t)}var jc={newInstance:fe.newInstance(Wc,"vtkWebGPUShaderModule"),extend:Wc};function zc(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var r=e.getType(),n=e.getHash(),a=t._shaderModules.keys(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hc,r),t._shaderModules=new Map,fe.obj(e,t),fe.setGet(e,t,["device","window"]),zc(e,t)}fe.newInstance(Kc,"vtkWebGPUShaderCache");var Xc=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}};function qc(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e,r){t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;for(var n=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yc,r),Z(e,t),t.layouts=[],t.shaderDescriptions=[],Q(e,t,["handle","pipelineDescription"]),te(e,t,["device","renderEncoder","topology","vertexState"]),qc(e,t)}var Qc={newInstance:ie(Zc,"vtkWebGPUPipeline"),extend:Zc};function $c(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=function(e,r){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=function(e,r){t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=function(e,r){var n=[],a=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=e.getOutputInterpolationsByReference(),c=0;c1&&(o.push("};"),a=o,n[n.length-1]+=",",n.push("input: ".concat(t.type,"Input")))}if(n.length&&(t.code=Xc(t.code,"//VTK::IOStructs::Input",n).result),t.outputNames.length+t.builtinOutputNames.length){for(var d=["struct ".concat(t.type,"Output\n{")],f=0;f ".concat(t.type,"Output")]).result}t.code=Xc(t.code,"//VTK::IOStructs::Dec",a).result}}var Jc={type:null,hash:null,code:null,outputNames:null,outputTypes:null};function eu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jc,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],fe.obj(e,t),fe.setGet(e,t,["type","hash","code"]),fe.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),$c(e,t)}var tu={newInstance:fe.newInstance(eu,"vtkWebGPUShaderDescription"),extend:eu},ru={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"},r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}},nu=function(e){return!e||e.length<6?0:e in ru==1?ru[e]:(F("unknown format ".concat(e)),null)},au=function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var r=1===t?e.length-1:e.length-3,n=Number(e[r]);return Number.isNaN(n)?(F("unknown format ".concat(e)),0):t*(5-n/2)},ou=function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void F("unknown format ".concat(e));t="Uint"}var r=e.split("x")[0],n=Number(r[r.length-1]);if(!Number.isNaN(n))return(t+=8*(5-n/2))+"Array";F("unknown format ".concat(e))},iu=function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void F("unknown format ".concat(e));t="u32"}var r=1;return"x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r?"vec4<".concat(t,">"):3===r?"vec3<".concat(t,">"):2===r?"vec2<".concat(t,">"):t},su=function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},lu=function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void F("unknown format ".concat(e))};function cu(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"vertex",a=r;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0}))},e.removeBufferIfPresent=function(e){for(var r=0;r0&&(e+=",\n"),e="".concat(e," @location(").concat(r,") ").concat(t.inputs[n].names[a]," : ").concat(i),r++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var r=[],n=0,a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,du,r),Z(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],te(e,t,["created","device","handle"]),uu(e,t)}var pu={newInstance:ie(fu,"vtkWebGPUVertexInput"),extend:fu},gu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",mu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function vu(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(r,n,a){var o=tu.newInstance({type:"vertex",hash:r,code:t.vertexShaderTemplate}),i=tu.newInstance({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),s=n.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,c=new RegExp("//VTK::[^:]*::","g"),u=l.match(c).filter((function(e,t,r){return r.indexOf(e)===t})),d=u.map((function(e){return"replaceShader".concat(e.substring(7,e.length-2))})),f=0;f","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,r){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),r.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(r,n){e.build(r,n),r.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(r),e.renderForPipeline(r)},e.getBindables=function(){var e=f(t.additionalBindables);t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hu,r),fe.obj(e,t),t.textureViews=[],t.vertexInput=pu.newInstance(),t.bindGroup=Gc.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||mu,t.vertexShaderTemplate=t.vertexShaderTemplate||gu,t.shaderReplacements=new Map,fe.get(e,t,["vertexInput"]),fe.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),vu(e,t)}var bu={newInstance:fe.newInstance(yu,"vtkWebGPUMapperHelper"),extend:yu};function Tu(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var r=e.build;e.build=function(e,n){var a=n.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,r(e,n)}}var Su={};function Cu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Su,r),bu.extend(e,t,r),Tu(e,t)}var xu={newInstance:fe.newInstance(Cu,"vtkWebGPUFullScreenQuad"),extend:Cu},Pu={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,CellIndex:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function wu(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 Ou=["getMappedRange","mapAsync","unmap"];function Au(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=function(e){!function(e,t,r,n){var a=n.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(n)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,0,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=e.byteLength,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var r=function(r){e[Ou[r]]=function(){var e;return(e=t.handle)[Ou[r]].apply(e,arguments)}},n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mu,r),fe.obj(e,t),fe.get(e,t,["handle","sizeInBytes","usage"]),fe.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),Au(e,t)}var Ru=function(e){for(var t=1;t0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var r=0;r<3;r++)t.color[r]=e*(t.ambient*t.ambientColor[r]+t.diffuse*t.diffuseColor[r]+t.specular*t.specularColor[r]);return[].concat(t.color)},e.addShaderVariable=Vu("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(Bu.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(Bu.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(Bu.PHONG)},e.getInterpolationAsString=function(){return fe.enumToString(Bu,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Du.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Du.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Du.POINTS)},e.getRepresentationAsString=function(){return fe.enumToString(Du,t.representation)}}var Nu={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:Bu.GOURAUD,representation:Du.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function ku(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nu,r),fe.obj(e,t),fe.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),fe.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),Lu(e,t)}var Fu=function(e){for(var t=1;t1?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,r){return numPoints>2?3*(e-2):0}};function Ku(e){switch(e){case Wu.Points:return"points";case Wu.Lines:return"lines";case Wu.Triangles:case Wu.TriangleEdges:return"polys";case Wu.TriangleStripEdges:case Wu.TriangleStrips:return"strips";default:return""}}function Xu(e,t,r){var n=null;n=t===ju.POINTS||"points"===r?Hu.anythingToPoints:t===ju.WIREFRAME||"lines"===r?Hu["".concat(r,"ToWireframe")]:Hu["".concat(r,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zu,r),Z(e,t),te(e,t,["device"]),Yu(e,t)}var $u=_u(_u({newInstance:ie(Qu),extend:Qu},{}),Pu),Ju=$u.BufferUsage,ed=fe.vtkErrorMacro;function td(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,r){t._bufferEntryNames.has(e)?ed("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:su(r),offset:-1,nativeType:lu(r),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,r=[],n=4,a=0;a4&&(P.packed=!0,P.offset=e,r.push(P),e+=P.sizeInBytes)}for(var w=0;w ").concat(t.label,": ").concat(t.label,"Struct;")),a.join("\n")}}var rd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function nd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},fe.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,fe.get(e,t,["binding","bindGroupTime"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),td(e,t)}var ad={newInstance:fe.newInstance(nd,"vtkWebGPUUniformBuffer"),extend:nd},od=k;function id(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;t.camera=t.renderable.getActiveCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.camera),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),t.webgpuCamera=e.getViewNodeFor(t.camera),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.camera.getClippingRange(),r=t.camera.getPositionByReference(),n=[],a=[];Gn(a,t.camera.getDirectionOfProjectionByReference(),.5*(e[0]+e[1])),Rn(n,r,a),da(a,n,t.stabilizedCenter),va(a)/(e[1]-e[0])>t.recenterThreshold&&(t.stabilizedCenter=n,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(od("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,r){for(var n=0;nr||e.getMTime()>r||t.camera.getMTime()>r||t.renderable.getMTime()>r){var n=t.webgpuCamera.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",n.wcvc),t.UBO.setArray("SCPCMatrix",n.scpc),t.UBO.setArray("PCSCMatrix",n.pcsc),t.UBO.setArray("SCVCMatrix",n.scvc),t.UBO.setArray("VCPCMatrix",n.vcpc),t.UBO.setArray("WCVCNormals",n.normalMatrix);var a=e.getYInvertedTiledSizeAndOrigin();t.UBO.setArray("viewportSize",[a.usize,a.vsize]),t.UBO.setValue("cameraParallel",t.camera.getParallelProjection());var o=t.parent.getDevice();t.UBO.sendIfNeeded(o)}},e.scissorAndViewport=function(t){var r=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize,0,1),t.getHandle().setScissorRect(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var n=0;n = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n");var r=ad.newInstance({label:"mapperUBO"});r.addEntry("BackgroundColor","vec4"),t.clearFSQ.setUBO(r)}var n=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",n),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sd,r),Vs.extend(e,t,r),t.UBO=ad.newInstance({label:"rendererUBO"}),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("viewportSize","vec2"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=Gc.newInstance({label:"rendererBG"}),t.bindGroup.setBindables([t.UBO]),t.tmpMat4=Pa(new Float64Array(16)),t.stabilizedTime={},Z(t.stabilizedTime,{mtime:0}),Q(e,t,["bindGroup","stabilizedTime"]),re(e,t,["stabilizedCenter"]),te(e,t,["renderEncoder","selector","suppressClear","UBO"]),id(e,t)}),"vtkWebGPURenderer");Rc("vtkRenderer",ld);var cd=$u.BufferUsage,ud=fe.vtkErrorMacro;function dd(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,r){if(t._bufferEntryNames.has(e))ud("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var n=su(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:lu(r)}),t.sizeInBytes+=n}},e.send=function(e){if(!t._buffer){var r={nativeArray:t.Float32Array,time:0,usage:cd.Storage,label:t.label};return t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=fe.newTypedArray(e,t.arrayBuffer))},e.setValue=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else ud("entry named ".concat(r," not found in UBO"))},e.setArray=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT,c=0;c;\n};\n@binding(").concat(e,") @group(").concat(r,") var ").concat(t.label,": ").concat(t.label,"Struct;\n")),n.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}var fd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function pd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},fe.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},fe.get(e,t,["bindGroupTime"]),fe.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),dd(e,t)}var gd={newInstance:fe.newInstance(pd,"vtkWebGPUStorageBuffer"),extend:pd};function md(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=function(e,r){return"@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}var vd={device:null,handle:null,label:null,options:null};function hd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vd,r),fe.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","options"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label"]),md(e,t)}var yd={newInstance:fe.newInstance(hd),extend:hd},bd=$s,Td="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n\n // var computedColor: vec4 = vec4(1.0,0.7, 0.5, 1.0);\n\n//VTK::RenderEncoder::Impl\n\n return output;\n}\n",Sd=new Float64Array(16),Cd=new Float64Array(16),xd=new Float64Array(16),Pd=new Float64Array(4),wd=new Float64Array(4);function Od(e,t){t.classHierarchy.push("vtkWebGPUImageMapper"),e.buildPass=function(r){if(r){t.WebGPUImageSlice=e.getFirstAncestorOfType("vtkWebGPUImageSlice"),t.WebGPURenderer=t.WebGPUImageSlice.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice();var n=t.WebGPURenderer.getRenderable();t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(n.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.render=function(){t.renderable.update(),t.currentInput=t.renderable.getInputData(),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.build(t.renderEncoder,t.device),e.updateUBO(t.device)},e.computePipelineHash=function(){var e=t.currentInput.getExtent();e[0]===e[1]||e[2]===e[3]||e[4]===e[5]?(t.dimensions=2,t.pipelineHash="img2"):(t.dimensions=3,t.pipelineHash="img3")},e.updateUBO=function(r){var n=t.UBO.getSendTime(),a=t.WebGPUImageSlice.getRenderable(),o=a.getMapper();if(e.getMTime()>n||t.renderable.getMTime()>n||a.getProperty().getMTime()>n){var i=o.getInputData(),s=t.WebGPURenderer.getStabilizedCenterByReference();Pa(Sd),Ra(Sd,Sd,s);var l=a.getMatrix();wa(Cd,l),Oa(Cd,Cd),Ia(Sd,Cd,Sd);var c=i.getWorldToIndex();Ia(Sd,c,Sd),Oa(xd,Sd);var u=i.getDimensions();Pa(Cd),Ea(Cd,Cd,[1/u[0],1/u[1],1/u[2]]),Ia(Sd,Cd,Sd),t.UBO.setArray("SCTCMatrix",Sd);var d=t.currentInput.getExtent(),f=t.renderable.getClosestIJKAxis().ijkMode,p=t.renderable.getSlice();f!==t.renderable.getSlicingMode()&&(p=t.renderable.getSliceAtPosition(p));var g=2,m=0,v=1;f===bd.I?(g=0,m=1,v=2):f===bd.J&&(g=1,m=2,v=0),Pd[g]=p,Pd[m]=d[2*m],Pd[v]=d[2*v],Pd[3]=1,ri(Pd,Pd,xd),t.UBO.setArray("Origin",Pd),wd[g]=p,wd[m]=d[2*m+1],wd[v]=d[2*v],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis1",wd),wd[g]=p,wd[m]=d[2*m],wd[v]=d[2*v+1],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis2",wd);for(var h=[1,1,1,1],y=[0,0,0,0],b=t.helper.getTextureViews()[0],T=b.getTexture().getScale(),S=b.getTexture().getNumberOfComponents(),C=0;C","@builtin(position) Position");var o=a.getCode(),i=["var pos: vec4 = mapperUBO.Origin +"," (vertexBC.x * 0.5 + 0.5) * mapperUBO.Axis1 + (vertexBC.y * 0.5 + 0.5) * mapperUBO.Axis2;","pos.w = 1.0;"];2===t.dimensions?i.push("var tcoord : vec2 = (mapperUBO.SCTCMatrix * pos).xy;"):i.push("var tcoord : vec3 = (mapperUBO.SCTCMatrix * pos).xyz;"),i.push("output.tcoordVS = tcoord;","output.Position = rendererUBO.SCPCMatrix * pos;"),o=Xc(o,"//VTK::Position::Impl",i).result,a.setCode(o)},r.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,r,n){var a=r.getShaderDescription("vertex");2===t.dimensions?a.addOutput("vec2","tcoordVS"):a.addOutput("vec3","tcoordVS")},r.set("replaceShaderTCoord",e.replaceShaderTCoord),e.replaceShaderImage=function(e,r,n){var a=r.getShaderDescription("fragment"),o=a.getCode();t.dimensions,o=Xc(o,"//VTK::Image::Sample",[" var computedColor: vec4 ="," textureSampleLevel(imgTexture, clampSampler, input.tcoordVS, 0.0);","//VTK::Image::Sample"]).result,o=Xc(o,"//VTK::Image::Sample",[" var coord: vec2 ="," vec2(computedColor.r * mapperUBO.cScale.r + mapperUBO.cShift.r, 0.5);"," computedColor = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);"]).result,a.setCode(o)},r.set("replaceShaderImage",e.replaceShaderImage)}var Ad={rowLength:1024};var Md=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,r),Vs.extend(e,t,r),t.helper=xu.newInstance(),t.helper.setFragmentShaderTemplate(Td),t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("SCTCMatrix","mat4x4"),t.UBO.addEntry("Origin","vec4"),t.UBO.addEntry("Axis2","vec4"),t.UBO.addEntry("Axis1","vec4"),t.UBO.addEntry("cScale","vec4"),t.UBO.addEntry("cShift","vec4"),t.helper.setUBO(t.UBO),t.SSBO=gd.newInstance({label:"volumeSSBO"}),t.componentSSBO=gd.newInstance({label:"componentSSBO"}),t.lutBuildTime={},Z(t.lutBuildTime,{mtime:0}),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),t.VBOBuildTime={},Z(t.VBOBuildTime),Od(e,t)}),"vtkWebGPUImageMapper");function Id(e,t){t.classHierarchy.push("vtkWebGPUImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageMapper",Md);var Rd={bufferShift:void 0,keyMatrixTime:null,keyMatrices:null,propID:void 0};var Ed=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rd,r),Vs.extend(e,t,r),t.keyMatricesTime={},Z(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},t.bufferShift=[0,0,0,0],Q(e,t,["propID","keyMatricesTime"]),Id(e,t)}),"vtkWebGPUImageSlice");function Dd(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),t.renderable.getMapper().update(),e.removeUnusedNodes())},e.queryPass=function(r,n){if(r){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;n.addVolume(e)}};var r=new Float64Array(3),n=new Float64Array(3);e.getBoundingCubePoints=function(e,a){var o=t.renderable.getMapper().getInputData();if(o)for(var i=o.getExtent(),s=t.renderable.getMatrix(),l=0,c=4;c<6;c++){r[2]=i[c];for(var u=2;u<4;u++){r[1]=i[u];for(var d=0;d<2;d++){r[0]=i[d],o.indexToWorld(r,n);var f=a+3*l;e[f++]=s[0]*n[0]+s[1]*n[1]+s[2]*n[2]+s[3],e[f++]=s[4]*n[0]+s[5]*n[1]+s[6]*n[2]+s[7],e[f++]=s[8]*n[0]+s[9]*n[1]+s[10]*n[2]+s[11],l++}}}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();wa(t.keyMatrices.bcwc,r),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageSlice",Ed);var Bd={propID:void 0,keyMatricesTime:null};var Vd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bd,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),Dd(e,t)}),"vtkWebGPUVolume");function Ld(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}Rc("vtkVolume",Vd);var Nd={};var kd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nd,r),Vs.extend(e,t,r),Ld(e,t)}),"vtkWebGPUPixelSpaceCallbackMapper");function Fd(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(r){if(r){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 n=0;nt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?xo(t.keyMatrices.normalMatrix):(yo(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Po(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}Rc("vtkPixelSpaceCallbackMapper",kd);var Gd={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};var _d=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gd,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),Fd(e,t)}));function Ud(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(r){if(r){if(!t.renderable)return;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 n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wd,r),Vs.extend(e,t,r),te(e,t,["context"]),Q(e,t,["activeTextures"]),Ud(e,t)}));_s("vtkActor2D",jd);var zd=Math.sqrt(50),Hd=Math.sqrt(10),Kd=Math.sqrt(2);function Xd(e,t,r){var n=(t-e)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,a);return a>=0?(o>=zd?10:o>=Hd?5:o>=Kd?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=zd?10:o>=Hd?5:o>=Kd?2:1)}function qd(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function Yd(e){let t=e,r=e,n=e;function a(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<0?a=r+1:o=r}while(ae(t)-r,r=qd,n=(t,r)=>qd(e(t),r)),{left:a,center:function(e,r,n=0,o=e.length){const i=a(e,r,n,o-1);return i>n&&t(e[i-1],r)>-t(e[i],r)?i-1:i},right:function(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<=0?a=r+1:o=r}while(a>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Tf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Tf(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=cf.exec(e))?new xf(t[1],t[2],t[3],1):(t=uf.exec(e))?new xf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=df.exec(e))?Tf(t[1],t[2],t[3],t[4]):(t=ff.exec(e))?Tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pf.exec(e))?Af(t[1],t[2]/100,t[3]/100,1):(t=gf.exec(e))?Af(t[1],t[2]/100,t[3]/100,t[4]):mf.hasOwnProperty(e)?bf(mf[e]):"transparent"===e?new xf(NaN,NaN,NaN,0):null}function bf(e){return new xf(e>>16&255,e>>8&255,255&e,1)}function Tf(e,t,r,n){return n<=0&&(e=t=r=NaN),new xf(e,t,r,n)}function Sf(e){return e instanceof tf||(e=yf(e)),e?new xf((e=e.rgb()).r,e.g,e.b,e.opacity):new xf}function Cf(e,t,r,n){return 1===arguments.length?Sf(e):new xf(e,t,r,null==n?1:n)}function xf(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Pf(){return"#"+Of(this.r)+Of(this.g)+Of(this.b)}function wf(){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 Of(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Af(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new If(e,t,r,n)}function Mf(e){if(e instanceof If)return new If(e.h,e.s,e.l,e.opacity);if(e instanceof tf||(e=yf(e)),!e)return new If;if(e instanceof If)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(i=t===o?(r-n)/s+6*(r0&&l<1?0:i,new If(i,s,l,e.opacity)}function If(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Rf(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function Ef(e,t,r,n,a){var o=e*e,i=o*e;return((1-3*e+3*o-i)*t+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*n+i*a)/6}Jd(tf,yf,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:vf,formatHex:vf,formatHsl:function(){return Mf(this).formatHsl()},formatRgb:hf,toString:hf}),Jd(xf,Cf,ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new xf(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new xf(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:Pf,formatHex:Pf,formatRgb:wf,toString:wf})),Jd(If,(function(e,t,r,n){return 1===arguments.length?Mf(e):new If(e,t,r,null==n?1:n)}),ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new If(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new If(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new xf(Rf(e>=240?e-240:e+120,a,n),Rf(e,a,n),Rf(e<120?e+240:e-120,a,n),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+")")}}));const Df=e=>()=>e;function Bf(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Df(isNaN(e)?t:e)}const Vf=function e(t){var r=function(e){return 1==(e=+e)?Bf:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Df(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Cf(e)).r,(t=Cf(t)).r),a=r(e.g,t.g),o=r(e.b,t.b),i=Bf(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=a(t),e.b=o(t),e.opacity=i(t),e+""}}return n.gamma=e,n}(1);function Lf(e){return function(t){var r,n,a=t.length,o=new Array(a),i=new Array(a),s=new Array(a);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],i=n>0?e[n-1]:2*a-o,s=no&&(a=t.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(r=r[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,l.push({i,x:Ff(r,n)})),o=Uf.lastIndex;return ot&&(r=e,e=t,t=r),c=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?Qf:Zf,a=o=null,d}function d(t){return null==t||isNaN(t=+t)?r:(a||(a=n(i.map(e),s,l)))(e(c(t)))}return d.invert=function(r){return c(t((o||(o=n(s,i.map(e),Ff)))(r)))},d.domain=function(e){return arguments.length?(i=Array.from(e,Kf),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Hf,u()},d.clamp=function(e){return arguments.length?(c=!!e||qf,u()):c!==qf},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,u()}}()(qf,qf)}function ep(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var tp,rp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=rp.exec(e)))throw new Error("invalid format: "+e);var t;return new ap({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 ap(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 op(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ip(e){return(e=op(Math.abs(e)))?e[1]:NaN}function sp(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}np.prototype=ap.prototype,ap.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};const lp={"%":(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)=>sp(100*e,t),r:sp,s:function(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(tp=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=n.length;return o===i?n:o>i?n+new Array(o-i+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+op(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cp(e){return e}var up,dp,fp,pp=Array.prototype.map,gp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mp(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,a,o,i,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t0){let r=Math.round(e/i),n=Math.round(t/i);for(r*it&&--n,o=new Array(a=n-r+1);++st&&--n,o=new Array(a=n-r+1);++s=zd?a*=10:o>=Hd?a*=5:o>=Kd&&(a*=2),t0;){if((a=Xd(l,c,r))===n)return o[i]=l,o[s]=c,t(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a}n=a}return e},e}function vp(){var e=Jf();return e.copy=function(){return $f(e,vp())},ep.apply(e,arguments),mp(e)}function hp(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}up=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?cp:(t=pp.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var a=e.length,o=[],i=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(a-=s,a+s)),!((l+=s+1)>n));)s=t[i=(i+1)%t.length];return o.reverse().join(r)}),a=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?cp:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(pp.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=np(e)).fill,r=e.align,d=e.sign,f=e.symbol,p=e.zero,g=e.width,m=e.comma,v=e.precision,h=e.trim,y=e.type;"n"===y?(m=!0,y="g"):lp[y]||(void 0===v&&(v=12),h=!0,y="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===f?a:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",T="$"===f?o:/[%p]/.test(y)?l:"",S=lp[y],C=/[defgprs%]/.test(y);function x(e){var a,o,l,f=b,x=T;if("c"===y)x=S(e)+x,e="";else{var P=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),v),h&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),P&&0==+e&&"+"!==d&&(P=!1),f=(P?"("===d?d:c:"-"===d||"("===d?"":d)+f,x=("s"===y?gp[8+tp/3]:"")+x+(P&&"("===d?")":""),C)for(a=-1,o=e.length;++a(l=e.charCodeAt(a))||l>57){x=(46===l?i+e.slice(a+1):e.slice(a))+x,e=e.slice(0,a);break}}m&&!p&&(e=n(e,1/0));var w=f.length+e.length+x.length,O=w>1)+f+e+x+O.slice(w);break;default:e=O+f+e+x}return s(e)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),x.toString=function(){return e+""},x}return{format:d,formatPrefix:function(e,t){var r=d(((e=np(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(ip(t)/3))),a=Math.pow(10,-n),o=gp[8+n/3];return function(e){return r(a*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),dp=up.format,fp=up.formatPrefix;var yp=fe.vtkDebugMacro;function bp(e,t){t.classHierarchy.push("vtkActor");var r=function(e){for(var t=1;t=1;return(r=r&&(!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=Fu.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 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||r[0]!==t.mapperBounds[0]||r[1]!==t.mapperBounds[1]||r[2]!==t.mapperBounds[2]||r[3]!==t.mapperBounds[3]||r[4]!==t.mapperBounds[4]||r[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){yp("Recomputing bounds..."),t.mapperBounds=r.concat();var n=[];Hr.getCorners(r,n),e.computeMatrix();var a=new Float64Array(16);wa(a,t.matrix),n.forEach((function(e){return Jn(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?n.reduce((function(e,r){return e>r[t/2]?r[t/2]:e}),e):n.reduce((function(e,r){return ee?n: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 r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var Tp={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function Sp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tp,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),bp(e,t)}var Cp={newInstance:fe.newInstance(Sp,"vtkActor"),extend:Sp};function xp(e,t){e.getBounds=function(){return 0},e.getBounds=function(r){e.getBounds();for(var n=0;n<6;n++)r[n]=t.bounds[n]},e.getCenter=function(){e.getBounds();for(var r=0;r<3;r++)t.center[r]=(t.bounds[2*r+1]+t.bounds[2*r])/2;return t.center.slice()},e.getLength=function(){var r=0,n=0;e.getBounds();for(var a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return Math.sqrt(n)}}var Pp={bounds:[1,-1,1,-1,1,-1],center:[0,0,0]},wp=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,r),ys(e,t,r),t.bounds||St(t.bounds),t.center||(t.center=[0,0,0]),xp(e,t)},Op=fe.vtkErrorMacro;function Ap(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+1+1.5:(r=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(r,n,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var c=e.getAlpha(),u=r.getNumberOfTuples(),d=r.getNumberOfComponents(),f=n.getData(),p=r.getData();if(c>=1){if(a===hi.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Mp={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 Ip(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mp,r),Di.extend(e,t,r),t.table||(t.table=[]),t.buildTime={},fe.obj(t.buildTime),t.opaqueFlagBuildTime={},fe.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},fe.obj(t.insertTime,{mtime:0}),fe.get(e,t,["buildTime"]),fe.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),fe.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),Ap(e,t)}var Rp={newInstance:fe.newInstance(Ip,"vtkLookupTable"),extend:Ip},Ep=1,Dp=0,Bp=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Vp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Dp=e}var Lp={getResolveCoincidentTopologyAsString:function(){return Bp[Dp]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Ep},getResolveCoincidentTopology:function(){return Dp},setResolveCoincidentTopology:Vp,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Ep=e},setResolveCoincidentTopologyToDefault:function(){Vp(0)},setResolveCoincidentTopologyToOff:function(){Vp(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Vp(1)}};function Np(e,t,r){r.forEach((function(r){e["get".concat(r.method)]=function(){return t[r.key]},e["set".concat(r.method)]=function(e,n){t[r.key]={factor:e,offset:n}}}))}var kp=["Polygon","Line","Point"],Fp={};Np(Fp,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},kp.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var Gp={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),fe.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Lp).forEach((function(t){e[t]=Lp[t]})),Object.keys(Fp).forEach((function(t){e[t]=Fp[t]})),Np(e,t.topologyOffset,kp.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyPolygonOffsetParameters(),r=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyLineOffsetParameters(),r=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Fp.getResolveCoincidentTopologyPointOffsetParameters(),r=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}}},staticOffsetAPI:Fp,otherStaticMethods:Lp,CATEGORIES:kp};function _p(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}function Up(e){for(var t=1;t1e3?n=1e3:n<-1e3&&(n=-1e3)),{texCoordS:n,texCoordT:a}},e.createColorTextureCoordinates=function(t,r,n,a,o,i,s,l,c){var u=(i[1]-i[0])/l,d=[];d[0]=i[0]-u,d[1]=i[1]+u;var f=1/(d[1]-d[0]),p=r.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==n){t.lookupTable.setAlpha(n),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),c=new Float64Array(2*s),u=0;ut.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=r.getNumberOfComponents(),g=r.getNumberOfTuples();t.colorCoordinates=qt.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===Xp.MAGNITUDE&&r.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(r,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(r){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var n=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=n.scalars;return!(!a||n.cellFlag||t.colorMode===zp.DEFAULT&&a.getDataType()===qp.UNSIGNED_CHAR||t.colorMode===zp.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 r=t.lookupTable.getMTime();e=r>e?r: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=Yp("AcquireInvertibleLookupTable"),e.valueToColor=Yp("ValueToColor"),e.colorToValue=Yp("ColorToValue"),e.useInvertibleColorFor=Yp("UseInvertibleColorFor"),e.clearInvertibleColor=Yp("ClearInvertibleColor")}var Qp={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 $p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qp,r),wp(e,t,r),fe.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),fe.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Gp.implementCoincidentTopologyMethods(e,t),Zp(e,t)}var Jp=Up(Up(Up({newInstance:fe.newInstance($p,"vtkMapper"),extend:$p},Wp),jp),Ti);function eg(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}function tg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};qt.extend(e,t,og(r)),ag(e,t)}var sg=tg({newInstance:fe.newInstance(ig,"vtkCellArray"),extend:ig},ng),lg=fe.vtkErrorMacro,cg=[1,-1,1,-1,1,-1];function ug(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==r&&(t.size=r*n,t.values=fe.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(n),e.modified())},e.setPoint=function(e){for(var r=e*t.numberOfComponents,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dg,r),qt.extend(e,t,r),ug(e,t)}var pg={newInstance:fe.newInstance(fg,"vtkPoints"),extend:fg};function gg(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){t.pointsIds=r;var n=t.points.getData();n.length!==3*t.pointsIds.length&&(n=fe.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach((function(e,t){var r=3*e,o=3*t;n[o]=a[r],n[++o]=a[++r],n[++o]=a[++r]})),t.points.setData(n)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),r=[];if(e){t.points.getPoint(0,r),t.bounds[0]=r[0],t.bounds[1]=r[0],t.bounds[2]=r[1],t.bounds[3]=r[1],t.bounds[4]=r[2],t.bounds[5]=r[2];for(var n=1;nt.bounds[1]?r[0]:t.bounds[1],t.bounds[2]=r[1]t.bounds[3]?r[1]:t.bounds[3],t.bounds[4]=r[2]t.bounds[5]?r[2]:t.bounds[5]}else St(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var r=0,n=0,a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return r},e.getParametricDistance=function(e){for(var t,r=0,n=0;n<3;n++)(t=e[n]<0?-e[n]:e[n]>1?e[n]-1:0)>r&&(r=t);return r},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,r,n,a,o,i){},e.evaluatePosition=function(e,t,r,n,a,o){}}var mg={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function vg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mg,r),fe.obj(e,t),t.points||(t.points=pg.newInstance()),fe.get(e,t,["points","pointsIds"]),gg(e,t)}var hg={newInstance:fe.newInstance(vg,"vtkCell"),extend:vg};function yg(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(r){var n=r.getPoints().getNumberOfPoints(),a=r.getNumberOfCells(),o=new Uint32Array(n);if(r.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=r,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,r){t.array[e].cells[t.array[e].ncells++]=r},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,r){t.array[r].cells=t.array[r].cells.filter((function(t){return t!==e})),t.array[r].ncells=t.array[r].cells.length},e.addCellReference=function(e,r){t.array[r].cells[t.array[r].ncells++]=e},e.resizeCellList=function(e,r){t.array[e].cells.length=r},e.squeeze=function(){!function(e,t){var r=t;for(t>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=f(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bg,r),fe.obj(e,t),yg(e,t)}var Sg={newInstance:fe.newInstance(Tg,"vtkCellLinks"),extend:Tg},Cg=0,xg=1,Pg=2,wg=3,Og=4,Ag=5,Mg=6,Ig=7,Rg=9,Eg=21,Dg=41,Bg=42,Vg=["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 Lg(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 Ng={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]=Cg},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(t,Fg,r),fe.obj(e,t),fe.get(e,t,["size","maxId","extend"]),fe.getArray(e,t,["typeArray","locationArray"]),kg(e,t)}var _g=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=Ge(i,i),c=1e-5*s;return 0!==l&&(o.t=s/l),c<0&&(c=-c),-c1?n=r:(n=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=n[0],a[1]=n[1],a[2]=n[2]),o.distance=ze(n,e),o}function Kg(e,t,r,n,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=n[0]-r[0],s[1]=n[1]-r[1],s[2]=n[2]-r[2],l[0]=r[0]-e[0],l[1]=r[1]-e[1],l[2]=r[2]-e[2];var c=[];c[0]=[Ge(i,i),-Ge(i,s)],c[1]=[c[0][1],Ge(s,s)];var u=[];if(u[0]=Ge(i,l),u[1]=-Ge(s,l),0===ut(c,u,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,r,n],g=[r,r,e,e],m=[n,n,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Hg(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?zg.YES_INTERSECTION:zg.NO_INTERSECTION}var Xg={distanceToLine:Hg,intersection:Kg};function qg(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,r,n,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],c=[];t.points.getPoint(0,l),t.points.getPoint(1,c);var u,d=[],f=[],p=Kg(e,r,l,c,d,f);if(i.t=d[0],i.betweenPoints=(u=i.t)>=0&&u<=1,o[0]=f[0],p===zg.YES_INTERSECTION){for(var g=0;g<3;g++)a[g]=l[g]+o[0]*(c[g]-l[g]),s[g]=e[g]+i.t*(r[g]-e[g]);if(ze(a,s)<=n*n)return i.intersect=1,i}else{var m;if(i.t<0)return(m=Hg(e,l,c,a)).distance<=n*n?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(m=Hg(r,l,c,a)).distance<=n*n?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,m=Hg(l,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,m=Hg(c,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,r,n,a,o){}}var Yg={};function Zg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,r),hg.extend(e,t,r),qg(e,t)}var Qg=jg(jg({newInstance:fe.newInstance(Zg,"vtkLine"),extend:Zg},Xg),Ug);function $g(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=T(t.points):t.points=pg.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var r=e.shallowCopy;e.shallowCopy=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r(e,n),t.points=pg.newInstance(),t.points.shallowCopy(e.getPoints())}}var Jg={};function em(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,r),pn.extend(e,t,r),fe.setGet(e,t,["points"]),$g(e,t)}var tm={newInstance:fe.newInstance(em,"vtkPointSet"),extend:em};function rm(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}function nm(e,t,r,n){var a=r[0]-t[0],o=r[1]-t[1],i=r[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],c=e[2]-t[2];n[0]=o*c-i*l,n[1]=i*s-a*c,n[2]=a*l-o*s}function am(e,t,r,n){nm(e,t,r,n);var a=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==a&&(n[0]/=a,n[1]/=a,n[2]/=a)}var om={computeNormalDirection:nm,computeNormal:am};function im(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(r,n,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,c=[],u=[],d=[];t.points.getPoint(0,c),t.points.getPoint(1,u),t.points.getPoint(2,d);var f=[];if(am(c,u,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=cr.intersectWithLine(r,n,c,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=ze(c,u),v=ze(u,d),h=ze(d,c);t.line||(t.line=Qg.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,u)):v>h&&v>m?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,c));var y=t.line.intersectWithLine(r,n,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],S=[],C=0;C<3;C++)b[C]=c[C]-d[C],T[C]=u[C]-d[C],S[C]=o[C]-d[C];return i[0]=Ge(S,b)/h,i[1]=Ge(S,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,r,n,a){var o,i,s,l,c,u,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,S=[],C=[],x=[],P=[],w=[];f.subId=0,n[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),nm(p,g,m,v),cr.generalizedProjectPoint(e,p,v,w);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(S[i++]=o);for(o=0;o<2;o++)h[o]=w[S[o]]-m[S[o]],y[o]=p[S[o]]-m[S[o]],b[o]=g[S[o]]-m[S[o]];if(0===(l=qe(y,b)))return n[0]=0,n[1]=0,f.evaluation=-1,f;if(n[0]=qe(h,b)/l,n[1]=qe(y,h)/l,a[0]=1-(n[0]+n[1]),a[1]=n[0],a[2]=n[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)r&&(f.dist2=ze(w,e),r[0]=w[0],r[1]=w[1],r[2]=w[2]),f.evaluation=1;else{var A;if(r)if(a[1]<0&&a[2]<0)for(c=ze(e,m),u=Qg.distanceToLine(e,p,m,A,x),d=Qg.distanceToLine(e,m,g,A,P),c1?n[a]-1:0)>r&&(r=t);return r}}var sm={};function lm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sm,r),hg.extend(e,t,r),im(e,t)}var cm,um=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),dm.forEach((function(r){t[r]=sg.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))},e.buildCells=function(){var r=e.getNumberOfVerts(),n=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=r+n+a+o,s=new Uint8Array(i),l=s,c=new Uint32Array(i),u=c;if(r){var d=0;t.verts.getCellSizes().forEach((function(e,t){u[t]=d,l[t]=e>1?Pg:xg,d+=e+1})),u=u.subarray(r),l=l.subarray(r)}if(n){var f=0;t.lines.getCellSizes().forEach((function(e,t){u[t]=f,l[t]=e>2?Og:wg,1===e&&fm("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1})),u=u.subarray(n),l=l.subarray(n)}if(a){var p=0;t.polys.getCellSizes().forEach((function(e,t){switch(u[t]=p,e){case 3:l[t]=Ag;break;case 4:l[t]=Rg;break;default:l[t]=Ig}e<3&&fm("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1})),u+=u.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Mg,0,o),t.strips.getCellSizes().forEach((function(e,t){u[t]=g,g+=e+1}))}t.cells=_g.newInstance(),t.cells.setCellTypes(i,s,c)},e.buildLinks=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Sg.newInstance(),r>0?t.links.allocate(r):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var r=t.cells.getCellType(e),n=null;switch(r){case xg:case Pg:n=t.verts;break;case wg:case Og:n=t.lines;break;case Ag:case Rg:case Ig:n=t.polys;break;case Mg:n=t.strips;break;default:return n=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:r,cellPointIds:n.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,r,n){var a=t.links.getLink(r),o=t.links.getLink(n);return a.cells.filter((function(t){return t!==e&&-1!==o.cells.indexOf(t)}))},e.getCell=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.getCellPoints(t),a=r||pm[n.cellType].newInstance();return a.initialize(e.getPoints(),n.cellPointIds),a}}var mm={};function vm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mm,r),tm.extend(e,t,r),fe.get(e,t,["cells","links"]),fe.setGet(e,t,["verts","lines","polys","strips"]),gm(e,t)}var hm={newInstance:fe.newInstance(vm,"vtkPolyData"),extend:vm};function ym(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setJsImageData=function(r){t.jsImageData!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null),t.jsImageData=r,t.imageLoaded=!0,e.modified())},e.setCanvas=function(r){t.canvas!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.jsImageData=null),t.canvas=r,e.modified())},e.setImage=function(r){t.image!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.canvas=null,t.jsImageData=null),t.image=r,t.imageLoaded=!1,r.complete?e.imageLoaded():r.addEventListener("load",e.imageLoaded),e.modified())}}var bm={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,canvas:null,imageLoaded:!1,jsImageData:null};function Tm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,r),fe.obj(e,t),fe.algo(e,t,6,0),fe.get(e,t,["canvas","image","jsImageData","imageLoaded"]),fe.setGet(e,t,["repeat","edgeClamp","interpolate"]),ym(e,t)}var Sm={newInstance:fe.newInstance(Tm,"vtkTexture"),extend:Tm};function Cm(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}function xm(e){for(var t=1;t.5?Gn(Em,Bm,o[0]*i):Gn(Em,Bm,o[0]*i-l.width/2),Rn(Im,Im,Em),Gn(Em,Vm,o[1]*i-l.height/2),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[0],s.tcoords[2*f+1]=l.tcoords[1],f++,Gn(Em,Bm,l.width),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[2],s.tcoords[2*f+1]=l.tcoords[3],f++,Gn(Em,Vm,l.height),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[4],s.tcoords[2*f+1]=l.tcoords[5],f++,Gn(Em,Bm,l.width),En(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[6],s.tcoords[2*f+1]=l.tcoords[7],f++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-3,s.polys[4*p+3]=f-2,p++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-2,s.polys[4*p+3]=f-1,s.ptIdx+=4,s.cellIdx+=2}},e.updateTexturePolyData=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r);var n=t.renderable.getTextValues().length,a=4*n,o=2*n,i=new Float64Array(3*a),s=new Uint16Array(4*o),l=new Float32Array(2*a);Oa(Lm,r);for(var c={ptIdx:0,cellIdx:0,polys:s,points:i,tcoords:l},u=0,d=0,f=0,p=t.renderable.getTextPolyData().getPoints().getData(),g=t.renderable.getTextValues();u2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),fe.setGet(e,t,["renderable"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.lastTickBounds=[],km(e,t)}),"vtkCubeAxesActorHelper");function Gm(e,t){t.classHierarchy.push("vtkCubeAxesActor"),e.setCamera=function(r){t.camera!==r&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=r,r&&(t.cameraModifiedSub=r.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=function(){var e=t.camera.getViewMatrix();wa(e,e);for(var r=!1,n=Hr.getDiagonalLength(t.dataBounds),a=Math.sin(t.faceVisibilityAngle*Math.PI/180),o=0;o<6;o++){var i=!1,s=Math.floor(o/2),l=(s+1)%3,c=(s+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*c]!==t.dataBounds[2*c+1]&&(Im[s]=t.dataBounds[o]-.1*n*Pm[o][s],Im[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),Im[c]=.5*(t.dataBounds[2*c]+t.dataBounds[2*c+1]),Jn(Em,Im,e),Im[s]=t.dataBounds[o],Jn(Dm,Im,e),En(Em,Dm,Em),Kn(Em,Em),i=Em[2]>a,t.camera.getParallelProjection()||(Kn(Dm,Dm),i=Xn(Dm,Em)>a)),i!==t.lastFacesToDraw[o]&&(t.lastFacesToDraw[o]=i,r=!0)}return r},e.updatePolyData=function(e,r,n){var a=0,o=0;a+=8;for(var i=0,s=0;s<12;s++)r[s]>0&&i++;if(o+=i,t.gridLines)for(var l=0;l<6;l++)e[l]&&(a+=2*n[Mm[l][0]].length+2*n[Mm[l][1]].length,o+=n[Mm[l][0]].length+n[Mm[l][1]].length);for(var c=new Float64Array(3*a),u=new Uint32Array(3*o),d=0,f=0,p=0;p<2;p++)for(var g=0;g<2;g++)for(var m=0;m<2;m++)c[3*d]=t.dataBounds[m],c[3*d+1]=t.dataBounds[2+g],c[3*d+2]=t.dataBounds[4+p],d++;for(var v=0;v<12;v++)r[v]>0&&(u[3*f]=2,u[3*f+1]=Om[v][0],u[3*f+2]=Om[v][1],f++);if(t.gridLines)for(var h=0;h<6;h++)if(e[h]){for(var y=Math.floor(h/2),b=n[Mm[h][0]],T=0;T2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_m(r)),Cp.extend(e,t,r),t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.gridMapper=Jp.newInstance(),t.polyData=hm.newInstance(),t.gridMapper.setInputData(t.polyData),t.gridActor=Cp.newInstance(),t.gridActor.setMapper(t.gridMapper),t.gridActor.setProperty(e.getProperty()),t.gridActor.setParentProp(e),t.textPolyData=hm.newInstance(),fe.setGet(e,t,["axisTitlePixelOffset","faceVisibilityAngle","gridLines","tickLabelPixelOffset"]),fe.setGetArray(e,t,["dataBounds"],6),fe.setGetArray(e,t,["axisLabels"],3),fe.get(e,t,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","_tmAtlas","tickCounts","gridActor"]),Gm(e,t)}var Wm={newInstance:fe.newInstance(Um,"vtkCubeAxesActor"),extend:Um,newCubeAxesActorHelper:Fm};function jm(e,t){t.classHierarchy.push("vtkOpenGLCubeAxesActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var zm={};var Hm=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zm,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),jm(e,t)}),"vtkOpenGLCubeAxesActor");_s("vtkCubeAxesActor",Hm);var Km={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},Xm=Fu.Representation,qm=Fu.Shading,Ym=Jp.ScalarMode,Zm=$l.Filter,Qm=$l.Wrap,$m=F,Jm={type:"StartEvent"},ev={type:"EndEvent"};function tv(e,r){function n(e,t,r){return t.identity(r),e.reduce((function(e,r,n){return 0===n?r?t.copy(e,r):t.identity(e):r?t.multiply(e,e,r):e}),r)}r.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(t){t&&(r.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),r.openGLRenderer=r.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(t){t&&(r.haveSeenDepthRequest=!0,r.renderDepth=!0,e.render(),r.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=Km.Start;n= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=wl.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:$m("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(t,n,a){if(r.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=t.Vertex,i=t.Geometry,s=t.Fragment;r.lastBoundBO.getCABO().getNormalOffset()?(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=wl.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=wl.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=wl.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):r.haveCellNormals?(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=wl.substitute(s,"//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(),r.lastBoundBO.getPrimitiveType())===r.context.LINES?(s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//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),t.Vertex=o,t.Geometry=i,t.Fragment=s}},e.replaceShaderPositionVC=function(e,t,n){var a=e.Vertex,o=e.Geometry,i=e.Fragment;n.getProperty().getRepresentation()!==Xm.POINTS&&r.lastBoundBO.getPrimitiveType()!==Km.Points||(a=wl.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(n.getProperty().getPointSize(),".0;")],!1).result),r.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=wl.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=wl.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=wl.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,t,n){if(r.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(r.drawingEdges)return;a=wl.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=r.openGLActor.getActiveTextures(),l=2,c=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===r.context.TEXTURE_CUBE_MAP&&(c=3)),r.renderable.getColorTextureMap()&&(l=r.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),c=2),2===c){if(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,t,n){var a=e.Vertex,o=e.Fragment;if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes();a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[".concat(i,"];"),"varying float clipDistancesVSOutput[".concat(i,"];")]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[".concat(i,"];")]).result,o=wl.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,t){var n=null,a=t.getProperty();if(r.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===Xm.SURFACE){var o=r.lastBoundBO.getPrimitiveType();o===Km.Points||a.getRepresentation()===Xm.POINTS?n=r.renderable.getCoincidentTopologyPointOffsetParameter():o===Km.Lines||a.getRepresentation()===Xm.WIREFRAME?n=r.renderable.getCoincidentTopologyLineOffsetParameters():o!==Km.Tris&&o!==Km.TriStrips||(n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==Km.TrisEdges&&o!==Km.TriStripsEdges||((n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,n.offset/=2)}return n},e.replaceShaderPicking=function(e,t,r){var n=e.Fragment;n=wl.substitute(n,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,n=wl.substitute(n,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=n},e.replaceShaderValues=function(t,n,a){if(e.replaceShaderColor(t,n,a),e.replaceShaderNormal(t,n,a),e.replaceShaderLight(t,n,a),e.replaceShaderTCoord(t,n,a),e.replaceShaderPicking(t,n,a),e.replaceShaderClip(t,n,a),e.replaceShaderCoincidentOffset(t,n,a),e.replaceShaderPositionVC(t,n,a),r.haveSeenDepthRequest){var o=t.Fragment;o=wl.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=wl.substitute(o,"//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,t.Fragment=o}},e.getNeedToRebuildShaders=function(t,n,a){var o=0,i=0,s=t.getPrimitiveType(),l=r.currentInput,c=!1,u=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===qm.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===r.context.TRIANGLES||d&&!u||!f&&u?c=!0:f||g!==r.context.LINES||(c=!0),a.getProperty().getLighting()&&c){o=0;for(var m=n.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=r.lastBoundBO.getReferenceByName("lastLightComplexity"),T=r.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(r.lastBoundBO.set({lastLightComplexity:o},!0),r.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(r.lastHaveSeenDepthRequest!==r.haveSeenDepthRequest||0===t.getProgram()||t.getShaderSourceTime().getMTime()t.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){var o=r.lastBoundBO.getReferenceByName("lastLightComplexity");t.getProgram().isAttributeUsed("vertexMC")&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"vertexMC",t.getCABO().getVertexOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting vertexMC in shader VAO.")),t.getProgram().isAttributeUsed("normalMC")&&t.getCABO().getNormalOffset()&&o>0?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"normalMC",t.getCABO().getNormalOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting normalMC in shader VAO."):t.getVAO().removeAttributeArray("normalMC"),r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||$m("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||$m("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),t.getProgram().isAttributeUsed("scalarColor")&&t.getCABO().getColorComponents()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO().getColorBO(),"scalarColor",t.getCABO().getColorOffset(),t.getCABO().getColorBOStride(),r.context.UNSIGNED_BYTE,4,!0)||$m("Error setting scalarColor in shader VAO."):t.getVAO().removeAttributeArray("scalarColor"),t.getAttributeUpdateTime().modified()}if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes(),s=[],l=t.getCABO().getCoordShiftAndScaleEnabled()?t.getCABO().getInverseShiftAndScaleMatrix():null,c=l?Sa(r.tmpMat4,a.getMatrix()):a.getMatrix();l&&(wa(c,c),Ia(c,c,l),wa(c,c));for(var u=0;u0){var u=c.getColorByReference(),d=c.getIntensity();r.lightColor[0]=u[0]*d,r.lightColor[1]=u[1]*d,r.lightColor[2]=u[2]*d;var p=c.getDirection(),g=t.getActiveCamera().getViewMatrix(),m=f(p);c.lightTypeIsSceneLight()&&(m[0]=g[0]*p[0]+g[1]*p[1]+g[2]*p[2],m[1]=g[4]*p[0]+g[5]*p[1]+g[6]*p[2],m[2]=g[8]*p[0]+g[9]*p[1]+g[10]*p[2],We(m)),r.lightDirection[0]=m[0],r.lightDirection[1]=m[1],r.lightDirection[2]=m[2],r.lightHalfAngle[0]=-r.lightDirection[0],r.lightHalfAngle[1]=-r.lightDirection[1],r.lightHalfAngle[2]=1-r.lightDirection[2],We(r.lightDirection),o.setUniform3fArray("lightColor".concat(i),r.lightColor),o.setUniform3fArray("lightDirectionVC".concat(i),r.lightDirection),o.setUniform3fArray("lightHalfAngleVC".concat(i),r.lightHalfAngle),i++}}if(!(a<3)){var v=t.getActiveCamera().getViewMatrix();wa(v,v),i=0;for(var h=0;h0){var b=y.getTransformedPosition(),T=new Float64Array(3);Jn(T,b,v),o.setUniform3fArray("lightAttenuation".concat(i),y.getAttenuationValuesByReference()),o.setUniformi("lightPositional".concat(i),y.getPositional()),o.setUniformf("lightExponent".concat(i),y.getExponent()),o.setUniformf("lightConeAngle".concat(i),y.getConeAngle()),o.setUniform3fArray("lightPositionVC".concat(i),[T[0],T[1],T[2]]),i++}}}}},e.setCameraShaderParameters=function(e,o,i){var s=e.getProgram(),l=r.openGLCamera.getKeyMatrices(o),c=o.getActiveCamera(),u=r.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:r.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,r.tmpMat3)),d!==u&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",c.getParallelProjection()),s.setLastCameraMTime(u)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,t,n){var a=e.getProgram(),o=n.getProperty(),i=o.getOpacity(),s=r.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=r.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),c=r.drawingEdges?1:o.getAmbient(),u=r.drawingEdges?0:o.getDiffuse(),d=r.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",c),a.setUniformf("diffuse",u);var p=r.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.setUniformf("specular",d),a.isUniformUsed("ambientIntensityBF")){if(i=(o=n.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),c=o.getAmbient(),l=o.getDiffuseColor(),u=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",c),a.setUniformf("diffuseIntensityBF",u),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(t,n){r.primitiveIDOffset=0,r.openGLRenderer.getSelector()&&(r.openGLRenderer.getSelector().getCurrentPass(),r.openGLRenderer.getSelector().renderProp(n)),e.updateBufferObjects(t,n),r.renderable.getColorTextureMap()&&r.internalColorTexture.activate(),r.lastBoundBO=null},e.renderPieceDraw=function(t,n){var a=n.getProperty().getRepresentation(),o=r.context,i=n.getProperty().getEdgeVisibility()&&a===Xm.SURFACE;o.lineWidth(n.getProperty().getLineWidth());for(var s=Km.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=Km,t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16));for(var n=Km.Start;ne?r:e}return e},e.mapScalars=function(r,n){var a=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(a){var o="".concat(e.getMTime()).concat(a.getMTime()).concat(n);if(t.colorBuildString!==o){t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]);var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,t.fieldDataTupleId)),t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(n)}}else t.colorMapColors=null}}var uv={static:!1,lookupTable:null,scalarVisibility:!1,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,transformCoordinate:null,viewSpecificProperties:null,customShaderAttributes:[]};function dv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uv,r),ys(e,t,r),fe.get(e,t,["colorMapColors"]),fe.setGet(e,t,["arrayAccessMode","colorByArrayName","colorMode","lookupTable","renderTime","scalarMode","scalarVisibility","static","transformCoordinate","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),cv(e,t)}var fv={newInstance:fe.newInstance(dv,"vtkMapper2D"),extend:dv},pv=1,gv=ov.primTypes,mv=fv.ScalarMode,vv=F,hv={type:"StartEvent"},yv={type:"EndEvent"};function bv(e,r){r.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),e.buildPass=function(t){t&&(r.openGLActor2D=e.getFirstAncestorOfType("vtkOpenGLActor2D"),r.openGLRenderer=r.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.overlayPass=function(t){t&&e.render()},e.getShaderTemplate=function(e,t,n){var a=r.renderable.getViewSpecificProperties().OpenGL,o="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.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// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n";if(a){var i=a.VertexShaderCode;void 0!==i&&""!==i&&(o=i)}e.Vertex=o;var s="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.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\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n";if(a){var l=a.FragmentShaderCode;void 0!==l&&""!==l&&(s=l)}e.Fragment=s;var c="";if(a){var u=a.GeometryShaderCode;void 0!==u&&(c=u)}e.Geometry=c},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=gv.Start;nt.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||vv("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||vv("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),r.internalColorTexture&&t.getProgram().isUniformUsed("texture1")&&t.getProgram().setUniformi("texture1",r.internalColorTexture.getTextureUnit());var o=r.openGLActor2D.getActiveTextures();if(o)for(var i=0;i=u[0]?l[0]:u[0],d[1]=l[1]>=u[1]?l[1]:u[1],d[2]=l[2]>=u[2]?l[2]:u[2],d[3]=l[3]>=u[3]?l[3]:u[3],!(d[0]>=d[2]||d[1]>=d[3])){s.usize=Pe(s.usize*(d[2]-d[0])/(l[2]-l[0])),s.vsize=Pe(s.vsize*(d[3]-d[1])/(l[3]-l[1]));var f=r.openGLRenderer.getParent().getSize(),p=Pe(c[0]-(d[0]-l[0])*f[0]),g=Pe(c[1]-(d[1]-l[1])*f[1]),m=-p,v=-p+s.usize,h=-g,y=-g+s.vsize;m===v&&(v=m+1),h===y&&(y=h+1);var b,T,S,C=Pa(new Float64Array(16));C[0]=2/(v-m),C[5]=2/(y-h),C[3]=-1*(v+m)/(v-m),C[7]=-1*(y+h)/(y-h),C[10]=0,C[11]=a.getProperty().getDisplayLocation()===pv?-1:1,C[15]=1,wa(C,C),o.setUniformMatrix("WCVCMatrix",(b=[C,i],T=t,S=r.tmpMat4,T.identity(S),b.reduce((function(e,t,r){return 0===r?t?T.copy(e,t):T.identity(e):t?T.multiply(e,e,t):e}),S)))}},e.haveWideLines=function(e,t){return r.lastBoundBO===r.lines&&t.getProperty().getLineWidth()>1}}var Tv={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};var Sv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=gv,t.tmpMat4=Pa(new Float64Array(16));for(var n=gv.Start;n1?s.fontSize=Math.max(20*o,10):s.fontSize=Math.max(16*o,10);var l=e.updateTextureAtlas();e.setTopTitle(!1);var c=e.getBoxSizeByReference();if(e.getLastAspectRatio()>1){e.setTickLabelPixelOffset(.4*s.fontSize);var u=2*(l.tickWidth+e.getTickLabelPixelOffset())/r[0];e.setAxisTitlePixelOffset(.8*i.fontSize);var d=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[0];u+.4*d>2*l.titleWidth/r[0]?(e.setTopTitle(!0),c[0]=u+.4*d,e.setBoxPosition([.98-c[0],-.92])):(c[0]=u+1.4*d,e.setBoxPosition([.99-c[0],-.92])),c[1]=Math.max(1.2,Math.min(1.84/a,1.84))}else{e.setAxisTitlePixelOffset(2*s.fontSize),e.setTickLabelPixelOffset(.5*s.fontSize);var f=2*(l.tickHeight+e.getTickLabelPixelOffset())/r[1],p=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[1],g=2*l.tickWidth/r[0];c[0]=Math.min(1.9,Math.max(1.4,1.4*g*(e.getTicks().length+3))),c[1]=f+p,e.setBoxPosition([-.5*c[0],-.97])}e.recomputeBarSegments(l)}}function Vv(e,t){t.classHierarchy.push("vtkScalarBarActorHelper"),e.setRenderable=function(r){t.renderable!==r&&(t.renderable=r,t.barActor.setProperty(r.getProperty()),t.barActor.setParentProp(r),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),t.axisTextStyle=xv({},r.getAxisTextStyle()),t.tickTextStyle=xv({},r.getTickTextStyle()),e.modified())},e.updateAPISpecificData=function(r,n,a){t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0);var o=t.renderable.getScalarsToColors();if(o&&t.renderable.getVisibility()){if(t.barMapper.setLookupTable(o),t.camera=n,t.renderWindow=a,t.forceUpdate||Math.max(o.getMTime(),e.getMTime())>t.lastRebuildTime.getMTime()){var i=o.getMappingRange();t.lastTickBounds=f(i),t.barMapper.setScalarRange(t.lastTickBounds);var s=vp().domain([t.lastTickBounds[0],t.lastTickBounds[1]]);t.ticks=s.ticks(5);var l=s.tickFormat(5);if(t.tickstrings=t.ticks.map(l),t.renderable.getAutomated())t.renderable.getAutoLayout()(e);else{t.axisTextStyle=xv({},t.renderable.getAxisTextStyle()),t.tickTextStyle=xv({},t.renderable.getTickTextStyle()),t.barPosition=f(t.renderable.getBarPosition()),t.barSize=f(t.renderable.getBarSize()),t.boxPosition=f(t.renderable.getBoxPosition()),t.boxSize=f(t.renderable.getBoxSize()),t.axisTitlePixelOffset=t.renderable.getAxisTitlePixelOffset(),t.tickLabelPixelOffset=t.renderable.getTickLabelPixelOffset();var c=e.updateTextureAtlas();e.recomputeBarSegments(c)}t.forceViewUpdate=!0,t.lastRebuildTime.modified(),t.forceUpdate=!1}(t.forceViewUpdate||t.camera.getMTime()>t.lastRedrawTime.getMTime())&&(e.updatePolyDataForLabels(),e.updatePolyDataForBarSegments(),t.lastRedrawTime.modified(),t.forceViewUpdate=!1)}},e.updateTextureAtlas=function(){t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left";var e={},r=new Map,n=0,a=1;Dv(t.tmContext,t.axisTextStyle);var o=t.tmContext.measureText(t.renderable.getAxisLabel()),i={height:o.actualBoundingBoxAscent+2,startingHeight:a,width:o.width+2,textStyle:t.axisTextStyle};r.set(t.renderable.getAxisLabel(),i),a+=i.height,n=i.width,e.titleWidth=i.width,e.titleHeight=i.height,e.tickWidth=0,e.tickHeight=0,Dv(t.tmContext,t.tickTextStyle);for(var s=[].concat(f(t.tickstrings),["NaN","Below","Above"]),l=0;lt.boxSize[0];var r=2*e.tickHeight/t.lastSize[1],n=[1,1];if(t.vertical){var a=2*(e.tickWidth+t.tickLabelPixelOffset)/t.lastSize[0];if(t.topTitle){var o=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0]-a,t.barSize[1]=t.boxSize[1]-o}else{var i=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[0];t.barSize[0]=t.boxSize[0]-i-a,t.barSize[1]=t.boxSize[1]}t.barPosition[0]=t.boxPosition[0]+a,t.barPosition[1]=t.boxPosition[1],n[1]=r}else{var s=(2*e.tickWidth-8)/t.lastSize[0],l=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0],t.barPosition[0]=t.boxPosition[0],t.barSize[1]=t.boxSize[1]-l-r,t.barPosition[1]=t.boxPosition[1],n[0]=s}return n},e.recomputeBarSegments=function(r){var n,a,o,i,s=e.computeBarSize(r);t.barSegments=[];var l=[0,0],c=t.vertical?1:0,u=t.vertical?.01:.02;function d(e,r){t.barSegments.push({corners:[[].concat(l),[l[0]+s[0],l[1]],[l[0]+s[0],l[1]+s[1]],[l[0],l[1]+s[1]]],scalars:r,title:e}),l[c]+=s[c]+u}t.renderable.getDrawNanAnnotation()&&t.renderable.getScalarsToColors().getNanColor()&&d("NaN",[NaN,NaN,NaN,NaN]),t.renderable.getDrawBelowRangeSwatch()&&null!==(n=(a=t.renderable.getScalarsToColors()).getUseBelowRangeColor)&&void 0!==n&&n.call(a)&&d("Below",[-.1,-.1,-.1,-.1]);var f=null===(o=(i=t.renderable.getScalarsToColors()).getUseAboveRangeColor)||void 0===o?void 0:o.call(i);l[c]+=u;var p=s[c];s[c]=f?1-2*u-s[c]-l[c]:1-u-l[c],d("ticks",t.vertical?[0,0,.995,.995]:[0,.995,.995,0]),t.renderable.getDrawAboveRangeSwatch()&&f&&(s[c]=p,l[c]+=u,d("Above",[1.1,1.1,1.1,1.1]))},e.createPolyDataForOneLabel=function(e,r,n,a,o,i,s){var l=t._tmAtlas.get(e);if(l){var c=s.ptIdx,u=s.cellIdx;wv[0]=r[0],wv[1]=r[1],wv[2]=r[2],o[0]<-.5?Gn(Av,n,o[0]*i-l.width):o[0]>.5?Gn(Av,n,o[0]*i):Gn(Av,n,o[0]*i-l.width/2),Rn(wv,wv,Av),Gn(Av,a,o[1]*i-l.height/2),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[0],s.tcoords[2*c+1]=l.tcoords[1],c++,Gn(Av,n,l.width),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[2],s.tcoords[2*c+1]=l.tcoords[3],c++,Gn(Av,a,l.height),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[4],s.tcoords[2*c+1]=l.tcoords[5],c++,Gn(Av,n,l.width),En(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[6],s.tcoords[2*c+1]=l.tcoords[7],c++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-3,s.polys[4*u+3]=c-2,u++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-2,s.polys[4*u+3]=c-1,s.ptIdx+=4,s.cellIdx+=2}},e.updatePolyDataForLabels=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r),Oa(Ev,r);var n=t.lastSize;Av[0]=0,Av[1]=0,Av[2]=-.99,Jn(wv,Av,Ev),Av[0]+=.1,Jn(Ov,Av,Ev),En(Iv,Ov,wv),Av[0]-=.1,Av[1]+=.1,Jn(Ov,Av,Ev),En(Rv,Ov,wv);for(var a=0;a<3;a++)Iv[a]/=.05*n[0],Rv[a]/=.05*n[1];var o=t.tickstrings.length+t.barSegments.length,i=4*o,s=2*o,l=new Float64Array(3*i),c=new Uint16Array(4*s),u=new Float32Array(2*i),d={ptIdx:0,cellIdx:0,polys:c,points:l,tcoords:u},f=t.vertical?0:1,p=t.vertical?1:0,g=[0,1];t.vertical?(t.topTitle?(Av[0]=t.boxPosition[0]+.5*t.boxSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,[0,1],t.axisTitlePixelOffset,d)):(Av[0]=t.barPosition[0]+t.barSize[0],Av[1]=t.barPosition[1]+.5*t.barSize[1],Jn(wv,Av,Ev),Gn(Iv,Iv,-1),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Rv,Iv,[0,-1],t.axisTitlePixelOffset,d),Gn(Iv,Iv,-1)),g=[-1,0]):(Av[0]=t.barPosition[0]+.5*t.barSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,g,t.axisTitlePixelOffset,d)),Mv[2]=-.99,Mv[f]=t.barPosition[f]+(.5*g[f]+.5)*t.barSize[f],Mv[p]=t.barPosition[p]+.5*t.barSize[p];for(var m=null,v=0;v2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),fe.setGet(e,t,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","barActor","tmActor","ticks"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.barMapper=Jp.newInstance(),t.barMapper.setInterpolateScalarsBeforeMapping(!0),t.polyData=hm.newInstance(),t.barMapper.setInputData(t.polyData),t.barActor=Cp.newInstance(),t.barActor.setMapper(t.barMapper),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.barPosition=[0,0],t.barSize=[0,0],t.boxPosition=[.88,-.92],t.boxSize=[.1,1.1],t.lastTickBounds=[],Vv(e,t)}),"vtkScalarBarActorHelper");function Nv(e,t){t.classHierarchy.push("vtkScalarBarActor"),e.setTickTextStyle=function(r){t.tickTextStyle=xv(xv({},t.tickTextStyle),r),e.modified()},e.setAxisTextStyle=function(r){t.axisTextStyle=xv(xv({},t.axisTextStyle),r),e.modified()},e.resetAutoLayoutToDefault=function(){t.autoLayout=Bv(0,t)}}function kv(e){return xv({automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif"},drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0},e)}function Fv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv(r)),t.autoLayout||(t.autoLayout=Bv(0,t)),Cp.extend(e,t,r),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),fe.setGet(e,t,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch"]),fe.get(e,t,["axisTextStyle","tickTextStyle"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),Nv(e,t)}var Gv={newInstance:fe.newInstance(Fv,"vtkScalarBarActor"),extend:Fv,newScalarBarActorHelper:Lv};function _v(e,t){t.classHierarchy.push("vtkOpenGLScalarBarActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var Uv={};var Wv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),_v(e,t)}),"vtkOpenGLScalarBarActor");_s("vtkScalarBarActor",Wv);var jv=F;function zv(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(r){if(r){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 n=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(n.getActiveCamera())}},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOpaqueActorCount()}},e.opaquePass=function(r,n){if(r&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.context.depthMask(!0),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var o=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(o),s=new Float64Array(16);if(Oa(s,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),"box"===t.lastFormat){var l=o.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),r=0;r<4;r++)e[3*r]=r%2*2-1,e[3*r+1]=r>1?1:-1,e[3*r+2]=1;var n=qt.newInstance({numberOfComponents:3,values:e});n.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 o=qt.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",cl.SURFACE,{points:n,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)||jv("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||jv("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var Hv={context:null};var Kv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hv,r),Vs.extend(e,t,r),t.openGLTexture=$l.newInstance(),t.tris=Bl.newInstance(),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),zv(e,t)}));function Xv(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}_s("vtkSkybox",Kv);var qv={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};var Yv=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],Xv(e,t)}));function Zv(e,t){t.classHierarchy.push("vtkWebGPUCubeAxesActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,a=t.WebGPURenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.WebGPURenderWindow.getRenderable())}}}Rc("vtkActor",Yv);var Qv={};var $v=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),Zv(e,t)}),"vtkWebGPUCubeAxesActor");Rc("vtkCubeAxesActor",$v);var Jv=$u.BufferUsage,eh=$u.PrimitiveTypes,th=Fu.Representation,rh=Jp.ScalarMode,nh={type:"StartEvent"},ah={type:"EndEvent"},oh="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",ih="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::Position::Impl\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function sh(e){return e.indexOf("edge")>=0}function lh(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(r){r&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var r=t.WebGPUActor.getRenderable().getProperty(),n=t.UBO.getSendTime();if(e.getMTime()>n||r.getMTime()>n||t.renderable.getMTime()>n){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=r.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",r.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",r.getDiffuse()),o=r.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",r.getSpecular()),t.UBO.setValue("SpecularPower",r.getSpecularPower()),o=r.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),o=r.getEdgeColorByReference(),t.UBO.setArray("EdgeColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",r.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(nh),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(ah),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();sh(e)?(n.addBuiltinInput("u32","@builtin(instance_index) instanceIndex"),a=Xc(a,"//VTK::Position::Impl",[" var tmpPos: vec4 = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"," var tmpPos2: vec3 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 1.4*(f32(input.instanceIndex % 2u) - 0.5)/rendererUBO.viewportSize.x;"," tmpPos2.y = tmpPos2.y + 1.4*(f32(input.instanceIndex / 2u) - 0.5)/rendererUBO.viewportSize.y;"," tmpPos2.z = tmpPos2.z + 0.00001;"," output.Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"]).result):a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var n=t.getShaderDescription("vertex");n.addOutput("vec3","normalVC");var a=n.getCode();a=Xc(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,r){var n=t.getShaderDescription("fragment"),a=n.getCode();a.includes("var normal")?(a=Xc(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a)):(a=Xc(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a))},e.replaceShaderColor=function(e,t,r){if(sh(e)){var n=t.getShaderDescription("fragment"),a=n.getCode();return a=Xc(a,"//VTK::Color::Impl",["ambientColor = mapperUBO.EdgeColor;","diffuseColor = mapperUBO.EdgeColor;"]).result,void n.setCode(a)}if(r.hasAttribute("colorVI")){var o=t.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,o.setCode(i);var s=t.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}},e.replaceShaderTCoord=function(e,r,n){if(n.hasAttribute("tcoord")){var a=r.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=Xc(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=r.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=Xc(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("fragment"),a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,n.setCode(a)}},e.getUsage=function(e,t){return e===th.POINTS||t===eh.Points?Jv.Verts:t===eh.Lines?Jv.Lines:e===th.WIREFRAME?t===eh.Triangles?Jv.LinesFromTriangles:Jv.LinesFromStrips:t===eh.Triangles?Jv.Triangles:t===eh.TriangleStrips?Jv.Strips:t===eh.TriangleEdges?Jv.LinesFromTriangles:Jv.LinesFromStrips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case Jv.Triangles:return"triangle-list";case Jv.Verts:return"point-list";case Jv.Lines:default:return"line-list"}},e.buildVertexInput=function(r,n,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=!1;a===eh.TriangleEdges&&(s=!0,o=th.WIREFRAME);var l=t.primitives[a].getVertexInput(),c="R".concat(o,"P").concat(a),u=r.getPoints();if(u){var d=t.WebGPUActor.getBufferShift(t.WebGPURenderer),f={owner:u,usage:Jv.PointArray,format:"float32x4",time:Math.max(u.getMTime(),n.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),hash:c,dataArray:u,cells:n,primitiveType:a,representation:o,shift:d,packExtra:!0},p=i.getBufferManager().getBuffer(f);l.addBuffer(p,["vertexBC"])}else l.removeBufferIfPresent("vertexBC");var g=e.getUsage(o,a);if(g===Jv.Triangles||g===Jv.Strips){var m=r.getPointData().getNormals(),v={format:"snorm8x4",hash:c,cells:n,representation:o,primitiveType:a,packExtra:!0,shift:0,scale:127};if(m){v.owner=m,v.dataArray=m,v.time=Math.max(m.getMTime(),n.getMTime()),v.usage=Jv.PointArray;var h=i.getBufferManager().getBuffer(v);l.addBuffer(h,["normalMC"])}else if(a===eh.Triangles){v.owner=u,v.dataArray=u,v.time=Math.max(u.getMTime(),n.getMTime()),v.usage=Jv.NormalsFromPoints;var y=i.getBufferManager().getBuffer(v);l.addBuffer(y,["normalMC"])}else l.removeBufferIfPresent("normalMC")}else l.removeBufferIfPresent("normalMC");var b=!1;if(t.renderable.getScalarVisibility()){var T=t.renderable.getColorMapColors();if(T&&!s){var S=t.renderable.getScalarMode(),C=!1;S!==rh.USE_CELL_DATA&&S!==rh.USE_CELL_FIELD_DATA&&S!==rh.USE_FIELD_DATA&&r.getPointData().getScalars()||S===rh.USE_POINT_FIELD_DATA||!T||(C=!0);var x={owner:T,usage:Jv.PointArray,format:"unorm8x4",time:Math.max(T.getMTime(),n.getMTime(),u.getMTime()),hash:c+C,dataArray:T,cells:n,primitiveType:a,representation:o,cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(x);l.addBuffer(P,["colorVI"]),b=!0}}b||l.removeBufferIfPresent("colorVI");var w=null;if((w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():r.getPointData().getTCoords())&&!s){var O={owner:w,usage:Jv.PointArray,format:"float32x2",time:Math.max(w.getMTime(),n.getMTime()),hash:c,dataArray:w,cells:n,primitiveType:a,representation:o},A=i.getBufferManager().getBuffer(O);l.addBuffer(A,["tcoord"])}else l.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],r=[],n=t.renderable.getColorTextureMap();n&&(t.colorTexture||(t.colorTexture=Sm.newInstance({label:"polyDataColor"})),t.colorTexture.setInputData(n),r.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(r,n,a){var o="pd";return a?o+="edge":(r.hasAttribute("normalMC")&&(o+="n"),r.hasAttribute("colorVI")&&(o+="c"),r.hasAttribute("tcoord")&&(o+="t"),t.textures.length&&(o+="tx".concat(t.textures.length))),t.SSBO&&(o+="ssbo"),(o+=e.getHashFromUsage(n))+t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var r=t.currentInput,n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(r,1),e.updateTextures();for(var o=t.WebGPUActor.getRenderable(),i=o.getProperty().getRepresentation(),s=o.getProperty().getEdgeVisibility(),l=eh.Points;l<=eh.Triangles;l++)if(n[l].getNumberOfValues()>0){var c=e.getUsage(i,l),u=t.primitives[l];e.buildVertexInput(t.currentInput,n[l],l),u.setPipelineHash(e.computePipelineHash(u.getVertexInput(),c,!1)),u.setTextureViews(t.textureViews),u.setWebGPURenderer(t.WebGPURenderer),u.setNumberOfInstances(1);var d=u.getVertexInput().getBuffer("vertexBC");if(u.setNumberOfVertices(d.getSizeInBytes()/d.getStrideInBytes()),u.setTopology(e.getTopologyFromUsage(c)),u.build(t.renderEncoder,a),u.registerToDraw(),s&&i===th.SURFACE&&l===eh.Triangles){var f=t.primitives[eh.TriangleEdges],p=e.getUsage(i,eh.TriangleEdges);e.buildVertexInput(t.currentInput,n[eh.Triangles],eh.TriangleEdges),f.setPipelineHash(e.computePipelineHash(f.getVertexInput(),p,!0)),f.setWebGPURenderer(t.WebGPURenderer),f.setNumberOfInstances(4);var g=f.getVertexInput().getBuffer("vertexBC");f.setNumberOfVertices(g.getSizeInBytes()/g.getStrideInBytes()),f.setTopology(e.getTopologyFromUsage(p)),f.build(t.renderEncoder,a),f.registerToDraw()}}},e.setShaderReplacement=function(e,r){for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ch,r),Vs.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||ih,t.vertexShaderTemplate=t.vertexShaderTemplate||oh,t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("EdgeColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),Q(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),te(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],lh(e,t);for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gh,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),ph(e,t)}),"vtkWebGPUScalarBarActor");function vh(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,r){t.texture=e,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;var n=nu(t.texture.getFormat());t.bindGroupLayoutEntry.texture.sampleType=n.sampleType},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,r){var n="f32";"sint"===t.bindGroupLayoutEntry.texture.sampleType?n="i32":"uint"===t.bindGroupLayoutEntry.texture.sampleType&&(n="u32");var a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_").concat(t.options.dimension,"<").concat(n,">;");return"depth"===t.bindGroupLayoutEntry.texture.sampleType&&(a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_depth_").concat(t.options.dimension,";")),a},e.addSampler=function(r,n){var a=yd.newInstance({label:"".concat(t.label,"Sampler")});a.create(r,n),e.setSampler(a)},e.getBindGroupTime=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.bindGroupTime},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}Rc("vtkScalarBarActor",mh);var hh={texture:null,handle:null,sampler:null,label:null};function yh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hh,r),fe.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","texture"]),fe.setGet(e,t,["bindGroupLayoutEntry","label","sampler"]),vh(e,t)}var bh={newInstance:fe.newInstance(yh),extend:yh},Th=$u.BufferUsage;function Sh(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,r){t.device=e,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1;var n=1===t.depth?"2d":"3d";t.format=r.format?r.format:"rgba8unorm",t.usage=r.usage?r.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label,dimension:n})},e.assignFromHandle=function(e,r,n){t.device=e,t.handle=r,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1,t.format=n.format?n.format:"rgba8unorm",t.usage=n.usage?n.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){if(e.canvas)return t.device.getHandle().queue.copyExternalImageToTexture({source:e.canvas,flipY:e.flip},{texture:t.handle,premultipliedAlpha:!0},[t.width,t.height,t.depth]),void(t.ready=!0);e.jsImageData&&!e.nativeArray&&(e.width=e.jsImageData.width,e.height=e.jsImageData.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.nativeArray=e.jsImageData.data);var r=nu(t.format),n=t.width*r.stride;if(e.nativeArray){var a={usage:Th.Texture};e.dataArray&&(a.dataArray=e.dataArray,a.time=e.dataArray.getMTime()),a.nativeArray=e.nativeArray;var o=e.nativeArray.length/(t.height*t.depth)*e.nativeArray.BYTES_PER_ELEMENT,i=2===r.elementSize&&"float"===r.sampleType;if(i||o%256){for(var s=e.nativeArray,l=o/s.BYTES_PER_ELEMENT,c=r.elementSize,u=256*Math.floor((l*c+255)/256),d=u/c,f=fe.newTypedArray(i?"Uint16Array":s.constructor.name,d*t.height*t.depth),p=0;p2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&r===t.height&&n===t.depth||(t.width=e,t.height=r,t.depth=n,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.createView=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.dimension||(n.dimension=1===t.depth?"2d":"3d");var a=bh.newInstance({label:r});return a.create(e,n),a}}var Ch={device:null,handle:null,buffer:null,ready:!1,label:null};function xh(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Ph(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xh(o,n,a,i,s,"next",e)}function s(e){xh(o,n,a,i,s,"throw",e)}i(void 0)}))}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ch,r),fe.obj(e,t),fe.get(e,t,["handle","ready","width","height","depth","format","usage"]),fe.setGet(e,t,["device","label"]),Sh(e,t)}));var wh=r(757),Oh=r.n(wh),Ah={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function Mh(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=Ph(Oh().mark((function e(t,r,n,a,o){return Oh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,r,n,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=Ph(Oh().mark((function t(r,n,a,o,i){var s;return Oh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(r,n,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(n,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)})));return function(e,r,n,a,o){return t.apply(this,arguments)}}()}var Ih={fieldAssociation:pn.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function Rh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ih,r),fe.obj(e,t),fe.setGet(e,t,["fieldAssociation","captureZValues"]),Mh(e,t)}var Eh={newInstance:fe.newInstance(Rh,"vtkHardwareSelector"),extend:Rh};function Dh(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}function Bh(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}var Vh={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function Lh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vh,r),fe.obj(e,t),t.properties={},fe.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Bh(e,t)}var Nh=function(e){for(var t=1;te.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=zh(o[0],o[1],e.pixBuffer[Fh.ACTOR_PASS],e.area);if(i<=0||i-1>=e.props.length)return null;var s={valid:!0};s.propID=i-1,s.prop=e.props[s.propID];var l=zh(o[0],o[1],e.pixBuffer[Fh.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-1,e.captureZValues){var c=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[c]+e.zBuffer[c+1])/65535,s.displayPosition=t}return s}var u=[t[0],t[1]],d=[0,0],f=Hh(e,t,0,n);if(f&&f.valid)return f;for(var p=1;pp?u[1]-p:0;g<=u[1]+p;++g){if(d[1]=g,u[0]>=p&&(d[0]=u[0]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[0]=u[0]+p,(f=Hh(e,d,0,n))&&f.valid)return f}for(var m=u[0]>=p?u[0]-(p-1):0;m<=u[0]+(p-1);++m){if(d[0]=m,u[1]>=p&&(d[1]=u[1]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[1]=u[1]+p,(f=Hh(e,d,0,n))&&f.valid)return f}}return n[0]=t[0],n[1]=t[1],null}function Kh(e,t,r,n,a){var o=[],i=0;return t.forEach((function(t,s){var l=Nh.newInstance();switch(l.setContentType(Gh.INDICES),e){case Uh.FIELD_ASSOCIATION_CELLS:l.setFieldType(_h.CELL);break;case Uh.FIELD_ASSOCIATION_POINTS:l.setFieldType(_h.POINT);break;default:Wh("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,r&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,n)),l.setSelectionList(t.attributeIDs),o[i]=l,i++})),o}function Xh(e,t,r,n,a){for(var o=Math.floor(t),i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=new Map,u=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Hh(e,[f,d],0,u);if(p&&p.valid){var g=jh(p);if(c.has(g)){var m=c.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(r){t.currentPass===Fh.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+1),t.props.push(r))},e.renderCompositeIndex=function(r){t.currentPass===Fh.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(r+1)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return fe.enumToString(Fh,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(r,n,a){var o=n<0?0:n;if(0===o){if(a[0]=r[0],a[1]=r[1],r[0]t.area[2]||r[1]t.area[3])return null;var i=[r[0]-t.area[0],r[1]-t.area[1]],s=zh(i[0],i[1],t.pixBuffer[Fh.ACTOR_PASS],t.area);if(s<=0||s-1>=t.props.length)return null;var l={valid:!0};l.propID=s-1,l.prop=t.props[l.propID];var c=zh(i[0],i[1],t.pixBuffer[Fh.COMPOSITE_INDEX_PASS],t.area);if((c<0||c>16777215)&&(c=0),l.compositeID=c-1,t.captureZValues){var u=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[u]+t.zBuffer[u+1])/65535,l.displayPosition=r}return l}var d=[r[0],r[1]],f=[0,0],p=e.getPixelInformation(r,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=r[0],a[1]=r[1],null},e.generateSelection=function(r,n,a,o){for(var i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=Math.floor(o),u=new Map,d=[0,0],f=s;f<=c;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=jh(m);if(u.has(v)){var h=u.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yh,r),Eh.extend(e,t,r),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),fe.setGetArray(e,t,["area"],4),fe.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),fe.setGetArray(e,t,["propColorValue"],3),fe.event(e,t,"event"),qh(e,t)}var Qh=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}r.replaceShaderNormal(e,n,a)},e.replaceShaderColor=function(e,n,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),c=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(c=c.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(c=c.concat(["varying vec4 vertexColorVSOutput;"]),o=wl.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=wl.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=wl.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=wl.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=wl.substitute(s,"//VTK::Color::Impl",u).result,s=wl.substitute(s,"//VTK::Color::Dec",c).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}r.replaceShaderColor(e,n,a)},e.replaceShaderPositionVC=function(e,n,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}r.replaceShaderPositionVC(e,n,a)},e.replaceShaderPicking=function(e,n,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=wl.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=wl.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=wl.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=wl.substitute(o,"//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=o}else r.replaceShaderPicking(e,n,a)},e.updateGlyphShaderParameters=function(r,n,a,o,i,s,l,c){var u=a.getProgram();if(r){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],S=d[6],C=d[7],x=d[8],P=f[p],w=f[p+1],O=f[p+2],A=f[p+3],M=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=P*m+w*y+O*S,g[1]=P*v+w*b+O*C,g[2]=P*h+w*T+O*x,g[3]=A*m+M*y+I*S,g[4]=A*v+M*b+I*C,g[5]=A*h+M*T+I*x,g[6]=R*m+E*y+D*S,g[7]=R*v+E*b+D*C,g[8]=R*h+E*T+D*x,u.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),u.setUniformMatrix("MCPCMatrix",t.tmpMat4),n&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),u.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var B=o.getData();t.tmpColor[0]=B[4*l]/255,t.tmpColor[1]=B[4*l+1]/255,t.tmpColor[2]=B[4*l+2]/255,u.setUniform3fArray("ambientColorUniform",t.tmpColor),u.setUniform3fArray("diffuseColorUniform",t.tmpColor)}c&&u.setUniform3fArray("mapperIndex",c.getPropColorValue())},e.renderPieceDraw=function(r,n){var a=n.getProperty().getRepresentation(),o=t.context,i=n.getProperty().getEdgeVisibility()&&a===ey.SURFACE,s=t.openGLCamera.getKeyMatrices(r),l=t.openGLActor.getKeyMatrices();Mo(t.normalMatrix,s.normalMatrix,l.normalMatrix),Ia(t.mcpcMatrix,s.wcpc,l.mcwc),Ia(t.mcvcMatrix,s.wcvc,l.mcwc);var c=t.renderable.getMatrixArray(),u=t.renderable.getNormalArray(),d=t.renderable.getColorArray(),f=c.length/16,p=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===ry.COMPOSITE_INDEX_PASS&&(p=!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)||Jh("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)||Jh("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)||Jh("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)||Jh("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),r.setMapperShaderParameters(e,n,a),void e.getAttributeUpdateTime().modified();r.setMapperShaderParameters(e,n,a)},e.getNeedToRebuildBufferObjects=function(e,n){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,ty.ARRAY_BUFFER),t.normalBuffer.upload(o,ty.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),ty.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),c=0;c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,iy,r),ov.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.normalMatrix=xo(new Float64Array(9)),t.mcpcMatrix=Pa(new Float64Array(16)),t.mcvcMatrix=Pa(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),oy(e,t)}),"vtkOpenGLGlyph3DMapper");function ly(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}_s("vtkGlyph3DMapper",sy);var cy=$u.PrimitiveTypes;function uy(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var r=function(e){for(var t=1;t","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=Xc(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}r.replaceShaderNormal(e,t,n)},e.replaceShaderColor=function(e,n,a){if(t.carray){var o=n.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=n.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else r.replaceShaderColor(e,n,a)},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("vertex");n.addOutput("u32","compositeID","flat");var a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),n=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",n),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}r.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dy,r),fh.extend(e,t,r),t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),t.SSBO=gd.newInstance({label:"glyphSSBO"}),uy(e,t);for(var n=cy.Start;n1&&void 0!==arguments[1]?arguments[1]:{};return gy[e]&&gy[e](t)}function hy(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(r){e.hasRenderer(r)||(r.setRenderWindow(e),t.renderers.push(r),e.modified())},e.removeRenderer=function(r){t.renderers=t.renderers.filter((function(e){return e!==r})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vy(e||t.defaultViewAPI,r)},e.addView=function(r){e.hasView(r)||(r.setRenderable(e),t.views.push(r),e.modified())},e.removeView=function(r){t.views=t.views.filter((function(e){return e!==r})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.preRender=function(){t.renderers.forEach((function(e){e.isActiveCameraCreated()||e.resetCamera()}))},e.render=function(){e.preRender(),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 r=t.getMapper&&t.getMapper();if(r&&r.getPrimitiveCount){var n=r.getPrimitiveCount();Object.keys(n).forEach((function(t){e[t]||(e[t]=0),e[t]+=n[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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fe.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(r,n):void 0})).filter((function(e){return!!e}))}}var yy={defaultViewAPI:py,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function by(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yy,r),fe.obj(e,t),fe.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),fe.get(e,t,["neverRendered"]),fe.getArray(e,t,["renderers"]),fe.event(e,t,"completion"),hy(e,t)}var Ty={newInstance:fe.newInstance(by,"vtkRenderWindow"),extend:by,registerViewConstructor:my,listViewAPIs:function(){return Object.keys(gy)},newAPISpecificView:vy};function Sy(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(fe.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=n,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})),t.delegates.forEach((function(t){t.traverse(r,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})))}}var Cy={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function xy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cy,r),fe.obj(e,t),fe.get(e,t,["currentOperation"]),fe.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),Sy(e,t)}var Py={newInstance:fe.newInstance(xy,"vtkRenderPass"),extend:xy};function wy(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e);for(var a=r.getRenderable().getNumberOfLayers(),o=r.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var u=r.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=yc.newInstance()),t.framebuffer.setOpenGLRenderWindow(r),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===u[0]&&d[1]===u[1]||(t.framebuffer.create(u[0],u[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)),t.overlayActorCount>0&&(e.setCurrentOperation("overlayPass"),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++},e.incrementOverlayActorCount=function(){return t.overlayActorCount++}}var Oy={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function Ay(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Oy,r),Py.extend(e,t,r),fe.get(e,t,["framebuffer"]),wy(e,t)}var My={newInstance:fe.newInstance(Ay,"vtkForwardPass"),extend:Ay},Iy=r(322),Ry=r.n(Iy),Ey=["lastShaderBound","context","openGLRenderWindow"];function Dy(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,r,n){var a=r;n.length>0&&(a=wl.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#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=wl.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#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=wl.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=wl.substitute(l,"varying","out").result,a=wl.substitute(a,"varying","in").result,a=wl.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=wl.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:wl.substitute(n,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,r,n){var a=e.replaceShaderValues(t,r,n),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,r,n){var a="".concat(e).concat(r).concat(n),o=Ry().hash(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=wl.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(r),n&&i.getGeometryShader().setSource(n),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(r){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(r)}))},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 By={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function Vy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,By,r),t.shaderPrograms={},fe.obj(e,t),fe.setGet(e,t,Ey),Dy(e,t)}var Ly={newInstance:fe.newInstance(Vy,"vtkShaderCache"),extend:Vy},Ny=fe.vtkErrorMacro;function ky(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fy,r),fe.obj(e,t),t.textureUnits=[],fe.get(e,t,["numberOfTextureUnits"]),fe.setGet(e,t,["context"]),ky(e,t)}var _y={newInstance:fe.newInstance(Gy,"vtkOpenGLTextureUnitManager"),extend:Gy};function Uy(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var r=e.getViewportByReference();return t.size[0]*(r[2]-r[0])/((r[3]-r[1])*t.size[1])},e.isInViewport=function(t,r,n){var a=n.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=r&&a[3]*o[1]>=r},e.getViewportSize=function(t){var r=t.getViewportByReference(),n=e.getFramebufferSize();return[(r[2]-r[0])*n[0],(r[3]-r[1])*n[1]]},e.getViewportCenter=function(t){var r=e.getViewportSize(t);return[.5*r[0],.5*r[1]]},e.displayToNormalizedDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t/a[0],r/a[1],n]},e.normalizedDisplayToDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t*a[0],r*a[1],n]},e.worldToView=function(e,t,r,n){return n.worldToView(e,t,r)},e.viewToWorld=function(e,t,r,n){return n.viewToWorld(e,t,r)},e.worldToDisplay=function(t,r,n,a){var o=a.worldToView(t,r,n),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,r,n,a){var o=e.displayToNormalizedDisplay(t,r,n),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,r,n,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,r,n);return[i[0]-o[0]-.5,i[1]-o[1]-.5,n]},e.viewportToNormalizedViewport=function(t,r,n,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),r/(o[1]-1),n]:[t,r,n]},e.normalizedViewportToViewport=function(t,r,n,a){var o=e.getViewportSize(a);return[t*(o[0]-1),r*(o[1]-1),n]},e.displayToLocalDisplay=function(t,r,n){return[t,e.getFramebufferSize()[1]-r-1,n]},e.viewportToNormalizedDisplay=function(t,r,n,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=r+o[1]+.5;return e.displayToNormalizedDisplay(i,s,n)},e.getPixelData=function(e,t,r,n){fe.vtkErrorMacro("not implemented")},e.createSelector=function(){fe.vtkErrorMacro("not implemented")}}var Wy={size:void 0,selector:void 0};function jy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,r),t.size||(t.size=[300,300]),fe.getArray(e,t,["size"],2),fe.get(e,t,["selector"]),Vs.extend(e,t,r),Uy(e,t)}var zy={newInstance:fe.newInstance(jy,"vtkRenderWindowViewNode"),extend:jy},Hy=fe.vtkDebugMacro,Ky=fe.vtkErrorMacro,Xy={position:"absolute",top:0,left:0,width:"100%",height:"100%"},qy=1,Yy=-.7,Zy=.25,Qy=-.5;function $y(e,t,r){var n=e.createFramebuffer(),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,r,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),o===e.FRAMEBUFFER_COMPLETE}var Jy=0,eb=[];function tb(){Jy++,eb.forEach((function(e){return e(Jy)}))}function rb(){Jy--,eb.forEach((function(e){return e(Jy)}))}function nb(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow"),e.getViewNodeFactory=function(){return t.myFactory};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(r){if(r){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=_y.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var r=t.context;r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),r.depthFunc(r.LEQUAL),r.enable(r.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(r){t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&Ky("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!==r&&(t.el=r,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(),r=e.width,n=e.height;t.containerSize=[r,n]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.getPixelData=function(e,r,n,a){var o=new Uint8Array((n-e+1)*(a-r+1)*4);return t.context.readPixels(e,r,n-e+1,a-r+1,t.context.RGBA,t.context.UNSIGNED_BYTE,o),o},e.get3DContext=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},n=null;void 0!==navigator.xr&&navigator.xr.isSessionSupported("immersive-vr")&&e.invokeHaveVRDisplay();var a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(n=t.canvas.getContext("webgl2",r))&&(t.webgl2=!0,Hy("using webgl2")),n||(Hy("using webgl1"),n=t.canvas.getContext("webgl",r)||t.canvas.getContext("experimental-webgl",r)),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),n},e.startXR=function(r){if(void 0===navigator.xr)throw new Error("WebXR is not available");t.xrSessionIsAR=r;var n=r?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(n))throw r?new Error("Device does not support AR session"):new Error("VR display is not available");if(null!==t.xrSession)throw new Error("XR Session already exists!");navigator.xr.requestSession(n).then(e.enterXR,(function(){throw new Error("Failed to create XR session!")}))},e.enterXR=function(){var n=Ph(Oh().mark((function n(a){var o,i;return Oh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.xrSession=a,t.oldCanvasSize=t.size.slice(),null===t.xrSession){n.next=15;break}return o=e.get3DContext(),n.next=6,o.makeXRCompatible();case 6:i=new r.g.XRWebGLLayer(t.xrSession,o),e.setSize(i.framebufferWidth,i.framebufferHeight),t.xrSession.updateRenderState({baseLayer:i}),t.xrSession.requestReferenceSpace("local").then((function(e){t.xrReferenceSpace=e})),e.resetXRScene(),t.renderable.getInteractor().switchToXRAnimation(),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),n.next=16;break;case 15:throw new Error("Failed to enter VR with a null xrSession.");case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),e.resetXRScene=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qy,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yy,n=e,a=r;t.xrSessionIsAR&&n===qy&&(n=Zy),t.xrSessionIsAR&&a===Yy&&(a=Qy);var o=t.renderable.getRenderers()[0];o.resetCamera();var i=o.getActiveCamera(),s=i.getPhysicalScale(),l=i.getPhysicalTranslation();a*=s/=n,l[2]+=a,i.setPhysicalScale(s),i.setPhysicalTranslation(l)},e.stopXR=Ph(Oh().mark((function r(){var n,a;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==navigator.xr){r.next=2;break}return r.abrupt("return");case 2:if(null===t.xrSession){r.next=10;break}return t.xrSession.cancelAnimationFrame(t.xrSceneFrame),t.renderable.getInteractor().returnFromXRAnimation(),(n=e.get3DContext()).bindFramebuffer(n.FRAMEBUFFER,null),r.next=9,t.xrSession.end().catch((function(e){if(!(e instanceof DOMException))throw e}));case 9:t.xrSession=null;case 10:void 0!==t.oldCanvasSize&&e.setSize.apply(e,f(t.oldCanvasSize)),(a=t.renderable.getRenderers()[0]).getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.traverseAllPasses();case 16:case"end":return r.stop()}}),r)}))),e.xrRender=function(){var r=Ph(Oh().mark((function r(n,a){var o,i,s,l,c;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=a.session,t.renderable.getInteractor().updateXRGamepads(o,a,t.xrReferenceSpace),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),(i=a.getViewerPose(t.xrReferenceSpace))&&(s=e.get3DContext(),t.xrSessionIsAR&&void 0!==t.oldCanvasSize&&(s.canvas.width=t.oldCanvasSize[0],s.canvas.height=t.oldCanvasSize[1]),l=o.renderState.baseLayer,s.bindFramebuffer(s.FRAMEBUFFER,l.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),c=t.renderable.getRenderers()[0],i.views.forEach((function(r){var n=l.getViewport(r);if(s.viewport(n.x,n.y,n.width,n.height),!t.xrSessionIsAR)if("left"===r.eye)c.setViewport(0,0,.5,1);else{if("right"!==r.eye)return;c.setViewport(.5,0,1,1)}c.getActiveCamera().computeViewParametersFromPhysicalMatrix(r.transform.inverse.matrix),c.getActiveCamera().setProjectionMatrix(r.projectionMatrix),e.traverseAllPasses()})));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.restoreContext=function(){var t=Py.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(r){var n=t._textureResourceIds.get(r);if(void 0===n){var a=e.getTextureUnitManager().allocate();a<0?Ky("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(r,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+n)},e.deactivateTexture=function(r){var n=t._textureResourceIds.get(r);void 0!==n&&(e.getTextureUnitManager().free(n),t._textureResourceIds.delete(r))},e.getTextureUnitForTexture=function(e){var r=t._textureResourceIds.get(e);return void 0!==r?r:-1},e.getDefaultTextureInternalFormat=function(e,r,n){if(t.webgl2){if(e===i.UNSIGNED_CHAR)switch(r){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;default:return t.context.RGBA8}switch(r){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;default:return t.context.RGBA16F}}switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.resetCamera,o=void 0!==a&&a,i=n.size,s=void 0===i?null:i,l=n.scale,c=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=r;var u=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==c?s||t.size.map((function(e){return e*c})):null},new Promise((function(r,n){var a=e.onImageReady((function(n){if(null===t._screenshot.size)t.notifyStartCaptureImage=u,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach((function(e){return(0,e.restoreParamsFn)(e.arg)})),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(n);else{var i=document.createElement("img");if(i.style=Xy,i.src=n,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o){var s=!0!==o;t._screenshot.cameras=t.renderable.getRenderers().map((function(e){var t=e.getActiveCamera(),r=t.get("focalPoint","position","parallelScale");return{resetCameraArgs:s?{renderer:e}:void 0,resetCameraFn:s?o:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(r))}})),t._screenshot.cameras.forEach((function(e){return(0,e.resetCameraFn)(e.resetCameraArgs)}))}e.traverseAllPasses()}}))}))},e.getGLInformations=function(){for(var r=e.get3DContext(),n=r.getExtension("OES_texture_float"),a=r.getExtension("OES_texture_half_float"),o=r.getExtension("WEBGL_debug_renderer_info"),i=r.getExtension("WEBGL_draw_buffers"),s=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",r.getParameter(r.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",r.getParameter(r.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",r.getParameter(r.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&r.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",r.getParameter(r.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",r.getParameter(r.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",r.getParameter(r.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",r.getParameter(r.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",r.getParameter(r.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",r.getParameter(r.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",r.getParameter(r.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",r.getParameter(r.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",r.getParameter(r.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",r.getParameter(r.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",r.getParameter(r.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",r.getParameter(r.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",r.getParameter(r.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.UNSIGNED_BYTE)?"RGBA":"",n&&$y(r,r.RGB,r.UNSIGNED_BYTE)?"RGB":"",n&&$y(r,r.LUMINANCE,r.UNSIGNED_BYTE)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.UNSIGNED_BYTE)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&$y(r,r.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&$y(r,r.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&$y(r,r.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&$y(r,r.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&$y(r,r.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.FLOAT)?"RGBA":"",n&&$y(r,r.RGB,r.FLOAT)?"RGB":"",n&&$y(r,r.LUMINANCE,r.FLOAT)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.FLOAT)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?r.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",r.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",r.getParameter(r.RENDERER)],["WebGL Vendor","VENDOR",r.getParameter(r.VENDOR)],["WebGL Version","VERSION",r.getParameter(r.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",r.getParameter(r.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&r.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],c={};l.length;){var d=u(l.pop(),3),f=d[0],p=d[1],g=d[2];p&&(c[p]={label:f,value:g})}return c},e.traverseAllPasses=function(){if(t.renderPasses)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,n=document.createElement("canvas"),a=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,r),zy.extend(e,t,r),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",tb(),t.selector||(t.selector=Qh.newInstance(),t.selector.setOpenGLRenderWindow(e)),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,t.myFactory=zs.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",ib),t.shaderCache=Ly.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=My.newInstance(),fe.event(e,t,"imageReady"),fe.event(e,t,"haveVRDisplay"),fe.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage","xrSupported"]),fe.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen","activeFramebuffer"]),fe.setGetArray(e,t,["size"],2),nb(e,t)}var ib=fe.newInstance(ob,"vtkOpenGLRenderWindow");my("WebGL",ib);var sb={newInstance:ib,extend:ob,pushMonitorGLContextCount:function(e){eb.push(e)},popMonitorGLContextCount:function(e){return eb.pop()}},lb=fe.vtkDebugMacro;function cb(e,t){t.classHierarchy.push("vtkCamera");var r=new Float64Array(3),n=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),o=Pa(new Float64Array(16)),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3),c=Pa(new Float64Array(16)),u=Pa(new Float64Array(16)),d=new Float64Array(3),p=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 r=e.getViewMatrix();t.viewUp[0]=r[4],t.viewUp[1]=r[5],t.viewUp[2]=r[6],e.modified()},e.setPosition=function(r,n,a){r===t.position[0]&&n===t.position[1]&&a===t.position[2]||(t.position[0]=r,t.position[1]=n,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(r,n,a){r===t.focalPoint[0]&&n===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=r,t.focalPoint[1]=n,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(r){if(t.distance!==r){t.distance=r,t.distance<1e-20&&(t.distance=1e-20,lb("Distance is set to minimum."));var n=t.directionOfProjection;t.focalPoint[0]=t.position[0]+n[0]*t.distance,t.focalPoint[1]=t.position[1]+n[1]*t.distance,t.focalPoint[2]=t.position[2]+n[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],r=t.focalPoint[1]-t.position[1],n=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+r*r+n*n),t.distance<1e-20){t.distance=1e-20,lb("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]=r/t.distance,t.directionOfProjection[2]=n/t.distance,g()},e.dolly=function(r){if(!(r<=0)){var n=t.distance/r;e.setPosition(t.focalPoint[0]-n*t.directionOfProjection[0],t.focalPoint[1]-n*t.directionOfProjection[1],t.focalPoint[2]-n*t.directionOfProjection[2])}},e.roll=function(r){var n=t.position,a=t.focalPoint,o=t.viewUp,i=new Float64Array([o[0],o[1],o[2],0]);Pa(c);var s=new Float64Array([a[0]-n[0],a[1]-n[1],a[2]-n[2]]);Da(c,c,Ce(r),s),ri(i,i,c),t.viewUp[0]=i[0],t.viewUp[1]=i[1],t.viewUp[2]=i[2],e.modified()},e.azimuth=function(r){var n=t.focalPoint;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.yaw=function(r){var n=t.position;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint(p[0],p[1],p[2])},e.elevation=function(r){var n=t.focalPoint,a=e.getViewMatrix(),o=[-a[0],-a[1],-a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.pitch=function(r){var n=t.position,a=e.getViewMatrix(),o=[a[0],a[1],a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint.apply(e,f(p))},e.zoom=function(r){r<=0||(t.parallelProjection?t.parallelScale/=r:t.viewAngle/=r,e.modified())},e.translate=function(r,n,a){var o=[r,n,a];Le(t.position,o,t.position),Le(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(r){var n=[].concat(f(t.viewUp),[1]),a=[],o=[],i=[];n[0]+=t.position[0],n[1]+=t.position[1],n[2]+=t.position[2],ri(a,[].concat(f(t.position),[1]),r),ri(o,[].concat(f(t.focalPoint),[1]),r),ri(i,n,r),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,f(a.slice(0,3))),e.setFocalPoint.apply(e,f(o.slice(0,3))),e.setViewUp.apply(e,f(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+n)},e.setThicknessFromFocalPoint=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.distance-n/2,t.distance+n/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,r,n=ii(e[0],e[1],e[2],e[3]),a=ni(),o=ii(0,0,1,0);return r=n,(t=a)[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],oi(o,n,o),oi(o,o,a),[o[0],o[1],o[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),Oa(t,t)},e.getWorldToPhysicalMatrix=function(e){Pa(e);var r=[3];_e(t.physicalViewNorth,t.physicalViewUp,r),e[0]=r[0],e[1]=r[1],e[2]=r[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],wa(e,e),In(i,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),Ea(e,e,i),Ra(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(c){Oa(o,c),Jn(i,r,o),e.computeDistance();var u=t.distance;e.setPosition(i[0],i[1],i[2]),Jn(s,n,o),En(s,s,i),Kn(s,s),e.setDirectionOfProjection(s[0],s[1],s[2]),Jn(l,a,o),En(l,l,i),Kn(l,l),e.setViewUp(l[0],l[1],l[2]),e.setDistance(u)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(o),Ia(o,t,o),e.computeViewParametersFromViewMatrix(o)},e.setViewMatrix=function(r){t.viewMatrix=r,t.viewMatrix&&(Sa(o,t.viewMatrix),e.computeViewParametersFromViewMatrix(o),wa(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;ao(o,t.position,t.focalPoint,t.viewUp),wa(o,o);var e=new Float64Array(16);return Sa(e,o),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,r,n){var a=new Float64Array(16);if(Pa(a),t.projectionMatrix){var s=1/t.physicalScale;return In(i,s,s,s),Sa(a,t.projectionMatrix),Ea(a,a,i),wa(a,a),a}Pa(o);var l=t.clippingRange[1]-t.clippingRange[0],c=[t.clippingRange[0]+(r+1)*l/2,t.clippingRange[0]+(n+1)*l/2];if(t.parallelProjection){var u=t.parallelScale*e,d=t.parallelScale,f=(t.windowCenter[0]-1)*u,p=(t.windowCenter[0]+1)*u,g=(t.windowCenter[1]-1)*d,m=(t.windowCenter[1]+1)*d;ro(o,f,p,g,m,c[0],c[1]),wa(o,o)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var v,h,y=Math.tan(Ce(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(v=t.clippingRange[0]*y,h=t.clippingRange[0]*y/e):(v=t.clippingRange[0]*y*e,h=t.clippingRange[0]*y);var b=(t.windowCenter[0]-1)*v,T=(t.windowCenter[0]+1)*v,S=(t.windowCenter[1]-1)*h,C=(t.windowCenter[1]+1)*h,x=c[0],P=c[1];o[0]=2*x/(T-b),o[5]=2*x/(C-S),o[2]=(b+T)/(T-b),o[6]=(S+C)/(C-S),o[10]=-(x+P)/(P-x),o[14]=-1,o[11]=-2*x*P/(P-x),o[15]=0}return Sa(a,o),a},e.getCompositeProjectionMatrix=function(t,r,n){var a=e.getViewMatrix(),o=e.getProjectionMatrix(t,r,n);return Ia(o,a,o),o},e.setDirectionOfProjection=function(e,r,n){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==r||t.directionOfProjection[2]!==n){t.directionOfProjection[0]=e,t.directionOfProjection[1]=r,t.directionOfProjection[2]=n;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(r,n,a,o){var i=[3];_e(t.physicalViewNorth,t.physicalViewUp,i);var s=Pa(new Float64Array(16));Da(s,s,Ce(r),t.physicalViewUp),Da(s,s,Ce(n),i),Da(s,s,Ce(a),t.physicalViewNorth),Da(s,s,Ce(-o),t.physicalViewUp);var l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),c=new Float64Array(t.physicalViewNorth);Jn(l,l,s),Jn(c,c,s),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(c[0],c[1],c[2]),e.modified()},e.setOrientationWXYZ=function(t,r,n,a){var o=Pa(new Float64Array(16));if(0!==t&&(0!==r||0!==n||0!==a)){var i=Ce(t),s=ni();ai(s,[r,n,a],i),Ya(o,s)}var l=new Float64Array(3);Jn(l,[0,0,-1],o);var c=new Float64Array(3);Jn(c,[0,1,0],o),e.setDirectionOfProjection.apply(e,f(l)),e.setViewUp.apply(e,f(c)),e.modified()},e.computeClippingRange=function(e){var r,n;r=t.viewPlaneNormal,n=t.position;for(var a=-r[0],o=-r[1],i=-r[2],s=-(a*n[0]+o*n[1]+i*n[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],c=0;c<2;c++)for(var u=0;u<2;u++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+u]+i*e[4+c]+s;l[0]=fl[1]?f:l[1]}return l}}var ub={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 db(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ub,r),fe.obj(e,t),fe.get(e,t,["distance"]),fe.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),fe.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),fe.setGetArray(e,t,["clippingRange","windowCenter"],2),fe.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),cb(e,t)}var fb={newInstance:fe.newInstance(db,"vtkCamera"),extend:db};function pb(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,gb,r),fe.obj(e,t),fe.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),fe.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),pb(e,t)}var vb={newInstance:fe.newInstance(mb,"vtkLight"),extend:mb,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},hb=fe.vtkErrorMacro;function yb(e,t){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var n=e.getNestedProps();if(n&&n.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bb,r),fe.obj(e,t),fe.event(e,t,"event"),fe.setGetArray(e,t,["viewport"],4),fe.setGetArray(e,t,["background","background2"],3),yb(e,t)}var Sb={newInstance:fe.newInstance(Tb,"vtkViewport"),extend:Tb},Cb=k,xb=F,Pb=G;function wb(e){return function(){return xb("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function Ob(e,t){t.classHierarchy.push("vtkRenderer");var r={type:"ComputeVisiblePropBoundsEvent",renderer:e},n={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(Cb("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var r=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(r.getPositionByReference()),e.setFocalPointFrom(r.getFocalPointByReference()),e.modified(r.getMTime())):xb("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=wb("allocateTime"),e.updateGeometry=wb("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(r){Cb(e.getClassName(),e,"setting Layer to ",r),t.layer!==r&&(t.layer=r,e.modified()),e.setPreserveColorBuffer(!!r)},e.setActiveCamera=function(r){return t.activeCamera!==r&&(t.activeCamera=r,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:r}),!0)},e.makeCamera=function(){var t=fb.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(r){t.actors=t.actors.filter((function(e){return e!==r})),e.removeViewProp(r),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(r){t.volumes=t.volumes.filter((function(e){return e!==r})),e.removeViewProp(r),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(r){t.lights=[].concat(t.lights,r),e.modified()},e.removeLight=function(r){t.lights=t.lights.filter((function(e){return e!==r})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(r){t.lights=r,e.modified()},e.makeLight=vb.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,r,n,a){var o=e.normalizedDisplayToProjection(t,r,n);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,r,n,a){var o=e.worldToView(t,r,n);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,r,n){if(null===t.activeCamera)return xb("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Oa(a,a),wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.projectionToView=function(e,r,n,a){if(null===t.activeCamera)return xb("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);Oa(o,o),wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.worldToView=function(e,r,n){if(null===t.activeCamera)return xb("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.viewToProjection=function(e,r,n,a){if(null===t.activeCamera)return xb("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.computeVisiblePropBounds=function(){t.allBounds[0]=Hr.INIT_BOUNDS[0],t.allBounds[1]=Hr.INIT_BOUNDS[1],t.allBounds[2]=Hr.INIT_BOUNDS[2],t.allBounds[3]=Hr.INIT_BOUNDS[3],t.allBounds[4]=Hr.INIT_BOUNDS[4],t.allBounds[5]=Hr.INIT_BOUNDS[5];var n=!0;e.invokeEvent(r);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 n&&(St(t.allBounds),Cb("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=r||e.computeVisiblePropBounds(),o=[0,0,0];if(!Ct(n))return Cb("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return xb("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),o[0]=(n[0]+n[1])/2,o[1]=(n[2]+n[3])/2,o[2]=(n[4]+n[5])/2;var s=n[1]-n[0],l=n[3]-n[2],c=n[5]-n[4],u=(s*=s)+(l*=l)+(c*=c);u=0===u?1:u,u=.5*Math.sqrt(u);var d=Ce(t.activeCamera.getViewAngle()),f=u,p=u/Math.sin(.5*d),g=t.activeCamera.getViewUp();return Math.abs(Ge(g,i))>.999&&(Pb("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(o[0],o[1],o[2]),t.activeCamera.setPosition(o[0]+p*i[0],o[1]+p*i[1],o[2]+p*i[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(f),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-o[0],-o[1],-o[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=r||e.computeVisiblePropBounds();if(!Ct(a))return Cb("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return xb("Trying to reset clipping range of non-existent camera"),!1;var o=t.activeCamera.computeClippingRange(a),i=0;if(t.activeCamera.getParallelProjection())i=.2*t.activeCamera.getParallelScale();else{var s=Ce(t.activeCamera.getViewAngle());i=.2*Math.tan(s/2)*o[1]}return o[1]-o[0]=o[1]?.01*o[1]:o[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),o[0]e&&(e=r);var n=t.createdLight?t.createdLight.getMTime():0;return n>e&&(e=n),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var Ab={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:Dt(),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 Mb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Object.assign(t,Ab,r),Sb.extend(e,t,r),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1),Q(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),te(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),re(e,t,["actors","volumes","lights"]),ae(e,t,["background"],4,1),Ob(e,t)}var Ib={newInstance:ie(Mb,"vtkRenderer"),extend:Mb},Rb={Unknown:0,LeftController:1,RightController:2},Eb={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},Db={Device:Rb,Input:Eb,Axis:{Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4}};function Bb(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}function Vb(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],o=document,i=r?"addEventListener":"removeEventListener",s=r?"removeEventListener":"addEventListener";!a&&!r&&n>0&&--n,n&&!a||(n=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&r&&++n}function u(){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){Fb("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(r){t.interactorStyle!==r&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=r,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 kb("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||a(0,0),t.currentRenderer},e.bindEvents=function(r){t.container=r,r.addEventListener("contextmenu",jb),r.addEventListener("wheel",e.handleWheel),r.addEventListener("DOMMouseScroll",e.handleWheel),r.addEventListener("mouseenter",e.handleMouseEnter),r.addEventListener("mouseleave",e.handleMouseLeave),r.addEventListener("mousemove",e.handleMouseMove),r.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),r.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){c(!1,!0),t.container.removeEventListener("contextmenu",jb),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.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var r=l(t);e.keyPressEvent(r)},e.handleKeyDown=function(t){var r=l(t);e.keyDownEvent(r)},e.handleKeyUp=function(t){var r=l(t);e.keyUpEvent(r)},e.handleMouseDown=function(t){if(!(t.button>2)){c(!0),jb(t);var r=Vb(Vb({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(r);break;case 1:e.middleButtonPressEvent(r);break;case 2:e.rightButtonPressEvent(r);break;default:Fb("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(n){void 0!==n?r.has(n)?kb("requester is already registered for animating"):(r.add(n),t.animationRequest||1!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Fb("undefined requester, can not start animating")},e.extendAnimation=function(n){var a=Date.now()+n;t._animationExtendedEnd=Math.max(t._animationExtendedEnd,a),t.animationRequest||0!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())},e.isAnimating=function(){return t.xrAnimation||null!==t.animationRequest},e.cancelAnimation=function(n){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.has(n))r.delete(n),t.animationRequest&&0===r.size&&Date.now()>t._animationExtendedEnd&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=n&&n.getClassName?n.getClassName():n;kb("".concat(o," did not request an animation"))}},e.switchToXRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.xrAnimation=!0},e.returnFromXRAnimation=function(){t.xrAnimation=!1,0!==r.size&&(t.recentAnimationFrameRate=10,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateXRGamepads=function(r,n,a){r.inputSources.forEach((function(r){var o=null==r.gripSpace?null:n.getPose(r.gripSpace,a),i=r.gamepad,s=r.handedness;if(i){i.index in t.lastGamepadValues||(t.lastGamepadValues[i.index]={left:{buttons:{}},right:{buttons:{}}});for(var l=0;l1e3&&t._animationFrameCount>1&&(t.recentAnimationFrameRate=1e3*(t._animationFrameCount-1)/(n-t._animationStartTime),t.lastFrameTime=1/t.recentAnimationFrameRate,e.animationFrameRateUpdateEvent(),t._animationStartTime=n,t._animationFrameCount=1),e.animationEvent(),u(),r.size>0||Date.now()1){var n=i(r.touches);if(2===r.touches.length){var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",n)}else{var s={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(r){if(jb(r),t.recognizeGestures&&r.touches.length>1){var n=i(r.touches);e.recognizeGesture("TouchMove",n)}else{var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(r){if(jb(r),t.recognizeGestures)if(0===r.touches.length)if(1===r.changedTouches.length){var n={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(n),c(!1)}else{var a=i(r.changedTouches);e.recognizeGesture("TouchEnd",a),c(!1)}else if(1===r.touches.length){var s=i(r.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var u=i(r.touches);e.recognizeGesture("TouchMove",u)}else{var d={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),c(!1)}},e.setView=function(r){t.view!==r&&(t.view=r,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){var e,r,n;return null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r||null===(n=r.getRenderersByReference())||void 0===n?void 0:n[0]},e.findPokedRenderer=function(){var e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var o=null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r?void 0:r.getRenderers();if(!o)return null;o.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var i=null,s=null,l=null,c=o.length;c--;){var u=o[c];if(t.view.isInViewport(n,a,u)&&u.getInteractive()){l=u;break}null===i&&u.getInteractive()&&(i=u),null===s&&t.view.isInViewport(n,a,u)&&(s=u)}return null===l&&(l=i),null===l&&(l=s),null==l&&(l=o[0]),l},e.render=function(){e.isAnimating()||t.inRender||u()},Wb.forEach((function(r){var n=r.charAt(0).toLowerCase()+r.slice(1);e["".concat(n,"Event")]=function(n){if(t.enabled)if(e.getCurrentRenderer()){var a=Vb({type:r,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},n);e["invoke".concat(r)](a)}else _b("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(r,n){if(!(Object.keys(n).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===r)return Object.keys(n).forEach((function(e){t.startingEventPositions[e]=n[e]})),void(t.currentGesture="Start");if("TouchEnd"===r)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,o=[],i=[];Object.keys(n).forEach((function(e){o[a]=n[e],i[a]=t.startingEventPositions[e],a++}));var s=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((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),c=xe(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),u=xe(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=u-c;u=u+180>=360?u-180:u+180,c=c+180>=360?c-180:c+180,Math.abs(u-c)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:n};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:n};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:n};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:n};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var S={scale:l/s,touches:n};e.pinchEvent(S)}if("Pan"===t.currentGesture){var C={translation:f,touches:n};e.panEvent(C)}}}},e.handleVisibilityChange=function(){t._animationStartTime=Date.now(),t._animationFrameCount=0},e.setCurrentRenderer=function(e){t._forcedRenderer=!!e,t.currentRenderer=e};var d=e.delete;e.delete=function(){for(;r.size;)e.cancelAnimation(r.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var Hb={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,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function Kb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hb,r),fe.obj(e,t),t._animationExtendedEnd=0,fe.event(e,t,"RenderEvent"),Wb.forEach((function(r){return fe.event(e,t,r)})),fe.get(e,t,["initialized","container","interactorStyle","lastFrameTime","recentAnimationFrameRate","view"]),fe.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),zb(e,t)}var Xb=Vb({newInstance:fe.newInstance(Kb,"vtkRenderWindowInteractor"),extend:Kb,handledEvents:Wb},Db);function qb(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}function Yb(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jb,r),fe.obj(e,t),fe.event(e,t,"InteractionEvent"),fe.event(e,t,"StartInteractionEvent"),fe.event(e,t,"EndInteractionEvent"),fe.get(e,t,["interactor","enabled"]),fe.setGet(e,t,["priority","processEvents"]),$b(e,t)}var tT=Yb({newInstance:fe.newInstance(eT,"vtkInteractorObserver"),extend:eT},{computeWorldToDisplay:function(e,t,r,n){return e.getRenderWindow().getViews()[0].worldToDisplay(t,r,n,e)},computeDisplayToWorld:function(e,t,r,n){return e.getRenderWindow().getViews()[0].displayToWorld(t,r,n,e)}}),rT={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 nT(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 aT=rT.States,oT={Rotate:aT.IS_ROTATE,Pan:aT.IS_PAN,Spin:aT.IS_SPIN,Dolly:aT.IS_DOLLY,CameraPose:aT.IS_CAMERA_POSE,WindowLevel:aT.IS_WINDOW_LEVEL,Slice:aT.IS_SLICE};function iT(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(oT).forEach((function(r){fe.event(e,t,"Start".concat(r,"Event")),e["start".concat(r)]=function(){t.state===aT.IS_NONE&&(t.state=oT[r],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(r,"Event")]({type:"Start".concat(r,"Event")}))},fe.event(e,t,"End".concat(r,"Event")),e["end".concat(r)]=function(){t.state===oT[r]&&(t.state=aT.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(r,"Event")]({type:"End".concat(r,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var r=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),r.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),r.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),r.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),r.render()}}}var sT={state:aT.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function lT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sT,r),tT.extend(e,t,r),iT(e,t)}var cT=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fT,r),cT.extend(e,t,r),fe.setGet(e,t,["motionFactor","zoomFactor"]),dT(e,t)}var gT={newInstance:fe.newInstance(pT,"vtkInteractorStyleTrackballCamera"),extend:pT};function mT(e,t){var r=e.invokeResize;delete e.invokeResize,t.renderWindow=Ty.newInstance(),t.renderer=Ib.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=sb.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Xb.newInstance(),t.interactor.setInteractorStyle(gT.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,f(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),n=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*n),Math.floor(e.height*n)),r(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=fe.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}var vT={background:[.32,.34,.43],listenWindowResize:!0,container:null};function hT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vT,r),fe.obj(e,t),fe.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),fe.event(e,t,"resize"),mT(e,t)}var yT={newInstance:fe.newInstance(hT),extend:hT},bT={PICKING_BUFFER:0,FRONT_BUFFER:1},TT={ViewTypes:{DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},RenderingTypes:bT,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}};function ST(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(r){var n=r.selectedState,a=r.representation;t.widgetState.activateOnly(n),t.activeState=n,n&&n.updateManipulator&&n.updateManipulator(),e.invokeActivateHandle({selectedState:n,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CT,r),fi.extend(e,t,r),tT.extend(e,t,r),fe.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),fe.get(e,t,["representations","widgetState"]),fe.event(e,t,"ActivateHandle"),ST(e,t)}var PT={newInstance:fe.newInstance(xT,"vtkAbstractWidget"),extend:xT};function wT(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,r,n,a,o){if(t.callback){var i=r.getCompositeProjectionMatrix(n,-1,1);wa(i,i);for(var s=e.getPoints(),l=new Float64Array(3),c=a.usize,u=a.vsize,d=c/2,f=u/2,p=[],g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OT,r),Jp.extend(e,t,r),fe.setGet(e,t,["callback","useZValues"]),wT(e,t)}var MT={newInstance:fe.newInstance(AT,"vtkPixelSpaceCallbackMapper"),extend:AT},IT=0,RT=1,ET=fe.vtkErrorMacro,DT=fe.vtkWarningMacro;function BT(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var r={mtimes:{},states:[]};function n(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),kp.forEach((function(r){if(t[r]){var n="setRelativeCoincidentTopology".concat(r,"OffsetParameters");if(e[n]){var a=t[r],o=a.factor,i=a.offset;e[n](o,i)}}})))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var r=arguments.length,n=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return r.mtimes.representation===e.getMTime()&&r.mtimes.input===n.getMTime()||(r.mtimes.representation=e.getMTime(),r.mtimes.input=n.getMTime(),r.states=[],t.labels.forEach((function(e){r.states=r.states.concat(n.getStatesWithLabel(e)||[])}))),r.states},e.getSelectedState=function(t,r){var n=e.getRepresentationStates();return r0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!0;switch(t.behavior){case IT:a=e===bT.PICKING_BUFFER||n;break;case RT:a=r;break;default:a=!0}for(var o=a,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,r),fi.extend(e,t,r),fe.algo(e,t,1,1),fe.get(e,t,["labels","coincidentTopologyParameters"]),fe.set(e,t,["displayScaleParams"]),fe.setGet(e,t,["scaleInPixels"]),BT(e,t)};var NT=function(e){return{name:e,attrs:{},eventListeners:{},textContent:null,children:[],setAttribute:function(e,t){this.attrs[e]=t},removeAttribute:function(e){delete this.attrs[e]},appendChild:function(e){this.children.push(e)},addEventListeners:function(e,t){this.eventListeners[e]=t}}};function kT(e){for(var t=document.createElementNS("http://www.w3.org/2000/svg",e.name),r=Object.keys(e.attrs),n=0;n=s;g--)p(g)}return r}var GT=TT.ViewTypes,_T=TT.RenderingTypes,UT=TT.CaptureOn,WT=fe.vtkErrorMacro,jT=fe.vtkWarningMacro,zT=NT,HT=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},KT=1;function XT(e){var t=e.getActiveCamera(),r=e.getRenderWindow(),n=r.getInteractor(),a=n.getView();return{renderer:e,renderWindow:r,interactor:n,apiSpecificRenderWindow:a,camera:t}}function qT(e,t){t.viewId||(t.viewId="view-".concat(KT++)),t.classHierarchy.push("vtkWidgetManager");var r,n=new WeakMap,a=new WeakMap,o=new WeakMap,i=[];function s(e){return e&&(e.isA("vtkAbstractWidget")?e:e.getWidgetForView({viewId:t.viewId}))}t.svgRoot=(t.viewId,(r=HT("svg")).setAttribute("style","position: absolute; top: 0; left: 0; width: 100%; height: 100%;"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r);var l=new WeakMap;function c(){var e=t.apiSpecificRenderWindow.getReferenceByName("el"),r=t.apiSpecificRenderWindow.getCanvas();e.insertBefore(t.svgRoot,r.nextSibling),"static"===window.getComputedStyle(e).position&&(e.style.position="relative")}function d(){var e=u(t.apiSpecificRenderWindow.getSize(),2),r=e[0],n=e[1],a=window.devicePixelRatio||1,o=String(r/a),i=String(n/a),s="0 0 ".concat(r," ").concat(n),l=t.svgRoot.getAttribute("width"),c=t.svgRoot.getAttribute("height"),d=t.svgRoot.getAttribute("viewBox");l!==o&&t.svgRoot.setAttribute("width",o),c!==i&&t.svgRoot.setAttribute("height",i),d!==s&&t.svgRoot.setAttribute("viewBox",s)}function f(){if(t.useSvgLayer)for(var e=function(e){var r=t.widgets[e],n=r.getRepresentations().filter((function(e){return e.isA("vtkSVGRepresentation")})),i=[];r.getVisibility()&&(i=n.filter((function(e){return e.getVisibility()})).map((function(e){return e.render()})));var s=Promise.all(i),c=l.get(r)||[];c.push(s),l.set(r,c),s.then((function(e){var n=l.get(r)||[],i=n.indexOf(s);if(!t.deleted&&!r.isDeleted()&&-1!==i){n=n.slice(i+1),l.set(r,n);for(var c=o.get(r),u=zT("g"),d=0;dc[2]||ac[3])){r.next=23;break}return r.next=23,h(n,a,n,a);case 23:t.selections=t._capturedBuffers.generateSelection(n,a,n,a);case 24:return r.abrupt("return",e.getSelectedData());case 25:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.updateSelectionFromXY=function(e,r){if(jT("updateSelectionFromXY is deprecated, please use getSelectedDataForXY"),t.pickingEnabled){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,YT,r),fe.obj(e,t),fe.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:GT}]),fe.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),qT(e,t)}var QT={newInstance:fe.newInstance(ZT,"vtkWidgetManager"),extend:ZT,Constants:TT};function $T(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}function JT(e){for(var t=1;t1&&(m[e]=fe.chain.apply(fe,f(t)))}))})),m.delete=fe.chain((function(){delete r[a]}),m.delete),m.setInteractor(u);var h=Object.freeze(m);return r[a]=h,h}return r[a]},e.getViewIds=function(){return Object.keys(r)},e.setVisibility=function(e){for(var t=Object.keys(r),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oS,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),aS(e,t)}var sS={intersectDisplayWithPlane:nS,extend:iS,newInstance:fe.newInstance(iS,"vtkPlaneManipulator")};function lS(e,t,r,n,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Ne(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];_e(n,s,l),_e(l,s,l);var c=Ge([i[0]-r[0],i[1]-r[1],i[2]-r[2]],l),u=Ge(l,n),d=n.slice();return ke(d,c/u),Le(r,d,d),d}function cS(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,r){return lS(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,r)}}var uS={origin:[0,0,0],normal:[0,0,1]};function dS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uS,r),fe.obj(e,t),fe.setGetArray(e,t,["origin","normal"],3),cS(e,t)}var fS={projectDisplayToLine:lS,extend:dS,newInstance:fe.newInstance(dS,"vtkLineManipulator")},pS={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function gS(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 mS=pS.OrientationModes,vS=pS.ScaleModes,hS=fe.vtkErrorMacro;function yS(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return fe.enumToString(mS,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode(mS.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode(mS.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode(mS.MATRIX)},e.getOrientationArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.orientationArray?r.getPointData().getArray(t.orientationArray):r.getPointData().getVectors():null},e.getScaleModeAsString=function(){return fe.enumToString(vS,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(vS.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(vS.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(vS.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.scaleArray?r.getPointData().getArray(t.scaleArray):r.getPointData().getScalars():null},e.getBounds=function(){var r=e.getInputData(0),n=e.getInputData(1);return r&&n?(e.buildArrays(),t.bounds):Dt()},e.buildArrays=function(){var r=e.getInputData(0),n=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=u[0]),u[1]>t.bounds[3]&&(t.bounds[3]=u[1]),u[2]>t.bounds[5]&&(t.bounds[5]=u[2]);var M=new Float32Array(y,36*T,9);yo(M,S),wo(M,M),Po(M,M)}var I=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var R=e.getLookupTable();R&&I&&(R.build(),t.colorArray=R.mapScalars(I,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),r=e.getInputData().getPoints().getNumberOfValues()/3;return{points:r*t.getPoints().getNumberOfValues()/3,verts:r*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:r*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:r*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var bS={orient:!0,orientationMode:mS.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:vS.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function TS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bS,r),Jp.extend(e,t,r),fe.algo(e,t,2,0),t.buildTime={},fe.obj(t.buildTime,{mtime:0}),t.boundsTime={},fe.obj(t.boundsTime,{mtime:0}),fe.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),fe.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),yS(e,t)}var SS=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=xS(xS({},wS),r);LT(e,t,n),fe.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),PS(0,t)};function AS(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,r){if(!t.deleted){var n=r[0],a=n?n.getPoints().getDataType():t.pointType;n=hm.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var c=t.startPhit.startPhi?t.endPhi:t.startPhi;u*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=fe.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var S=t.phiResolution-o,C=(u-c)/(t.phiResolution-1),x=0;x=180)for(var E=S-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,MS,r),fe.obj(e,t),fe.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),fe.setGetArray(e,t,["center"],3),fe.algo(e,t,0,1),AS(e,t)}var RS={newInstance:fe.newInstance(IS,"vtkSphereSource"),extend:IS};function ES(e,t){function r(r){if(t.displayCallback){for(var n=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DS,r),OS(e,t,r),fe.get(e,t,["glyph","mapper","actor"]),ES(e,t)}var VS={newInstance:fe.newInstance(BS,"vtkSphereHandleRepresentation"),extend:BS};function LS(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}function NS(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=NS(NS({},FS),r);LT(e,t,n),kS(0,t)},_S=fe.vtkErrorMacro,US=[2,0,1,2,0,2,2,0,4,2,1,3,2,1,5,2,2,3,2,2,6,2,3,7,2,4,5,2,4,6,2,5,7,2,6,7];function WS(e,t){var r;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=hm.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(US)),t.mapper=Jp.newInstance({scalarVisibility:!1}),t.actor=Cp.newInstance({parentProp:e}),(r=t.actor.getProperty()).setEdgeColor.apply(r,f(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(r,n){var a=e.getRepresentationStates(r[0]).filter((function(e){return e.getOrigin&&e.getOrigin()}));if(8===a.length){for(var o=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jS,r),GS(e,t,r),fe.setGetArray(e,t,["edgeColor"],3),fe.get(e,t,["mapper","actor"]),WS(e,t)}var HS={newInstance:fe.newInstance(zS,"vtkCroppingOutlineRepresentation"),extend:zS},KS=["-","=","+"];function XS(e,t){var r=new Float64Array(3);return Jn(r,e,t),r}function qS(e,t){var r=Pn(),n=ni();return Ka(n,t),ta(r,e,n),r}function YS(e){var t=u(e.split("").map((function(e){return KS.indexOf(e)-1})),3),r=t[0],n=t[1],a=t[2];return r*n*a!=0?"corners":r*n!=0||n*a!=0||a*r!=0?"edges":"faces"}function ZS(e,t){var r=null;e.setDisplayCallback=function(e){return t.representations[0].setDisplayCallback(e)},e.handleLeftButtonPress=function(){return t.activeState&&t.activeState.getActive()&&t.pickable?(r=!0,t.interactor.requestAnimation(e),fe.EVENT_ABORT):fe.VOID},e.handleMouseMove=function(n){return r&&t.pickable&&t.dragable?e.handleEvent(n):fe.VOID},e.handleLeftButtonRelease=function(){r&&t.pickable&&(r=!1,t.interactor.cancelAnimation(e),t.widgetState.deactivate())},e.handleEvent=function(e){if(t.pickable&&t.activeState&&t.activeState.getActive()){var r=t.activeState.getManipulator();if(r){var n=t.activeState.getName(),a=YS(n),o=n.split("").map((function(e){return KS.indexOf(e)})),i=t.widgetState.getCroppingPlanes().getPlanes(),s=t.widgetState.getIndexToWorldT(),l=[];if("corners"===a&&(r.setNormal(t.camera.getDirectionOfProjection()),l=r.handleEvent(e,t.apiSpecificRenderWindow)),"faces"===a){var c=[1-o[0],1-o[1],1-o[2]],u=[(i[0]+i[1])/2,(i[2]+i[3])/2,(i[4]+i[5])/2];r.setOrigin(XS(u,s)),r.setNormal(qS(c,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if("edges"===a){var d=o.map((function(e){return 1===e?e:0}));r.setNormal(qS(d,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if(l.length){for(var p,g,m=XS(l,t.widgetState.getWorldToIndexT()),v=0;v<3;v++)0===o[v]?i[2*v]=m[v]:2===o[v]&&(i[2*v+1]=m[v]);return(p=t.activeState).setOrigin.apply(p,f(l)),(g=t.widgetState.getCroppingPlanes()).setPlanes.apply(g,f(i)),fe.EVENT_ABORT}}}return fe.VOID},t.camera=t.renderer.getActiveCamera(),t.classHierarchy.push("vtkImageCroppingWidgetProp")}var QS="default";function $S(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}function JS(e,t){t.classHierarchy.push("vtkWidgetState");var r=[];t.labels={},t.nestedStates=[],e.bindState=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[QS];if(t.nestedStates.push(n),r.push(n.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,eC,r),fe.obj(e,t),fe.setGet(e,t,["active"]),JS(e,t)};function rC(e,t){var r=[],n=f(Hr.INIT_BOUNDS);e.containsPoint=function(e,t,r){return Array.isArray(e)?Hr.containsPoint(n,e[0],e[1],e[2]):Hr.containsPoint(n,e,t,r)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];r[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(r[0]+r[1])/2,(r[2]+r[3])/2,(r[4]+r[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(r[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}var nC={bounds:[-1,1,-1,1,-1,1],placeFactor:1},aC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nC,r),fe.setGetArray(e,t,["bounds"],6),fe.get(e,t,["placeFactor"]),fe.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),rC(e,t)}},oC={color:.5},iC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oC,r),fe.setGet(e,t,["color"])}};function sC(e,t){e.translate=function(t,r,n){var a=u(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+r,s+n)}}var lC={corner:[0,0,0]},cC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lC,r),fe.setGetArray(e,t,["corner"],3),sC(e)}},uC=function(e){return e},dC=Pa(new Float64Array(16)),fC=1e-6,pC=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];S(this,t),this.matrix=Pa(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?xn:uC}return x(t,[{key:"rotateFromDirections",value:function(e,t){var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(16);In(r,e[0],e[1],e[2]),In(n,t[0],t[1],t[2]),Kn(r,r),Kn(n,n);var o=Xn(r,n);return o>=1||(qn(this.tmp,r,n),On(this.tmp)1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(tt(dC,this.matrix))return this;for(var n=-1===r?e.length:t+3*r,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hC,r),fe.setGetArray(e,t,["direction"],3),vC(e,t)}};function bC(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,r=t.normal,n=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),n&&l?l(n):n&&!r&&s?s(n):r&&l&&l(r)}}}var TC={manipulator:null},SC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,TC,r),fe.setGet(e,t,["manipulator"]),bC(e,t)}},CC={name:""},xC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CC,r),fe.setGet(e,t,["name"])}};function PC(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function wC(e,t){var r={o:[],p1:[],p2:[]};e.normalize=function(){We(t.up),We(t.right),We(t.direction),e.modified()},e.updateFromOriginRightUp=function(n,a,o){(function(e,t,r,n){return PC(e,n.o)&&PC(t,n.p1)&&PC(r,n.p2)})(n,a,o,r)||(r.o=n.slice(),r.p1=a.slice(),r.p2=o.slice(),t.up=[o[0]-n[0],o[1]-n[1],o[2]-n[2]],t.right=[a[0]-n[0],a[1]-n[1],a[2]-n[2]],_e(t.up,t.right,t.direction),_e(t.direction,t.up,t.right),e.normalize(),e.modified())}}var OC={up:[0,1,0],right:[1,0,0],direction:[0,0,1]},AC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,r),fe.setGetArray(e,t,["up","right","direction"],3),wC(e,t)}};function MC(e,t){e.translate=function(t,r,n){var a=u(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+r,s+n)}}var IC={origin:null},RC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,IC,r),fe.setGetArray(e,t,["origin"],3),MC(e)}},EC={scale1:.5},DC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EC,r),fe.setGet(e,t,["scale1"])}},BC={scale3:[1,1,1]},VC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BC,r),fe.setGetArray(e,t,["scale3"],3)}},LC={text:"DefaultText"},NC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,r),fe.setGet(e,t,["text"])}},kC={visible:!0},FC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kC,r),fe.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},GC={shape:""},_C={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,GC,r),fe.setGet(e,t,["shape"])}},UC=fe.vtkErrorMacro,WC={bounds:aC,color:iC,corner:cC,direction:yC,manipulator:SC,name:xC,orientation:AC,origin:RC,scale1:DC,scale3:VC,text:NC,visible:FC,shape:_C};function jC(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];a||tC(r,n,t);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ex,r),rS.extend(e,t,r),JC(e,t)}var rx={newInstance:fe.newInstance(tx,"vtkImageCroppingWidget"),extend:tx},nx=fe.vtkErrorMacro;function ax(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,f(t.getExtent()))},e.requestData=function(e,r){var n=e[0];if(n){var a=n.getPointData().getScalars();if(a){var o=n.getExtent(),i=t.croppingPlanes&&6===t.croppingPlanes.length?o.map((function(e,r){return r%2==0?Math.max(e,Math.round(t.croppingPlanes[r])):Math.min(e,Math.round(t.croppingPlanes[r]))})):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=ei.newInstance();return s.shallowCopy(n),void(r[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var c=[i[2*l+1],i[2*l]];i[2*l]=c[0],i[2*l+1]=c[1]}for(var u=0;u<6;u+=2)i[u]=Math.max(i[u],o[u]),i[u+1]=Math.min(i[u+1],o[u+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=n.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,S=i[4];S<=i[5];++S)for(var C=i[2];C<=i[3];++C){var x=h+(C-o[2])*m+(S-o[4])*v,P=x+y,w=p.subarray(x,P);b.set(w,T),T+=w.length}var O=ei.newInstance({extent:i,origin:n.getOrigin(),direction:n.getDirection(),spacing:n.getSpacing()}),A=qt.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(A),r[0]=O}else nx("No scalars from input")}else nx("Invalid or missing input")},e.isResetAvailable=function(){if(null==t.croppingPlanes||0===t.croppingPlanes.length)return!1;var r=e.getInputData();if(r){var n=r.getExtent().find((function(e,r){return Math.abs(t.croppingPlanes[r]-e)>Number.EPSILON}));return void 0!==n}return!1}}var ox={};fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ox,r),fe.obj(e,t),fe.algo(e,t,1,1),fe.setGetArray(e,t,["croppingPlanes"],6),ax(e,t)}),"vtkImageCropFilter");var ix=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){ix[e.Name]=e}));var sx=Object.keys(ix);sx.sort();var lx,cx,ux={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(ix[e.Name]||(sx.push(e.Name),sx.sort()),ix[e.Name]=e)},removePresetByName:function(e){var t=sx.indexOf(e);t>-1&&sx.splice(t,1),delete ix[e]},getPresetByName:function(e){return ix[e]},rgbPresetNames:sx},dx=r(146),fx=r.n(dx),px=(lx=function(){!function(){var e={exports:{}},t=function(){function e(e,t){for(var r=0;r1?t-1:0),n=1;n1?t-1:0),a=1;a1?r-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:[];r([0,e,t,n],a)},v=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([1,e,t,n])};return self.addEventListener("message",(function(e){var t=e.data;Array.isArray(t)?p.apply(void 0,s(t)):t&&t.eventName&&n.emitLocally.apply(n,[t.eventName].concat(s(t.args)))})),n},e.exports.TransferableResponse=f;var p=e.exports;p((function(e,t){var r=e.array,n=e.min,a=e.max,o=e.component||0,i=e.numberOfComponents||1,s=e.numberOfBins,l=a-n,c=new Float32Array(s);c.fill(0);for(var u=r.length,d=o;d1&&void 0!==arguments[1]?arguments[1]:256,r=[];r.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=1,h=i*(c<1?c*m+(1-c)*g:(2-c)*m+(c-1)*v);h>r[u]&&(r[u]=h)}}return r}function Sx(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(r.length-1),i=!!n.fillStyle,s=a+t[1];e.lineWidth=n.lineWidth,e.strokeStyle=n.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[n[0]+(e-r[0])/r[2]*(n[1]-n[0]),(t-r[1])/r[3]]}function xx(e,t){var r=t.map((function(t){return Math.abs(t.position-e)})),n=Math.min.apply(Math,f(r));return r.indexOf(n)}function Px(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(r){var n=r.offsetX,a=r.offsetY;t&&r.preventDefault(),e(n,a)}}function wx(){yx.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,f(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function Ox(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,(function(e){return[e.pageX-o.left,e.pageY-o.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(yx[e].timeout),yx[e].ts=a.timeStamp,yx[e].singleTouche=i,yx[e].touches=a.touches.length):"touchmove"===a.type?(yx[e].ts=0,yx[e].count=0,yx[e].ready=!1):"touchend"===a.type&&(a.timeStamp-yx[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=n.numberOfBinToConsiders,o=void 0===a?1:a,i=n.numberOfBinsToSkip,s=void 0===i?1:i,l=n.numberOfComponents,c=void 0===l?1:l,d=n.component,f=void 0===d?0:d;t.histogram=null,t.histogramArray=r,t.dataRange=Ie(r,f,c);var p=u(t.dataRange,2),g=p[0],m=p[1],v=4,h=Math.floor(r.length/v)||1;h+=h%c;for(var y=0,b=[],T=[];yn;)a.shift();for(var l=a.reduce((function(e,t){return e+t}),0)/n,c=0,u=t.histogram.length;c1){for(var s=t.style.iconSize+t.style.padding,l=s,c=0;n>l;)c+=1,l+=s;switch(c){case 0:var d=e.addGaussian(0,1,.1,0,0),f=t.gaussians[d],p=mx({},f),g=bx.adjustPosition;t.activeGaussian=d,t.selectedGaussian=d,fe.setImmediate((function(){e.onDown(r,n),t.dragAction={originalXY:[0,0],action:g,gaussian:f,originalGaussian:p}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var m=xx(o,t.gaussians);m!==t.selectedGaussian&&(t.selectedGaussian=m,e.modified())}return!0},e.onHover=function(r,n){var a=20/t.canvas.height,o=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=u(Cx(r,n,t.graphArea),1)[0],c=i<0?t.selectedGaussian:xx(i,t.gaussians);t.canvas.style.cursor="default";var d=t.gaussians[c];if(t.enableRangeZoom&&l>=0&&nt.rangeZoom[1]-f?t.canvas.style.cursor=hx.adjustZoom:t.canvas.style.cursor=hx.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:bx.adjustZoom}}else if(d&&l>=0){var p,g=1-s;p=g>d.height+a?"adjustPosition":g>d.height-a?Math.abs(i-d.position).5*d.height+a?"adjustPosition":g>.5*d.height-a?Math.abs(i-d.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=hx[p];var m=bx[p],v=mx({},d);t.dragAction={originalXY:[i,s],action:m,gaussian:d,originalGaussian:v}}return c!==t.activeGaussian&&(t.activeGaussian=c,e.modified()),!0},e.onDown=function(r,n){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(r,n){if(t.dragAction){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,mx({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=Tx(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(r,n){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(r,n){return e.onUp(r,n),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(r,n){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(r,n){var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var r=function(){return!!t.mouseIsDown},n=function(){for(var e=yx.length,t=arguments.length,r=new Array(t),n=0;n1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),c=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(c-o/2,c,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c),e.stroke(),e.moveTo(c-o/2,c-l+t.style.strokeWidth+2),e.lineTo(c-o/2,c+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(c-o/2,c+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c+o/2+t.style.iconSize),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&Sx(e,i,Mx(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),Sx(e,i,Mx(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var d=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,r,n){var a=n||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(r[0],r[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var c=256*t*4,u=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[r[0]+a*n,r[0]+o*n]};var r=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var n=r(e);return n&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),n};var n=e.setRangeZoom;e.setRangeZoom=function(){var e=n.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,f(t.size))}var Ex={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 Dx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ex,r),fe.obj(e,t),fe.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),fe.setGetArray(e,t,["rangeZoom"],2),fe.get(e,t,["size","canvas","gaussians"]),fe.event(e,t,"opacityChange"),fe.event(e,t,"animation"),fe.event(e,t,"zoomChange"),Rx(e,t)}var Bx=mx({newInstance:fe.newInstance(Dx,"vtkPiecewiseGaussianWidget"),extend:Dx},Ix);function Vx(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,r){var n=e.computeWorldToDisplay(r,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=n[0],t.displayCenter[1]=n[1]}}var Lx={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]},Nx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lx,r),fe.setGet(e,t,["rotationFactor"]),fe.setGetArray(e,t,["displayCenter"],2),fe.setGetArray(e,t,["center"],3),Vx(e,t)};function kx(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,r){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,r){},e.onStartScroll=function(e,t,r){},e.onScroll=function(e,t,r){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var Fx={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1},Gx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fx,r),fe.setGet(e,t,["button","shift","control","alt"]),fe.set(e,t,["dragEnabled","scrollEnabled"]),kx(e,t)};function _x(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(3),o=new Float64Array(16),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,c,u){if(u){var d=c.getActiveCamera(),f=d.getPosition(),p=d.getFocalPoint();Pa(o);var g=t.center,m=t.rotationFactor;t.useFocalPointAsCenterOfRotation&&(g[0]=p[0],g[1]=p[1],g[2]=p[2]);var v=t.previousPosition.x-u.x,h=t.previousPosition.y-u.y,y=e.getView().getSize(),b=d.getViewUp();if(t.useWorldUpVec){var T=new Float64Array(3);Mn(T,t.worldUpVec),ke(T,Ge(f,t.worldUpVec)/Ge(t.worldUpVec,t.worldUpVec)),Le(g,T,T),Ra(o,o,T),Da(o,o,Ce(360*v/y[0]*m),t.worldUpVec),T[0]=-T[0],T[1]=-T[1],T[2]=-T[2],Ra(o,o,T),Ra(o,o,g)}else Ra(o,o,g),Da(o,o,Ce(360*v/y[0]*m),b);_e(d.getDirectionOfProjection(),b,i),Da(o,o,Ce(-360*h/y[1]*m),i),s[0]=-g[0],s[1]=-g[1],s[2]=-g[2],Ra(o,o,s),Jn(r,f,o),Jn(n,p,o),l[0]=b[0]+f[0],l[1]=b[1]+f[1],l[2]=b[2]+f[2],Jn(a,l,o),d.setPosition(r[0],r[1],r[2]),d.setFocalPoint(n[0],n[1],n[2]),d.setViewUp(a[0]-r[0],a[1]-r[1],a[2]-r[2]),d.orthogonalizeViewUp(),c.resetCameraClippingRange(),e.getLightFollowCamera()&&c.updateLightsGeometryToFollowCamera(),t.previousPosition=u}}}var Ux={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function Wx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ux,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["useWorldUpVec"]),fe.setGetArray(e,t,["worldUpVec"],3),fe.setGet(e,t,["useFocalPointAsCenterOfRotation"]),_x(e,t)}var jx={newInstance:fe.newInstance(Wx,"vtkMouseCameraTrackballRotateManipulator"),extend:Wx};function zx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,r,n){if(n){var a=n,o=t.previousPosition;t.previousPosition=n;var i=r.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var c=i.getViewUp(),u=[0,0,0];_e(i.getViewPlaneNormal(),c,u);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=u[0]*(f*=2*g)+c[0]*p;s[0]+=m,l[0]+=m,m=u[1]*f+c[1]*p,s[1]+=m,l[1]+=m,m=u[2]*f+c[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(r,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(r,a.x,a.y,y),T=h.computeDisplayToWorld(r,o.x,o.y,y),S=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],C=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(S[0],S[1],S[2]),i.setFocalPoint(C[0],C[1],C[2])}r.resetCameraClippingRange(),e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}}var Hx={};function Kx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hx,r),fe.obj(e,t),Nx(e,t,r),Gx(e,t,r),zx(e,t)}var Xx={newInstance:fe.newInstance(Kx,"vtkMouseCameraTrackballPanManipulator"),extend:Kx};function qx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView().getSize(),o=r.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,r,n){if(n){var a=t.previousPosition.y-n.y,o=r.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),c=o.getDirectionOfProjection(),u=a*t.zoomScale,d=u*c[0];s[0]+=d,l[0]+=d,d=u*c[1],s[1]+=d,l[1]+=d,d=u*c[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),r.resetCameraClippingRange()}e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),t.previousPosition=n}},e.onScroll=function(e,t,r){if(r){var n=t.getActiveCamera(),a=1-r/10;n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var Yx={zoomScale:0,flipDirection:!1};function Zx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yx,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["flipDirection"]),qx(e,t)}var Qx={newInstance:fe.newInstance(Zx,"vtkMouseCameraTrackballZoomManipulator"),extend:Zx};function $x(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var r=new Map;function n(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var n=e.getValue(),a=t*e.scale+r.get(e),o=n+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==n?(e.setValue(o),r.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?r.set(e,0):r.set(e,a)}e.setHorizontalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(r.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(r.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(r.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(r);t.containerSize=i.map((function(e){return e*o}))},e.onMouseMove=function(e,r,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=n(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],c=n(t.verticalListener,l);a(t.verticalListener,c)}t.previousPosition=o}},e.onScroll=function(e,r,n){t.scrollListener&&n&&a(t.scrollListener,n*t.scrollListener.step)},e.onStartScroll=e.onScroll}var Jx={horizontalListener:null,verticalListener:null,scrollListener:null};function eP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jx,r),fe.obj(e,t),Gx(e,t,r),$x(e,t)}var tP={newInstance:fe.newInstance(eP,"vtkMouseRangeManipulator"),extend:eP};function rP(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 nP=fe.vtkDebugMacro,aP=cT.States,oP={type:"StartInteractionEvent"},iP={type:"InteractionEvent"},sP={type:"EndInteractionEvent"};function lP(e,t,r,n,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],c=t.getInteractorStyle().computeDisplayToWorld(e,r,n,l),u=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[u[0]-c[0],u[1]-c[1],u[2]-c[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var cP={dollyToPosition:function(e,t,r,n){var a=r.getActiveCamera();if(a.getParallelProjection()){var o=n.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,c=t.y;lP(r,n,i,s,l,c),a.setParallelScale(a.getParallelScale()/e),lP(r,n,l,c,i,s)}else{var u=a.getFocalPoint(),d=a.getViewPlaneNormal();u=n.getInteractorStyle().computeWorldToDisplay(r,u[0],u[1],u[2]);var f=n.getInteractorStyle().computeDisplayToWorld(r,t.x,t.y,u[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),r.resetCameraClippingRange();var p=a.getPosition();u=a.getFocalPoint();var g=[0,0,0],m=d[0]*(u[0]-p[0])+d[1]*(u[1]-p[1])+d[2]*(u[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),r.resetCameraClippingRange()}},translateCamera:lP,dollyByFactor:function(e,t,r){if(!Number.isNaN(r)){var n=t.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/r):(n.dolly(r),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};function uP(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var r=function(t,r){var n=r.indexOf(t);return-1!==n&&(r.splice(n,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return r(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return r(e,t.gestureManipulators)};var n=function(t,r){return-1===r.indexOf(t)&&(r.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return n(e,t.vrManipulators)},e.addGestureManipulator=function(e){return n(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(1,r)},e.handleMiddleButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(2,r)},e.handleRightButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(3,r)},e.handleButton3D=function(r){r&&(t.currentManipulator=e.findVRManipulator(r.device,r.input,r.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,r.pokedRenderer,t.state,r.device,r.input,r.pressed),r.pressed?e.startCameraPose():e.endCameraPose()):nP("No manipulator found"))},e.handleMove3D=function(r){t.currentManipulator&&t.state===aP.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,r.pokedRenderer,t.state,r)},e.onButtonDown=function(r,n){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(r,n.shiftKey,n.controlKey,n.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,n.pokedRenderer,n.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(oP)):nP("No manipulator found"))},e.findMouseManipulator=function(e,r,n,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===r&&s.getControl()===n&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,r){for(var n=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===r&&(n=o)}return n},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(r){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===r&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(sP))},e.handleStartMouseWheel=function(r){if(!t.currentWheelManipulator){for(var n=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===r.shiftKey&&o.getControl()===r.controlKey&&o.getAlt()===r.altKey&&(n=o)}n?(t.currentWheelManipulator=n,t.currentWheelManipulator.onStartScroll(t.interactor,r.pokedRenderer,r.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(oP)):nP("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(sP))},e.handleMouseWheel=function(r){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,r.pokedRenderer,r.spinY,t.cachedMousePosition),e.invokeInteractionEvent(iP))},e.handleMouseMove=function(r){t.cachedMousePosition=r.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,r.pokedRenderer,r.position),e.invokeInteractionEvent(iP))},e.handleKeyPress=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyPress})).forEach((function(n){n.onKeyPress(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyDown=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyDown})).forEach((function(n){n.onKeyDown(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyUp=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyUp})).forEach((function(n){n.onKeyUp(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleStartPinch=function(r){e.startDolly();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,r.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(oP)},e.handleEndPinch=function(){e.endDolly();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPinchEnabled()&&(n.onEndPinch(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(sP)},e.handleStartRotate=function(r){e.startRotate();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,r.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(oP)},e.handleEndRotate=function(){e.endRotate();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isRotateEnabled()&&(n.onEndRotate(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(sP)},e.handleStartPan=function(r){e.startPan();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,r.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(oP)},e.handleEndPan=function(){e.endPan();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPanEnabled()&&(n.onEndPan(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(sP)},e.handlePinch=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,r.pokedRenderer,r.scale),a++)}a&&e.invokeInteractionEvent(iP)},e.handlePan=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPanEnabled()&&(o.onPan(t.interactor,r.pokedRenderer,r.translation),a++)}a&&e.invokeInteractionEvent(iP)},e.handleRotate=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,r.pokedRenderer,r.rotation),a++)}a&&e.invokeInteractionEvent(iP)}}var dP={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function fP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dP,r),cT.extend(e,t,r),fe.setGet(e,t,["rotationFactor"]),fe.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),fe.setGetArray(e,t,["centerOfRotation"],3),uP(e,t)}var pP=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mP,r),fe.obj(e,t),fe.get(e,t,["renderer"]),fe.getArray(e,t,["selectionPoint","pickPosition"]),fe.setGet(e,t,["pickFromList","pickList"]),gP(e,t)}var hP={newInstance:fe.newInstance(vP,"vtkAbstractPicker"),extend:vP};function yP(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 bP=fe.vtkErrorMacro,TP=fe.vtkWarningMacro;function SP(e,t){t.classHierarchy.push("vtkPicker");var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CP,r),hP.extend(e,t,r),fe.setGet(e,t,["tolerance"]),fe.setGetArray(e,t,["mapperPosition"],3),fe.get(e,t,["mapper","dataSet","actors","pickedPositions"]),fe.event(e,t,"pickChange"),SP(e,t)}var PP={newInstance:fe.newInstance(xP,"vtkPicker"),extend:xP},wP=fe.vtkErrorMacro;function OP(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(r,n,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(r,n);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(r,n,a,o));return i},e.intersectActorWithLine=function(e,r,n,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],c=0;c<3;c++)l[c]=r[c]-e[c];var u,d=Ge(l,l);if(0===d)return wP("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=o.getPoints();if(t.useCells)for(var y=o.getPolys().getData(),b=y[0],T=o.getPolys().getNumberOfCells(),S=0;S=0&&u<=1&&u<=p+t.tolerance){for(var O=0,A=0;A<3;A++){m[A]=e[A]+u*l[A];var M=Math.abs(v[A]-m[A]);M>O&&(O=M)}O<=n&&O=0&&u<=1&&u<=p+t.tolerance){for(var I=0,R=0;R<3;R++){m[R]=e[R]+u*l[R];var E=Math.abs(v[R]-m[R]);E>I&&(I=E)}I<=n&&I2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,AP,r),PP.extend(e,t,r),fe.getArray(e,t,["pointIJK"]),fe.get(e,t,["pointId"]),fe.setGet(e,t,["useCells"]),OP(e,t)}var IP={newInstance:fe.newInstance(MP,"vtkPointPicker"),extend:MP},RP=fe.vtkWarningMacro;function EP(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(r,n){if(!t.deleted){var a=n[0],o=a?a.getPoints().getDataType():t.pointType,i=hm.newInstance(),s=[],l=[];if(Ne(t.point1,t.origin,s),Ne(t.point2,t.origin,l),e.updatePlane(s,l)){var c=t.xResolution,u=t.yResolution,d=(c+1)*(u+1),f=c*u,p=fe.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=qt.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=qt.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,S=0;S2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DP,r),t.normal=[0,0,1],t.center=[0,0,0],fe.obj(e,t),fe.setGet(e,t,["xResolution","yResolution"]),fe.setGetArray(e,t,["origin"],3),fe.getArray(e,t,["point1","point2","normal","center"],3),fe.algo(e,t,0,1),EP(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}var VP={newInstance:fe.newInstance(BP,"vtkPlaneSource"),extend:BP},LP={Coordinate:{DISPLAY:0,NORMALIZED_DISPLAY:1,VIEWPORT:2,NORMALIZED_VIEWPORT:3,PROJECTION:4,VIEW:5,WORLD:6}};function NP(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 kP=LP.Coordinate,FP=fe.vtkErrorMacro;function GP(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return FP("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_P,r),fe.obj(e,t),fe.set(e,t,["property"]),fe.get(e,t,["value"]),fe.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),fe.getArray(e,t,["value"],3),GP(e,t)}var WP=function(e){for(var t=1;t1?1e3*e:1e3;this.actor.getMapper().setMaximumSamplesPerRay(t),this.renderWindow.render()}get resolution(){return Math.round(1/this._raysDistance)}get presetsList(){return ux.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,r=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(r,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set rangeLUT([e,t]){this._rangeLUT=[e,t],this.actor.getProperty().getRGBTransferFunction(0).setMappingRange(e,t)}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Xi.newInstance();let r;t.applyColorMap(ux.getPresetByName(e)),r=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...r),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const n=$i.newInstance();this.actor.getProperty().setScalarOpacity(0,n),this.ctfun=t,this.ofun=n,this.updateWidget()}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),r=this.actor.getMapper();e?(t.onLeftButtonPress((()=>{r.setSampleDistance(5*this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))):(t.onLeftButtonPress((()=>{r.setSampleDistance(this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})))}initVR(){const e=yT.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize((()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)})),window.addEventListener("resize",(t=>{e.resize()})),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=Is(e);this.actor=t,this.lut="Grayscale",this.resolution=2,this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setActorProperties(),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return ux.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(.3),this.actor.getProperty().setDiffuse(.7),this.actor.getProperty().setSpecular(.3),this.actor.getProperty().setSpecularPower(.8)}setupCropWidget(){const e=QT.newInstance();e.setRenderer(this.renderer);const t=rx.newInstance(),r=(e.addWidget(t),t.getWidgetState().getCroppingPlanes());r.onModified((()=>{const e=function(e,t){const r=ni();Ka(r,e.getIndexToWorld());const n=e=>{const t=[0,0,0];return ta(t,e,r),t},[a,o,i,s,l,c]=t,u=e.indexToWorld([a,i,l]),d=e.indexToWorld([o,s,c]);return[cr.newInstance({normal:n([1,0,0]),origin:u}),cr.newInstance({normal:n([-1,0,0]),origin:d}),cr.newInstance({normal:n([0,1,0]),origin:u}),cr.newInstance({normal:n([0,-1,0]),origin:d}),cr.newInstance({normal:n([0,0,1]),origin:u}),cr.newInstance({normal:n([0,0,-1]),origin:d})]}(a,r.getPlanes());n.removeAllClippingPlanes(),e.forEach((e=>{n.addClippingPlane(e)})),n.modified()}));let n=this.actor.getMapper(),a=n.getInputData();t.copyImageDataDescription(a),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const r=Bx.newInstance({numberOfBins:256,size:[e,t]});r.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",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:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),r.setContainer(this.PGwidgetElement),window.addEventListener("resize",(e=>{r.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),r.render()})),this.PGwidget=r}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,r=1.8;this.PGwidget.addGaussian(this.wl,e,this.ww,t,r)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified((()=>{this.PGwidget.render(),this.renderWindow.render()})),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation((e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)})),this.PGwidget.onOpacityChange((e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}}))}setupInteractor(){const e=jx.newInstance({button:1}),t=Xx.newInstance({button:3,control:!0}),r=Qx.newInstance({button:3,scrollEnabled:!0}),n=tP.newInstance({button:1,shift:!0});let a=this;n.setVerticalListener(-1,1,.001,(function(){return a.wl}),(function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let r=a.PGwidget.getGaussians().slice();r[0].position=a.wl,a.PGwidget.setGaussians(r)})),n.setHorizontalListener(.1,2.1,.001,(function(){return a.ww}),(function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let r=a.PGwidget.getGaussians().slice();r[0].width=a.ww,a.PGwidget.setGaussians(r)}));const o=pP.newInstance();o.addMouseManipulator(n),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(r),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel((()=>this.resetMeasurementState())),this.renderWindow.getInteractor().onRightButtonPress((()=>this.resetMeasurementState()))}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,r){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(r,e);break;case"Rotation":this.resetMeasurementState(r),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let r=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter((e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName())).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(r);const n=IP.newInstance();if(n.setPickFromList(1),n.initializePickList(),!this._pickingPlane){const e=VP.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const r=Jp.newInstance();r.setInputConnection(e.getOutputPort());const n=Cp.newInstance();n.setMapper(r),n.getProperty().setOpacity(.01),this.renderer.addActor(n),this._pickingPlane=e,this._planeActor=n}n.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress((r=>{if(this.renderer!==r.pokedRenderer)return;const a=r.position,o=[a.x,a.y,0];if(n.pick(o,this.renderer),0===n.getActors().length){const e=n.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const r=n.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${r}`);const a=WP.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...r);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,r,n){jP[n](e,t,r)}(e,o,r,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()}))}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor&&(this.actor.getMapper().delete(),this.actor.delete(),this.actor=null),this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.getCanvas().remove(),this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}const qP=fe;const YP={slabThickness:.1};function ZP(e,t,r={}){Object.assign(t,YP,r),pP.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onScroll"]),qP.get(e,t,["slabThickness","viewUp"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulator=Xx.newInstance({button:1,shift:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function n(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=r=>{if(i(r),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),r){const i=r.getCurrentRenderer().getActiveCamera();a=i.onModified((()=>{n(),e.modified()})),o=r.onAnimation((()=>{const{slabThickness:e}=t,r=i.getDistance(),n=r-e/2,a=r+e/2;i.setClippingRange(n,a)}))}},e.handleMouseMove=qP.chain(e.handleMouseMove,(()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:r}=t,n=e.getActiveCamera(),a=n.getDistance(),o=a-r/2,i=a+r/2;n.setClippingRange(o,i)}));const s=e.setVolumeMapper;e.setVolumeMapper=e=>{if(s(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.getSlice=()=>{const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=e.getSliceNormal(),a=gC().identity().rotateFromDirections(n,[1,0,0]),o=r.getFocalPoint();return a.apply(o),o[0]},e.setSlice=r=>{const n=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,r){return er?r:e}(r,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=n.getDistance(),c=n.getDirectionOfProjection();Lt.normalize(c);const u=(a[1]+a[0])/2,d=[s[0]-c[0]*u,s[1]-c[1]*u,s[2]-c[2]*u],f=[d[0]+c[0]*i,d[1]+c[1]*i,d[2]+c[2]*i],p=[f[0]-c[0]*l,f[1]-c[1]*l,f[2]-c[2]*l];n.setPosition(...p),n.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}},e.getSliceRange=()=>{if(t.volumeMapper){const n=e.getSliceNormal();if(n[0]===r.sliceNormal[0]&&n[1]===r.sliceNormal[1]&&n[2]===r.sliceNormal[2])return r.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=gC().identity().rotateFromDirections(n,[1,0,0]);a.forEach((e=>o.apply(e)));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),tt.volumeMapper&&t.interactor?t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection():[0,0,0],e.setSliceNormal=(r,n=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...r],t.viewUp=[...n];const o=[...r],i=[...n];if(t.volumeMapper){Lt.normalize(o);let r=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(r=t.volumeMapper.getMapper());let n=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(r.getInputData().getDirection());Lt.transpose3x3(n,n),Lt.multiply3x3_vect3(n,o,o);let s=a.getFocalPoint(),l=a.getDistance(),c=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),r=Math.sqrt(Lt.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],c=90,l=r/(2*Math.tan(c/360*Math.PI))}const u=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Lt.multiply3x3_vect3(n,i,i);const{slabThickness:d}=t;a.setPosition(...u),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(c),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}},e.setSlabThickness=e=>{t.slabThickness=e;const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=r.getDistance();r.setClippingRange(n-e/2,n+e/2)},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),n()}(e,t)}const QP=qP.newInstance(ZP,"vtkInteractorStyleMPRSlice"),$P=Object.assign({newInstance:QP,extend:ZP}),{States:JP}=rT;const ew={wlStartPos:[0,0],levelScale:1};function tw(e,t,r={}){Object.assign(t,ew,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=n=>{const a=[n.position.x,n.position.y];t.state===JP.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),r&&r(n)};const n=e.setVolumeMapper;e.setVolumeMapper=e=>{if(n(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.windowLevelFromMouse=([r,n])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(r-t.wlStartPos[0])*o,s=(n-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:c}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),c=Math.round(c+s),e.setWindowLevel(l,c),t.wlStartPos=[r,n];const u=e.getOnLevelsChanged();u&&u({windowCenter:c,windowWidth:l})},e.getWindowLevel=()=>function(e,t){const r=Math.abs(e-t);return{windowWidth:r,windowCenter:e+r/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice()),e.setWindowLevel=(e,r)=>{const n=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,r);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(n.lower,n.upper)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=r=>{t.wlStartPos=[r.position.x,r.position.y],r.shiftKey||r.controlKey?a&&a(r):e.startWindowLevel()},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===JP.IS_WINDOW_LEVEL?e.endWindowLevel():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const rw=qP.newInstance(tw,"vtkInteractorStyleMPRWindowLevel"),nw=Object.assign({newInstance:rw,extend:tw}),{States:aw}=rT;const ow={};function iw(e,t,r={}){Object.assign(t,ow,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onClickCallback"]),function(e,t){function r(t){const r=[t.position.x,t.position.y],n=t.pokedRenderer,a=e.getOnClickCallback(),o=WP.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(r[0],r[1],0);const i=o.getComputedWorldValue(n);i.length&&a({worldPos:i,displayPos:r}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=e=>{t.state===aw.IS_SLICE&&r(e),n&&n(e)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=n=>{n.shiftKey||n.controlKey?a&&a(n):t.volumeMapper&&(r(n),e.startSlice())};const o=e.setVolumeMapper;e.setVolumeMapper=e=>{if(o(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===aw.IS_SLICE?e.endSlice():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const sw=qP.newInstance(iw,"vtkInteractorStyleMPRCrosshairs"),lw=Object.assign({newInstance:sw,extend:iw}),{States:cw}=rT;const uw={wlStartPos:[0,0],levelScale:1};function dw(e,t,r={}){Object.assign(t,uw,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),function(e,t){function r(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=e=>{"zoom"==e?t.leftManipulator=Qx.newInstance({button:1}):"pan"==e?t.leftManipulator=Xx.newInstance({button:1}):console.error("No tool found for",e),r()},t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),r();const n=e.setInteractor;e.setInteractor=r=>{if(n(r),null===r)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();r.onAnimation(a)}}(e,t)}const fw=qP.newInstance(dw,"vtkInteractorStyleMPRPanZoom"),pw=Object.assign({newInstance:fw,extend:dw}),gw=[[0,0,1],[-1,0,0],[0,1,0]],mw=[[0,-1,0],[0,0,1],[0,0,1]];class vw{constructor(e,t,r){this.VERBOSE=!1,this._key=e,this._element=r,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=gw[t],this.sliceViewUp=mw[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=yT.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(r),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,r,n){this._volume=e;const a=$P.newInstance();a.setOnScroll(r),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),n()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,r=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let n=[];qn(n,e.sliceViewUp,e.slicePlaneNormal),Kn(n,n);let a=e.sliceViewUp;const o=ba();Da(o,o,Ms(e.slicePlaneYRotation),a),Da(o,o,Ms(e.slicePlaneXRotation),n),this.VERBOSE&&console.log(t,e.slicePlaneNormal,o),Jn(t,e.slicePlaneNormal,o);const i=ni();ai(i,t,Ms(-e.viewRotation)),si(i,i);const s=ni();ai(s,n,Ms(e.slicePlaneXRotation)),si(s,s);(function(e,t,r){e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3]})(ni(),s,i),ta(r,e.sliceViewUp,i);const l=this._genericRenderWindow.getRenderWindow(),c=l.getInteractor().getInteractorStyle();c&&c.setSliceNormal&&c.setSliceNormal(t,r),l.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],r=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let n,a;"left"===this._key?(n=t[1],a=t[2]):"front"===this._key?(n=t[0],a=t[2]):"top"===this._key&&(n=t[0],a=t[1]),r>=n/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(n/r+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),r=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&r.getSliceNormal()&&e.setSliceNormal(r.getSliceNormal(),r.getViewUp()),e.setSlabThickness&&r.getSlabThickness()&&e.setSlabThickness(r.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class hw{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const r=t-e/2,n=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(r,n),Object.keys(this.elements).forEach(((r,n)=>{this.mprViews[r].wwwl=[e,t]}))}initMPR(){Object.keys(this.elements).forEach(((e,t)=>{try{this.mprViews[e]=new vw(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}})),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce(((e,t)=>{let{slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:c}=e[t];return e[t]={slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:c},e}),Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce(((e,t)=>({...e,[t]:[0,0]})),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let r=Is(t);this.volume=r,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(r.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach((t=>{this.mprViews[t].initView(r,e,(()=>{this.onScrolled.call(this,e)}),(()=>{this.onScrolled.call(this,e)}))})),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"pan"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnPanChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"zoom"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnZoomChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach((([t])=>{const r=nw.newInstance();r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnLevelsChanged((r=>{this.updateLevels({...r,srcKey:t},e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach((([r])=>{const n=lw.newInstance();n.setOnScroll((()=>{t.onScrolled(e)})),n.setOnClickCallback((({worldPos:n})=>{t.onCrosshairPointSelected({worldPos:n,srcKey:r},e)})),this.mprViews[r].setInteractor(n)})),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},r){Object.keys(this.elements).forEach((n=>{if(n!==e){const e=this.mprViews[n]._genericRenderWindow.getRenderWindow(),r=e.getInteractor().getInteractorStyle(),a=r.getSliceNormal(),o=gC().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];r.setSlice(s),e.render()}this.updateInteractorCenters(r)})),this.sliceIntersection=[...t],r.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:r},n){n.views[r].window.center=e,n.views[r].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter((e=>e!==r)).forEach((r=>{this.mprViews[r].wwwl=[t,e]}))}onScrolled(e){let t=[];Object.keys(this.elements).forEach((e=>{const r=this.mprViews[e].camera;t.push({position:r.getFocalPoint(),normal:r.getDirectionOfProjection()})}));const r=((e,t,r)=>{try{let n=cr.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(n.intersection){const{l0:e,l1:t}=n,a=cr.intersectWithLine(e,t,r.position,r.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN})(...t);return Number.isNaN(r)||r.some((e=>Number.isNaN(e)))||(this.sliceIntersection=[...r],e.sliceIntersection=[...r],this.VERBOSE&&console.log("updating slice intersection",r)),this.updateInteractorCenters(e),r}onRotate(e,t,r,n){switch(e){case"top":"x"===t?n.views.front.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneYRotation=r);break;case"left":"x"===t?n.views.top.slicePlaneXRotation=r:"y"===t&&(n.views.front.slicePlaneXRotation=r);break;case"front":"x"===t?n.views.top.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneXRotation=r)}Object.keys(this.elements).filter((t=>t!==e)).forEach((e=>{this.mprViews[e].updateSlicePlane(n.views[e])})),this.VERBOSE&&console.log("afterOnRotate",n)}onThickness(e,t,r,n){const a=r>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",n.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=r,n.views[o].sliceThickness=r}updateInteractorCenters(e){Object.keys(this.elements).forEach((t=>{const r=this.mprViews[t]._genericRenderWindow.getRenderer(),n=WP.newInstance();n.setCoordinateSystemToWorld(),n.setValue(...this.sliceIntersection);const a=n.getComputedDisplayValue(r);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a}))}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach((e=>{e.onResize()})),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach((e=>{this.mprViews[e].destroy()}))}}console.groupCollapsed("%c** dtk **","background: #0aa658; color: #000000; line-height: 1.6"),console.log("Version 1.0.1"),console.log("Detected graphic card:"),console.log(function(){const e=document.createElement("canvas").getContext("webgl");if(!e)return{error:"no webgl"};const t=e.getExtension("WEBGL_debug_renderer_info");return t?{vendor:e.getParameter(t.UNMASKED_VENDOR_WEBGL),renderer:e.getParameter(t.UNMASKED_RENDERER_WEBGL)}:{error:"no WEBGL_debug_renderer_info"}}()),console.groupEnd("dtk")})(),n})()})); \ No newline at end of file diff --git a/docs/examples/diglettk.js b/docs/examples/diglettk.js index 9364f85..df6f4cb 100644 --- a/docs/examples/diglettk.js +++ b/docs/examples/diglettk.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(self,(function(){return(()=>{var e={757:(e,t,r)=>{e.exports=r(666)},289:(e,t,r)=>{"use strict";var n=r(215),a="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,i=Array.prototype.concat,s=Object.defineProperty,l=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,r,n){var a;(!(t in e)||"function"==typeof(a=n)&&"[object Function]"===o.call(a)&&n())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);a&&(o=i.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,r)=>{"use strict";var n=r(289),a=r(221),o=r(168),i=r(471),s=o(),l=function(){return s};n(l,{getPolyfill:o,implementation:a,shim:i}),e.exports=l},168:(e,t,r)=>{"use strict";var n=r(221);e.exports=function(){return"object"==typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},471:(e,t,r)=>{"use strict";var n=r(289),a=r(168);e.exports=function(){var e=a();if(n.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=r(414),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&a.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=i(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var g=c&&r;if(s&&e.length>0&&!a.call(e,0))for(var m=0;m0)for(var v=0;v{"use strict";var n=Array.prototype.slice,a=r(414),o=Object.keys,i=o?function(e){return o(e)}:r(987),s=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return a(e)?s(n.call(e)):s(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),i=new M(n||[]);return o._invoke=function(e,t,r){var n=d;return function(a,o){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===a)throw o;return R()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=w(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=g,r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function v(){}function h(){}function y(){}var b={};l(b,o,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(I([])));S&&S!==r&&n.call(S,o)&&(b=S);var C=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(a,o,i,s){var l=u(e[a],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(l.arg)}var a;this._invoke=function(e,n){function o(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(o,o):o()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function I(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},377:(e,t,r)=>{var n=r(832),a=r(652),o=r(801),i=r(30),s=r(618),l=r(49),c=r(971);c.alea=n,c.xor128=a,c.xorwow=o,c.xorshift7=i,c.xor4096=s,c.tychei=l,e.exports=c},832:function(e,t,r){var n;!function(e,a,o){function i(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new i(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},49:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>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):r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},652:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},618:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,o=t.i;return t.w=n=n+1640531527|0,r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,a,o,i,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(i=i+1640531527|0,a=0==(r=s[127&o]^=n+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=i,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},30:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},801:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>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 l(e,t){var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},971:function(e,t,r){var n;!function(a,o,i){var s,l=256,c=i.pow(l,6),u=i.pow(2,52),d=2*u,f=255;function p(e,t,r){var n=[],f=h(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,r=t&&t.plugins;return[+new Date,a,r,a.screen,y(o)]}}():e,3),n),p=new g(n),b=function(){for(var e=p.g(6),t=c,r=0;e=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|p.g(4)},b.quick=function(){return p.g(4)/4294967296},b.double=b,h(y(p.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,p),e.state=function(){return m(p,{})}),r?(i.random=e,t):e})(b,f,"global"in t?t.global:this==i,t.state)}function g(e){var t,r=e.length,n=this,a=0,o=n.i=n.j=0,i=n.S=[];for(r||(e=[r++]);a{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],a=e[2],o=e[3];n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&a)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+t[2]+606105819|0)<<17|a>>>15)+o|0)&o|~a&r)+t[3]-1044525330|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&a)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+t[6]-1473231341|0)<<17|a>>>15)+o|0)&o|~a&r)+t[7]-45705983|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&a)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+t[10]-42063|0)<<17|a>>>15)+o|0)&o|~a&r)+t[11]-1990404162|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&a)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+t[14]-1502002290|0)<<17|a>>>15)+o|0)&o|~a&r)+t[15]+1236535329|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[1]-165796510|0)<<5|r>>>27)+n|0)&a|n&~a)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|a>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[5]-701558691|0)<<5|r>>>27)+n|0)&a|n&~a)+t[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|a>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[9]+568446438|0)<<5|r>>>27)+n|0)&a|n&~a)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|a>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&a|n&~a)+t[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|a>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^a)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|a>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^a)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|a>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^a)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|a>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^a)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|a>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|n>>>9)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~a))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[14]-1416354905|0)<<15|a>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~a))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[10]-1051523|0)<<15|a>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~a))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[6]-1560198380|0)<<15|a>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~a))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[2]+718787259|0)<<15|a>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+a|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=a+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function a(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var t,a,o,i,s,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,n(e.substring(t-64,t)));for(a=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}function i(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;tc?new ArrayBuffer(0):(n=c-l,a=new ArrayBuffer(n),o=new Uint8Array(a),i=new Uint8Array(this,l,n),o.set(i),a)}}(),u.prototype.append=function(e){return this.appendBinary(l(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,a=this._buff.length;for(t=64;t<=a;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.prototype.end=function(e){var t,r,n=this._buff,a=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var n,a,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(r(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=a,e[15]=o,r(this._hash,e)},u.hash=function(e,t){return u.hashBinary(l(e),t)},u.hashBinary=function(e,t){var r=s(o(e));return t?c(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var t,n,o,i,s,l=(n=this._buff.buffer,o=e,i=!0,(s=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(o),n.byteLength),i?s:s.buffer),c=l.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)r(this._hash,a(l.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,a=new ArrayBuffer(n),o=new Uint8Array(a);for(r=0;r>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}(new Uint8Array(e)));return t?c(n):n},u}()},146:(e,t,r)=>{const n=r(544);e.exports=class extends n{constructor(e){super(),this._messageId=1,this._messages=new Map,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._id=Math.ceil(1e7*Math.random())}terminate(){this._worker.terminate()}isFree(){return 0===this._messages.size}jobsLength(){return this._messages.size}exec(e,t=null,r=[],n){return new Promise(((a,o)=>{const i=this._messageId++;this._messages.set(i,[a,o,n]),this._worker.postMessage([i,t,e],r||[])}))}postMessage(e=null,t=[],r){return new Promise(((n,a)=>{const o=this._messageId++;this._messages.set(o,[n,a,r]),this._worker.postMessage([o,e],t||[])}))}emit(e,...t){this._worker.postMessage({eventName:e,args:t})}_onMessage(e){if(!Array.isArray(e.data)&&e.data.eventName)return super.emit(e.data.eventName,...e.data.args);const[t,...r]=e.data;if(1===t)this._onEvent(...r);else{if(0!==t)throw new Error(`Wrong message type '${t}'`);this._onResult(...r)}}_onResult(e,t,r){const[n,a]=this._messages.get(e);return this._messages.delete(e),1===t?n(r):a(r)}_onEvent(e,t,r){const[,,n]=this._messages.get(e);n&&n(t,r)}}},544:e=>{e.exports=class{constructor(){Object.defineProperty(this,"__listeners",{value:{},enumerable:!1,writable:!1})}emit(e,...t){if(!this.__listeners[e])return this;for(const r of this.__listeners[e])r(...t);return this}once(e,t){const r=(...n)=>{this.off(e,r),t(...n)};return this.on(e,r)}on(e,t){return this.__listeners[e]||(this.__listeners[e]=[]),this.__listeners[e].push(t),this}off(e,t){return this.__listeners[e]=t?this.__listeners[e].filter((e=>e!==t)):[],this}}},42:()=>{}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{MPRManager:()=>hw,VRView:()=>XP,buildVtkVolume:()=>ws,loadDemoSerieWithLarvitar:()=>As});var e={};r.r(e),r.d(e,{add:()=>Rn,angle:()=>oa,bezier:()=>Qn,ceil:()=>Vn,clone:()=>wn,copy:()=>Mn,create:()=>Pn,cross:()=>qn,dist:()=>ga,distance:()=>Un,div:()=>pa,divide:()=>Bn,dot:()=>Xn,equals:()=>ca,exactEquals:()=>la,floor:()=>Ln,forEach:()=>ya,fromValues:()=>An,hermite:()=>Zn,inverse:()=>Hn,len:()=>va,length:()=>On,lerp:()=>Yn,max:()=>kn,min:()=>Nn,mul:()=>fa,multiply:()=>Dn,negate:()=>zn,normalize:()=>Kn,random:()=>$n,rotateX:()=>ra,rotateY:()=>na,rotateZ:()=>aa,round:()=>Fn,scale:()=>Gn,scaleAndAdd:()=>_n,set:()=>In,sqrDist:()=>ma,sqrLen:()=>ha,squaredDistance:()=>Wn,squaredLength:()=>jn,str:()=>sa,sub:()=>da,subtract:()=>En,transformMat3:()=>ea,transformMat4:()=>Jn,transformQuat:()=>ta,zero:()=>ia});var t={};r.r(t),r.d(t,{add:()=>lo,adjoint:()=>Aa,clone:()=>Ta,copy:()=>Sa,create:()=>ba,determinant:()=>Ma,equals:()=>go,exactEquals:()=>po,frob:()=>so,fromQuat:()=>Ya,fromQuat2:()=>ja,fromRotation:()=>Fa,fromRotationTranslation:()=>Wa,fromRotationTranslationScale:()=>Xa,fromRotationTranslationScaleOrigin:()=>qa,fromScaling:()=>ka,fromTranslation:()=>Na,fromValues:()=>Ca,fromXRotation:()=>Ga,fromYRotation:()=>_a,fromZRotation:()=>Ua,frustum:()=>Za,getRotation:()=>Ka,getScaling:()=>Ha,getTranslation:()=>za,identity:()=>Pa,invert:()=>Oa,lookAt:()=>ao,mul:()=>mo,multiply:()=>Ia,multiplyScalar:()=>uo,multiplyScalarAndAdd:()=>fo,ortho:()=>ro,orthoNO:()=>to,orthoZO:()=>no,perspective:()=>$a,perspectiveFromFieldOfView:()=>eo,perspectiveNO:()=>Qa,perspectiveZO:()=>Ja,rotate:()=>Da,rotateX:()=>Ba,rotateY:()=>Va,rotateZ:()=>La,scale:()=>Ea,set:()=>xa,str:()=>io,sub:()=>vo,subtract:()=>co,targetTo:()=>oo,translate:()=>Ra,transpose:()=>wa});var a={};function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{add:()=>Uo,adjoint:()=>Oo,clone:()=>bo,copy:()=>To,create:()=>ho,determinant:()=>Ao,equals:()=>Ko,exactEquals:()=>Ho,frob:()=>_o,fromMat2d:()=>Lo,fromMat4:()=>yo,fromQuat:()=>No,fromRotation:()=>Bo,fromScaling:()=>Vo,fromTranslation:()=>Do,fromValues:()=>So,identity:()=>xo,invert:()=>wo,mul:()=>Xo,multiply:()=>Mo,multiplyScalar:()=>jo,multiplyScalarAndAdd:()=>zo,normalFromMat4:()=>ko,projection:()=>Fo,rotate:()=>Ro,scale:()=>Eo,set:()=>Co,str:()=>Go,sub:()=>qo,subtract:()=>Wo,translate:()=>Io,transpose:()=>Po});var i={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:i.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:i};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?t-1:0),n=1;n1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(t);var r=[];function n(e){r[e]=null}function a(e){return Object.freeze({unsubscribe:function(){n(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++D),"classHierarchy"in t?t.classHierarchy instanceof I||(t.classHierarchy=I.from(t.classHierarchy)):t.classHierarchy=new I("vtkObject"),e.isDeleted=function(){return!!t.deleted},e.modified=function(n){t.deleted?F("instance deleted - cannot call any method"):n&&n0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(r).forEach((function(i){var s=a?null:e["set".concat(H(i))];s&&Array.isArray(r[i])&&s.length>1?o=s.apply(void 0,f(r[i]))||o:s?o=s(r[i])||o:(-1!==["mtime"].indexOf(i)||n||G("Warning: Set value to model directly ".concat(i,", ").concat(r[i])),o=t[i]!==r[i]||o,t[i]=r[i])})),o},e.get=function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&void 0!==arguments[1]&&arguments[1];if(r.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(r.getClassName()," into ").concat(e.getClassName()));var a=r.get(),o=Object.keys(t).sort(),i=Object.keys(a).sort();i.forEach((function(e){var r=o.indexOf(e);-1===r?n&&k("add ".concat(e," in shallowCopy")):o.splice(r,1),t[e]=a[e]})),o.length&&n&&k("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function Q(e,t,r){r.forEach((function(r){"object"===d(r)?e["get".concat(H(r.name))]=function(){return t[r.name]}:e["get".concat(H(r))]=function(){return t[r]}}))}W.Float32Array=Float32Array,W.Float64Array=Float64Array,W.Uint8Array=Uint8Array,W.Int8Array=Int8Array,W.Uint16Array=Uint16Array,W.Int16Array=Int16Array,W.Uint32Array=Uint32Array,W.Int32Array=Int32Array,W.Uint8ClampedArray=Uint8ClampedArray;var $={enum:function(e,t,r){return function(n){if("string"==typeof n){if(void 0!==r.enum[n])return t[r.name]!==r.enum[n]&&(t[r.name]=r.enum[n],e.modified(),!0);throw F("Set Enum with invalid argument ".concat(r,", ").concat(n)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof n){if(t[r.name]!==n){if(-1!==Object.keys(r.enum).map((function(e){return r.enum[e]})).indexOf(n))return t[r.name]=n,e.modified(),!0;throw F("Set Enum outside numeric range ".concat(r,", ").concat(n)),new RangeError("Set Enum outside numeric range")}return!1}throw F("Set Enum with invalid argument (String/Number) ".concat(r,", ").concat(n)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function J(e){if("object"===d(e)){var t=$[e.type];if(t)return function(r,n){return t(r,n,e)};throw F("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,r){return function(n){return r.deleted?(F("instance deleted - cannot call any method"),!1):r[e]!==n&&(r[e]=n,t.modified(),!0)}}}function ee(e,t,r){r.forEach((function(r){"object"===d(r)?e["set".concat(H(r.name))]=J(r)(e,t):e["set".concat(H(r))]=J(r)(e,t)}))}function te(e,t,r){Q(e,t,r),ee(e,t,r)}function re(e,t,r){r.forEach((function(r){e["get".concat(H(r))]=function(){return t[r]?[].concat(t[r]):t[r]},e["get".concat(H(r),"ByReference")]=function(){return t[r]}}))}function ne(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;r.forEach((function(r){if(t[r]&&n&&t[r].length!==n)throw new RangeError("Invalid initial number of values for array (".concat(r,")"));e["set".concat(H(r))]=function(){if(t.deleted)return F("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s=0)&&(c=c[0],u=!0),null==c)l=t[r]!==c;else{if(n&&c.length!==n){if(!(c.length4&&void 0!==arguments[4]?arguments[4]:void 0;re(e,t,r),ne(e,t,r,n,a)}var oe=Symbol("Event abort");function ie(e,t){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},n={};return e(n,r,t),Object.freeze(n)};return t&&T.register(t,r),r}function se(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},r),e.setKey=function(e,r){t.keystore[e]=r},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 ue=1,de="__root__",fe={algo:function(e,t,r,n){function a(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?F("instance deleted - cannot call any method"):n>=t.numberOfInputs?F("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[n]!==r||t.inputConnection[n])&&(t.inputData[n]=r,t.inputConnection[n]=null,e.modified&&e.modified())}function o(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)F("instance deleted - cannot call any method");else{if(n>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void F(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[n]=null,t.inputConnection[n]=r}}function i(){for(var e=t.numberOfInputs;e&&!t.inputData[e-1]&&!t.inputConnection[e-1];)e--;return e===t.numberOfInputs&&t.numberOfInputs++,e}function s(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(F("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[r])}if(t.inputData?t.inputData=t.inputData.map(T):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(T):t.inputConnection=[],t.output?t.output=t.output.map(T):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(T):t.inputArrayToProcess=[],t.numberOfInputs=r,e.shouldUpdate=function(){for(var r=e.getMTime(),a=1/0,o=n;o--;){if(!t.output[o]||t.output[o].isDeleted())return!0;var i=t.output[o].getMTime();if(ia)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=o,e.addInputData=function(e){t.deleted?F("instance deleted - cannot call any method"):a(e,i())},e.addInputConnection=function(e){t.deleted?F("instance deleted - cannot call any method"):o(e,i())},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]}}n&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=function(){return s(t)};return r.filter=e,r}),e.update=function(){var r=[];if(t.numberOfInputs)for(var n=0;n3&&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(r)),null;if(t.deleted)return F("instance deleted - cannot call any method"),null;var i=o++;return n.push([i,e,a]),n.sort((function(e,t){return t[2]-e[2]})),s(i)},e.delete=function(){a(),n.forEach((function(e){return i(u(e,1)[0])}))}},EVENT_ABORT:oe,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=["TB","GB","MB","KB"],a=Number(e),o="B";a>r;)a/=r,o=n.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=[],n=e;n>1e3;)r.push("000".concat(n%1e3).slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(t)},get:Q,getArray:re,getCurrentGlobalMTime:function(){return D},getStateArrayMapFunc:q,isVtkObject:le,keystore:ce,newInstance:ie,newTypedArray:j,newTypedArrayFrom:z,normalizeWheel:function(e){var t=0,r=0,n=0,a=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,a=10*r,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||a)&&e.deltaMode&&(1===e.deltaMode?(n*=40,a*=40):(n*=800,a*=800)),n&&!t&&(t=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:a}},obj:Z,proxy:function(e,t){ce(e,t);var r=e.delete;t.proxyId="".concat(ue++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),Q(e,t,["proxyId","proxyGroup","proxyName"]),te(e,t,["proxyManager"]);var n={},a={};function i(e,t){a[t]||(a[t]=[]);for(var r=a[t],o=0;o0&&void 0!==arguments[0]?arguments[0]:de;return a[e]}function l(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,n=[],a=t.proxyId,o=s(r)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var n=null,a=[],i=0,s=!1;function l(r){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(s)return null;var c=[],u=null;for(i=a.length;i--;){var d=a[i];d.instance===r?u=d:c.push(d)}if(!u)return null;var f=u.instance["get".concat(H(u.propertyName))]();if(!X(f,n)||l){for(n=f,s=!0;c.length;){var p=c.pop();p.instance.set(o({},p.propertyName,n))}s=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=f),f}function c(e,t){var r=[];for(i=a.length;i--;){var n=a[i];n.instance!==e||n.propertyName!==t&&void 0!==t||(n.subscription.unsubscribe(),r.push(i))}for(;r.length;)a.splice(r.pop(),1)}function u(r,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=r.onModified(l),u=a[0];return a.push({instance:r,propertyName:n,subscription:s}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?r.set(o({},n,t.propertyLinkMap[e].value)):u&&l(u.instance,!0)),{unsubscribe:function(){return c(r,n)}}}function d(){for(;a.length;)a.pop().subscription.unsubscribe()}var f={bind:u,unbind:c,unsubscribe:d,persistent:r};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(n[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},e.delete=function(){for(var n=Object.keys(t.propertyLinkMap),a=n.length;a--;)t.propertyLinkMap[n[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),r()},Y((function(){if(t.links)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function a(e){for(var r=Object.keys(e),n=r.length;n--;){var a=r[n];t[a].set(e[a])}}t.this=e;for(var o=Object.keys(n),i=o.length,s=function(){var s=o[i];t[s]=n[s];var l=r[s];e["set".concat(H(s))]=function(r){r!==t[s]&&(t[s]=r,a(l[r]),e.modified())}};i--;)s();o.length&&Q(e,t,o)},safeArrays:K,set:ee,setArray:ne,setGet:te,setGetArray:ae,setImmediate:Y,setLoggerFunction:function(e,t){N[e]&&(N[e]=t||L)},throttle:function(e,t){var r=!1,n=null;function a(){r=!1,null!==n&&(o.apply(void 0,f(n)),n=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(le(t)){if(a.indexOf(t)>=0)return n;a.push(t);var o=r(t);void 0!==o&&n.push(o);var i=t.get();Object.keys(i).forEach((function(t){var o=i[t];Array.isArray(o)?o.forEach((function(t){e(t,r,n,a)})):e(o,r,n,a)}))}return n},TYPED_ARRAYS:W,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:B,vtkDebugMacro:k,vtkErrorMacro:F,vtkInfoMacro:function(){N.info.apply(N,arguments)},vtkLogMacro:function(){N.log.apply(N,arguments)},vtkOnceErrorMacro:function(e){U[e]||(N.error(e),U[e]=!0)},vtkWarningMacro:G},pe=r(377),ge=r.n(pe),me=fe.vtkErrorMacro,ve=fe.vtkWarningMacro,he=0,ye=1e-12;function be(e){return function(){return me("vtkMath::".concat(e," - NOT IMPLEMENTED"))}}function Te(e,t){for(var r=0;r<3;r++){var n=e[r];e[r]=t[r],t[r]=n}}function Se(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=-1/0,o=t,i=e.length;o1&&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 r=0,n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;function n(e,n){return Math.abs(e-t[n])<=r}return e.every(n)}var tt=et;function rt(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 r="".concat(e).split("e"),n="";return+r[1]+t>0&&(n="+"),+"".concat(Math.round("".concat(+r[0],"e").concat(n).concat(+r[1]+t)),"e-").concat(t)}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=rt(e[0],r),t[1]=rt(e[1],r),t[2]=rt(e[2],r),t}function at(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g,m,v,h,y,b,T=Se(t),S=Se(t),C=function(e,t,r,n,a){h=e[t][r],v=e[n][a],e[t][r]=h-m*(v+h*p),e[n][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(r[l])+h===Math.abs(r[l])&&Math.abs(r[s])+h===Math.abs(r[s]))e[l][s]=0;else if(Math.abs(e[l][s])>u){for(v=r[s]-r[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],S[l]-=v,S[s]+=v,r[l]-=v,r[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)C(e,o,l,o,s);for(o=l+1;o<=s-1;o++)C(e,l,o,o,s);for(o=s+1;o=20)return ve("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=r[i=a]);if(i!==o)for(r[i]=r[o],r[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&c++;if(c(n=l>s?l:s)?c:n,a[i]=1,0!==n&&(a[i]/=n)}var u=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(n=u)&&(n=d,o[0]=1),f>=n&&(o[0]=2),0!==o[0]&&(Te(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(n=p)&&(o[1]=2,Te(t[2],t[1])),o[2]=2;var m=0;if($e(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Se(4);if(ot(t,h),Je(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Te(t[o[1]],t[1]),0!==o[0]&&Te(t[o[0]],t[0])}function st(e,t,r){var n,a,o,i,s,l,c=[Se(3),Se(3),Se(3)],u=Se(3),d=Se(3);for(n=0;n<3;n++)c[n][0]=e[n][0],c[n][1]=e[n][1],c[n][2]=e[n][2],u[n]=c[n],d[n]=r[n];if(at(u,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(Ze(r,r),n=0;n<3;n++)if(t[(n+1)%3]===t[(n+2)%3]){for(l=Math.abs(r[n][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(r[n][a]))&&(l=s,i=a);return i!==n&&(s=t[i],t[i]=t[n],t[n]=s,Te(r[n],r[i])),r[i][i]<0&&(r[i][0]=-r[i][0],r[i][1]=-r[i][1],r[i][2]=-r[i][2]),o=(i+2)%3,r[a=(i+1)%3][0]=0,r[a][1]=0,r[a][2]=0,r[a][a]=1,_e(r[i],r[a],r[o]),We(r[o]),_e(r[o],r[i],r[a]),void Ze(r,r)}for(l=Math.abs(r[0][0]),i=0,n=1;n<3;n++)l<(s=Math.abs(r[n][0]))&&(l=s,i=n);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Te(r[i],r[0])),Math.abs(r[1][1])i&&(i=c);if(0===i)return ve("Unable to factor linear system"),0;d[n]=1/i}for(a=0;a=i&&(i=l,u=n)}if(a!==u){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*r[o];else 0!==l&&(i=a);r[a]=l}for(a=n-1;a>=0;a--){for(l=r[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=n||Se(r),i=a||Se(r);if(0===lt(e,o,r))return 0;for(var s=0;sc?c=i:ic?c=s:s0?(c-d)/c:0)>0?(r=o===c?l*(i-s)/(c-d):i===c?1/3+l*(s-o)/(c-d):2/3+l*(o-i)/(c-d))<0&&(r+=1):r=0,t[0]=r,t[1]=n,t[2]=f}function gt(e,t){var r,n,a,o=u(e,3),i=o[0],s=o[1],l=o[2],c=1/3,d=1/6,f=2/3,p=5/6;i>d&&i<=c?(n=1,r=(c-i)/d,a=0):i>c&&i<=.5?(n=1,a=(i-c)/d,r=0):i>.5&&i<=f?(a=1,n=(f-i)/d,r=0):i>f&&i<=p?(a=1,r=(i-f)/d,n=0):i>p&&i<=1?(r=1,a=(1-i)/d,n=0):(r=1,n=i/d,a=0),r=s*r+(1-s),n=s*n+(1-s),a=s*a+(1-s),r*=l,n*=l,a*=l,t[0]=r,t[1]=n,t[2]=a}function mt(e,t){var r=u(e,3),n=(r[0]+16)/116,a=r[1]/500+n,o=n-r[2]/200;n=Math.pow(n,3)>.008856?Math.pow(n,3):(n-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787,t[0]=.9505*a,t[1]=1*n,t[2]=1.089*o}function vt(e,t){var r=u(e,3),n=r[0]/.9505,a=r[1]/1,o=r[2]/1.089;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(n-a),t[2]=200*(a-o)}function ht(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2],i=3.2406*n+-1.5372*a+-.4986*o,s=-.9689*n+1.8758*a+.0415*o,l=.0557*n+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var c=i;c1&&(i/=c,s/=c,l/=c),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function yt(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2];n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*n+.3576*a+.1805*o,t[1]=.2126*n+.7152*a+.0722*o,t[2]=.0193*n+.1192*a+.9505*o}function bt(e,t){var r=[0,0,0];yt(e,r),vt(r,t)}function Tt(e,t){var r=[0,0,0];mt(e,r),ht(r,t)}function St(e){return e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1,e}function Ct(e){return!(e[1]-e[0]<0)}function xt(e,t,r){return r[0]=Math.min(e[0],t[0]),r[1]=Math.max(e[0],t[0]),r[2]=Math.min(e[1],t[1]),r[3]=Math.max(e[1],t[1]),r[4]=Math.min(e[2],t[2]),r[5]=Math.max(e[2],t[2]),r}function Pt(e,t,r){return er?r:e}function wt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0,0];return n[0]=Pt(e[0],t[0],r[0]),n[1]=Pt(e[1],t[1],r[1]),n[2]=Pt(e[2],t[2],r[2]),n}var Ot=be("GetScalarTypeFittingRange"),At=be("GetAdjustedScalarRange");var Mt=function(e){return!Number.isFinite(e)},It=Number.isFinite,Rt=Number.isNaN,Et=Rt;function Dt(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Bt(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function Vt(e){return Math.round(255*e)}var Lt={Pi:function(){return Math.PI},radiansFromDegrees:Ce,degreesFromRadians:xe,round:Pe,floor:we,ceil:Oe,ceilLog2:Re,min:Ae,max:Me,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=-1/0,a=t,o=e.length;a=0;--a)if(r[a]0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=t-e;return e+r*Math.random()},gaussian:Ve,add:Le,subtract:Ne,multiplyScalar:ke,multiplyScalar2D:Fe,multiplyAccumulate:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n},multiplyAccumulate2D:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n},dot:Ge,outer:function(e,t,r){for(var n=0;n<3;n++)for(var a=0;a<3;a++)r[n][a]=e[n]*t[a]},cross:_e,norm:Ue,normalize:We,perpendiculars:function(e,t,r,n){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],c=e[2]*e[2],u=Math.sqrt(s+l+c);s>l&&s>c?(a=0,o=1,i=2):l>c?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/u,f=e[o]/u,p=e[i]/u,g=Math.sqrt(d*d+p*p);if(0!==n){var m=Math.sin(n),v=Math.cos(n);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),r&&(r[a]=(-p*m-d*f*v)/g,r[o]=v*g,r[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),r&&(r[a]=-d*f/g,r[o]=g,r[i]=-f*p/g)},projectVector:function(e,t,r){var n=Ge(t,t);if(0===n)return r[0]=0,r[1]=0,r[2]=0,!1;for(var a=Ge(e,t)/n,o=0;o<3;o++)r[o]=t[o];return ke(r,a),!0},projectVector2D:function(e,t,r){var n=je(t,t);if(0===n)return r[0]=0,r[1]=0,!1;for(var a=je(e,t)/n,o=0;o<2;o++)r[o]=t[o];return Fe(r,a),!0},distance2BetweenPoints:ze,angleBetweenVectors:He,gaussianAmplitude:function(e,t,r){var n=Math.abs(e-r);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(n,2)/(2*t))},gaussianWeight:function(e,t,r){var n=Math.abs(e-r);return Math.exp(-Math.pow(n,2)/(2*t))},dot2D:je,outer2D:function(e,t,r){for(var n=0;n<2;n++)for(var a=0;a<2;a++)r[n][a]=e[n]*t[a]},norm2D:Ke,normalize2D:Xe,determinant2x2:qe,LUFactor3x3:function(e,t){for(var r,n,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(n=Math.abs(e[i][1]))>a&&(a=n),(n=Math.abs(e[i][2]))>a&&(a=n),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),r=0,(n=o[1]*Math.abs(e[1][0]))>=a&&(a=n,r=1),(n=o[2]*Math.abs(e[2][0]))>=a&&(r=2),0!==r&&(Te(e[r],e[0]),o[r]=o[0]),t[0]=r,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),r=1,(n=o[2]*Math.abs(e[2][1]))>=a&&(r=2,Te(e[2],e[1]),o[2]=o[1]),t[1]=r,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,r){var n=r[t[0]];r[t[0]]=r[0],r[0]=n,n=r[t[1]],r[t[1]]=r[1],r[1]=n-e[1][0]*r[0],n=r[t[2]],r[t[2]]=r[2],r[2]=n-e[2][0]*r[0]-e[2][1]*r[1],r[2]/=e[2][2],r[1]=(r[1]-e[1][2]*r[2])/e[1][1],r[0]=(r[0]-e[0][1]*r[1]-e[0][2]*r[2])/e[0][0]},linearSolve3x3:function(e,t,r){var n=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],u=e[2][1],d=e[2][2],f=+qe(s,u,l,d),p=-qe(i,c,l,d),g=+qe(i,c,s,u),m=-qe(a,u,o,d),v=+qe(n,c,o,d),h=-qe(n,c,a,u),y=+qe(a,s,o,l),b=-qe(n,i,o,l),T=+qe(n,i,a,s),S=n*f+a*p+o*g,C=f*t[0]+m*t[1]+y*t[2],x=p*t[0]+v*t[1]+b*t[2],P=g*t[0]+h*t[1]+T*t[2];r[0]=C/S,r[1]=x/S,r[2]=P/S},multiply3x3_vect3:function(e,t,r){var n=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];r[0]=n,r[1]=a,r[2]=o},multiply3x3_mat3:Ye,multiplyMatrix:function(e,t,r,n,a,o,i){n!==a&&me("Number of columns of A must match number of rows of B.");for(var s=0;sMe&&(n=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eye&&(f=0,d[c]=0);if(f&&1===a)return ve("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),ft(e,t,r,o);if(f)g=1;else for(c=0;c1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:pt,hsv2rgb:gt,lab2xyz:mt,xyz2lab:vt,xyz2rgb:ht,rgb2xyz:yt,rgb2lab:bt,lab2rgb:Tt,uninitializeBounds:St,areBoundsInitialized:Ct,computeBoundsFromPoints:xt,clampValue:Pt,clampVector:wt,clampAndNormalizeValue:function(e,t){var r=0;return t[0]!==t[1]&&(r=((r=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),r},getScalarTypeFittingRange:Ot,getAdjustedScalarRange:At,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]t[r+1]||e[r+1]t[r+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,r){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]+r[n/2]t[n+1]||e[n+1]+r[n/2]t[n+1])return 0;return 1},pointIsWithinBounds:function(e,t,r){if(!e||!t||!r)return 0;for(var n=0;n<3;n++)if(e[n]+r[n]t[2*n+1])return 0;return 1},solve3PointCircle:function(e,t,r,n){for(var a=Se(3),o=Se(3),i=Se(3),s=Se(3),l=Se(3),c=Se(3),u=0;u<3;++u)a[u]=e[u]-t[u],o[u]=t[u]-r[u],i[u]=r[u]-e[u],s[u]=-a[u],l[u]=-o[u],c[u]=-i[u];var d=Ue(s),f=Ue(l),p=Ue(i),g=Se(3);_e(a,o,g);for(var m=Ue(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*Ge(a,c)/h,b=p*p*Ge(s,o)/h,T=d*d*Ge(i,l)/h,S=0;S<3;++S)n[S]=y*e[S]+b*t[S]+T*r[S];return v},inf:1/0,negInf:-1/0,isInf:Mt,isNan:Rt,isNaN:Rt,isFinite:It,createUninitializedBounds:Dt,getMajorAxisIndex:function(e){for(var t=-1,r=-1,n=0;nt&&(r=n,t=a)}return r},floatToHex2:Bt,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Bt).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(Vt).join(", "),")"):"rgba(".concat(Vt(e[0]||0),", ").concat(Vt(e[1]||0),", ").concat(Vt(e[2]||0),", ").concat(e[3]||0,")")}};function Nt(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}function kt(e){for(var t=1;ta&&(a=o);return{min:n,max:a}}function _t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<0&&r>1){for(var n=e.length,a=n/r,o=new Float64Array(a),i=0,s=0;i1&&void 0!==arguments[1]?arguments[1]:0,r=e||[];r.length<=t;)r.push(null);return r}function Wt(e){return Object.prototype.toString.call(e).slice(8,-1)}var jt={computeRange:_t,createRangeHelper:function(){var e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=0,n=0;return{add:function(a){e>a&&(e=a),tr&&(r=a)}return r}};function zt(e,t){function r(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=function(e,n,a){a!==t.values[e*t.numberOfComponents+n]&&(t.values[e*t.numberOfComponents+n]=a,r())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,r=e<0?t.numberOfComponents:e,n=null;return t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents)),(n=t.ranges[r])?(t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple):(n=_t(t.values,e,t.numberOfComponents),t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple)},e.setRange=function(e,r){t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents));var n={min:e.min,max:e.max};return t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple},e.setTuple=function(e,r){for(var n=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:Ft,n=t.numberOfComponents||1;r.length!==n&&(r.length=n);var a=e*n;if(1===n)r[0]=t.values[a];else if(2===n)r[0]=t.values[a],r[1]=t.values[a+1];else if(3===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2];else if(4===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2],r[3]=t.values[a+3];else for(var o=0;o0&&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 Xt({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,n){t.values=e,t.size=e.length,t.dataType=Wt(e),n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),r()},e.getState=function(){var r=kt(kt({},t),{},{vtkClass:e.getClassName()});r.values=Array.from(r.values),delete r.buffer,Object.keys(r).forEach((function(e){r[e]||delete r[e]}));var n={};return Object.keys(r).sort().forEach((function(e){n[e]=r[e]})),n.mtime&&delete n.mtime,n}}var Ht={name:"",numberOfComponents:1,size:0,dataType:s.DefaultDataType,rangeTuple:[0,0]};function Kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Ht,r),!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=z(t.dataType,t.values)):t.values=j(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=Wt(t.values)),Z(e,t),ee(e,t,["name","numberOfComponents"]),zt(e,t)}var Xt=ie(Kt,"vtkDataArray"),qt=kt(kt({newInstance:Xt,extend:Kt},jt),s);function Yt(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 Zt=1e-6,Qt="coincide",$t="disjoint";function Jt(e,t,r){var n=r[0]*(e[0]-t[0])+r[1]*(e[1]-t[1])+r[2]*(e[2]-t[2]);return Math.abs(n)}function er(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a);n[0]=e[0]-o*r[0],n[1]=e[1]-o*r[1],n[2]=e[2]-o*r[2]}function tr(e,t,r){var n=Ge(e,t),a=Ge(t,t);return 0===a&&(a=1),r[0]=e[0]-n*t[0]/a,r[1]=e[1]-n*t[1]/a,r[2]=e[2]-n*t[2]/a,r}function rr(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a),i=Ge(r,r);0!==i?(n[0]=e[0]-o*r[0]/i,n[1]=e[1]-o*r[1]/i,n[2]=e[2]-o*r[2]/i):(n[0]=e[0],n[1]=e[1],n[2]=e[2])}function nr(e,t,r,n){var a={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},o=[],i=[];Ne(t,e,o),Ne(r,e,i);var s=Ge(n,i),l=Ge(n,o);return(l<0?-l:l)<=(s<0?-s*Zt:s*Zt)||(a.t=s/l,a.x[0]=e[0]+a.t*o[0],a.x[1]=e[1]+a.t*o[1],a.x[2]=e[2]+a.t*o[2],a.intersection=!0,a.betweenPoints=a.t>=0&&a.t<=1),a}function ar(e,t,r,n){var a={intersection:!1,l0:[],l1:[],error:null},o=[];_e(t,n,o);var i,s=o.map((function(e){return Math.abs(e)}));if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var c=[],u=-Ge(t,e),d=-Ge(n,r);switch(i){case"x":c[0]=0,c[1]=(d*t[2]-u*n[2])/o[0],c[2]=(u*n[1]-d*t[1])/o[0];break;case"y":c[0]=(u*n[2]-d*t[2])/o[1],c[1]=0,c[2]=(d*t[0]-u*n[0])/o[1];break;case"z":c[0]=(d*t[1]-u*n[1])/o[2],c[1]=(u*n[0]-d*t[0])/o[2],c[2]=0}return a.l0=c,Le(c,o,a.l1),a.intersection=!0,a}var or={evaluate:function(e,t,r){return e[0]*(r[0]-t[0])+e[1]*(r[1]-t[1])+e[2]*(r[2]-t[2])},distanceToPlane:Jt,projectPoint:er,projectVector:tr,generalizedProjectPoint:rr,intersectWithLine:nr,intersectWithPlane:ar,DISJOINT:$t,COINCIDE:Qt};function ir(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return Jt(e,t.origin,t.normal)},e.projectPoint=function(e,r){er(e,t.origin,t.normal,r)},e.projectVector=function(e,r){return tr(e,t.normal,r)},e.push=function(e){if(0!==e)for(var r=0;r<3;r++)t.origin[r]+=e*t.normal[r]},e.generalizedProjectPoint=function(e,r){rr(e,t.origin,t.normal,r)},e.evaluateFunction=function(e,r,n){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]*(r-t.origin[1])+t.normal[2]*(n-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,r){return nr(e,r,t.origin,t.normal)},e.intersectWithPlane=function(e,r){return ar(e,r,t.origin,t.normal)}}var sr={normal:[0,0,1],origin:[0,0,0]};function lr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sr,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),ir(e,t)}var cr=function(e){for(var t=1;t(arguments.length<=1?void 0:arguments[1])?n: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]=o>(arguments.length<=2?void 0:arguments[2])?o: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]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function hr(e,t,r,n,a,o,i){var s=u(e,6),l=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],c),e[2]=Math.min(t[2],d),e[3]=Math.max(t[3],f),e[4]=Math.min(t[4],p),e[5]=Math.max(t[5],g)):(e[0]=Math.min(t,l),e[1]=Math.max(r,c),e[2]=Math.min(n,d),e[3]=Math.max(a,f),e[4]=Math.min(o,p),e[5]=Math.max(i,g))}function yr(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=r,e[3]=r>l?r:l,e[4]=n,e[5]=n>d?n:d,o!==t||s!==r||c!==n}function br(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),r>=0?(e[2]*=r,e[3]*=r):(e[2]=r*e[3],e[3]=r*e[2]),n>=0?(e[4]*=n,e[5]*=n):(e[4]=n*e[5],e[5]=n*e[4]),!0)}function Cr(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function xr(e,t){return e[2*t+1]-e[2*t]}function Pr(e){return[xr(e,0),xr(e,1),xr(e,2)]}function wr(e){return e.slice(0,2)}function Or(e){return e.slice(2,4)}function Ar(e){return e.slice(4,6)}function Mr(e){var t=Pr(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function Ir(e){if(pr(e)){var t=Pr(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Rr(e){return[e[0],e[2],e[4]]}function Er(e){return[e[1],e[3],e[5]]}function Dr(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Br(e,t){for(var r=0,n=0;n<2;n++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[r]=[e[n],e[a],e[o]],r++}function Vr(e,t,r){t[0]=e[0],t[1]=e[2],t[2]=e[4],r[0]=e[1],r[1]=e[3],r[2]=e[5]}function Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Cr(e);return t[0]=e[1]-r[0],t[1]=e[3]-r[1],t[2]=e[5]-r[2],t}function Nr(e,t,r,n){for(var a=[].concat(dr),o=e.getData(),i=0;ie[2*u+1]?(i[u]=0,c[u]=e[2*u+1],o=!1):i[u]=2;if(o)return n[0]=t[0],n[1]=t[1],n[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==r[d]?l[d]=(c[d]-t[d])/r[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(n[p]=t[p]+l[s]*r[p],n[p]e[2*p+1])return 0}else n[p]=c[p];return 1}function Fr(e,t,r){for(var n=[],a=0,o=1,i=1,s=4;s<=5;++s){n[2]=e[s];for(var l=2;l<=3;++l){n[1]=e[l];for(var c=0;c<=1;++c)if(n[0]=e[c],a=cr.evaluate(r,t,n),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Gr(e,t){if(!pr(e)||!pr(t))return!1;for(var r,n=[0,0,0,0,0,0],a=0;a<3;a++)if(r=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(r=!0,n[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(r=!0,n[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(r=!0,n[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(r=!0,n[2*a+1]=e[2*a+1]),!r)return!1;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],!0}function _r(e,t){if(!pr(e)||!pr(t))return!1;for(var r=0;r<3;r++)if(!(t[2*r]>=e[2*r]&&t[2*r]<=e[2*r+1]||e[2*r]>=t[2*r]&&e[2*r]<=t[2*r+1]||t[2*r+1]>=e[2*r]&&t[2*r+1]<=e[2*r+1]||e[2*r+1]>=t[2*r]&&e[2*r+1]<=t[2*r+1]))return!1;return!0}function Ur(e,t,r,n){return!(te[1]||re[3]||ne[5])}function Wr(e,t,r){for(var n=[[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],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var c=[e[i],e[s],e[l]];a[o++]=cr.evaluate(r,t,c)}for(var u=2;u--&&!(Dr(a[n[u][0]],a[n[u][4]])&&Dr(a[n[u][1]],a[n[u][5]])&&Dr(a[n[u][2]],a[n[u][6]])&&Dr(a[n[u][3]],a[n[u][7]])););if(u<0)return!1;for(var d=Math.sign(r[u]),f=Math.abs((e[2*u+1]-e[2*u])*r[u]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[n[u][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*u]+p*e[2*u+1];return d>0?e[2*u]=v:e[2*u+1]=v,!0}var jr=function(){function e(t){S(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),gr(this.bounds,dr))}return x(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return fr(this.bounds,e)}},{key:"isValid",value:function(){return pr(this.bounds)}},{key:"setBounds",value:function(e){return gr(this.bounds,e)}},{key:"reset",value:function(){return mr(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r=0&&e=0},e.getArrayName=function(e){var r=t.arrays[e];return r?r.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r.getArrays().forEach((function(r){var o=e.getFlag(r.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&r){var i=e.getArrayByName(r.getName());if(i){if(r.getNumberOfComponents()===i.getNumberOfComponents())if(n>-1&&n-1?a:n;i.setTuple(s,r.getTuple(n))}else for(var l=0;lr.getNumberOfTuples())e.addArray(r);else{var c=r.getNumberOfComponents(),u=r.getNumberOfValues(),d=a>-1?a:n;ue?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=r();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var Xr={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function qr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xr,r),fe.obj(e,t),Kr(e,t)}var Yr={newInstance:fe.newInstance(qr,"vtkFieldData"),extend:qr},Zr={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Qr(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 $r=Zr.AttributeTypes,Jr=Zr.AttributeCopyOperations,en=fe.vtkWarningMacro;function tn(e,t){var r=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(e){var t=r.find((function(t){return $r[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(r,a){var o=n(a);if(r&&"PEDIGREEIDS"===o.toUpperCase()&&!r.isA("vtkDataArray"))return en("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(r&&!e.checkNumberOfComponents(r,o))return en("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rn,r),Yr.extend(e,t,r),fe.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),tn(e,t)}var an=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),cn.forEach((function(r){t[r]=an.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))}}var dn={};function fn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dn,r),fe.obj(e,t),fe.setGet(e,t,cn),un(e,t)}var pn=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?hn.EMPTY:3===t?hn.XYZ_GRID:2===t?e[0]===e[1]?hn.YZ_PLANE:e[2]===e[3]?hn.XZ_PLANE:hn.XY_PLANE:1===t?e[0]0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Xn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[0],s=r[1],l=r[2];return e[0]=a*l-o*s,e[1]=o*i-n*l,e[2]=n*s-a*i,e}function Yn(e,t,r,n){var a=t[0],o=t[1],i=t[2];return e[0]=a+n*(r[0]-a),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function Zn(e,t,r,n,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,c=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*s+r[0]*l+n[0]*c+a[0]*u,e[1]=t[1]*s+r[1]*l+n[1]*c+a[1]*u,e[2]=t[2]*s+r[2]*l+n[2]*c+a[2]*u,e}function Qn(e,t,r,n,a,o){var i=1-o,s=i*i,l=o*o,c=s*i,u=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*d+a[0]*f,e[1]=t[1]*c+r[1]*u+n[1]*d+a[1]*f,e[2]=t[2]*c+r[2]*u+n[2]*d+a[2]*f,e}function $n(e,t){t=t||1;var r=2*Sn()*Math.PI,n=2*Sn()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}function Jn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[3]*n+r[7]*a+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*a+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*a+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*a+r[10]*o+r[14])/i,e}function ea(e,t,r){var n=t[0],a=t[1],o=t[2];return e[0]=n*r[0]+a*r[3]+o*r[6],e[1]=n*r[1]+a*r[4]+o*r[7],e[2]=n*r[2]+a*r[5]+o*r[8],e}function ta(e,t,r){var n=r[0],a=r[1],o=r[2],i=r[3],s=t[0],l=t[1],c=t[2],u=a*c-o*l,d=o*s-n*c,f=n*l-a*s,p=a*f-o*d,g=o*u-n*f,m=n*d-a*u,v=2*i;return u*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+u+p,e[1]=l+d+g,e[2]=c+f+m,e}function ra(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0],o[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),o[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function na(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),o[1]=a[1],o[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function aa(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),o[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),o[2]=a[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function oa(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(r*r+n*n+a*a)*Math.sqrt(o*o+i*i+s*s),c=l&&Xn(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function ia(e){return e[0]=0,e[1]=0,e[2]=0,e}function sa(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function la(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ca(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(r-o)<=bn*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=bn*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-s)<=bn*Math.max(1,Math.abs(a),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ua,da=En,fa=Dn,pa=Bn,ga=Un,ma=Wn,va=On,ha=jn,ya=(ua=Pn(),function(e,t,r,n,a,o){var i,s;for(t||(t=3),r||(r=0),s=n?Math.min(n*t+r,e.length):e.length,i=r;i0?(r[0]=2*(s*i+u*n+l*o-c*a)/d,r[1]=2*(l*i+u*a+c*n-s*o)/d,r[2]=2*(c*i+u*o+s*a-l*n)/d):(r[0]=2*(s*i+u*n+l*o-c*a),r[1]=2*(l*i+u*a+c*n-s*o),r[2]=2*(c*i+u*o+s*a-l*n)),Wa(e,t,r),e}function za(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ha(e,t){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,c,u),e}function Ka(e,t){var r=new Tn(3);Ha(r,t);var n=1/r[0],a=1/r[1],o=1/r[2],i=t[0]*n,s=t[1]*a,l=t[2]*o,c=t[4]*n,u=t[5]*a,d=t[6]*o,f=t[8]*n,p=t[9]*a,g=t[10]*o,m=i+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),e[3]=.25*v,e[0]=(d-p)/v,e[1]=(f-l)/v,e[2]=(s-c)/v):i>u&&i>g?(v=2*Math.sqrt(1+i-u-g),e[3]=(d-p)/v,e[0]=.25*v,e[1]=(s+c)/v,e[2]=(f+l)/v):u>g?(v=2*Math.sqrt(1+u-i-g),e[3]=(f-l)/v,e[0]=(s+c)/v,e[1]=.25*v,e[2]=(d+p)/v):(v=2*Math.sqrt(1+g-i-u),e[3]=(s-c)/v,e[0]=(f+l)/v,e[1]=(d+p)/v,e[2]=.25*v),e}function Xa(e,t,r,n){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,c=o+o,u=i+i,d=a*l,f=a*c,p=a*u,g=o*c,m=o*u,v=i*u,h=s*l,y=s*c,b=s*u,T=n[0],S=n[1],C=n[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*S,e[5]=(1-(d+v))*S,e[6]=(m+h)*S,e[7]=0,e[8]=(p+y)*C,e[9]=(m-h)*C,e[10]=(1-(d+g))*C,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function qa(e,t,r,n,a){var o=t[0],i=t[1],s=t[2],l=t[3],c=o+o,u=i+i,d=s+s,f=o*c,p=o*u,g=o*d,m=i*u,v=i*d,h=s*d,y=l*c,b=l*u,T=l*d,S=n[0],C=n[1],x=n[2],P=a[0],w=a[1],O=a[2],A=(1-(m+h))*S,M=(p+T)*S,I=(g-b)*S,R=(p-T)*C,E=(1-(f+h))*C,D=(v+y)*C,B=(g+b)*x,V=(v-y)*x,L=(1-(f+m))*x;return e[0]=A,e[1]=M,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=B,e[9]=V,e[10]=L,e[11]=0,e[12]=r[0]+P-(A*P+R*w+B*O),e[13]=r[1]+w-(M*P+E*w+V*O),e[14]=r[2]+O-(I*P+D*w+L*O),e[15]=1,e}function Ya(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=u+h,e[2]=f-v,e[3]=0,e[4]=u-h,e[5]=1-c-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Za(e,t,r,n,a,o,i){var s=1/(r-t),l=1/(a-n),c=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*l,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function Qa(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=(a+n)*o,e[14]=2*a*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=Qa;function Ja(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=a*o,e[14]=a*n*o):(e[10]=-1,e[14]=-n),e}function eo(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),c=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function to(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(i+o)*c,e[15]=1,e}var ro=to;function no(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=o*c,e[15]=1,e}function ao(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g=t[0],m=t[1],v=t[2],h=n[0],y=n[1],b=n[2],T=r[0],S=r[1],C=r[2];return Math.abs(g-T)0&&(u*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-c*d,m=c*u-s*f,v=s*d-l*u;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-u*v,e[6]=u*m-d*g,e[7]=0,e[8]=u,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function io(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]+")"}function so(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])}function lo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function co(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function uo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function fo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function po(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]}function go(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],h=e[15],y=t[0],b=t[1],T=t[2],S=t[3],C=t[4],x=t[5],P=t[6],w=t[7],O=t[8],A=t[9],M=t[10],I=t[11],R=t[12],E=t[13],D=t[14],B=t[15];return Math.abs(r-y)<=bn*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-b)<=bn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-T)<=bn*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(o-S)<=bn*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-C)<=bn*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-x)<=bn*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-P)<=bn*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-w)<=bn*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(u-O)<=bn*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(d-A)<=bn*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-M)<=bn*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(p-I)<=bn*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=bn*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=bn*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=bn*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-B)<=bn*Math.max(1,Math.abs(h),Math.abs(B))}var mo=Ia,vo=co;function ho(){var e=new Tn(9);return Tn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function yo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function bo(e){var t=new Tn(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function To(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}function So(e,t,r,n,a,o,i,s,l){var c=new Tn(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=a,c[5]=o,c[6]=i,c[7]=s,c[8]=l,c}function Co(e,t,r,n,a,o,i,s,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i,e[6]=s,e[7]=l,e[8]=c,e}function xo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Po(e,t){if(e===t){var r=t[1],n=t[2],a=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=a}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function wo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*i-s*c,f=-u*o+s*l,p=c*o-i*l,g=r*d+n*f+a*p;return g?(g=1/g,e[0]=d*g,e[1]=(-u*n+a*c)*g,e[2]=(s*n-a*i)*g,e[3]=f*g,e[4]=(u*r-a*l)*g,e[5]=(-s*r+a*o)*g,e[6]=p*g,e[7]=(-c*r+n*l)*g,e[8]=(i*r-n*o)*g,e):null}function Oo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=i*u-s*c,e[1]=a*c-n*u,e[2]=n*s-a*i,e[3]=s*l-o*u,e[4]=r*u-a*l,e[5]=a*o-r*s,e[6]=o*c-i*l,e[7]=n*l-r*c,e[8]=r*i-n*o,e}function Ao(e){var t=e[0],r=e[1],n=e[2],a=e[3],o=e[4],i=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-i*l)+r*(-c*a+i*s)+n*(l*a-o*s)}function Mo(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],h=r[5],y=r[6],b=r[7],T=r[8];return e[0]=f*n+p*i+g*c,e[1]=f*a+p*s+g*u,e[2]=f*o+p*l+g*d,e[3]=m*n+v*i+h*c,e[4]=m*a+v*s+h*u,e[5]=m*o+v*l+h*d,e[6]=y*n+b*i+T*c,e[7]=y*a+b*s+T*u,e[8]=y*o+b*l+T*d,e}function Io(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1];return e[0]=n,e[1]=a,e[2]=o,e[3]=i,e[4]=s,e[5]=l,e[6]=f*n+p*i+c,e[7]=f*a+p*s+u,e[8]=f*o+p*l+d,e}function Ro(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=Math.sin(r),p=Math.cos(r);return e[0]=p*n+f*i,e[1]=p*a+f*s,e[2]=p*o+f*l,e[3]=p*i-f*n,e[4]=p*s-f*a,e[5]=p*l-f*o,e[6]=c,e[7]=u,e[8]=d,e}function Eo(e,t,r){var n=r[0],a=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Do(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Bo(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Vo(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function No(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[3]=u-h,e[6]=f+v,e[1]=u+h,e[4]=1-c-g,e[7]=p-m,e[2]=f-v,e[5]=p+m,e[8]=1-c-d,e}function ko(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],h=t[15],y=r*s-n*i,b=r*l-a*i,T=r*c-o*i,S=n*l-a*s,C=n*c-o*s,x=a*c-o*l,P=u*m-d*g,w=u*v-f*g,O=u*h-p*g,A=d*v-f*m,M=d*h-p*m,I=f*h-p*v,R=y*I-b*M+T*A+S*O-C*w+x*P;return R?(R=1/R,e[0]=(s*I-l*M+c*A)*R,e[1]=(l*O-i*I-c*w)*R,e[2]=(i*M-s*O+c*P)*R,e[3]=(a*M-n*I-o*A)*R,e[4]=(r*I-a*O+o*w)*R,e[5]=(n*O-r*M-o*P)*R,e[6]=(m*x-v*C+h*S)*R,e[7]=(v*T-g*x-h*b)*R,e[8]=(g*C-m*T+h*y)*R,e):null}function Fo(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Go(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function _o(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Uo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Wo(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function jo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function zo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function Ho(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]}function Ko(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=t[0],f=t[1],p=t[2],g=t[3],m=t[4],v=t[5],h=t[6],y=t[7],b=t[8];return Math.abs(r-d)<=bn*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-f)<=bn*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=bn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=bn*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-m)<=bn*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-v)<=bn*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-h)<=bn*Math.max(1,Math.abs(l),Math.abs(h))&&Math.abs(c-y)<=bn*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=bn*Math.max(1,Math.abs(u),Math.abs(b))}var Xo=Mo,qo=Wo,Yo=fe.vtkErrorMacro;function Zo(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&(r*=t[n]-1)}return r},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(r){var n=e.getDimensions();if(0===n[0]||0===n[1]||0===n[2])return Yo("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case gn.EMPTY:return null;case gn.SINGLE_POINT:break;case gn.X_LINE:a[0]=r;break;case gn.Y_LINE:a[1]=r;break;case gn.Z_LINE:a[2]=r;break;case gn.XY_PLANE:a[0]=r%n[0],a[1]=r/n[0];break;case gn.YZ_PLANE:a[1]=r%n[1],a[2]=r/n[1];break;case gn.XZ_PLANE:a[0]=r%n[0],a[2]=r/n[0];break;case gn.XYZ_GRID:a[0]=r%n[0],a[1]=r/n[0]%n[1],a[2]=r/(n[0]*n[1]);break;default:Yo("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var r=[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]],n=new Float64Array([r[0],r[1],r[2]]),a=new Float64Array(3);e.indexToWorld(n,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],i=3;i<24;i+=3)In(n,r[i],r[i+1],r[i+2]),e.indexToWorld(n,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){Na(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],Ea(t.indexToWorld,t.indexToWorld,t.spacing),Oa(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.indexToWorld),r},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.worldToIndex),r},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.indexToWorld),Jn(i,a,t.indexToWorld),xt(o,i,r)},e.worldToIndexBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.worldToIndex),Jn(i,a,t.worldToIndex),xt(o,i,r)},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),r=[],n=0;n<3;n++)r[n]=(t[2*n+1]+t[2*n])/2;return r},e.computeHistogram=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[0,0,0,0,0,0];e.worldToIndexBounds(t,n);var a=[0,0,0],o=[0,0,0];Hr.computeCornerPoints(n,a,o),nt(a,a),nt(o,o);var i=e.getDimensions();wt(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),wt(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],c=e.getPointData().getScalars().getData(),u=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!r||r([y,v,m],n)){var b=c[h];b>u&&(u=b),b0?p/g:0,S=g?Math.abs(f/g-T*T):0,C=Math.sqrt(S);return{minimum:d,maximum:u,average:T,variance:S,sigma:C,count:g}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=t,a=0;a<3;++a)r[a]=n,n*=e[2*a+1]-e[2*a]+1;return r},e.computeOffsetIndex=function(t){var r=u(t,3),n=r[0],a=r[1],o=r[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(n)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var r=e.getExtent(),n=e.worldToIndex(t),a=0;a<3;++a)if(n[a]r[2*a+1])return Yo("GetScalarPointer: Pixel ".concat(n," is not in memory. Current extent = ").concat(r)),NaN;return e.computeOffsetIndex(n)},e.getScalarValueFromWorld=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=n)return Yo("GetScalarPointer: Scalar Component ".concat(r," is not within bounds. Current Scalar numberOfComponents: ").concat(n)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,r)}}var Qo={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:gn.EMPTY};function $o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qo,r),pn.extend(e,t,r),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=xo(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),fe.get(e,t,["direction","indexToWorld","worldToIndex"]),fe.setGetArray(e,t,["origin","spacing"],3),fe.getArray(e,t,["extent"],6),Zo(e,t)}var Jo,ei={newInstance:fe.newInstance($o,"vtkImageData"),extend:$o};function ti(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function ri(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*a+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*a+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*a+r[11]*o+r[15]*i,e}function ni(){var e=new Tn(4);return Tn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ai(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function oi(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+i*s+a*c-o*l,e[1]=a*u+i*l+o*s-n*c,e[2]=o*u+i*c+n*l-a*s,e[3]=i*u-n*s-a*l-o*c,e}Jo=new Tn(4),Tn!=Float32Array&&(Jo[0]=0,Jo[1]=0,Jo[2]=0,Jo[3]=0);var ii=function(e,t,r,n){var a=new Tn(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a},si=function(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r*r+n*n+a*a+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=a*i,e[3]=o*i,e};function li(e){return function(){return fe.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}function ci(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,r=0;re&&(e=n)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=li("pick"),e.hasKey=li("hasKey"),e.getNestedVisibility=function(){return t.visibility&&(!t.parentProp||t.parentProp.getNestedVisibility())},e.getNestedPickable=function(){return t.pickable&&(!t.parentProp||t.parentProp.getNestedPickable())},e.getNestedDragable=function(){return t.dragable&&(!t.parentProp||t.parentProp.getNestedDragable())},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(r){r&&!e.hasTexture(r)&&(t.textures=t.textures.concat(r),e.modified())},e.removeTexture=function(r){var n=t.textures.filter((function(e){return e!==r}));t.textures.length!==n.length&&(t.textures=n,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}Pn(),An(1,0,0),An(0,1,0),ni(),ni(),ho();var ui={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function di(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ui,r),fe.obj(e,t),fe.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),fe.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier","parentProp"]),ci(e,t)}var fi={newInstance:fe.newInstance(di,"vtkProp"),extend:di};function pi(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(r){t.position=t.position.map((function(e,t){return e+r[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=ni();Ka(e,t.rotation);var r=new Float64Array(3),n=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>bn?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}(r,e);return[xe(n),r[0],r[1],r[2]]},e.rotateX=function(r){0!==r&&(Ba(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateY=function(r){0!==r&&(Va(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateZ=function(r){0!==r&&(La(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateWXYZ=function(r,n,a,o){if(0!==r&&(0!==n||0!==a||0!==o)){var i=Ce(r),s=ni();ai(s,[n,a,o],i);var l=new Float64Array(16);Ya(l,s),Ia(t.rotation,t.rotation,l),e.modified()}},e.setOrientation=function(r,n,a){return(r!==t.orientation[0]||n!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[r,n,a],Pa(t.rotation),e.rotateZ(a),e.rotateX(r),e.rotateY(n),e.modified(),!0)},e.setUserMatrix=function(r){Sa(t.userMatrix,r),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Pa(t.matrix),t.userMatrix&&Ia(t.matrix,t.matrix,t.userMatrix),Ra(t.matrix,t.matrix,t.origin),Ra(t.matrix,t.matrix,t.position),Ia(t.matrix,t.matrix,t.rotation),Ea(t.matrix,t.matrix,t.scale),Ra(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),wa(t.matrix,t.matrix),t.isIdentity=!0;for(var r=0;r<4;++r)for(var n=0;n<4;++n)(r===n?1:0)!==t.matrix[r+4*n]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Hr.getCenter(t.bounds)},e.getLength=function(){return Hr.getLength(t.bounds)},e.getXRange=function(){return Hr.getXRange(t.bounds)},e.getYRange=function(){return Hr.getYRange(t.bounds)},e.getZRange=function(){return Hr.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var gi={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 mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gi,r),fi.extend(e,t,r),t.matrixMTime={},fe.obj(t.matrixMTime),fe.get(e,t,["bounds","isIdentity"]),fe.getArray(e,t,["orientation"]),fe.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Pa(new Float64Array(16)),t.rotation=Pa(new Float64Array(16)),t.userMatrix=Pa(new Float64Array(16)),t.transform=null,pi(e,t)}var vi={newInstance:fe.newInstance(mi,"vtkProp3D"),extend:mi},hi={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},yi={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:hi},bi={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Ti={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:bi};function Si(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 Ci=yi.ScalarMappingTarget,xi=yi.VectorMode,Pi=qt.VtkDataTypes,wi=Ti.ColorMode,Oi=fe.vtkErrorMacro;function Ai(e){return e}function Mi(e){return Math.floor(255*e+.5)}function Ii(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(xi.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(xi.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(xi.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(r,n){if(!(r&&!n||!r&&n))if(r&&n&&r.length!==n.length)Oi("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],n&&r)for(var a=n.length,o=0;o=0?t.annotationArray[a].annotation!==n&&(t.annotationArray[a].annotation=n,o=!0):(t.annotationArray.push({value:r,annotation:n}),a=t.annotationArray.length-1,o=!0),o&&(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(r){return t.annotationArray.length?e.checkForAnnotatedValue(r):-1},e.removeAnnotation=function(r){var n=e.checkForAnnotatedValue(r),a=n>=0;return a&&(t.annotationArray.splice(n,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(r,n){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(r);e.getIndexedColor(a,n)}else e.getColor(parseFloat(r),n),n[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var r=t.annotationArray.length;return t.annotatedValueMap[e]%r}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,r=0;r1?e.mapVectorsThroughTable(t,o,Ci.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Ci.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,r){for(var n=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=c&&(l=c-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=c):(l<0&&(l=0),l>=c&&(l=c-1),l+s>c&&(s=c-l)),i!==xi.MAGNITUDE||1!==c&&1!==s||(i=xi.COMPONENT));var u=0;switch(l>0&&(u=l),i){case xi.COMPONENT:e.mapScalarsThroughTable(t,r,n,u);break;case xi.RGBCOLORS:break;case xi.MAGNITUDE:default:var d=qt.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,r,n,0)}},e.luminanceToRGBA=function(e,t,r,n){for(var a=n(r),o=t.getData(),i=e.getData(),s=o.length,l=0,c=0;c=1&&r.getDataType()===Pi.UNSIGNED_CHAR)return r;var i=qt.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Pi.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ai;switch(r.getDataType()!==Pi.FLOAT&&r.getDataType()!==Pi.DOUBLE||(s=Mi),n){case 1:e.luminanceToRGBA(i,r,o,s);break;case 2:e.luminanceAlphaToRGBA(i,r,s);break;case 3:e.rGBToRGBA(i,r,o,s);break;case 4:e.rGBAToRGBA(i,r,o,s);break;default:return Oi("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,r){return e.setMappingRange(t,r)},e.getRange=function(t,r){return e.getMappingRange()}}var Ri={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:xi.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Ei(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ri,r),fe.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],fe.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),fe.setArray(e,t,["mappingRange"],2),fe.getArray(e,t,["mappingRange"]),Ii(e,t)}var Di=function(e){for(var t=1;t.001?Math.acos(r/o):0,s=i>.001?Math.atan2(a,n):0;t[0]=o,t[1]=i,t[2]=s}function Wi(e,t){if(e[0]>=t-.1)return e[2];var r=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+r:e[2]-r}function ji(e,t,r,n){var a=[],o=[];bt(t,a),bt(r,o);var i=[],s=[];Ui(a,i),Ui(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var r=e-t;for(r<0&&(r=-r);r>=2*Math.PI;)r-=2*Math.PI;return r>Math.PI&&(r=2*Math.PI-r),r}(i[2],s[2])>.33*Math.PI){var c=Math.max(i[0],s[0]);c=Math.max(88,c),e<.5?(s[0]=c,s[1]=0,s[2]=0,l*=2):(i[0]=c,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Wi(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Wi(i,s[0]));var u=[];u[0]=(1-l)*i[0]+l*s[0],u[1]=(1-l)*i[1]+l*s[1],u[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var r=e[0],n=e[1],a=e[2];t[0]=r*Math.cos(n),t[1]=r*Math.sin(n)*Math.cos(a),t[2]=r*Math.sin(n)*Math.sin(a)}(u,d),Tt(d,n)}function zi(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,r,n,a){return e.addRGBPointLong(t,r,n,a,.5,0)},e.addRGBPointLong=function(r,n,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Gi("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Gi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var l={x:r,r:n,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[],l=[r,n,a];return gt(l,s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(r){if(t.nodes!==r){var n=JSON.stringify(t.nodes);t.nodes=r;var a=JSON.stringify(t.nodes);if(e.sortAndUpdateRange()||n!==a)return e.modified(),!0}return!1},e.sortAndUpdateRange=function(){var r=JSON.stringify(t.nodes);t.nodes.sort((function(e,t){return e.x-t.x}));var n=JSON.stringify(t.nodes),a=e.updateRange();return a||r===n?a:(e.modified(),!0)},e.updateRange=function(){var r=[2];r[0]=t.mappingRange[0],r[1]=t.mappingRange[1];var n=t.nodes.length;return n?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[n-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(r[0]!==t.mappingRange[0]||r[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(r){for(var n=0;n=t.nodes.length)return-1;var o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(r,n){if(r!==n){e.removePoint(n);for(var a=0;a=r&&t.nodes[u].x<=i?t.nodes.splice(u,1):u++;e.addRGBPointLong(r,n,a,o,.5,0),e.addRGBPointLong(i,s,l,c,.5,0),e.modified()},e.addHSVSegment=function(t,r,n,a,o,i,s,l){var c=[i,s,l],u=[],d=[];gt([r,n,a],u),gt(c,d),e.addRGBSegment(t,u[0],u[1],u[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var r=[];return e.getColor(t,r),[Math.floor(255*r[0]+.5),Math.floor(255*r[1]+.5),Math.floor(255*r[2]+.5),255]},e.getColor=function(r,n){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(r);if(o<0||0===a)e.getNanColor(n);else{var i=[];e.getNodeValue(o%a,i),n[0]=i.r,n[1]=i.g,n[2]=i.b}}else e.getTable(r,r,1,n)},e.getRedValue=function(t){var r=[];return e.getColor(t,r),r[0]},e.getGreenValue=function(t){var r=[];return e.getColor(t,r),r[1]},e.getBlueValue=function(t){var r=[];return e.getColor(t,r),r[2]},e.getTable=function(r,n,a,o){if(Et(r)||Et(n))for(var i=0;i0);var S=0,C=0,x=0;T&&(S=Math.log10(r),C=Math.log10(n));for(var P=0;P1?T?(x=S+P/(a-1)*(C-S),f=Math.pow(10,x)):f=r+P/(a-1)*(n-r):T?(x=.5*(S+C),f=Math.pow(10,x)):f=.5*(r+n),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var A=t.numberOfValues,M=O[1]-O[0];if(A<=1)f=O[0]+M/2;else{var I=(f-O[0])/M,R=we(A*I);f=O[0]+R/(A-1)*M}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[w]=0,o[w+1]=0,o[w+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[w]=t.aboveRangeColor[0],o[w+1]=t.aboveRangeColor[1],o[w+2]=t.aboveRangeColor[2]):(o[w]=c,o[w+1]=u,o[w+2]=d));else if(f0&&(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-r)<1e-6||t.discretize))l>0?(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b):(o[w]=0,o[w+1]=0,o[w+2]=0);else{var E=0;if(E=(E=T?(x-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[w]=m[0],o[w+1]=m[1],o[w+2]=m[2];continue}o[w]=v[0],o[w+1]=v[1],o[w+2]=v[2];continue}if(y<.01){if(t.colorSpace===Li.RGB)o[w]=(1-E)*m[0]+E*v[0],o[w+1]=(1-E)*m[1]+E*v[1],o[w+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Li.HSV){var D=[],B=[];pt(m,D),pt(v,B),t.hSVWrap&&(D[0]-B[0]>.5||B[0]-D[0]>.5)&&(D[0]>B[0]?D[0]-=1:B[0]-=1);var V=[];V[0]=(1-E)*D[0]+E*B[0],V[0]<0&&(V[0]+=1),V[1]=(1-E)*D[1]+E*B[1],V[2]=(1-E)*D[2]+E*B[2],gt(V,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var L=[],N=[];bt(m,L),bt(v,N);var k=[];k[0]=(1-E)*L[0]+E*N[0],k[1]=(1-E)*L[1]+E*N[1],k[2]=(1-E)*L[2]+E*N[2],Tt(k,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,W=G-2*F+E,j=G-F,z=void 0;if(t.colorSpace===Li.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[w+H]=_*m[H]+U*v[H]+W*z+j*z;else if(t.colorSpace===Li.HSV){var K=[],X=[];pt(m,K),pt(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+W*z+j*z,0===Y&&q[Y]<0&&(q[Y]+=1);gt(q,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var Z=[],Q=[];bt(m,Z),bt(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+W*z+j*z;Tt($,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[w+ee]=o[w+ee]<0?0:o[w+ee],o[w+ee]=o[w+ee]>1?1:o[w+ee]}}}},e.getUint8Table=function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Gi("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(r,n,a,s);for(var l=0;l1&&(i=(n-r)/(a-1));for(var s=0;s=t.nodes.length?(Gi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].r,r[2]=t.nodes[e].g,r[3]=t.nodes[e].b,r[4]=t.nodes[e].midpoint,r[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){if(r<0||r>=t.nodes.length)return Gi("Index out of range!"),-1;var a=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].r=n[1],t.nodes[r].g=n[2],t.nodes[r].b=n[3],t.nodes[r].midpoint=n[4],t.nodes[r].sharpness=n[5],a!==n[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,r){var n=e.getSize();if(n>0&&t>=0){var a=[];e.getNodeValue(t%n,a);for(var o=0;o<3;++o)r[o]=a[o+1];r[3]=1}else e.getNanColor(r),r[3]=1},e.fillFromDataPointer=function(t,r){if(!(t<=0)&&r){e.removeAllPoints();for(var n=0;nr[1]?(e.getColor(r[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])):(e.getColor(n[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=r[0]&&t.nodes[o].x<=r[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,r),Di.extend(e,t,r),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},fe.obj(t.buildTime),fe.get(e,t,["buildTime","mappingRange"]),fe.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),zi(e,t)}var Xi=function(e){for(var t=1;t0&&(r=t.nodes[0].y);for(var a=1;ar)switch(n){case 0:case 1:n=1;break;default:n=3}else switch(n){case 0:case 2:n=2;break;default:n=3}if(r=e,3===n)break}switch(n){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var r=0;r0?t.nodes[r-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,r){var n=t.nodes.length;return e<0||e>=n?(qi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].y,r[2]=t.nodes[e].midpoint,r[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){var a=t.nodes.length;if(r<0||r>=a)return qi("Index out of range!"),-1;var o=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].y=n[1],t.nodes[r].midpoint=n[2],t.nodes[r].sharpness=n[3],o!==n[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,r){return e.addPointLong(t,r,.5,0)},e.addPointLong=function(r,n,a,o){if(a<0||a>1)return qi("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return qi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var i,s={x:r,y:n,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=n,o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(r,n,a,o){e.sortAndUpdateRange();for(var i=0;i=r&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(r,n,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var r=[];return e.getTable(t,t,1,r),r[0]},e.adjustRange=function(r){if(r.length<2)return 0;var n=e.getRange();n[0]r[1]?e.addPoint(r[1],e.getValue(r[1])):e.addPoint(r[1],e.getValue(n[1])),e.sortAndUpdateRange();for(var a=0;a=r[0]&&t.nodes[a].x<=r[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var r=t.nodes[1].x-t.nodes[0].x,n=0;n4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,c=0;0!==l&&(c=t.nodes[l-1].y);var u=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(n-1)*(r-e):.5*(e+r);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?c:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(u-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,S=2*T-3*b+1,C=-2*T+3*b,x=T-2*b+y,P=T-b,w=g-p,O=(1-v)*w;a[h]=S*p+C*g+x*O+P*O;var A=pg?p:g;a[h]=a[h]M?M:a[h]}}}}var Zi={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function Qi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zi,r),fe.obj(e,t),t.nodes=[],fe.setGet(e,t,["allowDuplicateScalars","clamping"]),fe.setArray(e,t,["range"],2),fe.getArray(e,t,["range"]),Yi(e,t)}var $i={newInstance:fe.newInstance(Qi,"vtkPiecewiseFunction"),extend:Qi},Ji={NEAREST:0,LINEAR:1,FAST_LINEAR:2},es={FRACTIONAL:0,PROPORTIONAL:1},ts={InterpolationType:Ji,OpacityMode:es};function rs(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 ns=ts.InterpolationType,as=ts.OpacityMode,os=fe.vtkErrorMacro;function is(e,t){t.classHierarchy.push("vtkVolumeProperty"),e.getMTime=function(){for(var e,r=t.mtime,n=0;n<4;n++)1===t.componentData[n].colorChannels?t.componentData[n].grayTransferFunction&&(r=r>(e=t.componentData[n].grayTransferFunction.getMTime())?r:e):3===t.componentData[n].colorChannels&&t.componentData[n].rGBTransferFunction&&(r=r>(e=t.componentData[n].rGBTransferFunction.getMTime())?r:e),t.componentData[n].scalarOpacity&&(r=r>(e=t.componentData[n].scalarOpacity.getMTime())?r:e),t.componentData[n].gradientOpacity&&(t.componentData[n].disableGradientOpacity||(r=r>(e=t.componentData[n].gradientOpacity.getMTime())?r:e));return r},e.getColorChannels=function(e){return e<0||e>3?(os("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(r,n){var a=!1;return t.componentData[r].grayTransferFunction!==n&&(t.componentData[r].grayTransferFunction=n,a=!0),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(r){return null===t.componentData[r].grayTransferFunction&&(t.componentData[r].grayTransferFunction=$i.newInstance(),t.componentData[r].grayTransferFunction.addPoint(0,0),t.componentData[r].grayTransferFunction.addPoint(1024,1),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1),e.modified()),t.componentData[r].grayTransferFunction},e.setRGBTransferFunction=function(r,n){var a=!1;return t.componentData[r].rGBTransferFunction!==n&&(t.componentData[r].rGBTransferFunction=n,a=!0),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(r){return null===t.componentData[r].rGBTransferFunction&&(t.componentData[r].rGBTransferFunction=Xi.newInstance(),t.componentData[r].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[r].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3),e.modified()),t.componentData[r].rGBTransferFunction},e.setScalarOpacity=function(r,n){return t.componentData[r].scalarOpacity!==n&&(t.componentData[r].scalarOpacity=n,e.modified(),!0)},e.getScalarOpacity=function(r){return null===t.componentData[r].scalarOpacity&&(t.componentData[r].scalarOpacity=$i.newInstance(),t.componentData[r].scalarOpacity.addPoint(0,1),t.componentData[r].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[r].scalarOpacity},e.setComponentWeight=function(r,n){if(r<0||r>=4)return os("Invalid index"),!1;var a=Math.min(1,Math.max(0,n));return t.componentData[r].componentWeight!==a&&(t.componentData[r].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(os("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(ns.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(ns.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(ns.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return fe.enumToString(ns,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["set".concat(n)]=function(n,a){return t.componentData[n]["".concat(r)]!==a&&(t.componentData[n]["".concat(r)]=a,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["get".concat(n)]=function(e){return t.componentData[e]["".concat(r)]}}))}var ss={independentComponents:!0,interpolationType:ns.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function ls(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,ss,r),fe.obj(e,t),!t.componentData){t.componentData=[];for(var n=0;n<4;++n)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:as.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}fe.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),is(e,t)}var cs=function(e){for(var t=1;tn[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!(r=[n,t.mapperBounds],r[0].map((function(e,t){return r.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){us("Recomputing bounds..."),t.mapperBounds=n.map((function(e){return e}));var a=[];Hr.getCorners(n,a),e.computeMatrix();var o=new Float64Array(16);wa(o,t.matrix),a.forEach((function(e){return Jn(e,e,o)})),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,r){return e>r[t/2]?r[t/2]:e}),e):a.reduce((function(e,r){return ee?r:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e}}var fs={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function ps(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fs,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["mapper"]),fe.getArray(e,t,["bounds"],6),ds(e,t)}var gs={newInstance:fe.newInstance(ps,"vtkVolume"),extend:ps},ms={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4};function vs(e,t){t.classHierarchy.push("vtkAbstractMapper"),e.update=function(){e.getInputData()},e.addClippingPlane=function(r){return!!r.isA("vtkPlane")&&!t.clippingPlanes.includes(r)&&(t.clippingPlanes.push(r),e.modified(),!0)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(r){var n=t.clippingPlanes.indexOf(r);return-1!==n&&(t.clippingPlanes.splice(n,1),e.modified(),!0)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var r=t.length,n=0;n=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,r),fe.obj(e,t),fe.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),vs(e,t)},bs=ms,Ts={OFF:0,NORMALIZED:1,RAW:2};function Ss(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var r=e.getInputData();return r?(t.static||e.update(),t.bounds=r.getBounds()):t.bounds=Dt(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(bs.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(bs.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(bs.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(bs.AVERAGE_INTENSITY_BLEND)},e.setBlendModeToAdditiveIntensity=function(){e.setBlendMode(bs.ADDITIVE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return fe.enumToString(bs,t.blendMode)},e.setAverageIPScalarRange=function(t,r){console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),e.setIpScalarRange(t,r)},e.getFilterModeAsString=function(){return fe.enumToString(Ts,t.filterMode)},e.setFilterModeToOff=function(){e.setFilterMode(Ts.OFF)},e.setFilterModeToNormalized=function(){e.setFilterMode(Ts.NORMALIZED)},e.setFilterModeToRaw=function(){e.setFilterMode(Ts.RAW)}}var Cs={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:bs.COMPOSITE_BLEND,ipScalarRange:[-1e6,1e6],filterMode:Ts.OFF,preferSizeOverAccuracy:!1};function xs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cs,r),ys(e,t,r),fe.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode","filterMode","preferSizeOverAccuracy"]),fe.setGetArray(e,t,["ipScalarRange"],2),fe.event(e,t,"lightingActivated"),Ss(e,t)}var Ps={newInstance:fe.newInstance(xs,"vtkVolumeMapper"),extend:xs};function ws(e,t){const r=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(r[0]*r[1]*r[2]<1||r[1]<2||r[1]<2||r[2]<2)return;const n=ei.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);n.setDimensions(r),n.setOrigin(a),n.setSpacing(o);const i=qt.newInstance({name:"Scalars",values:t,numberOfComponents:1});return n.getPointData().setScalars(i),n.modified(),n}let Os=!1;function As(e,t,r){let n=[],a=0,o=function(){let t={knee:24,thorax:364,abdomen:147}[e],r=[];for(let n=1;n{t.resetImageParsing(),t.readFiles(n,(function(e,n){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),r&&setTimeout(r,3e3,a)}))}))}))}function Ms(e){return e*Math.PI/180}function Is(e){const t=gs.newInstance(),r=Ps.newInstance();r.setSampleDistance(1),t.setMapper(r),r.setInputData(e);const n=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(n[0],n[1]),t}r(666);var Rs=fe.vtkErrorMacro;function Es(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(r){var n=r.getTraverseOperation(),a=e[n];if(a)a(r);else{e.apply(r,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ds,r),fe.obj(e,t),fe.event(e,t,"event"),t._renderableChildMap=new Map,fe.get(e,t,["visited"]),fe.setGet(e,t,["parent","renderable","myFactory"]),fe.getArray(e,t,["children"]),Es(e,t)}var Vs={newInstance:fe.newInstance(Bs,"vtkViewNode"),extend:Bs,PASS_TYPES:["Build","Render"]};function Ls(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(r){if(r.isDeleted())return null;for(var n=0,a=r.getClassName(n++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=r.getClassName(n++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,r){t.overrides[e]=r}}var Ns={};function ks(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ns,r),fe.obj(e,t),Ls(e,t)}var Fs={newInstance:fe.newInstance(ks,"vtkViewNodeFactory"),extend:ks},Gs=Object.create(null);function _s(e,t){Gs[e]=t}function Us(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Ws={};function js(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ws,r),t.overrides=Gs,Fs.extend(e,t,r),Us(0,t)}var zs={newInstance:fe.newInstance(js,"vtkOpenGLViewNodeFactory"),extend:js};function Hs(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var r=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),t.context.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(r){if(r!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||r.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Sa(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),yo(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var n=t.openGLRenderer.getAspectRatio();Sa(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(n,-1,1)),wa(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Ia(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=r}return t.keyMatrices}}var Ks={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};var Xs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},te(e,t,["context","keyMatrixTime"]),Hs(e,t)}));_s("vtkCamera",Xs);var qs=k;function Ys(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(qs("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(r){if(r){var n=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),n|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),n|=a.DEPTH_BUFFER_BIT,t.context.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(n),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],a=e[1]-r[1],o=t.parent.normalizedDisplayToDisplay(n,a),i=Math.round(o[0]),s=Math.round(o[1]),l=e[2]-r[0],c=e[3]-r[1],u=t.parent.normalizedDisplayToDisplay(l,c),d=Math.round(u[0])-i,f=Math.round(u[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var r=0,n=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),r|=n.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,t.context.depthMask(!0)),n.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.clear(r),n.enable(n.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(t.context=t.openGLRenderWindow.getContext()))}}var Zs={context:null,openGLRenderWindow:null,selector:null};var Qs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zs,r),Vs.extend(e,t,r),Q(e,t,["shaderCache"]),te(e,t,["selector"]),Ys(e,t)}),"vtkOpenGLRenderer");_s("vtkRenderer",Qs);var $s={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},Js={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},el={ObjectType:Js};function tl(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}function rl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ol,r),fe.obj(e,t),fe.get(e,t,["openGLRenderWindow"]),al(e,t)}var sl=rl(rl({newInstance:fe.newInstance(il),extend:il},{}),el),ll={FLAT:0,GOURAUD:1,PHONG:2},cl={POINTS:0,WIREFRAME:1,SURFACE:2},ul={Shading:ll,Representation:cl,Interpolation:ll},dl=fe.vtkErrorMacro;function fl(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Js.ARRAY_BUFFER),e.createVBO=function(r,n,a,o){if(!r.getData()||!r.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=o.points.getData(),s=null,l=null,c=null,u=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.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())})),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,c=o.colors.getData(),t.colorBO||(t.colorBO=sl.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,r){for(var n=0;n2)for(var n=0;n2){for(var n=0;n1?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,r){return e>2?3*(e-2):0}},S=null,C=null;a===cl.POINTS||"verts"===n?(S=b.anythingToPoints,C=T.anythingToPoints):a===cl.WIREFRAME||"lines"===n?(S=b["".concat(n,"ToWireframe")],C=T["".concat(n,"ToWireframe")]):(S=b["".concat(n,"ToSurface")],C=T["".concat(n,"ToSurface")]);for(var x=r.getData(),P=x.length,w=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(M[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],M[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],M[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(M[I++]=i[p++],M[I++]=i[p++],M[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,M[I++]=s[g++],M[I++]=s[g++],M[I++]=s[g++]),t.customData.forEach((function(t){h=e*t.components;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pl,r),sl.extend(e,t,r),fe.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),fe.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),fl(e,t)}var ml={newInstance:fe.newInstance(gl),extend:gl},vl=fe.vtkErrorMacro;function hl(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;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,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 r=t.context.getShaderInfoLog(t.handle);return vl("Error compiling shader '".concat(t.source,"': ").concat(r)),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 yl={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function bl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yl,r),fe.obj(e,t),fe.setGet(e,t,["shaderType","source","error","handle","context"]),hl(e,t)}var Tl={newInstance:fe.newInstance(bl,"vtkShader"),extend:bl},Sl=fe.vtkErrorMacro;function Cl(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):(Sl("Links failed: ".concat(t.error)),0):(Sl(t.error),0):(Sl(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(t.fragmentShader.getError()),0):(Sl(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(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 r=t.context.getProgramInfoLog(t.handle);return Sl("Error linking shader ".concat(r)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1f(a,n),!0)},e.setUniformfv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1fv(a,n),!0)},e.setUniformi=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1i(a,n),!0)},e.setUniformiv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1iv(a,n),!0)},e.setUniform2f=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,n,a),!0},e.setUniform2fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2fv(a,n),!0)},e.setUniform2i=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,n,a),!0},e.setUniform2iv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2iv(a,n),!0)},e.setUniform3f=function(r,n,a,o){var i=e.findUniform(r);if(-1===i)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,n,a,o),!0},e.setUniform3fArray=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(!Array.isArray(n)||3!==n.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,n[0],n[1],n[2]),!0},e.setUniform3fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform3fv(a,n),!0)},e.setUniform3i=function(r){var n=e.findUniform(r);if(-1===n)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;for(var a=arguments.length,o=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,xl,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Tl.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Tl.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Tl.newInstance(),t.geometryShader.setShaderType("Geometry"),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),Cl(e,t)}var wl={newInstance:fe.newInstance(Pl,"vtkShaderProgram"),extend:Pl,substitute:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}}};function Ol(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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):r.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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):r.vertexAttribDivisor(i.index+l,0)),r.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,r,n,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,r,n,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(r,n,a,o,i,s,l,c,u,d){if(!r)return!1;if(!r.isBound()||0===n.getHandle()||n.getType()!==Js.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=c,p.isMatrix=d,p.divisor=u,-1===p.Index)return!1;if(n.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),u>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=n.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(r){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Al,r),t.buffers=[],fe.obj(e,t),fe.get(e,t,["supported"]),fe.setGet(e,t,["forceEmulation"]),Ol(e,t)}var Il={newInstance:fe.newInstance(Ml,"vtkOpenGLVertexArrayObject"),extend:Ml};function Rl(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 El={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function Dl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,El,r),fe.obj(e,t),t.shaderSourceTime={},fe.obj(t.shaderSourceTime),t.attributeUpdateTime={},fe.obj(t.attributeUpdateTime),fe.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=wl.newInstance(),t.VAO=Il.newInstance(),t.CABO=ml.newInstance(),Rl(e,t)}var Bl={newInstance:fe.newInstance(Dl),extend:Dl},Vl={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Ll={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Nl={Wrap:Vl,Filter:Ll},kl=new Float32Array(1),Fl=new Int32Array(kl.buffer),Gl=function(e){var t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))},_l=function(e){kl[0]=e;var t=Fl[0],r=t>>16&32768,n=t>>12&2047,a=t>>23&255;return a<103?r:a>142?(r|=31744,r|=(255===a?0:1)&&8388607&t):a<113?r|=((n|=2048)>>114-a)+(n>>113-a&1):(r|=a-112<<10|n>>1,r+=1&n)};function Ul(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 Wl=Nl.Wrap,jl=Nl.Filter,zl=qt.VtkDataTypes,Hl=k,Kl=F,Xl=G;function ql(e,t){var r=this;function n(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],o=t.width*t.height*t.components;if(n&&(o*=t.depth),e!==zl.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var i=0;i=a&&(b=a-1);var T=h-y,S=1-T;y=y*n*o,b=b*n*o;for(var C=0;C=n&&(O=n-1);var A=P-w;w*=o,O*=o;for(var M=0;Ma[l]&&(a[l]=r[i]),i++;for(var c=[],u=[],d=0;d2048||a<-2048||a>2048)return!1}return!0}(n,a)&&!o)}t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t.openGLRenderWindow=r:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(jl.LINEAR),e.setMagnificationFilter(jl.LINEAR)):(e.setMinificationFilter(jl.NEAREST),e.setMagnificationFilter(jl.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Wl.REPEAT),e.setWrapS(Wl.REPEAT),e.setWrapT(Wl.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR));var n=t.renderable.getCanvas();e.create2DFromRaw(n.width,n.height,4,zl.UNSIGNED_CHAR,n,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){var a=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw(a.width,a.height,4,zl.UNSIGNED_CHAR,a.data,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}var o=t.renderable.getInputData(0);if(o&&o.getPointData().getScalars()){for(var i=o.getExtent(),s=o.getPointData().getScalars(),l=[],c=0;ct.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:Xl("impossible case"),e=t.context.getIntegerv(r)===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(r,n){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||Hl("Unable to find suitable internal format for T=".concat(r," NC= ").concat(n)),t.internalFormat},e.getDefaultInternalFormat=function(e,n){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!1))||(a=r.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!0))||(Hl("Unsupported internal texture type!"),Hl("Unable to find suitable internal format for T=".concat(e," NC= ").concat(n))),a},e.setInternalFormat=function(r){r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=function(r,n){return t.format=e.getDefaultFormat(r,n),t.format},e.getDefaultFormat=function(e,r){if(t.openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.openGLRenderWindow.getWebgl2())switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case r&&zl.SHORT:case r&&zl.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case zl.FLOAT:case zl.VOID:default:return t.context.FLOAT}switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case zl.FLOAT:case zl.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;var n=t.context.getExtension("OES_texture_half_float");return n&&t.context.getExtension("OES_texture_half_float_linear")?n.HALF_FLOAT_OES:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.openGLDataType=e.getDefaultDataType(r,n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:e=(r=127.5)-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:e=(r=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:e=(r=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=function(e){switch(e){case jl.NEAREST:return t.context.NEAREST;case jl.LINEAR:return t.context.LINEAR;case jl.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case jl.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case jl.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case jl.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Wl.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Wl.REPEAT:return t.context.REPEAT;case Wl.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(r,o,i,s,l){var c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=[l],d=n(s,u),f=a(d);return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,c),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,f[0]),t.generateMipmap&&t.context.generateMipmap(t.target),c&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),e.deactivate(),!0},e.createCubeFromRaw=function(r,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var c=a(n(s,l)),u=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var S=null;y<=t.maxLevel&&(S=u[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,S),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(r,n,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===zl.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=r,t.height=n,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,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Kl("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(r){if(e.getOpenGLDataType(zl.UNSIGNED_CHAR),e.getInternalFormat(zl.UNSIGNED_CHAR,4),e.getFormat(zl.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=r.width,t.height=r.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var n=!Be(r.width)||!Be(r.height),a=document.createElement("canvas");a.width=n?De(r.width):r.width,a.height=n?De(r.height):r.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(r,0,0,r.width,r.height,0,0,a.width,a.height);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(r,o,i,s,l,c){if(e.getOpenGLDataType(l,!0),e.getInternalFormat(l,s),e.getFormat(l,s),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=s,t.width=r,t.height=o,t.depth=i,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(n(l,[c],!0));return t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFilterableFromRaw=function(r,n,a,s,l,c){for(var u=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=r*n*a,f=[],p=[],g=0;g4096&&(A===zl.FLOAT||s>=3)&&(I=4096);var R=1,E=1;d>I*I&&(E=R=Math.ceil(Math.sqrt(d/(I*I))));var D=Math.sqrt(d)/R;D=De(D);var B,V=Math.floor(D*R/r),L=Math.ceil(a/V),N=De(n*L/E);t.width=D,t.height=N,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=V,t.volumeInfo.yreps=L,t.volumeInfo.xstride=R,t.volumeInfo.ystride=E,t.volumeInfo.offset=w.offset,t.volumeInfo.scale=w.scale;var k=D*N*s;B=A===zl.FLOAT?new Float32Array(k):new Uint8Array(k);for(var F=0,G=Math.floor(r/R),_=Math.floor(n/E),U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yl,r),Vs.extend(e,t,r),t.sendParametersTime={},Z(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},Z(t.textureBuildTime,{mtime:0}),ee(e,t,["format","openGLDataType"]),te(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),Q(e,t,["width","height","volumeInfo","components","handle","target"]),ql(e,t)}var Ql=ie(Zl,"vtkOpenGLTexture"),$l=function(e){for(var t=1;t6&&(F("OpenGL has a limit of 6 clipping planes"),i=6),a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=wl.substitute(o,"//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=o},e.getNeedToRebuildShaders=function(e,r,n){var a=t.openGLTexture.getComponents(),o=n.getProperty().getIndependentComponents();return(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===e.getProgram()||t.lastTextureComponents!==a||t.lastIndependentComponents!==o)&&(t.lastHaveSeenDepthRequest=t.haveSeenDepthRequest,t.lastTextureComponents=a,t.lastIndependentComponents=o,!0)},e.updateShaders=function(r,n,a){if(t.lastBoundBO=r,e.getNeedToRebuildShaders(r,n,a)){var o={Vertex:null,Fragment:null,Geometry:null};e.buildShaders(o,n,a);var i=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);i!==r.getProgram()&&(r.setProgram(i),r.getVAO().releaseGraphicsResources()),r.getShaderSourceTime().modified()}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(r.getProgram());r.getVAO().bind(),e.setMapperShaderParameters(r,n,a),e.setCameraShaderParameters(r,n,a),e.setPropertyShaderParameters(r,n,a)},e.setMapperShaderParameters=function(r,n,a){r.getCABO().getElementCount()&&(t.VBOBuildTime>r.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(r.getProgram().isAttributeUsed("vertexMC")&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"vertexMC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||nc("Error setting vertexMC in shader VAO.")),r.getProgram().isAttributeUsed("tcoordMC")&&r.getCABO().getTCoordOffset()&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"tcoordMC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getTCoordComponents(),t.context.FALSE)||nc("Error setting tcoordMC in shader VAO.")),r.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();r.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l6&&(F("OpenGL has a limit of 6 clipping planes"),I=6);var R=t.currentInput.getWorldToIndex(),E=r.getCABO().getCoordShiftAndScaleEnabled()?r.getCABO().getInverseShiftAndScaleMatrix():null,D=E?Sa(t.imagematinv,a.getMatrix()):a.getMatrix();E&&(wa(D,D),Ia(D,D,E),wa(D,D)),Ia(t.imagematinv,D,R);for(var B=[],V=0;V1?1:0;var H=o.getData(),K=null;if(V===ac.I){K=new H.constructor(_[2]*_[1]*c);for(var X=0,q=0;q<_[2];q++)for(var Y=0;Y<_[1];Y++){var Z=(N+Y*_[0]+q*_[0]*_[1])*c;X=(q*_[1]+Y)*c,K.set(H.subarray(Z,Z+c),X)}_[0]=_[1],_[1]=_[2],W[0]=L,W[1]=F[2],W[2]=F[4],W[3]=L,W[4]=F[3],W[5]=F[4],W[6]=L,W[7]=F[2],W[8]=F[5],W[9]=L,W[10]=F[3],W[11]=F[5]}else if(V===ac.J){K=new H.constructor(_[2]*_[0]*c);for(var Q=0,$=0;$<_[2];$++)for(var J=0;J<_[0];J++){var ee=(J+N*_[0]+$*_[0]*_[1])*c;Q=($*_[0]+J)*c,K.set(H.subarray(ee,ee+c),Q)}_[1]=_[2],W[0]=F[0],W[1]=L,W[2]=F[4],W[3]=F[1],W[4]=L,W[5]=F[4],W[6]=F[0],W[7]=L,W[8]=F[5],W[9]=F[1],W[10]=L,W[11]=F[5]}else V===ac.K||V===ac.NONE?(K=H.subarray(N*U,(N+1)*U),W[0]=F[0],W[1]=F[2],W[2]=L,W[3]=F[1],W[4]=F[2],W[5]=L,W[6]=F[0],W[7]=F[3],W[8]=L,W[9]=F[1],W[10]=F[3],W[11]=L):nc("Reformat slicing not yet supported.");t.openGLTexture.create2DFromRaw(_[0],_[1],c,o.getDataType(),K),t.openGLTexture.activate(),t.openGLTexture.sendParameters(),t.openGLTexture.deactivate();var te=qt.newInstance({numberOfComponents:3,values:W});te.setName("points");var re=qt.newInstance({numberOfComponents:2,values:j});re.setName("tcoords");var ne=new Uint16Array(8);ne[0]=3,ne[1]=0,ne[2]=1,ne[3]=3,ne[4]=3,ne[5]=0,ne[6]=3,ne[7]=2;var ae=qt.newInstance({numberOfComponents:1,values:ne});t.tris.getCABO().createVBO(ae,"polys",cl.SURFACE,{points:te,tcoords:re,cellOffset:0}),t.VBOBuildTime.modified(),t.VBOBuildString=G}}}}}var sc={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};var lc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sc,r),Vs.extend(e,t,r),rc(e,t,r),t.tris=Bl.newInstance(),t.openGLTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.pwfTexture=$l.newInstance(),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),te(e,t,[]),t.VBOBuildTime={},Z(t.VBOBuildTime),ic(e,t)}),"vtkOpenGLImageMapper");function cc(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,r){return e.opaquePass(t,r)},e.opaquePass=function(e,r){e&&t.context.depthMask(!0)},e.translucentPass=function(e,r){t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}_s("vtkImageMapper",lc);var uc={context:null,keyMatrixTime:null,keyMatrices:null};var dc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),cc(e,t)}),"vtkOpenGLImageSlice");function fc(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementVolumeCount()}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.volumePass=function(e){t.renderable&&t.renderable.getVisibility()&&t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.MCWCMatrix,t.renderable.getMatrix()),wa(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?xo(t.normalMatrix):(yo(t.normalMatrix,t.MCWCMatrix),wo(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}_s("vtkImageSlice",dc);var pc={};var gc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),te(e,t,["context"]),fc(e,t)}),"vtkOpenGLVolume");function mc(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(r),e.saveCurrentBuffers(r)},e.saveCurrentBindings=function(e){var r=t.context;t.previousDrawBinding=r.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(r),e.restorePreviousBuffers(r)},e.restorePreviousBindings=function(e){var r=t.context;r.bindFramebuffer(r.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,r){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=r},e.setColorBuffer=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.context,a=n.COLOR_ATTACHMENT0;if(r>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");a+=r}t.colorTexture=e,n.framebufferTexture2D(n.FRAMEBUFFER,a,n.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=t.context,n=r.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");n+=e}r.framebufferTexture2D(r.FRAMEBUFFER,n,r.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var r=t.context;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,e.getHandle(),0)}else F("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 F("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(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 r=t.context,n=$l.newInstance();n.setOpenGLRenderWindow(t.openGLRenderWindow),n.setMinificationFilter(Ll.LINEAR),n.setMagnificationFilter(Ll.LINEAR),n.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,i.UNSIGNED_CHAR,null),e.setColorBuffer(n),t.depthTexture=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthTexture),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthTexture)}}_s("vtkVolume",gc);var vc={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function hc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vc,r),Z(e,t),te(e,t,["colorTexture"]),mc(e,t)}var yc={newInstance:ie(hc,"vtkFramebuffer"),extend:hc};function bc(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 Tc=G,Sc=F;function Cc(e,t){t.classHierarchy.push("vtkOpenGLVolumeMapper"),e.buildPass=function(){t.zBufferTexture=null},e.opaqueZBufferPass=function(e,r){if(e){var n=r.getZBufferTexture();n!==t.zBufferTexture&&(t.zBufferTexture=n)}},e.volumePass=function(r,n){if(r){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.jitterTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.framebuffer.setOpenGLRenderWindow(t.openGLRenderWindow),t.scalarTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.opacityTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLVolume=e.getFirstAncestorOfType("vtkOpenGLVolume");var a=t.openGLVolume.getRenderable();t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer");var o=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(o.getActiveCamera()),e.renderPiece(o,a)}},e.buildShaders=function(t,r,n){e.getShaderTemplate(t,r,n),e.replaceShaderValues(t,r,n)},e.getShaderTemplate=function(e,t,r){e.Vertex="//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 vertexDC;\n\nvarying vec3 vertexVCVSOutput;\nuniform mat4 PCVCMatrix;\n\nuniform float dcxmin;\nuniform float dcxmax;\nuniform float dcymin;\nuniform float dcymax;\n\nvoid main()\n{\n // dcsmall is the device coords reduced to the\n // x y area covered by the volume\n vec4 dcsmall = vec4(\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\n vertexDC.z,\n vertexDC.w);\n vec4 vcpos = PCVCMatrix * dcsmall;\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\n gl_Position = dcsmall;\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkVolumeFS.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 volume mappers fragment shader\n\n// the output of this shader\n//VTK::Output::Dec\n\nvarying vec3 vertexVCVSOutput;\n\n// first declare the settings from the mapper\n// that impact the code paths in here\n\n// always set vtkNumComponents 1,2,3,4\n//VTK::NumComponents\n\n// possibly define vtkTrilinearOn\n//VTK::TrilinearOn\n\n// possibly define vtkIndependentComponents\n//VTK::IndependentComponentsOn\n\n// possibly define any \"proportional\" components\n//VTK::vtkProportionalComponents\n\n// Define the blend mode to use\n#define vtkBlendMode //VTK::BlendMode\n\n// Possibly define vtkImageLabelOutlineOn\n//VTK::ImageLabelOutlineOn\n\n#ifdef vtkImageLabelOutlineOn\nuniform int outlineThickness;\nuniform float vpWidth;\nuniform float vpHeight;\nuniform float vpOffsetX;\nuniform float vpOffsetY;\nuniform mat4 PCWCMatrix;\nuniform mat4 vWCtoIDX;\n#endif\n\n// define vtkLightComplexity\n//VTK::LightComplexity\n#if vtkLightComplexity > 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\nuniform vec4 ipScalarRangeMin;\nuniform vec4 ipScalarRangeMax;\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 trilinear values from multiple z slices\n#ifdef vtkTrilinearOn\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 - vpOffsetX - 0.5) * 2.0,\n (fragCoord.y / vpHeight - vpOffsetY - 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\nbool valueWithinScalarRange(vec4 val, vec4 min, vec4 max) {\n bool withinRange = false;\n #if vtkNumComponents == 1\n if (val.r >= min.r && val.r <= max.r) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents == 2\n if (val.r >= min.r && val.r <= max.r &&\n val.g >= min.g && val.g <= max.g) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 3\n if (all(greaterThanEqual(val, ipScalarRangeMin)) &&\n all(lessThanEqual(val, ipScalarRangeMax))) {\n withinRange = true;\n }\n #endif\n return withinRange;\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 || vtkBlendMode == 4 //AVERAGE_INTENSITY_BLEND || ADDITIVE_BLEND\n vec4 sum = vec4(0.);\n\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\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 if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n // Sum the values across each step in the path\n sum += tValue;\n }\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 IPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n #if vtkBlendMode == 3 // Average\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n #endif\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 (abs(result) < 1e-6)\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(r,n,a){var o=r.Fragment;a.getProperty().getInterpolationType()===Ji.LINEAR&&(o=wl.substitute(o,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===a.getProperty().getUseLabelOutline()&&(o=wl.substitute(o,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();o=wl.substitute(o,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var s=a.getProperty().getIndependentComponents();if(s){o=wl.substitute(o,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var l=[],c=0;c0&&(o=wl.substitute(o,"//VTK::vtkProportionalComponents",l.join("\n")).result)}var u=t.currentInput.getExtent(),d=t.currentInput.getSpacing(),f=new Float64Array(3);In(f,(u[1]-u[0])*d[0],(u[3]-u[2])*d[1],(u[5]-u[4])*d[2]);var p=On(f)/t.renderable.getSampleDistance();o=wl.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(p))).result,o=wl.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var g=1;s&&!t.gopacity&&g0&&(a=wl.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=wl.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)}))}e.Fragment=a},e.replaceShaderClippingPlane=function(e,r,n){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=wl.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=wl.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; 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(r,n,a){var i=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===ms.COMPOSITE_BLEND&&(i=0,t.numberOfLights=0,n.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===i&&(i=1)),1===i&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(i=2),i<3&&e.getPositional()&&(i=3)})));var s=!1;t.lastLightComplexity!==i&&(t.lastLightComplexity=i,s=!0);var l=t.scalarTexture.getComponents(),c=a.getProperty().getIndependentComponents(),u=!1,d=[];if(c){for(var f=0;f0&&(u=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);In(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=On(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:u,iComps:c,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;rr.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(r.getVAO().addAttributeArray(o,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("Error setting vertexDC in shader VAO.")),r.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance());for(var i=t.scalarTexture.getVolumeInfo(),s=t.renderable.getIpScalarRange(),l=[],c=[],u=0;u<4;u++)l[u]=s[0]*i.dataComputedScale[u]+i.dataComputedOffset[u],c[u]=s[1]*i.dataComputedScale[u]+i.dataComputedOffset[u],l[u]=(l[u]-i.offset[u])/i.scale[u],c[u]=(c[u]-i.offset[u])/i.scale[u];if(o.setUniform4f("ipScalarRangeMin",l[0],l[1],l[2],l[3]),o.setUniform4f("ipScalarRangeMax",c[0],c[1],c[2],c[3]),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var d=e.getRenderTargetSize();o.setUniformf("vpWidth",d[0]),o.setUniformf("vpHeight",d[1])}},e.setCameraShaderParameters=function(r,n,a){var o=t.openGLCamera.getKeyMatrices(n),i=t.openGLVolume.getKeyMatrices();Ia(t.modelToView,o.wcvc,i.mcwc);var s=r.getProgram(),l=t.openGLCamera.getRenderable(),c=l.getClippingRange();s.setUniformf("camThick",c[1]-c[0]),s.setUniformf("camNear",c[0]),s.setUniformf("camFar",c[1]);for(var u=t.currentInput.getBounds(),d=t.currentInput.getDimensions(),f=new Float64Array(3),p=new Float64Array(3),g=1,m=-1,v=1,h=-1,y=0;y<8;++y)In(f,u[y%2],u[2+Math.floor(y/2)%2],u[4+Math.floor(y/4)]),Jn(f,f,t.modelToView),l.getParallelProjection()||(Kn(p,f),Gn(f,p,-c[0]/f[2])),Jn(f,f,o.vcpc),g=Math.min(f[0],g),m=Math.max(f[0],m),v=Math.min(f[1],v),h=Math.max(f[1],h);s.setUniformf("dcxmin",g),s.setUniformf("dcxmax",m),s.setUniformf("dcymin",v),s.setUniformf("dcymax",h),s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",l.getParallelProjection());var b=t.currentInput.getExtent(),T=t.currentInput.getSpacing(),S=new Float64Array(3);In(S,(b[1]-b[0]+1)*T[0],(b[3]-b[2]+1)*T[1],(b[5]-b[4]+1)*T[2]),s.setUniform3f("vSpacing",T[0],T[1],T[2]),In(f,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(f,f),Jn(f,f,t.modelToView),s.setUniform3f("vOriginVC",f[0],f[1],f[2]);var C=t.currentInput.getIndexToWorld();Ia(t.idxToView,t.modelToView,C),Mo(t.idxNormalMatrix,o.normalMatrix,i.normalMatrix),Mo(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var x=On(S)/t.renderable.getSampleDistance();x>t.renderable.getMaximumSamplesPerRay()&&Tc("The number of steps required ".concat(Math.ceil(x)," 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=new Float64Array(3);if(In(P,1,1,1),Bn(P,P,S),s.setUniform3f("vVCToIJK",P[0],P[1],P[2]),s.setUniform3i("volumeDimensions",d[0],d[1],d[2]),!t.openGLRenderWindow.getWebgl2()){var w=t.scalarTexture.getVolumeInfo();s.setUniformf("texWidth",t.scalarTexture.getWidth()),s.setUniformf("texHeight",t.scalarTexture.getHeight()),s.setUniformi("xreps",w.xreps),s.setUniformi("xstride",w.xstride),s.setUniformi("ystride",w.ystride)}for(var O=new Float64Array(3),A=new Float64Array(3),M=0;M<6;++M){switch(M){case 1:In(O,-1,0,0),In(A,b[0],b[2],b[4]);break;case 2:In(O,0,1,0),In(A,b[1],b[3],b[5]);break;case 3:In(O,0,-1,0),In(A,b[0],b[2],b[4]);break;case 4:In(O,0,0,1),In(A,b[1],b[3],b[5]);break;case 5:In(O,0,0,-1),In(A,b[0],b[2],b[4]);break;default:In(O,1,0,0),In(A,b[1],b[3],b[5])}ea(O,O,t.idxNormalMatrix),Jn(A,A,t.idxToView);var I=-1*Xn(A,O);if(s.setUniform3f("vPlaneNormal".concat(M),O[0],O[1],O[2]),s.setUniformf("vPlaneDistance".concat(M),I),a.getProperty().getUseLabelOutline()){var R=t.currentInput.getWorldToIndex();s.setUniformMatrix("vWCtoIDX",R),Oa(t.projectionToWorld,o.wcpc),s.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var E=e.getRenderTargetSize();s.setUniformf("vpWidth",E[0]),s.setUniformf("vpHeight",E[1]);var D=e.getRenderTargetOffset();s.setUniformf("vpOffsetX",D[0]/E[0]),s.setUniformf("vpOffsetY",D[1]/E[1])}}switch(Oa(t.projectionToView,o.vcpc),s.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){case 1:case 2:case 3:var B=0,V=[];n.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),r=e.getIntensity();V[0]=t[0]*r,V[1]=t[1]*r,V[2]=t[2]*r,s.setUniform3fArray("lightColor".concat(B),V);var n=e.getDirection();In(O,n[0],n[1],n[2]),ea(O,O,o.normalMatrix),s.setUniform3f("lightDirectionVC".concat(B),O[0],O[1],O[2]);var a=[-.5*O[0],-.5*O[1],-.5*(O[2]-1)];s.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}}))}},e.setPropertyShaderParameters=function(e,r,n){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=n.getProperty(),s=t.scalarTexture.getComponents(),l=n.getProperty().getIndependentComponents();if(l&&s>=2)for(var c=0;c0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,r,n){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(r),o=[],i=[],s=t.renderable.getClippingPlanes(),l=s.length,c=0;c1.5&&(t._useSmallViewport=!0),t._animationRateSubscription||(t._animationRateSubscription=a.onAnimationFrameRateUpdate((function(){if(t.renderable.getAutoAdjustSampleDistances()){var e=a.getRecentAnimationFrameRate(),r=a.getDesiredUpdateRate()/e;(r>1.15||r<.85)&&(t._lastScale*=r),t._lastScale>400&&(t._lastScale=400),t._lastScale<1.5&&(t._lastScale=1.5)}else t._lastScale=t.renderable.getImageSampleDistance()*t.renderable.getImageSampleDistance();var n=t.openGLRenderWindow.getFramebufferSize();t._smallViewportWidth=Math.ceil(n[0]/Math.sqrt(t._lastScale)),t._smallViewportHeight=Math.ceil(n[1]/Math.sqrt(t._lastScale))}))),t._useSmallViewport){var o=t.openGLRenderWindow.getFramebufferSize();if(t._smallViewportHeight>o[1]&&(t._smallViewportHeight=o[1]),t._smallViewportWidth>o[0]&&(t._smallViewportWidth=o[0]),t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer();else{var i=t.framebuffer.getSize();i[0]===o[0]&&i[1]===o[1]||(t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var s=t.context;s.clearColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clear(s.COLOR_BUFFER_BIT),s.viewport(0,0,t._smallViewportWidth,t._smallViewportHeight),t.fvp=[t._smallViewportWidth/o[0],t._smallViewportHeight/o[1]]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(r,n),n.getProperty().getInterpolationType()===Ji.NEAREST?(t.scalarTexture.setMinificationFilter(Ll.NEAREST),t.scalarTexture.setMagnificationFilter(Ll.NEAREST)):(t.scalarTexture.setMinificationFilter(Ll.LINEAR),t.scalarTexture.setMagnificationFilter(Ll.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(r,n){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,r,n),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,r){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t._useSmallViewport){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 n=t.copyShader;t.copyVAO=Il.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(n,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("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 o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.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()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(r,n){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)):Sc("No input!")},e.computeBounds=function(r,n){e.getInput()?t.bounds=e.getInput().getBounds():St(t.Bounds)},e.updateBufferObjects=function(t,r){e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r)},e.getNeedToRebuildBufferObjects=function(r,n){return t.VBOBuildTime.getMTime()1?1:-1,E[3*D+2]=-1;var B=new Uint16Array(8);B[0]=3,B[1]=0,B[2]=1,B[3]=3,B[4]=3,B[5]=0,B[6]=3,B[7]=2;var V=qt.newInstance({numberOfComponents:3,values:E});V.setName("points");var L=qt.newInstance({numberOfComponents:1,values:B});t.tris.getCABO().createVBO(L,"polys",cl.SURFACE,{points:V,cellOffset:0})}t.VBOBuildTime.modified()}}}}var xc={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};var Pc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xc,r),Vs.extend(e,t,r),t.VBOBuildTime={},Z(t.VBOBuildTime,{mtime:0}),t.tris=Bl.newInstance(),t.scalarTexture=$l.newInstance(),t.opacityTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.jitterTexture=$l.newInstance(),t.jitterTexture.setWrapS(Vl.REPEAT),t.jitterTexture.setWrapT(Vl.REPEAT),t.framebuffer=yc.newInstance(),t.idxToView=Pa(new Float64Array(16)),t.idxNormalMatrix=xo(new Float64Array(9)),t.modelToView=Pa(new Float64Array(16)),t.projectionToView=Pa(new Float64Array(16)),t.projectionToWorld=Pa(new Float64Array(16)),t._lastScale=1,te(e,t,["context"]),Cc(e,t)}),"vtkOpenGLVolumeMapper");_s("vtkVolumeMapper",Pc);var wc=k;function Oc(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=n.getZBufferTexture(),c=Math.floor(l.getWidth()),u=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():wc("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(c*u*4),d.viewport(0,0,c,u),d.readPixels(0,0,c,u,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,r){e&&t.renderable.getUseZValues()&&r.requestDepth()}}var Ac={};var Mc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ac,r),Vs.extend(e,t,r),Oc(e,t)}),"vtkOpenGLPixelSpaceCallbackMapper");_s("vtkPixelSpaceCallbackMapper",Mc);var Ic=Object.create(null);function Rc(e,t){Ic[e]=t}function Ec(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}var Dc={};function Bc(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getProjectionMatrix=function(e,r,n,a){if(Pa(e),t.renderable.getParallelProjection()){var o=t.renderable.getParallelScale(),i=o*r,s=o,l=(a[0]-1)*i,c=(a[0]+1)*i,u=(a[1]-1)*s,d=(a[1]+1)*s,f=1/(c-l),p=1/(d-u);e[0]=2*f,e[5]=2*p,e[10]=1/(n[1]-n[0]),e[12]=(c+l)*f,e[13]=(d+u)*p,e[14]=n[1]/(n[1]-n[0])}else{var g,m,v=Math.tan(Math.PI*t.renderable.getViewAngle()/360);!0===t.renderable.getUseHorizontalViewAngle()?(g=n[0]*v,m=n[0]*v/r):(g=n[0]*v*r,m=n[0]*v);var h=(a[0]-1)*g,y=(a[0]+1)*g,b=(a[1]-1)*m,T=(a[1]+1)*m;e[0]=2*n[0]/(y-h),e[5]=2*n[0]/(T-b),e[12]=(h+y)/(y-h),e[13]=(b+T)/(T-b),e[10]=0,e[14]=n[0],e[11]=-1,e[15]=0}},e.convertToOpenGLDepth=function(e){if(t.renderable.getParallelProjection())return 1-e;var r=t.renderable.getClippingRangeByReference(),n=-r[0]/e;return.5*(n=(r[0]+r[1])/(r[1]-r[0])+2*r[0]*r[1]/(n*(r[1]-r[0])))+.5},e.getKeyMatrices=function(r){var n=r.getRenderable(),a=r.getParent();if(Math.max(a.getMTime(),e.getMTime(),n.getMTime(),t.renderable.getMTime(),r.getStabilizedTime())>t.keyMatrixTime.getMTime()){var o=t.renderable.getViewMatrix();Sa(t.keyMatrices.normalMatrix,o),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,o);var i=r.getStabilizedCenterByReference();Ra(t.keyMatrices.scvc,t.keyMatrices.wcvc,i);var s=r.getAspectRatio(),l=t.renderable.getClippingRangeByReference();e.getProjectionMatrix(t.keyMatrices.vcpc,s,l,t.renderable.getWindowCenterByReference()),Ia(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),Oa(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dc,r),t.overrides=Ic,Fs.extend(e,t,r),Ec(0,t)}),"vtkWebGPUViewNodeFactory");var Vc={keyMatrixTime:null,keyMatrices:null};var Lc=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,r),Vs.extend(e,t,r),t.keyMatrixTime={},fe.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},fe.setGet(e,t,["keyMatrixTime"]),Bc(e,t)}));function Nc(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=function(r){if(t.bindables.length===r.length){for(var n=!0,a=0;an?o:n}if(n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kc,r),fe.obj(e,t),t.bindables=[],t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),fe.setGet(e,t,["label","device","arrayInformation","sourceTime"]),Nc(e,t)}var Gc={newInstance:fe.newInstance(Fc),extend:Fc};function _c(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,r){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}}var Uc={device:null,handle:null};function Wc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uc,r),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["device","handle"]),_c(e,t)}var jc={newInstance:fe.newInstance(Wc,"vtkWebGPUShaderModule"),extend:Wc};function zc(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var r=e.getType(),n=e.getHash(),a=t._shaderModules.keys(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hc,r),t._shaderModules=new Map,fe.obj(e,t),fe.setGet(e,t,["device","window"]),zc(e,t)}fe.newInstance(Kc,"vtkWebGPUShaderCache");var Xc=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}};function qc(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e,r){t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;for(var n=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yc,r),Z(e,t),t.layouts=[],t.shaderDescriptions=[],Q(e,t,["handle","pipelineDescription"]),te(e,t,["device","renderEncoder","topology","vertexState"]),qc(e,t)}var Qc={newInstance:ie(Zc,"vtkWebGPUPipeline"),extend:Zc};function $c(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=function(e,r){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=function(e,r){t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=function(e,r){var n=[],a=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=e.getOutputInterpolationsByReference(),c=0;c1&&(o.push("};"),a=o,n[n.length-1]+=",",n.push("input: ".concat(t.type,"Input")))}if(n.length&&(t.code=Xc(t.code,"//VTK::IOStructs::Input",n).result),t.outputNames.length+t.builtinOutputNames.length){for(var d=["struct ".concat(t.type,"Output\n{")],f=0;f ".concat(t.type,"Output")]).result}t.code=Xc(t.code,"//VTK::IOStructs::Dec",a).result}}var Jc={type:null,hash:null,code:null,outputNames:null,outputTypes:null};function eu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jc,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],fe.obj(e,t),fe.setGet(e,t,["type","hash","code"]),fe.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),$c(e,t)}var tu={newInstance:fe.newInstance(eu,"vtkWebGPUShaderDescription"),extend:eu},ru={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"},r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}},nu=function(e){return!e||e.length<6?0:e in ru==1?ru[e]:(F("unknown format ".concat(e)),null)},au=function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var r=1===t?e.length-1:e.length-3,n=Number(e[r]);return Number.isNaN(n)?(F("unknown format ".concat(e)),0):t*(5-n/2)},ou=function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void F("unknown format ".concat(e));t="Uint"}var r=e.split("x")[0],n=Number(r[r.length-1]);if(!Number.isNaN(n))return(t+=8*(5-n/2))+"Array";F("unknown format ".concat(e))},iu=function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void F("unknown format ".concat(e));t="u32"}var r=1;return"x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r?"vec4<".concat(t,">"):3===r?"vec3<".concat(t,">"):2===r?"vec2<".concat(t,">"):t},su=function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},lu=function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void F("unknown format ".concat(e))};function cu(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"vertex",a=r;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0}))},e.removeBufferIfPresent=function(e){for(var r=0;r0&&(e+=",\n"),e="".concat(e," @location(").concat(r,") ").concat(t.inputs[n].names[a]," : ").concat(i),r++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var r=[],n=0,a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,du,r),Z(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],te(e,t,["created","device","handle"]),uu(e,t)}var pu={newInstance:ie(fu,"vtkWebGPUVertexInput"),extend:fu},gu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",mu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function vu(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(r,n,a){var o=tu.newInstance({type:"vertex",hash:r,code:t.vertexShaderTemplate}),i=tu.newInstance({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),s=n.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,c=new RegExp("//VTK::[^:]*::","g"),u=l.match(c).filter((function(e,t,r){return r.indexOf(e)===t})),d=u.map((function(e){return"replaceShader".concat(e.substring(7,e.length-2))})),f=0;f","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,r){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),r.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(r,n){e.build(r,n),r.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(r),e.renderForPipeline(r)},e.getBindables=function(){var e=f(t.additionalBindables);t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hu,r),fe.obj(e,t),t.textureViews=[],t.vertexInput=pu.newInstance(),t.bindGroup=Gc.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||mu,t.vertexShaderTemplate=t.vertexShaderTemplate||gu,t.shaderReplacements=new Map,fe.get(e,t,["vertexInput"]),fe.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),vu(e,t)}var bu={newInstance:fe.newInstance(yu,"vtkWebGPUMapperHelper"),extend:yu};function Tu(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var r=e.build;e.build=function(e,n){var a=n.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,r(e,n)}}var Su={};function Cu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Su,r),bu.extend(e,t,r),Tu(e,t)}var xu={newInstance:fe.newInstance(Cu,"vtkWebGPUFullScreenQuad"),extend:Cu},Pu={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,CellIndex:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function wu(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 Ou=["getMappedRange","mapAsync","unmap"];function Au(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=function(e){!function(e,t,r,n){var a=n.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(n)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,0,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=e.byteLength,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var r=function(r){e[Ou[r]]=function(){var e;return(e=t.handle)[Ou[r]].apply(e,arguments)}},n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mu,r),fe.obj(e,t),fe.get(e,t,["handle","sizeInBytes","usage"]),fe.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),Au(e,t)}var Ru=function(e){for(var t=1;t0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var r=0;r<3;r++)t.color[r]=e*(t.ambient*t.ambientColor[r]+t.diffuse*t.diffuseColor[r]+t.specular*t.specularColor[r]);return[].concat(t.color)},e.addShaderVariable=Vu("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(Bu.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(Bu.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(Bu.PHONG)},e.getInterpolationAsString=function(){return fe.enumToString(Bu,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Du.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Du.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Du.POINTS)},e.getRepresentationAsString=function(){return fe.enumToString(Du,t.representation)}}var Nu={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:Bu.GOURAUD,representation:Du.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function ku(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nu,r),fe.obj(e,t),fe.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),fe.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),Lu(e,t)}var Fu=function(e){for(var t=1;t1?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,r){return numPoints>2?3*(e-2):0}};function Ku(e){switch(e){case Wu.Points:return"points";case Wu.Lines:return"lines";case Wu.Triangles:case Wu.TriangleEdges:return"polys";case Wu.TriangleStripEdges:case Wu.TriangleStrips:return"strips";default:return""}}function Xu(e,t,r){var n=null;n=t===ju.POINTS||"points"===r?Hu.anythingToPoints:t===ju.WIREFRAME||"lines"===r?Hu["".concat(r,"ToWireframe")]:Hu["".concat(r,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zu,r),Z(e,t),te(e,t,["device"]),Yu(e,t)}var $u=_u(_u({newInstance:ie(Qu),extend:Qu},{}),Pu),Ju=$u.BufferUsage,ed=fe.vtkErrorMacro;function td(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,r){t._bufferEntryNames.has(e)?ed("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:su(r),offset:-1,nativeType:lu(r),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,r=[],n=4,a=0;a4&&(P.packed=!0,P.offset=e,r.push(P),e+=P.sizeInBytes)}for(var w=0;w ").concat(t.label,": ").concat(t.label,"Struct;")),a.join("\n")}}var rd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function nd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},fe.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,fe.get(e,t,["binding","bindGroupTime"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),td(e,t)}var ad={newInstance:fe.newInstance(nd,"vtkWebGPUUniformBuffer"),extend:nd},od=k;function id(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;t.camera=t.renderable.getActiveCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.camera),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),t.webgpuCamera=e.getViewNodeFor(t.camera),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.camera.getClippingRange(),r=t.camera.getPositionByReference(),n=[],a=[];Gn(a,t.camera.getDirectionOfProjectionByReference(),.5*(e[0]+e[1])),Rn(n,r,a),da(a,n,t.stabilizedCenter),va(a)/(e[1]-e[0])>t.recenterThreshold&&(t.stabilizedCenter=n,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(od("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,r){for(var n=0;nr||e.getMTime()>r||t.camera.getMTime()>r||t.renderable.getMTime()>r){var n=t.webgpuCamera.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",n.wcvc),t.UBO.setArray("SCPCMatrix",n.scpc),t.UBO.setArray("PCSCMatrix",n.pcsc),t.UBO.setArray("SCVCMatrix",n.scvc),t.UBO.setArray("VCPCMatrix",n.vcpc),t.UBO.setArray("WCVCNormals",n.normalMatrix);var a=e.getYInvertedTiledSizeAndOrigin();t.UBO.setArray("viewportSize",[a.usize,a.vsize]),t.UBO.setValue("cameraParallel",t.camera.getParallelProjection());var o=t.parent.getDevice();t.UBO.sendIfNeeded(o)}},e.scissorAndViewport=function(t){var r=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize,0,1),t.getHandle().setScissorRect(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var n=0;n = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n");var r=ad.newInstance({label:"mapperUBO"});r.addEntry("BackgroundColor","vec4"),t.clearFSQ.setUBO(r)}var n=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",n),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sd,r),Vs.extend(e,t,r),t.UBO=ad.newInstance({label:"rendererUBO"}),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("viewportSize","vec2"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=Gc.newInstance({label:"rendererBG"}),t.bindGroup.setBindables([t.UBO]),t.tmpMat4=Pa(new Float64Array(16)),t.stabilizedTime={},Z(t.stabilizedTime,{mtime:0}),Q(e,t,["bindGroup","stabilizedTime"]),re(e,t,["stabilizedCenter"]),te(e,t,["renderEncoder","selector","suppressClear","UBO"]),id(e,t)}),"vtkWebGPURenderer");Rc("vtkRenderer",ld);var cd=$u.BufferUsage,ud=fe.vtkErrorMacro;function dd(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,r){if(t._bufferEntryNames.has(e))ud("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var n=su(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:lu(r)}),t.sizeInBytes+=n}},e.send=function(e){if(!t._buffer){var r={nativeArray:t.Float32Array,time:0,usage:cd.Storage,label:t.label};return t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=fe.newTypedArray(e,t.arrayBuffer))},e.setValue=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else ud("entry named ".concat(r," not found in UBO"))},e.setArray=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT,c=0;c;\n};\n@binding(").concat(e,") @group(").concat(r,") var ").concat(t.label,": ").concat(t.label,"Struct;\n")),n.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}var fd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function pd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},fe.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},fe.get(e,t,["bindGroupTime"]),fe.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),dd(e,t)}var gd={newInstance:fe.newInstance(pd,"vtkWebGPUStorageBuffer"),extend:pd};function md(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=function(e,r){return"@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}var vd={device:null,handle:null,label:null,options:null};function hd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vd,r),fe.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","options"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label"]),md(e,t)}var yd={newInstance:fe.newInstance(hd),extend:hd},bd=$s,Td="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n\n // var computedColor: vec4 = vec4(1.0,0.7, 0.5, 1.0);\n\n//VTK::RenderEncoder::Impl\n\n return output;\n}\n",Sd=new Float64Array(16),Cd=new Float64Array(16),xd=new Float64Array(16),Pd=new Float64Array(4),wd=new Float64Array(4);function Od(e,t){t.classHierarchy.push("vtkWebGPUImageMapper"),e.buildPass=function(r){if(r){t.WebGPUImageSlice=e.getFirstAncestorOfType("vtkWebGPUImageSlice"),t.WebGPURenderer=t.WebGPUImageSlice.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice();var n=t.WebGPURenderer.getRenderable();t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(n.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.render=function(){t.renderable.update(),t.currentInput=t.renderable.getInputData(),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.build(t.renderEncoder,t.device),e.updateUBO(t.device)},e.computePipelineHash=function(){var e=t.currentInput.getExtent();e[0]===e[1]||e[2]===e[3]||e[4]===e[5]?(t.dimensions=2,t.pipelineHash="img2"):(t.dimensions=3,t.pipelineHash="img3")},e.updateUBO=function(r){var n=t.UBO.getSendTime(),a=t.WebGPUImageSlice.getRenderable(),o=a.getMapper();if(e.getMTime()>n||t.renderable.getMTime()>n||a.getProperty().getMTime()>n){var i=o.getInputData(),s=t.WebGPURenderer.getStabilizedCenterByReference();Pa(Sd),Ra(Sd,Sd,s);var l=a.getMatrix();wa(Cd,l),Oa(Cd,Cd),Ia(Sd,Cd,Sd);var c=i.getWorldToIndex();Ia(Sd,c,Sd),Oa(xd,Sd);var u=i.getDimensions();Pa(Cd),Ea(Cd,Cd,[1/u[0],1/u[1],1/u[2]]),Ia(Sd,Cd,Sd),t.UBO.setArray("SCTCMatrix",Sd);var d=t.currentInput.getExtent(),f=t.renderable.getClosestIJKAxis().ijkMode,p=t.renderable.getSlice();f!==t.renderable.getSlicingMode()&&(p=t.renderable.getSliceAtPosition(p));var g=2,m=0,v=1;f===bd.I?(g=0,m=1,v=2):f===bd.J&&(g=1,m=2,v=0),Pd[g]=p,Pd[m]=d[2*m],Pd[v]=d[2*v],Pd[3]=1,ri(Pd,Pd,xd),t.UBO.setArray("Origin",Pd),wd[g]=p,wd[m]=d[2*m+1],wd[v]=d[2*v],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis1",wd),wd[g]=p,wd[m]=d[2*m],wd[v]=d[2*v+1],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis2",wd);for(var h=[1,1,1,1],y=[0,0,0,0],b=t.helper.getTextureViews()[0],T=b.getTexture().getScale(),S=b.getTexture().getNumberOfComponents(),C=0;C","@builtin(position) Position");var o=a.getCode(),i=["var pos: vec4 = mapperUBO.Origin +"," (vertexBC.x * 0.5 + 0.5) * mapperUBO.Axis1 + (vertexBC.y * 0.5 + 0.5) * mapperUBO.Axis2;","pos.w = 1.0;"];2===t.dimensions?i.push("var tcoord : vec2 = (mapperUBO.SCTCMatrix * pos).xy;"):i.push("var tcoord : vec3 = (mapperUBO.SCTCMatrix * pos).xyz;"),i.push("output.tcoordVS = tcoord;","output.Position = rendererUBO.SCPCMatrix * pos;"),o=Xc(o,"//VTK::Position::Impl",i).result,a.setCode(o)},r.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,r,n){var a=r.getShaderDescription("vertex");2===t.dimensions?a.addOutput("vec2","tcoordVS"):a.addOutput("vec3","tcoordVS")},r.set("replaceShaderTCoord",e.replaceShaderTCoord),e.replaceShaderImage=function(e,r,n){var a=r.getShaderDescription("fragment"),o=a.getCode();t.dimensions,o=Xc(o,"//VTK::Image::Sample",[" var computedColor: vec4 ="," textureSampleLevel(imgTexture, clampSampler, input.tcoordVS, 0.0);","//VTK::Image::Sample"]).result,o=Xc(o,"//VTK::Image::Sample",[" var coord: vec2 ="," vec2(computedColor.r * mapperUBO.cScale.r + mapperUBO.cShift.r, 0.5);"," computedColor = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);"]).result,a.setCode(o)},r.set("replaceShaderImage",e.replaceShaderImage)}var Ad={rowLength:1024};var Md=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,r),Vs.extend(e,t,r),t.helper=xu.newInstance(),t.helper.setFragmentShaderTemplate(Td),t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("SCTCMatrix","mat4x4"),t.UBO.addEntry("Origin","vec4"),t.UBO.addEntry("Axis2","vec4"),t.UBO.addEntry("Axis1","vec4"),t.UBO.addEntry("cScale","vec4"),t.UBO.addEntry("cShift","vec4"),t.helper.setUBO(t.UBO),t.SSBO=gd.newInstance({label:"volumeSSBO"}),t.componentSSBO=gd.newInstance({label:"componentSSBO"}),t.lutBuildTime={},Z(t.lutBuildTime,{mtime:0}),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),t.VBOBuildTime={},Z(t.VBOBuildTime),Od(e,t)}),"vtkWebGPUImageMapper");function Id(e,t){t.classHierarchy.push("vtkWebGPUImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageMapper",Md);var Rd={bufferShift:void 0,keyMatrixTime:null,keyMatrices:null,propID:void 0};var Ed=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rd,r),Vs.extend(e,t,r),t.keyMatricesTime={},Z(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},t.bufferShift=[0,0,0,0],Q(e,t,["propID","keyMatricesTime"]),Id(e,t)}),"vtkWebGPUImageSlice");function Dd(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),t.renderable.getMapper().update(),e.removeUnusedNodes())},e.queryPass=function(r,n){if(r){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;n.addVolume(e)}};var r=new Float64Array(3),n=new Float64Array(3);e.getBoundingCubePoints=function(e,a){var o=t.renderable.getMapper().getInputData();if(o)for(var i=o.getExtent(),s=t.renderable.getMatrix(),l=0,c=4;c<6;c++){r[2]=i[c];for(var u=2;u<4;u++){r[1]=i[u];for(var d=0;d<2;d++){r[0]=i[d],o.indexToWorld(r,n);var f=a+3*l;e[f++]=s[0]*n[0]+s[1]*n[1]+s[2]*n[2]+s[3],e[f++]=s[4]*n[0]+s[5]*n[1]+s[6]*n[2]+s[7],e[f++]=s[8]*n[0]+s[9]*n[1]+s[10]*n[2]+s[11],l++}}}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();wa(t.keyMatrices.bcwc,r),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageSlice",Ed);var Bd={propID:void 0,keyMatricesTime:null};var Vd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bd,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),Dd(e,t)}),"vtkWebGPUVolume");function Ld(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}Rc("vtkVolume",Vd);var Nd={};var kd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nd,r),Vs.extend(e,t,r),Ld(e,t)}),"vtkWebGPUPixelSpaceCallbackMapper");function Fd(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(r){if(r){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 n=0;nt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?xo(t.keyMatrices.normalMatrix):(yo(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Po(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}Rc("vtkPixelSpaceCallbackMapper",kd);var Gd={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};var _d=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gd,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),Fd(e,t)}));function Ud(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(r){if(r){if(!t.renderable)return;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 n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wd,r),Vs.extend(e,t,r),te(e,t,["context"]),Q(e,t,["activeTextures"]),Ud(e,t)}));_s("vtkActor2D",jd);var zd=Math.sqrt(50),Hd=Math.sqrt(10),Kd=Math.sqrt(2);function Xd(e,t,r){var n=(t-e)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,a);return a>=0?(o>=zd?10:o>=Hd?5:o>=Kd?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=zd?10:o>=Hd?5:o>=Kd?2:1)}function qd(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function Yd(e){let t=e,r=e,n=e;function a(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<0?a=r+1:o=r}while(ae(t)-r,r=qd,n=(t,r)=>qd(e(t),r)),{left:a,center:function(e,r,n=0,o=e.length){const i=a(e,r,n,o-1);return i>n&&t(e[i-1],r)>-t(e[i],r)?i-1:i},right:function(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<=0?a=r+1:o=r}while(a>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Tf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Tf(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=cf.exec(e))?new xf(t[1],t[2],t[3],1):(t=uf.exec(e))?new xf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=df.exec(e))?Tf(t[1],t[2],t[3],t[4]):(t=ff.exec(e))?Tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pf.exec(e))?Af(t[1],t[2]/100,t[3]/100,1):(t=gf.exec(e))?Af(t[1],t[2]/100,t[3]/100,t[4]):mf.hasOwnProperty(e)?bf(mf[e]):"transparent"===e?new xf(NaN,NaN,NaN,0):null}function bf(e){return new xf(e>>16&255,e>>8&255,255&e,1)}function Tf(e,t,r,n){return n<=0&&(e=t=r=NaN),new xf(e,t,r,n)}function Sf(e){return e instanceof tf||(e=yf(e)),e?new xf((e=e.rgb()).r,e.g,e.b,e.opacity):new xf}function Cf(e,t,r,n){return 1===arguments.length?Sf(e):new xf(e,t,r,null==n?1:n)}function xf(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Pf(){return"#"+Of(this.r)+Of(this.g)+Of(this.b)}function wf(){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 Of(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Af(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new If(e,t,r,n)}function Mf(e){if(e instanceof If)return new If(e.h,e.s,e.l,e.opacity);if(e instanceof tf||(e=yf(e)),!e)return new If;if(e instanceof If)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(i=t===o?(r-n)/s+6*(r0&&l<1?0:i,new If(i,s,l,e.opacity)}function If(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Rf(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function Ef(e,t,r,n,a){var o=e*e,i=o*e;return((1-3*e+3*o-i)*t+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*n+i*a)/6}Jd(tf,yf,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:vf,formatHex:vf,formatHsl:function(){return Mf(this).formatHsl()},formatRgb:hf,toString:hf}),Jd(xf,Cf,ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new xf(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new xf(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:Pf,formatHex:Pf,formatRgb:wf,toString:wf})),Jd(If,(function(e,t,r,n){return 1===arguments.length?Mf(e):new If(e,t,r,null==n?1:n)}),ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new If(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new If(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new xf(Rf(e>=240?e-240:e+120,a,n),Rf(e,a,n),Rf(e<120?e+240:e-120,a,n),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+")")}}));const Df=e=>()=>e;function Bf(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Df(isNaN(e)?t:e)}const Vf=function e(t){var r=function(e){return 1==(e=+e)?Bf:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Df(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Cf(e)).r,(t=Cf(t)).r),a=r(e.g,t.g),o=r(e.b,t.b),i=Bf(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=a(t),e.b=o(t),e.opacity=i(t),e+""}}return n.gamma=e,n}(1);function Lf(e){return function(t){var r,n,a=t.length,o=new Array(a),i=new Array(a),s=new Array(a);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],i=n>0?e[n-1]:2*a-o,s=no&&(a=t.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(r=r[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,l.push({i,x:Ff(r,n)})),o=Uf.lastIndex;return ot&&(r=e,e=t,t=r),c=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?Qf:Zf,a=o=null,d}function d(t){return null==t||isNaN(t=+t)?r:(a||(a=n(i.map(e),s,l)))(e(c(t)))}return d.invert=function(r){return c(t((o||(o=n(s,i.map(e),Ff)))(r)))},d.domain=function(e){return arguments.length?(i=Array.from(e,Kf),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Hf,u()},d.clamp=function(e){return arguments.length?(c=!!e||qf,u()):c!==qf},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,u()}}()(qf,qf)}function ep(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var tp,rp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=rp.exec(e)))throw new Error("invalid format: "+e);var t;return new ap({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 ap(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 op(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ip(e){return(e=op(Math.abs(e)))?e[1]:NaN}function sp(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}np.prototype=ap.prototype,ap.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};const lp={"%":(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)=>sp(100*e,t),r:sp,s:function(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(tp=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=n.length;return o===i?n:o>i?n+new Array(o-i+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+op(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cp(e){return e}var up,dp,fp,pp=Array.prototype.map,gp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mp(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,a,o,i,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t0){let r=Math.round(e/i),n=Math.round(t/i);for(r*it&&--n,o=new Array(a=n-r+1);++st&&--n,o=new Array(a=n-r+1);++s=zd?a*=10:o>=Hd?a*=5:o>=Kd&&(a*=2),t0;){if((a=Xd(l,c,r))===n)return o[i]=l,o[s]=c,t(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a}n=a}return e},e}function vp(){var e=Jf();return e.copy=function(){return $f(e,vp())},ep.apply(e,arguments),mp(e)}function hp(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}up=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?cp:(t=pp.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var a=e.length,o=[],i=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(a-=s,a+s)),!((l+=s+1)>n));)s=t[i=(i+1)%t.length];return o.reverse().join(r)}),a=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?cp:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(pp.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=np(e)).fill,r=e.align,d=e.sign,f=e.symbol,p=e.zero,g=e.width,m=e.comma,v=e.precision,h=e.trim,y=e.type;"n"===y?(m=!0,y="g"):lp[y]||(void 0===v&&(v=12),h=!0,y="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===f?a:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",T="$"===f?o:/[%p]/.test(y)?l:"",S=lp[y],C=/[defgprs%]/.test(y);function x(e){var a,o,l,f=b,x=T;if("c"===y)x=S(e)+x,e="";else{var P=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),v),h&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),P&&0==+e&&"+"!==d&&(P=!1),f=(P?"("===d?d:c:"-"===d||"("===d?"":d)+f,x=("s"===y?gp[8+tp/3]:"")+x+(P&&"("===d?")":""),C)for(a=-1,o=e.length;++a(l=e.charCodeAt(a))||l>57){x=(46===l?i+e.slice(a+1):e.slice(a))+x,e=e.slice(0,a);break}}m&&!p&&(e=n(e,1/0));var w=f.length+e.length+x.length,O=w>1)+f+e+x+O.slice(w);break;default:e=O+f+e+x}return s(e)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),x.toString=function(){return e+""},x}return{format:d,formatPrefix:function(e,t){var r=d(((e=np(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(ip(t)/3))),a=Math.pow(10,-n),o=gp[8+n/3];return function(e){return r(a*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),dp=up.format,fp=up.formatPrefix;var yp=fe.vtkDebugMacro;function bp(e,t){t.classHierarchy.push("vtkActor");var r=function(e){for(var t=1;t=1;return(r=r&&(!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=Fu.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 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||r[0]!==t.mapperBounds[0]||r[1]!==t.mapperBounds[1]||r[2]!==t.mapperBounds[2]||r[3]!==t.mapperBounds[3]||r[4]!==t.mapperBounds[4]||r[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){yp("Recomputing bounds..."),t.mapperBounds=r.concat();var n=[];Hr.getCorners(r,n),e.computeMatrix();var a=new Float64Array(16);wa(a,t.matrix),n.forEach((function(e){return Jn(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?n.reduce((function(e,r){return e>r[t/2]?r[t/2]:e}),e):n.reduce((function(e,r){return ee?n: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 r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var Tp={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function Sp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tp,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),bp(e,t)}var Cp={newInstance:fe.newInstance(Sp,"vtkActor"),extend:Sp};function xp(e,t){e.getBounds=function(){return 0},e.getBounds=function(r){e.getBounds();for(var n=0;n<6;n++)r[n]=t.bounds[n]},e.getCenter=function(){e.getBounds();for(var r=0;r<3;r++)t.center[r]=(t.bounds[2*r+1]+t.bounds[2*r])/2;return t.center.slice()},e.getLength=function(){var r=0,n=0;e.getBounds();for(var a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return Math.sqrt(n)}}var Pp={bounds:[1,-1,1,-1,1,-1],center:[0,0,0]},wp=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,r),ys(e,t,r),t.bounds||St(t.bounds),t.center||(t.center=[0,0,0]),xp(e,t)},Op=fe.vtkErrorMacro;function Ap(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+1+1.5:(r=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(r,n,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var c=e.getAlpha(),u=r.getNumberOfTuples(),d=r.getNumberOfComponents(),f=n.getData(),p=r.getData();if(c>=1){if(a===hi.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Mp={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 Ip(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mp,r),Di.extend(e,t,r),t.table||(t.table=[]),t.buildTime={},fe.obj(t.buildTime),t.opaqueFlagBuildTime={},fe.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},fe.obj(t.insertTime,{mtime:0}),fe.get(e,t,["buildTime"]),fe.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),fe.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),Ap(e,t)}var Rp={newInstance:fe.newInstance(Ip,"vtkLookupTable"),extend:Ip},Ep=1,Dp=0,Bp=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Vp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Dp=e}var Lp={getResolveCoincidentTopologyAsString:function(){return Bp[Dp]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Ep},getResolveCoincidentTopology:function(){return Dp},setResolveCoincidentTopology:Vp,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Ep=e},setResolveCoincidentTopologyToDefault:function(){Vp(0)},setResolveCoincidentTopologyToOff:function(){Vp(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Vp(1)}};function Np(e,t,r){r.forEach((function(r){e["get".concat(r.method)]=function(){return t[r.key]},e["set".concat(r.method)]=function(e,n){t[r.key]={factor:e,offset:n}}}))}var kp=["Polygon","Line","Point"],Fp={};Np(Fp,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},kp.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var Gp={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),fe.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Lp).forEach((function(t){e[t]=Lp[t]})),Object.keys(Fp).forEach((function(t){e[t]=Fp[t]})),Np(e,t.topologyOffset,kp.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyPolygonOffsetParameters(),r=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyLineOffsetParameters(),r=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Fp.getResolveCoincidentTopologyPointOffsetParameters(),r=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}}},staticOffsetAPI:Fp,otherStaticMethods:Lp,CATEGORIES:kp};function _p(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}function Up(e){for(var t=1;t1e3?n=1e3:n<-1e3&&(n=-1e3)),{texCoordS:n,texCoordT:a}},e.createColorTextureCoordinates=function(t,r,n,a,o,i,s,l,c){var u=(i[1]-i[0])/l,d=[];d[0]=i[0]-u,d[1]=i[1]+u;var f=1/(d[1]-d[0]),p=r.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==n){t.lookupTable.setAlpha(n),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),c=new Float64Array(2*s),u=0;ut.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=r.getNumberOfComponents(),g=r.getNumberOfTuples();t.colorCoordinates=qt.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===Xp.MAGNITUDE&&r.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(r,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(r){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var n=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=n.scalars;return!(!a||n.cellFlag||t.colorMode===zp.DEFAULT&&a.getDataType()===qp.UNSIGNED_CHAR||t.colorMode===zp.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 r=t.lookupTable.getMTime();e=r>e?r: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=Yp("AcquireInvertibleLookupTable"),e.valueToColor=Yp("ValueToColor"),e.colorToValue=Yp("ColorToValue"),e.useInvertibleColorFor=Yp("UseInvertibleColorFor"),e.clearInvertibleColor=Yp("ClearInvertibleColor")}var Qp={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 $p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qp,r),wp(e,t,r),fe.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),fe.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Gp.implementCoincidentTopologyMethods(e,t),Zp(e,t)}var Jp=Up(Up(Up({newInstance:fe.newInstance($p,"vtkMapper"),extend:$p},Wp),jp),Ti);function eg(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}function tg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};qt.extend(e,t,og(r)),ag(e,t)}var sg=tg({newInstance:fe.newInstance(ig,"vtkCellArray"),extend:ig},ng),lg=fe.vtkErrorMacro,cg=[1,-1,1,-1,1,-1];function ug(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==r&&(t.size=r*n,t.values=fe.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(n),e.modified())},e.setPoint=function(e){for(var r=e*t.numberOfComponents,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dg,r),qt.extend(e,t,r),ug(e,t)}var pg={newInstance:fe.newInstance(fg,"vtkPoints"),extend:fg};function gg(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){t.pointsIds=r;var n=t.points.getData();n.length!==3*t.pointsIds.length&&(n=fe.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach((function(e,t){var r=3*e,o=3*t;n[o]=a[r],n[++o]=a[++r],n[++o]=a[++r]})),t.points.setData(n)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),r=[];if(e){t.points.getPoint(0,r),t.bounds[0]=r[0],t.bounds[1]=r[0],t.bounds[2]=r[1],t.bounds[3]=r[1],t.bounds[4]=r[2],t.bounds[5]=r[2];for(var n=1;nt.bounds[1]?r[0]:t.bounds[1],t.bounds[2]=r[1]t.bounds[3]?r[1]:t.bounds[3],t.bounds[4]=r[2]t.bounds[5]?r[2]:t.bounds[5]}else St(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var r=0,n=0,a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return r},e.getParametricDistance=function(e){for(var t,r=0,n=0;n<3;n++)(t=e[n]<0?-e[n]:e[n]>1?e[n]-1:0)>r&&(r=t);return r},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,r,n,a,o,i){},e.evaluatePosition=function(e,t,r,n,a,o){}}var mg={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function vg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mg,r),fe.obj(e,t),t.points||(t.points=pg.newInstance()),fe.get(e,t,["points","pointsIds"]),gg(e,t)}var hg={newInstance:fe.newInstance(vg,"vtkCell"),extend:vg};function yg(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(r){var n=r.getPoints().getNumberOfPoints(),a=r.getNumberOfCells(),o=new Uint32Array(n);if(r.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=r,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,r){t.array[e].cells[t.array[e].ncells++]=r},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,r){t.array[r].cells=t.array[r].cells.filter((function(t){return t!==e})),t.array[r].ncells=t.array[r].cells.length},e.addCellReference=function(e,r){t.array[r].cells[t.array[r].ncells++]=e},e.resizeCellList=function(e,r){t.array[e].cells.length=r},e.squeeze=function(){!function(e,t){var r=t;for(t>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=f(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bg,r),fe.obj(e,t),yg(e,t)}var Sg={newInstance:fe.newInstance(Tg,"vtkCellLinks"),extend:Tg},Cg=0,xg=1,Pg=2,wg=3,Og=4,Ag=5,Mg=6,Ig=7,Rg=9,Eg=21,Dg=41,Bg=42,Vg=["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 Lg(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 Ng={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]=Cg},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(t,Fg,r),fe.obj(e,t),fe.get(e,t,["size","maxId","extend"]),fe.getArray(e,t,["typeArray","locationArray"]),kg(e,t)}var _g=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=Ge(i,i),c=1e-5*s;return 0!==l&&(o.t=s/l),c<0&&(c=-c),-c1?n=r:(n=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=n[0],a[1]=n[1],a[2]=n[2]),o.distance=ze(n,e),o}function Kg(e,t,r,n,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=n[0]-r[0],s[1]=n[1]-r[1],s[2]=n[2]-r[2],l[0]=r[0]-e[0],l[1]=r[1]-e[1],l[2]=r[2]-e[2];var c=[];c[0]=[Ge(i,i),-Ge(i,s)],c[1]=[c[0][1],Ge(s,s)];var u=[];if(u[0]=Ge(i,l),u[1]=-Ge(s,l),0===ut(c,u,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,r,n],g=[r,r,e,e],m=[n,n,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Hg(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?zg.YES_INTERSECTION:zg.NO_INTERSECTION}var Xg={distanceToLine:Hg,intersection:Kg};function qg(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,r,n,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],c=[];t.points.getPoint(0,l),t.points.getPoint(1,c);var u,d=[],f=[],p=Kg(e,r,l,c,d,f);if(i.t=d[0],i.betweenPoints=(u=i.t)>=0&&u<=1,o[0]=f[0],p===zg.YES_INTERSECTION){for(var g=0;g<3;g++)a[g]=l[g]+o[0]*(c[g]-l[g]),s[g]=e[g]+i.t*(r[g]-e[g]);if(ze(a,s)<=n*n)return i.intersect=1,i}else{var m;if(i.t<0)return(m=Hg(e,l,c,a)).distance<=n*n?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(m=Hg(r,l,c,a)).distance<=n*n?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,m=Hg(l,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,m=Hg(c,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,r,n,a,o){}}var Yg={};function Zg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,r),hg.extend(e,t,r),qg(e,t)}var Qg=jg(jg({newInstance:fe.newInstance(Zg,"vtkLine"),extend:Zg},Xg),Ug);function $g(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=T(t.points):t.points=pg.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var r=e.shallowCopy;e.shallowCopy=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r(e,n),t.points=pg.newInstance(),t.points.shallowCopy(e.getPoints())}}var Jg={};function em(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,r),pn.extend(e,t,r),fe.setGet(e,t,["points"]),$g(e,t)}var tm={newInstance:fe.newInstance(em,"vtkPointSet"),extend:em};function rm(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}function nm(e,t,r,n){var a=r[0]-t[0],o=r[1]-t[1],i=r[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],c=e[2]-t[2];n[0]=o*c-i*l,n[1]=i*s-a*c,n[2]=a*l-o*s}function am(e,t,r,n){nm(e,t,r,n);var a=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==a&&(n[0]/=a,n[1]/=a,n[2]/=a)}var om={computeNormalDirection:nm,computeNormal:am};function im(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(r,n,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,c=[],u=[],d=[];t.points.getPoint(0,c),t.points.getPoint(1,u),t.points.getPoint(2,d);var f=[];if(am(c,u,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=cr.intersectWithLine(r,n,c,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=ze(c,u),v=ze(u,d),h=ze(d,c);t.line||(t.line=Qg.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,u)):v>h&&v>m?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,c));var y=t.line.intersectWithLine(r,n,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],S=[],C=0;C<3;C++)b[C]=c[C]-d[C],T[C]=u[C]-d[C],S[C]=o[C]-d[C];return i[0]=Ge(S,b)/h,i[1]=Ge(S,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,r,n,a){var o,i,s,l,c,u,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,S=[],C=[],x=[],P=[],w=[];f.subId=0,n[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),nm(p,g,m,v),cr.generalizedProjectPoint(e,p,v,w);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(S[i++]=o);for(o=0;o<2;o++)h[o]=w[S[o]]-m[S[o]],y[o]=p[S[o]]-m[S[o]],b[o]=g[S[o]]-m[S[o]];if(0===(l=qe(y,b)))return n[0]=0,n[1]=0,f.evaluation=-1,f;if(n[0]=qe(h,b)/l,n[1]=qe(y,h)/l,a[0]=1-(n[0]+n[1]),a[1]=n[0],a[2]=n[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)r&&(f.dist2=ze(w,e),r[0]=w[0],r[1]=w[1],r[2]=w[2]),f.evaluation=1;else{var A;if(r)if(a[1]<0&&a[2]<0)for(c=ze(e,m),u=Qg.distanceToLine(e,p,m,A,x),d=Qg.distanceToLine(e,m,g,A,P),c1?n[a]-1:0)>r&&(r=t);return r}}var sm={};function lm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sm,r),hg.extend(e,t,r),im(e,t)}var cm,um=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),dm.forEach((function(r){t[r]=sg.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))},e.buildCells=function(){var r=e.getNumberOfVerts(),n=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=r+n+a+o,s=new Uint8Array(i),l=s,c=new Uint32Array(i),u=c;if(r){var d=0;t.verts.getCellSizes().forEach((function(e,t){u[t]=d,l[t]=e>1?Pg:xg,d+=e+1})),u=u.subarray(r),l=l.subarray(r)}if(n){var f=0;t.lines.getCellSizes().forEach((function(e,t){u[t]=f,l[t]=e>2?Og:wg,1===e&&fm("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1})),u=u.subarray(n),l=l.subarray(n)}if(a){var p=0;t.polys.getCellSizes().forEach((function(e,t){switch(u[t]=p,e){case 3:l[t]=Ag;break;case 4:l[t]=Rg;break;default:l[t]=Ig}e<3&&fm("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1})),u+=u.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Mg,0,o),t.strips.getCellSizes().forEach((function(e,t){u[t]=g,g+=e+1}))}t.cells=_g.newInstance(),t.cells.setCellTypes(i,s,c)},e.buildLinks=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Sg.newInstance(),r>0?t.links.allocate(r):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var r=t.cells.getCellType(e),n=null;switch(r){case xg:case Pg:n=t.verts;break;case wg:case Og:n=t.lines;break;case Ag:case Rg:case Ig:n=t.polys;break;case Mg:n=t.strips;break;default:return n=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:r,cellPointIds:n.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,r,n){var a=t.links.getLink(r),o=t.links.getLink(n);return a.cells.filter((function(t){return t!==e&&-1!==o.cells.indexOf(t)}))},e.getCell=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.getCellPoints(t),a=r||pm[n.cellType].newInstance();return a.initialize(e.getPoints(),n.cellPointIds),a}}var mm={};function vm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mm,r),tm.extend(e,t,r),fe.get(e,t,["cells","links"]),fe.setGet(e,t,["verts","lines","polys","strips"]),gm(e,t)}var hm={newInstance:fe.newInstance(vm,"vtkPolyData"),extend:vm};function ym(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setJsImageData=function(r){t.jsImageData!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null),t.jsImageData=r,t.imageLoaded=!0,e.modified())},e.setCanvas=function(r){t.canvas!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.jsImageData=null),t.canvas=r,e.modified())},e.setImage=function(r){t.image!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.canvas=null,t.jsImageData=null),t.image=r,t.imageLoaded=!1,r.complete?e.imageLoaded():r.addEventListener("load",e.imageLoaded),e.modified())}}var bm={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,canvas:null,imageLoaded:!1,jsImageData:null};function Tm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,r),fe.obj(e,t),fe.algo(e,t,6,0),fe.get(e,t,["canvas","image","jsImageData","imageLoaded"]),fe.setGet(e,t,["repeat","edgeClamp","interpolate"]),ym(e,t)}var Sm={newInstance:fe.newInstance(Tm,"vtkTexture"),extend:Tm};function Cm(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}function xm(e){for(var t=1;t.5?Gn(Em,Bm,o[0]*i):Gn(Em,Bm,o[0]*i-l.width/2),Rn(Im,Im,Em),Gn(Em,Vm,o[1]*i-l.height/2),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[0],s.tcoords[2*f+1]=l.tcoords[1],f++,Gn(Em,Bm,l.width),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[2],s.tcoords[2*f+1]=l.tcoords[3],f++,Gn(Em,Vm,l.height),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[4],s.tcoords[2*f+1]=l.tcoords[5],f++,Gn(Em,Bm,l.width),En(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[6],s.tcoords[2*f+1]=l.tcoords[7],f++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-3,s.polys[4*p+3]=f-2,p++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-2,s.polys[4*p+3]=f-1,s.ptIdx+=4,s.cellIdx+=2}},e.updateTexturePolyData=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r);var n=t.renderable.getTextValues().length,a=4*n,o=2*n,i=new Float64Array(3*a),s=new Uint16Array(4*o),l=new Float32Array(2*a);Oa(Lm,r);for(var c={ptIdx:0,cellIdx:0,polys:s,points:i,tcoords:l},u=0,d=0,f=0,p=t.renderable.getTextPolyData().getPoints().getData(),g=t.renderable.getTextValues();u2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),fe.setGet(e,t,["renderable"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.lastTickBounds=[],km(e,t)}),"vtkCubeAxesActorHelper");function Gm(e,t){t.classHierarchy.push("vtkCubeAxesActor"),e.setCamera=function(r){t.camera!==r&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=r,r&&(t.cameraModifiedSub=r.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=function(){var e=t.camera.getViewMatrix();wa(e,e);for(var r=!1,n=Hr.getDiagonalLength(t.dataBounds),a=Math.sin(t.faceVisibilityAngle*Math.PI/180),o=0;o<6;o++){var i=!1,s=Math.floor(o/2),l=(s+1)%3,c=(s+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*c]!==t.dataBounds[2*c+1]&&(Im[s]=t.dataBounds[o]-.1*n*Pm[o][s],Im[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),Im[c]=.5*(t.dataBounds[2*c]+t.dataBounds[2*c+1]),Jn(Em,Im,e),Im[s]=t.dataBounds[o],Jn(Dm,Im,e),En(Em,Dm,Em),Kn(Em,Em),i=Em[2]>a,t.camera.getParallelProjection()||(Kn(Dm,Dm),i=Xn(Dm,Em)>a)),i!==t.lastFacesToDraw[o]&&(t.lastFacesToDraw[o]=i,r=!0)}return r},e.updatePolyData=function(e,r,n){var a=0,o=0;a+=8;for(var i=0,s=0;s<12;s++)r[s]>0&&i++;if(o+=i,t.gridLines)for(var l=0;l<6;l++)e[l]&&(a+=2*n[Mm[l][0]].length+2*n[Mm[l][1]].length,o+=n[Mm[l][0]].length+n[Mm[l][1]].length);for(var c=new Float64Array(3*a),u=new Uint32Array(3*o),d=0,f=0,p=0;p<2;p++)for(var g=0;g<2;g++)for(var m=0;m<2;m++)c[3*d]=t.dataBounds[m],c[3*d+1]=t.dataBounds[2+g],c[3*d+2]=t.dataBounds[4+p],d++;for(var v=0;v<12;v++)r[v]>0&&(u[3*f]=2,u[3*f+1]=Om[v][0],u[3*f+2]=Om[v][1],f++);if(t.gridLines)for(var h=0;h<6;h++)if(e[h]){for(var y=Math.floor(h/2),b=n[Mm[h][0]],T=0;T2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_m(r)),Cp.extend(e,t,r),t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.gridMapper=Jp.newInstance(),t.polyData=hm.newInstance(),t.gridMapper.setInputData(t.polyData),t.gridActor=Cp.newInstance(),t.gridActor.setMapper(t.gridMapper),t.gridActor.setProperty(e.getProperty()),t.gridActor.setParentProp(e),t.textPolyData=hm.newInstance(),fe.setGet(e,t,["axisTitlePixelOffset","faceVisibilityAngle","gridLines","tickLabelPixelOffset"]),fe.setGetArray(e,t,["dataBounds"],6),fe.setGetArray(e,t,["axisLabels"],3),fe.get(e,t,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","_tmAtlas","tickCounts","gridActor"]),Gm(e,t)}var Wm={newInstance:fe.newInstance(Um,"vtkCubeAxesActor"),extend:Um,newCubeAxesActorHelper:Fm};function jm(e,t){t.classHierarchy.push("vtkOpenGLCubeAxesActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var zm={};var Hm=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zm,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),jm(e,t)}),"vtkOpenGLCubeAxesActor");_s("vtkCubeAxesActor",Hm);var Km={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},Xm=Fu.Representation,qm=Fu.Shading,Ym=Jp.ScalarMode,Zm=$l.Filter,Qm=$l.Wrap,$m=F,Jm={type:"StartEvent"},ev={type:"EndEvent"};function tv(e,r){function n(e,t,r){return t.identity(r),e.reduce((function(e,r,n){return 0===n?r?t.copy(e,r):t.identity(e):r?t.multiply(e,e,r):e}),r)}r.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(t){t&&(r.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),r.openGLRenderer=r.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(t){t&&(r.haveSeenDepthRequest=!0,r.renderDepth=!0,e.render(),r.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=Km.Start;n= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=wl.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:$m("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(t,n,a){if(r.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=t.Vertex,i=t.Geometry,s=t.Fragment;r.lastBoundBO.getCABO().getNormalOffset()?(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=wl.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=wl.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=wl.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):r.haveCellNormals?(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=wl.substitute(s,"//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(),r.lastBoundBO.getPrimitiveType())===r.context.LINES?(s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//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),t.Vertex=o,t.Geometry=i,t.Fragment=s}},e.replaceShaderPositionVC=function(e,t,n){var a=e.Vertex,o=e.Geometry,i=e.Fragment;n.getProperty().getRepresentation()!==Xm.POINTS&&r.lastBoundBO.getPrimitiveType()!==Km.Points||(a=wl.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(n.getProperty().getPointSize(),".0;")],!1).result),r.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=wl.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=wl.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=wl.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,t,n){if(r.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(r.drawingEdges)return;a=wl.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=r.openGLActor.getActiveTextures(),l=2,c=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===r.context.TEXTURE_CUBE_MAP&&(c=3)),r.renderable.getColorTextureMap()&&(l=r.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),c=2),2===c){if(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,t,n){var a=e.Vertex,o=e.Fragment;if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes();a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[".concat(i,"];"),"varying float clipDistancesVSOutput[".concat(i,"];")]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[".concat(i,"];")]).result,o=wl.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,t){var n=null,a=t.getProperty();if(r.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===Xm.SURFACE){var o=r.lastBoundBO.getPrimitiveType();o===Km.Points||a.getRepresentation()===Xm.POINTS?n=r.renderable.getCoincidentTopologyPointOffsetParameter():o===Km.Lines||a.getRepresentation()===Xm.WIREFRAME?n=r.renderable.getCoincidentTopologyLineOffsetParameters():o!==Km.Tris&&o!==Km.TriStrips||(n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==Km.TrisEdges&&o!==Km.TriStripsEdges||((n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,n.offset/=2)}return n},e.replaceShaderPicking=function(e,t,r){var n=e.Fragment;n=wl.substitute(n,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,n=wl.substitute(n,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=n},e.replaceShaderValues=function(t,n,a){if(e.replaceShaderColor(t,n,a),e.replaceShaderNormal(t,n,a),e.replaceShaderLight(t,n,a),e.replaceShaderTCoord(t,n,a),e.replaceShaderPicking(t,n,a),e.replaceShaderClip(t,n,a),e.replaceShaderCoincidentOffset(t,n,a),e.replaceShaderPositionVC(t,n,a),r.haveSeenDepthRequest){var o=t.Fragment;o=wl.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=wl.substitute(o,"//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,t.Fragment=o}},e.getNeedToRebuildShaders=function(t,n,a){var o=0,i=0,s=t.getPrimitiveType(),l=r.currentInput,c=!1,u=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===qm.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===r.context.TRIANGLES||d&&!u||!f&&u?c=!0:f||g!==r.context.LINES||(c=!0),a.getProperty().getLighting()&&c){o=0;for(var m=n.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=r.lastBoundBO.getReferenceByName("lastLightComplexity"),T=r.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(r.lastBoundBO.set({lastLightComplexity:o},!0),r.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(r.lastHaveSeenDepthRequest!==r.haveSeenDepthRequest||0===t.getProgram()||t.getShaderSourceTime().getMTime()t.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){var o=r.lastBoundBO.getReferenceByName("lastLightComplexity");t.getProgram().isAttributeUsed("vertexMC")&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"vertexMC",t.getCABO().getVertexOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting vertexMC in shader VAO.")),t.getProgram().isAttributeUsed("normalMC")&&t.getCABO().getNormalOffset()&&o>0?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"normalMC",t.getCABO().getNormalOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting normalMC in shader VAO."):t.getVAO().removeAttributeArray("normalMC"),r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||$m("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||$m("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),t.getProgram().isAttributeUsed("scalarColor")&&t.getCABO().getColorComponents()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO().getColorBO(),"scalarColor",t.getCABO().getColorOffset(),t.getCABO().getColorBOStride(),r.context.UNSIGNED_BYTE,4,!0)||$m("Error setting scalarColor in shader VAO."):t.getVAO().removeAttributeArray("scalarColor"),t.getAttributeUpdateTime().modified()}if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes(),s=[],l=t.getCABO().getCoordShiftAndScaleEnabled()?t.getCABO().getInverseShiftAndScaleMatrix():null,c=l?Sa(r.tmpMat4,a.getMatrix()):a.getMatrix();l&&(wa(c,c),Ia(c,c,l),wa(c,c));for(var u=0;u0){var u=c.getColorByReference(),d=c.getIntensity();r.lightColor[0]=u[0]*d,r.lightColor[1]=u[1]*d,r.lightColor[2]=u[2]*d;var p=c.getDirection(),g=t.getActiveCamera().getViewMatrix(),m=f(p);c.lightTypeIsSceneLight()&&(m[0]=g[0]*p[0]+g[1]*p[1]+g[2]*p[2],m[1]=g[4]*p[0]+g[5]*p[1]+g[6]*p[2],m[2]=g[8]*p[0]+g[9]*p[1]+g[10]*p[2],We(m)),r.lightDirection[0]=m[0],r.lightDirection[1]=m[1],r.lightDirection[2]=m[2],r.lightHalfAngle[0]=-r.lightDirection[0],r.lightHalfAngle[1]=-r.lightDirection[1],r.lightHalfAngle[2]=1-r.lightDirection[2],We(r.lightDirection),o.setUniform3fArray("lightColor".concat(i),r.lightColor),o.setUniform3fArray("lightDirectionVC".concat(i),r.lightDirection),o.setUniform3fArray("lightHalfAngleVC".concat(i),r.lightHalfAngle),i++}}if(!(a<3)){var v=t.getActiveCamera().getViewMatrix();wa(v,v),i=0;for(var h=0;h0){var b=y.getTransformedPosition(),T=new Float64Array(3);Jn(T,b,v),o.setUniform3fArray("lightAttenuation".concat(i),y.getAttenuationValuesByReference()),o.setUniformi("lightPositional".concat(i),y.getPositional()),o.setUniformf("lightExponent".concat(i),y.getExponent()),o.setUniformf("lightConeAngle".concat(i),y.getConeAngle()),o.setUniform3fArray("lightPositionVC".concat(i),[T[0],T[1],T[2]]),i++}}}}},e.setCameraShaderParameters=function(e,o,i){var s=e.getProgram(),l=r.openGLCamera.getKeyMatrices(o),c=o.getActiveCamera(),u=r.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:r.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,r.tmpMat3)),d!==u&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",c.getParallelProjection()),s.setLastCameraMTime(u)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,t,n){var a=e.getProgram(),o=n.getProperty(),i=o.getOpacity(),s=r.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=r.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),c=r.drawingEdges?1:o.getAmbient(),u=r.drawingEdges?0:o.getDiffuse(),d=r.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",c),a.setUniformf("diffuse",u);var p=r.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.setUniformf("specular",d),a.isUniformUsed("ambientIntensityBF")){if(i=(o=n.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),c=o.getAmbient(),l=o.getDiffuseColor(),u=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",c),a.setUniformf("diffuseIntensityBF",u),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(t,n){r.primitiveIDOffset=0,r.openGLRenderer.getSelector()&&(r.openGLRenderer.getSelector().getCurrentPass(),r.openGLRenderer.getSelector().renderProp(n)),e.updateBufferObjects(t,n),r.renderable.getColorTextureMap()&&r.internalColorTexture.activate(),r.lastBoundBO=null},e.renderPieceDraw=function(t,n){var a=n.getProperty().getRepresentation(),o=r.context,i=n.getProperty().getEdgeVisibility()&&a===Xm.SURFACE;o.lineWidth(n.getProperty().getLineWidth());for(var s=Km.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=Km,t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16));for(var n=Km.Start;ne?r:e}return e},e.mapScalars=function(r,n){var a=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(a){var o="".concat(e.getMTime()).concat(a.getMTime()).concat(n);if(t.colorBuildString!==o){t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]);var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,t.fieldDataTupleId)),t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(n)}}else t.colorMapColors=null}}var uv={static:!1,lookupTable:null,scalarVisibility:!1,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,transformCoordinate:null,viewSpecificProperties:null,customShaderAttributes:[]};function dv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uv,r),ys(e,t,r),fe.get(e,t,["colorMapColors"]),fe.setGet(e,t,["arrayAccessMode","colorByArrayName","colorMode","lookupTable","renderTime","scalarMode","scalarVisibility","static","transformCoordinate","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),cv(e,t)}var fv={newInstance:fe.newInstance(dv,"vtkMapper2D"),extend:dv},pv=1,gv=ov.primTypes,mv=fv.ScalarMode,vv=F,hv={type:"StartEvent"},yv={type:"EndEvent"};function bv(e,r){r.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),e.buildPass=function(t){t&&(r.openGLActor2D=e.getFirstAncestorOfType("vtkOpenGLActor2D"),r.openGLRenderer=r.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.overlayPass=function(t){t&&e.render()},e.getShaderTemplate=function(e,t,n){var a=r.renderable.getViewSpecificProperties().OpenGL,o="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.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// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n";if(a){var i=a.VertexShaderCode;void 0!==i&&""!==i&&(o=i)}e.Vertex=o;var s="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.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\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n";if(a){var l=a.FragmentShaderCode;void 0!==l&&""!==l&&(s=l)}e.Fragment=s;var c="";if(a){var u=a.GeometryShaderCode;void 0!==u&&(c=u)}e.Geometry=c},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=gv.Start;nt.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||vv("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||vv("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),r.internalColorTexture&&t.getProgram().isUniformUsed("texture1")&&t.getProgram().setUniformi("texture1",r.internalColorTexture.getTextureUnit());var o=r.openGLActor2D.getActiveTextures();if(o)for(var i=0;i=u[0]?l[0]:u[0],d[1]=l[1]>=u[1]?l[1]:u[1],d[2]=l[2]>=u[2]?l[2]:u[2],d[3]=l[3]>=u[3]?l[3]:u[3],!(d[0]>=d[2]||d[1]>=d[3])){s.usize=Pe(s.usize*(d[2]-d[0])/(l[2]-l[0])),s.vsize=Pe(s.vsize*(d[3]-d[1])/(l[3]-l[1]));var f=r.openGLRenderer.getParent().getSize(),p=Pe(c[0]-(d[0]-l[0])*f[0]),g=Pe(c[1]-(d[1]-l[1])*f[1]),m=-p,v=-p+s.usize,h=-g,y=-g+s.vsize;m===v&&(v=m+1),h===y&&(y=h+1);var b,T,S,C=Pa(new Float64Array(16));C[0]=2/(v-m),C[5]=2/(y-h),C[3]=-1*(v+m)/(v-m),C[7]=-1*(y+h)/(y-h),C[10]=0,C[11]=a.getProperty().getDisplayLocation()===pv?-1:1,C[15]=1,wa(C,C),o.setUniformMatrix("WCVCMatrix",(b=[C,i],T=t,S=r.tmpMat4,T.identity(S),b.reduce((function(e,t,r){return 0===r?t?T.copy(e,t):T.identity(e):t?T.multiply(e,e,t):e}),S)))}},e.haveWideLines=function(e,t){return r.lastBoundBO===r.lines&&t.getProperty().getLineWidth()>1}}var Tv={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};var Sv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=gv,t.tmpMat4=Pa(new Float64Array(16));for(var n=gv.Start;n1?s.fontSize=Math.max(20*o,10):s.fontSize=Math.max(16*o,10);var l=e.updateTextureAtlas();e.setTopTitle(!1);var c=e.getBoxSizeByReference();if(e.getLastAspectRatio()>1){e.setTickLabelPixelOffset(.4*s.fontSize);var u=2*(l.tickWidth+e.getTickLabelPixelOffset())/r[0];e.setAxisTitlePixelOffset(.8*i.fontSize);var d=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[0];u+.4*d>2*l.titleWidth/r[0]?(e.setTopTitle(!0),c[0]=u+.4*d,e.setBoxPosition([.98-c[0],-.92])):(c[0]=u+1.4*d,e.setBoxPosition([.99-c[0],-.92])),c[1]=Math.max(1.2,Math.min(1.84/a,1.84))}else{e.setAxisTitlePixelOffset(2*s.fontSize),e.setTickLabelPixelOffset(.5*s.fontSize);var f=2*(l.tickHeight+e.getTickLabelPixelOffset())/r[1],p=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[1],g=2*l.tickWidth/r[0];c[0]=Math.min(1.9,Math.max(1.4,1.4*g*(e.getTicks().length+3))),c[1]=f+p,e.setBoxPosition([-.5*c[0],-.97])}e.recomputeBarSegments(l)}}function Vv(e,t){t.classHierarchy.push("vtkScalarBarActorHelper"),e.setRenderable=function(r){t.renderable!==r&&(t.renderable=r,t.barActor.setProperty(r.getProperty()),t.barActor.setParentProp(r),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),t.axisTextStyle=xv({},r.getAxisTextStyle()),t.tickTextStyle=xv({},r.getTickTextStyle()),e.modified())},e.updateAPISpecificData=function(r,n,a){t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0);var o=t.renderable.getScalarsToColors();if(o&&t.renderable.getVisibility()){if(t.barMapper.setLookupTable(o),t.camera=n,t.renderWindow=a,t.forceUpdate||Math.max(o.getMTime(),e.getMTime())>t.lastRebuildTime.getMTime()){var i=o.getMappingRange();t.lastTickBounds=f(i),t.barMapper.setScalarRange(t.lastTickBounds);var s=vp().domain([t.lastTickBounds[0],t.lastTickBounds[1]]);t.ticks=s.ticks(5);var l=s.tickFormat(5);if(t.tickstrings=t.ticks.map(l),t.renderable.getAutomated())t.renderable.getAutoLayout()(e);else{t.axisTextStyle=xv({},t.renderable.getAxisTextStyle()),t.tickTextStyle=xv({},t.renderable.getTickTextStyle()),t.barPosition=f(t.renderable.getBarPosition()),t.barSize=f(t.renderable.getBarSize()),t.boxPosition=f(t.renderable.getBoxPosition()),t.boxSize=f(t.renderable.getBoxSize()),t.axisTitlePixelOffset=t.renderable.getAxisTitlePixelOffset(),t.tickLabelPixelOffset=t.renderable.getTickLabelPixelOffset();var c=e.updateTextureAtlas();e.recomputeBarSegments(c)}t.forceViewUpdate=!0,t.lastRebuildTime.modified(),t.forceUpdate=!1}(t.forceViewUpdate||t.camera.getMTime()>t.lastRedrawTime.getMTime())&&(e.updatePolyDataForLabels(),e.updatePolyDataForBarSegments(),t.lastRedrawTime.modified(),t.forceViewUpdate=!1)}},e.updateTextureAtlas=function(){t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left";var e={},r=new Map,n=0,a=1;Dv(t.tmContext,t.axisTextStyle);var o=t.tmContext.measureText(t.renderable.getAxisLabel()),i={height:o.actualBoundingBoxAscent+2,startingHeight:a,width:o.width+2,textStyle:t.axisTextStyle};r.set(t.renderable.getAxisLabel(),i),a+=i.height,n=i.width,e.titleWidth=i.width,e.titleHeight=i.height,e.tickWidth=0,e.tickHeight=0,Dv(t.tmContext,t.tickTextStyle);for(var s=[].concat(f(t.tickstrings),["NaN","Below","Above"]),l=0;lt.boxSize[0];var r=2*e.tickHeight/t.lastSize[1],n=[1,1];if(t.vertical){var a=2*(e.tickWidth+t.tickLabelPixelOffset)/t.lastSize[0];if(t.topTitle){var o=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0]-a,t.barSize[1]=t.boxSize[1]-o}else{var i=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[0];t.barSize[0]=t.boxSize[0]-i-a,t.barSize[1]=t.boxSize[1]}t.barPosition[0]=t.boxPosition[0]+a,t.barPosition[1]=t.boxPosition[1],n[1]=r}else{var s=(2*e.tickWidth-8)/t.lastSize[0],l=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0],t.barPosition[0]=t.boxPosition[0],t.barSize[1]=t.boxSize[1]-l-r,t.barPosition[1]=t.boxPosition[1],n[0]=s}return n},e.recomputeBarSegments=function(r){var n,a,o,i,s=e.computeBarSize(r);t.barSegments=[];var l=[0,0],c=t.vertical?1:0,u=t.vertical?.01:.02;function d(e,r){t.barSegments.push({corners:[[].concat(l),[l[0]+s[0],l[1]],[l[0]+s[0],l[1]+s[1]],[l[0],l[1]+s[1]]],scalars:r,title:e}),l[c]+=s[c]+u}t.renderable.getDrawNanAnnotation()&&t.renderable.getScalarsToColors().getNanColor()&&d("NaN",[NaN,NaN,NaN,NaN]),t.renderable.getDrawBelowRangeSwatch()&&null!==(n=(a=t.renderable.getScalarsToColors()).getUseBelowRangeColor)&&void 0!==n&&n.call(a)&&d("Below",[-.1,-.1,-.1,-.1]);var f=null===(o=(i=t.renderable.getScalarsToColors()).getUseAboveRangeColor)||void 0===o?void 0:o.call(i);l[c]+=u;var p=s[c];s[c]=f?1-2*u-s[c]-l[c]:1-u-l[c],d("ticks",t.vertical?[0,0,.995,.995]:[0,.995,.995,0]),t.renderable.getDrawAboveRangeSwatch()&&f&&(s[c]=p,l[c]+=u,d("Above",[1.1,1.1,1.1,1.1]))},e.createPolyDataForOneLabel=function(e,r,n,a,o,i,s){var l=t._tmAtlas.get(e);if(l){var c=s.ptIdx,u=s.cellIdx;wv[0]=r[0],wv[1]=r[1],wv[2]=r[2],o[0]<-.5?Gn(Av,n,o[0]*i-l.width):o[0]>.5?Gn(Av,n,o[0]*i):Gn(Av,n,o[0]*i-l.width/2),Rn(wv,wv,Av),Gn(Av,a,o[1]*i-l.height/2),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[0],s.tcoords[2*c+1]=l.tcoords[1],c++,Gn(Av,n,l.width),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[2],s.tcoords[2*c+1]=l.tcoords[3],c++,Gn(Av,a,l.height),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[4],s.tcoords[2*c+1]=l.tcoords[5],c++,Gn(Av,n,l.width),En(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[6],s.tcoords[2*c+1]=l.tcoords[7],c++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-3,s.polys[4*u+3]=c-2,u++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-2,s.polys[4*u+3]=c-1,s.ptIdx+=4,s.cellIdx+=2}},e.updatePolyDataForLabels=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r),Oa(Ev,r);var n=t.lastSize;Av[0]=0,Av[1]=0,Av[2]=-.99,Jn(wv,Av,Ev),Av[0]+=.1,Jn(Ov,Av,Ev),En(Iv,Ov,wv),Av[0]-=.1,Av[1]+=.1,Jn(Ov,Av,Ev),En(Rv,Ov,wv);for(var a=0;a<3;a++)Iv[a]/=.05*n[0],Rv[a]/=.05*n[1];var o=t.tickstrings.length+t.barSegments.length,i=4*o,s=2*o,l=new Float64Array(3*i),c=new Uint16Array(4*s),u=new Float32Array(2*i),d={ptIdx:0,cellIdx:0,polys:c,points:l,tcoords:u},f=t.vertical?0:1,p=t.vertical?1:0,g=[0,1];t.vertical?(t.topTitle?(Av[0]=t.boxPosition[0]+.5*t.boxSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,[0,1],t.axisTitlePixelOffset,d)):(Av[0]=t.barPosition[0]+t.barSize[0],Av[1]=t.barPosition[1]+.5*t.barSize[1],Jn(wv,Av,Ev),Gn(Iv,Iv,-1),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Rv,Iv,[0,-1],t.axisTitlePixelOffset,d),Gn(Iv,Iv,-1)),g=[-1,0]):(Av[0]=t.barPosition[0]+.5*t.barSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,g,t.axisTitlePixelOffset,d)),Mv[2]=-.99,Mv[f]=t.barPosition[f]+(.5*g[f]+.5)*t.barSize[f],Mv[p]=t.barPosition[p]+.5*t.barSize[p];for(var m=null,v=0;v2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),fe.setGet(e,t,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","barActor","tmActor","ticks"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.barMapper=Jp.newInstance(),t.barMapper.setInterpolateScalarsBeforeMapping(!0),t.polyData=hm.newInstance(),t.barMapper.setInputData(t.polyData),t.barActor=Cp.newInstance(),t.barActor.setMapper(t.barMapper),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.barPosition=[0,0],t.barSize=[0,0],t.boxPosition=[.88,-.92],t.boxSize=[.1,1.1],t.lastTickBounds=[],Vv(e,t)}),"vtkScalarBarActorHelper");function Nv(e,t){t.classHierarchy.push("vtkScalarBarActor"),e.setTickTextStyle=function(r){t.tickTextStyle=xv(xv({},t.tickTextStyle),r),e.modified()},e.setAxisTextStyle=function(r){t.axisTextStyle=xv(xv({},t.axisTextStyle),r),e.modified()},e.resetAutoLayoutToDefault=function(){t.autoLayout=Bv(0,t)}}function kv(e){return xv({automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif"},drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0},e)}function Fv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv(r)),t.autoLayout||(t.autoLayout=Bv(0,t)),Cp.extend(e,t,r),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),fe.setGet(e,t,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch"]),fe.get(e,t,["axisTextStyle","tickTextStyle"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),Nv(e,t)}var Gv={newInstance:fe.newInstance(Fv,"vtkScalarBarActor"),extend:Fv,newScalarBarActorHelper:Lv};function _v(e,t){t.classHierarchy.push("vtkOpenGLScalarBarActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var Uv={};var Wv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),_v(e,t)}),"vtkOpenGLScalarBarActor");_s("vtkScalarBarActor",Wv);var jv=F;function zv(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(r){if(r){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 n=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(n.getActiveCamera())}},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOpaqueActorCount()}},e.opaquePass=function(r,n){if(r&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.context.depthMask(!0),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var o=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(o),s=new Float64Array(16);if(Oa(s,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),"box"===t.lastFormat){var l=o.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),r=0;r<4;r++)e[3*r]=r%2*2-1,e[3*r+1]=r>1?1:-1,e[3*r+2]=1;var n=qt.newInstance({numberOfComponents:3,values:e});n.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 o=qt.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",cl.SURFACE,{points:n,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)||jv("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||jv("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var Hv={context:null};var Kv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hv,r),Vs.extend(e,t,r),t.openGLTexture=$l.newInstance(),t.tris=Bl.newInstance(),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),zv(e,t)}));function Xv(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}_s("vtkSkybox",Kv);var qv={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};var Yv=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],Xv(e,t)}));function Zv(e,t){t.classHierarchy.push("vtkWebGPUCubeAxesActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,a=t.WebGPURenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.WebGPURenderWindow.getRenderable())}}}Rc("vtkActor",Yv);var Qv={};var $v=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),Zv(e,t)}),"vtkWebGPUCubeAxesActor");Rc("vtkCubeAxesActor",$v);var Jv=$u.BufferUsage,eh=$u.PrimitiveTypes,th=Fu.Representation,rh=Jp.ScalarMode,nh={type:"StartEvent"},ah={type:"EndEvent"},oh="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",ih="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::Position::Impl\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function sh(e){return e.indexOf("edge")>=0}function lh(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(r){r&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var r=t.WebGPUActor.getRenderable().getProperty(),n=t.UBO.getSendTime();if(e.getMTime()>n||r.getMTime()>n||t.renderable.getMTime()>n){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=r.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",r.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",r.getDiffuse()),o=r.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",r.getSpecular()),t.UBO.setValue("SpecularPower",r.getSpecularPower()),o=r.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),o=r.getEdgeColorByReference(),t.UBO.setArray("EdgeColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",r.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(nh),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(ah),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();sh(e)?(n.addBuiltinInput("u32","@builtin(instance_index) instanceIndex"),a=Xc(a,"//VTK::Position::Impl",[" var tmpPos: vec4 = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"," var tmpPos2: vec3 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 1.4*(f32(input.instanceIndex % 2u) - 0.5)/rendererUBO.viewportSize.x;"," tmpPos2.y = tmpPos2.y + 1.4*(f32(input.instanceIndex / 2u) - 0.5)/rendererUBO.viewportSize.y;"," tmpPos2.z = tmpPos2.z + 0.00001;"," output.Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"]).result):a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var n=t.getShaderDescription("vertex");n.addOutput("vec3","normalVC");var a=n.getCode();a=Xc(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,r){var n=t.getShaderDescription("fragment"),a=n.getCode();a.includes("var normal")?(a=Xc(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a)):(a=Xc(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a))},e.replaceShaderColor=function(e,t,r){if(sh(e)){var n=t.getShaderDescription("fragment"),a=n.getCode();return a=Xc(a,"//VTK::Color::Impl",["ambientColor = mapperUBO.EdgeColor;","diffuseColor = mapperUBO.EdgeColor;"]).result,void n.setCode(a)}if(r.hasAttribute("colorVI")){var o=t.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,o.setCode(i);var s=t.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}},e.replaceShaderTCoord=function(e,r,n){if(n.hasAttribute("tcoord")){var a=r.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=Xc(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=r.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=Xc(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("fragment"),a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,n.setCode(a)}},e.getUsage=function(e,t){return e===th.POINTS||t===eh.Points?Jv.Verts:t===eh.Lines?Jv.Lines:e===th.WIREFRAME?t===eh.Triangles?Jv.LinesFromTriangles:Jv.LinesFromStrips:t===eh.Triangles?Jv.Triangles:t===eh.TriangleStrips?Jv.Strips:t===eh.TriangleEdges?Jv.LinesFromTriangles:Jv.LinesFromStrips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case Jv.Triangles:return"triangle-list";case Jv.Verts:return"point-list";case Jv.Lines:default:return"line-list"}},e.buildVertexInput=function(r,n,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=!1;a===eh.TriangleEdges&&(s=!0,o=th.WIREFRAME);var l=t.primitives[a].getVertexInput(),c="R".concat(o,"P").concat(a),u=r.getPoints();if(u){var d=t.WebGPUActor.getBufferShift(t.WebGPURenderer),f={owner:u,usage:Jv.PointArray,format:"float32x4",time:Math.max(u.getMTime(),n.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),hash:c,dataArray:u,cells:n,primitiveType:a,representation:o,shift:d,packExtra:!0},p=i.getBufferManager().getBuffer(f);l.addBuffer(p,["vertexBC"])}else l.removeBufferIfPresent("vertexBC");var g=e.getUsage(o,a);if(g===Jv.Triangles||g===Jv.Strips){var m=r.getPointData().getNormals(),v={format:"snorm8x4",hash:c,cells:n,representation:o,primitiveType:a,packExtra:!0,shift:0,scale:127};if(m){v.owner=m,v.dataArray=m,v.time=Math.max(m.getMTime(),n.getMTime()),v.usage=Jv.PointArray;var h=i.getBufferManager().getBuffer(v);l.addBuffer(h,["normalMC"])}else if(a===eh.Triangles){v.owner=u,v.dataArray=u,v.time=Math.max(u.getMTime(),n.getMTime()),v.usage=Jv.NormalsFromPoints;var y=i.getBufferManager().getBuffer(v);l.addBuffer(y,["normalMC"])}else l.removeBufferIfPresent("normalMC")}else l.removeBufferIfPresent("normalMC");var b=!1;if(t.renderable.getScalarVisibility()){var T=t.renderable.getColorMapColors();if(T&&!s){var S=t.renderable.getScalarMode(),C=!1;S!==rh.USE_CELL_DATA&&S!==rh.USE_CELL_FIELD_DATA&&S!==rh.USE_FIELD_DATA&&r.getPointData().getScalars()||S===rh.USE_POINT_FIELD_DATA||!T||(C=!0);var x={owner:T,usage:Jv.PointArray,format:"unorm8x4",time:Math.max(T.getMTime(),n.getMTime(),u.getMTime()),hash:c+C,dataArray:T,cells:n,primitiveType:a,representation:o,cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(x);l.addBuffer(P,["colorVI"]),b=!0}}b||l.removeBufferIfPresent("colorVI");var w=null;if((w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():r.getPointData().getTCoords())&&!s){var O={owner:w,usage:Jv.PointArray,format:"float32x2",time:Math.max(w.getMTime(),n.getMTime()),hash:c,dataArray:w,cells:n,primitiveType:a,representation:o},A=i.getBufferManager().getBuffer(O);l.addBuffer(A,["tcoord"])}else l.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],r=[],n=t.renderable.getColorTextureMap();n&&(t.colorTexture||(t.colorTexture=Sm.newInstance({label:"polyDataColor"})),t.colorTexture.setInputData(n),r.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(r,n,a){var o="pd";return a?o+="edge":(r.hasAttribute("normalMC")&&(o+="n"),r.hasAttribute("colorVI")&&(o+="c"),r.hasAttribute("tcoord")&&(o+="t"),t.textures.length&&(o+="tx".concat(t.textures.length))),t.SSBO&&(o+="ssbo"),(o+=e.getHashFromUsage(n))+t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var r=t.currentInput,n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(r,1),e.updateTextures();for(var o=t.WebGPUActor.getRenderable(),i=o.getProperty().getRepresentation(),s=o.getProperty().getEdgeVisibility(),l=eh.Points;l<=eh.Triangles;l++)if(n[l].getNumberOfValues()>0){var c=e.getUsage(i,l),u=t.primitives[l];e.buildVertexInput(t.currentInput,n[l],l),u.setPipelineHash(e.computePipelineHash(u.getVertexInput(),c,!1)),u.setTextureViews(t.textureViews),u.setWebGPURenderer(t.WebGPURenderer),u.setNumberOfInstances(1);var d=u.getVertexInput().getBuffer("vertexBC");if(u.setNumberOfVertices(d.getSizeInBytes()/d.getStrideInBytes()),u.setTopology(e.getTopologyFromUsage(c)),u.build(t.renderEncoder,a),u.registerToDraw(),s&&i===th.SURFACE&&l===eh.Triangles){var f=t.primitives[eh.TriangleEdges],p=e.getUsage(i,eh.TriangleEdges);e.buildVertexInput(t.currentInput,n[eh.Triangles],eh.TriangleEdges),f.setPipelineHash(e.computePipelineHash(f.getVertexInput(),p,!0)),f.setWebGPURenderer(t.WebGPURenderer),f.setNumberOfInstances(4);var g=f.getVertexInput().getBuffer("vertexBC");f.setNumberOfVertices(g.getSizeInBytes()/g.getStrideInBytes()),f.setTopology(e.getTopologyFromUsage(p)),f.build(t.renderEncoder,a),f.registerToDraw()}}},e.setShaderReplacement=function(e,r){for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ch,r),Vs.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||ih,t.vertexShaderTemplate=t.vertexShaderTemplate||oh,t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("EdgeColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),Q(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),te(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],lh(e,t);for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gh,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),ph(e,t)}),"vtkWebGPUScalarBarActor");function vh(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,r){t.texture=e,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;var n=nu(t.texture.getFormat());t.bindGroupLayoutEntry.texture.sampleType=n.sampleType},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,r){var n="f32";"sint"===t.bindGroupLayoutEntry.texture.sampleType?n="i32":"uint"===t.bindGroupLayoutEntry.texture.sampleType&&(n="u32");var a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_").concat(t.options.dimension,"<").concat(n,">;");return"depth"===t.bindGroupLayoutEntry.texture.sampleType&&(a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_depth_").concat(t.options.dimension,";")),a},e.addSampler=function(r,n){var a=yd.newInstance({label:"".concat(t.label,"Sampler")});a.create(r,n),e.setSampler(a)},e.getBindGroupTime=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.bindGroupTime},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}Rc("vtkScalarBarActor",mh);var hh={texture:null,handle:null,sampler:null,label:null};function yh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hh,r),fe.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","texture"]),fe.setGet(e,t,["bindGroupLayoutEntry","label","sampler"]),vh(e,t)}var bh={newInstance:fe.newInstance(yh),extend:yh},Th=$u.BufferUsage;function Sh(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,r){t.device=e,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1;var n=1===t.depth?"2d":"3d";t.format=r.format?r.format:"rgba8unorm",t.usage=r.usage?r.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label,dimension:n})},e.assignFromHandle=function(e,r,n){t.device=e,t.handle=r,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1,t.format=n.format?n.format:"rgba8unorm",t.usage=n.usage?n.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){if(e.canvas)return t.device.getHandle().queue.copyExternalImageToTexture({source:e.canvas,flipY:e.flip},{texture:t.handle,premultipliedAlpha:!0},[t.width,t.height,t.depth]),void(t.ready=!0);e.jsImageData&&!e.nativeArray&&(e.width=e.jsImageData.width,e.height=e.jsImageData.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.nativeArray=e.jsImageData.data);var r=nu(t.format),n=t.width*r.stride;if(e.nativeArray){var a={usage:Th.Texture};e.dataArray&&(a.dataArray=e.dataArray,a.time=e.dataArray.getMTime()),a.nativeArray=e.nativeArray;var o=e.nativeArray.length/(t.height*t.depth)*e.nativeArray.BYTES_PER_ELEMENT,i=2===r.elementSize&&"float"===r.sampleType;if(i||o%256){for(var s=e.nativeArray,l=o/s.BYTES_PER_ELEMENT,c=r.elementSize,u=256*Math.floor((l*c+255)/256),d=u/c,f=fe.newTypedArray(i?"Uint16Array":s.constructor.name,d*t.height*t.depth),p=0;p2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&r===t.height&&n===t.depth||(t.width=e,t.height=r,t.depth=n,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.createView=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.dimension||(n.dimension=1===t.depth?"2d":"3d");var a=bh.newInstance({label:r});return a.create(e,n),a}}var Ch={device:null,handle:null,buffer:null,ready:!1,label:null};function xh(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Ph(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xh(o,n,a,i,s,"next",e)}function s(e){xh(o,n,a,i,s,"throw",e)}i(void 0)}))}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ch,r),fe.obj(e,t),fe.get(e,t,["handle","ready","width","height","depth","format","usage"]),fe.setGet(e,t,["device","label"]),Sh(e,t)}));var wh=r(757),Oh=r.n(wh),Ah={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function Mh(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=Ph(Oh().mark((function e(t,r,n,a,o){return Oh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,r,n,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=Ph(Oh().mark((function t(r,n,a,o,i){var s;return Oh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(r,n,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(n,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)})));return function(e,r,n,a,o){return t.apply(this,arguments)}}()}var Ih={fieldAssociation:pn.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function Rh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ih,r),fe.obj(e,t),fe.setGet(e,t,["fieldAssociation","captureZValues"]),Mh(e,t)}var Eh={newInstance:fe.newInstance(Rh,"vtkHardwareSelector"),extend:Rh};function Dh(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}function Bh(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}var Vh={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function Lh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vh,r),fe.obj(e,t),t.properties={},fe.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Bh(e,t)}var Nh=function(e){for(var t=1;te.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=zh(o[0],o[1],e.pixBuffer[Fh.ACTOR_PASS],e.area);if(i<=0||i-1>=e.props.length)return null;var s={valid:!0};s.propID=i-1,s.prop=e.props[s.propID];var l=zh(o[0],o[1],e.pixBuffer[Fh.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-1,e.captureZValues){var c=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[c]+e.zBuffer[c+1])/65535,s.displayPosition=t}return s}var u=[t[0],t[1]],d=[0,0],f=Hh(e,t,0,n);if(f&&f.valid)return f;for(var p=1;pp?u[1]-p:0;g<=u[1]+p;++g){if(d[1]=g,u[0]>=p&&(d[0]=u[0]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[0]=u[0]+p,(f=Hh(e,d,0,n))&&f.valid)return f}for(var m=u[0]>=p?u[0]-(p-1):0;m<=u[0]+(p-1);++m){if(d[0]=m,u[1]>=p&&(d[1]=u[1]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[1]=u[1]+p,(f=Hh(e,d,0,n))&&f.valid)return f}}return n[0]=t[0],n[1]=t[1],null}function Kh(e,t,r,n,a){var o=[],i=0;return t.forEach((function(t,s){var l=Nh.newInstance();switch(l.setContentType(Gh.INDICES),e){case Uh.FIELD_ASSOCIATION_CELLS:l.setFieldType(_h.CELL);break;case Uh.FIELD_ASSOCIATION_POINTS:l.setFieldType(_h.POINT);break;default:Wh("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,r&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,n)),l.setSelectionList(t.attributeIDs),o[i]=l,i++})),o}function Xh(e,t,r,n,a){for(var o=Math.floor(t),i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=new Map,u=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Hh(e,[f,d],0,u);if(p&&p.valid){var g=jh(p);if(c.has(g)){var m=c.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(r){t.currentPass===Fh.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+1),t.props.push(r))},e.renderCompositeIndex=function(r){t.currentPass===Fh.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(r+1)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return fe.enumToString(Fh,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(r,n,a){var o=n<0?0:n;if(0===o){if(a[0]=r[0],a[1]=r[1],r[0]t.area[2]||r[1]t.area[3])return null;var i=[r[0]-t.area[0],r[1]-t.area[1]],s=zh(i[0],i[1],t.pixBuffer[Fh.ACTOR_PASS],t.area);if(s<=0||s-1>=t.props.length)return null;var l={valid:!0};l.propID=s-1,l.prop=t.props[l.propID];var c=zh(i[0],i[1],t.pixBuffer[Fh.COMPOSITE_INDEX_PASS],t.area);if((c<0||c>16777215)&&(c=0),l.compositeID=c-1,t.captureZValues){var u=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[u]+t.zBuffer[u+1])/65535,l.displayPosition=r}return l}var d=[r[0],r[1]],f=[0,0],p=e.getPixelInformation(r,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=r[0],a[1]=r[1],null},e.generateSelection=function(r,n,a,o){for(var i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=Math.floor(o),u=new Map,d=[0,0],f=s;f<=c;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=jh(m);if(u.has(v)){var h=u.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yh,r),Eh.extend(e,t,r),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),fe.setGetArray(e,t,["area"],4),fe.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),fe.setGetArray(e,t,["propColorValue"],3),fe.event(e,t,"event"),qh(e,t)}var Qh=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}r.replaceShaderNormal(e,n,a)},e.replaceShaderColor=function(e,n,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),c=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(c=c.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(c=c.concat(["varying vec4 vertexColorVSOutput;"]),o=wl.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=wl.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=wl.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=wl.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=wl.substitute(s,"//VTK::Color::Impl",u).result,s=wl.substitute(s,"//VTK::Color::Dec",c).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}r.replaceShaderColor(e,n,a)},e.replaceShaderPositionVC=function(e,n,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}r.replaceShaderPositionVC(e,n,a)},e.replaceShaderPicking=function(e,n,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=wl.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=wl.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=wl.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=wl.substitute(o,"//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=o}else r.replaceShaderPicking(e,n,a)},e.updateGlyphShaderParameters=function(r,n,a,o,i,s,l,c){var u=a.getProgram();if(r){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],S=d[6],C=d[7],x=d[8],P=f[p],w=f[p+1],O=f[p+2],A=f[p+3],M=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=P*m+w*y+O*S,g[1]=P*v+w*b+O*C,g[2]=P*h+w*T+O*x,g[3]=A*m+M*y+I*S,g[4]=A*v+M*b+I*C,g[5]=A*h+M*T+I*x,g[6]=R*m+E*y+D*S,g[7]=R*v+E*b+D*C,g[8]=R*h+E*T+D*x,u.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),u.setUniformMatrix("MCPCMatrix",t.tmpMat4),n&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),u.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var B=o.getData();t.tmpColor[0]=B[4*l]/255,t.tmpColor[1]=B[4*l+1]/255,t.tmpColor[2]=B[4*l+2]/255,u.setUniform3fArray("ambientColorUniform",t.tmpColor),u.setUniform3fArray("diffuseColorUniform",t.tmpColor)}c&&u.setUniform3fArray("mapperIndex",c.getPropColorValue())},e.renderPieceDraw=function(r,n){var a=n.getProperty().getRepresentation(),o=t.context,i=n.getProperty().getEdgeVisibility()&&a===ey.SURFACE,s=t.openGLCamera.getKeyMatrices(r),l=t.openGLActor.getKeyMatrices();Mo(t.normalMatrix,s.normalMatrix,l.normalMatrix),Ia(t.mcpcMatrix,s.wcpc,l.mcwc),Ia(t.mcvcMatrix,s.wcvc,l.mcwc);var c=t.renderable.getMatrixArray(),u=t.renderable.getNormalArray(),d=t.renderable.getColorArray(),f=c.length/16,p=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===ry.COMPOSITE_INDEX_PASS&&(p=!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)||Jh("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)||Jh("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)||Jh("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)||Jh("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),r.setMapperShaderParameters(e,n,a),void e.getAttributeUpdateTime().modified();r.setMapperShaderParameters(e,n,a)},e.getNeedToRebuildBufferObjects=function(e,n){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,ty.ARRAY_BUFFER),t.normalBuffer.upload(o,ty.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),ty.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),c=0;c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,iy,r),ov.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.normalMatrix=xo(new Float64Array(9)),t.mcpcMatrix=Pa(new Float64Array(16)),t.mcvcMatrix=Pa(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),oy(e,t)}),"vtkOpenGLGlyph3DMapper");function ly(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}_s("vtkGlyph3DMapper",sy);var cy=$u.PrimitiveTypes;function uy(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var r=function(e){for(var t=1;t","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=Xc(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}r.replaceShaderNormal(e,t,n)},e.replaceShaderColor=function(e,n,a){if(t.carray){var o=n.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=n.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else r.replaceShaderColor(e,n,a)},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("vertex");n.addOutput("u32","compositeID","flat");var a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),n=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",n),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}r.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dy,r),fh.extend(e,t,r),t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),t.SSBO=gd.newInstance({label:"glyphSSBO"}),uy(e,t);for(var n=cy.Start;n1&&void 0!==arguments[1]?arguments[1]:{};return gy[e]&&gy[e](t)}function hy(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(r){e.hasRenderer(r)||(r.setRenderWindow(e),t.renderers.push(r),e.modified())},e.removeRenderer=function(r){t.renderers=t.renderers.filter((function(e){return e!==r})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vy(e||t.defaultViewAPI,r)},e.addView=function(r){e.hasView(r)||(r.setRenderable(e),t.views.push(r),e.modified())},e.removeView=function(r){t.views=t.views.filter((function(e){return e!==r})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.preRender=function(){t.renderers.forEach((function(e){e.isActiveCameraCreated()||e.resetCamera()}))},e.render=function(){e.preRender(),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 r=t.getMapper&&t.getMapper();if(r&&r.getPrimitiveCount){var n=r.getPrimitiveCount();Object.keys(n).forEach((function(t){e[t]||(e[t]=0),e[t]+=n[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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fe.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(r,n):void 0})).filter((function(e){return!!e}))}}var yy={defaultViewAPI:py,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function by(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yy,r),fe.obj(e,t),fe.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),fe.get(e,t,["neverRendered"]),fe.getArray(e,t,["renderers"]),fe.event(e,t,"completion"),hy(e,t)}var Ty={newInstance:fe.newInstance(by,"vtkRenderWindow"),extend:by,registerViewConstructor:my,listViewAPIs:function(){return Object.keys(gy)},newAPISpecificView:vy};function Sy(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(fe.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=n,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})),t.delegates.forEach((function(t){t.traverse(r,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})))}}var Cy={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function xy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cy,r),fe.obj(e,t),fe.get(e,t,["currentOperation"]),fe.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),Sy(e,t)}var Py={newInstance:fe.newInstance(xy,"vtkRenderPass"),extend:xy};function wy(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e);for(var a=r.getRenderable().getNumberOfLayers(),o=r.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var u=r.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=yc.newInstance()),t.framebuffer.setOpenGLRenderWindow(r),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===u[0]&&d[1]===u[1]||(t.framebuffer.create(u[0],u[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)),t.overlayActorCount>0&&(e.setCurrentOperation("overlayPass"),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++},e.incrementOverlayActorCount=function(){return t.overlayActorCount++}}var Oy={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function Ay(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Oy,r),Py.extend(e,t,r),fe.get(e,t,["framebuffer"]),wy(e,t)}var My={newInstance:fe.newInstance(Ay,"vtkForwardPass"),extend:Ay},Iy=r(322),Ry=r.n(Iy),Ey=["lastShaderBound","context","openGLRenderWindow"];function Dy(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,r,n){var a=r;n.length>0&&(a=wl.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#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=wl.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#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=wl.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=wl.substitute(l,"varying","out").result,a=wl.substitute(a,"varying","in").result,a=wl.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=wl.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:wl.substitute(n,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,r,n){var a=e.replaceShaderValues(t,r,n),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,r,n){var a="".concat(e).concat(r).concat(n),o=Ry().hash(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=wl.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(r),n&&i.getGeometryShader().setSource(n),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(r){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(r)}))},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 By={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function Vy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,By,r),t.shaderPrograms={},fe.obj(e,t),fe.setGet(e,t,Ey),Dy(e,t)}var Ly={newInstance:fe.newInstance(Vy,"vtkShaderCache"),extend:Vy},Ny=fe.vtkErrorMacro;function ky(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fy,r),fe.obj(e,t),t.textureUnits=[],fe.get(e,t,["numberOfTextureUnits"]),fe.setGet(e,t,["context"]),ky(e,t)}var _y={newInstance:fe.newInstance(Gy,"vtkOpenGLTextureUnitManager"),extend:Gy};function Uy(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var r=e.getViewportByReference();return t.size[0]*(r[2]-r[0])/((r[3]-r[1])*t.size[1])},e.isInViewport=function(t,r,n){var a=n.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=r&&a[3]*o[1]>=r},e.getViewportSize=function(t){var r=t.getViewportByReference(),n=e.getFramebufferSize();return[(r[2]-r[0])*n[0],(r[3]-r[1])*n[1]]},e.getViewportCenter=function(t){var r=e.getViewportSize(t);return[.5*r[0],.5*r[1]]},e.displayToNormalizedDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t/a[0],r/a[1],n]},e.normalizedDisplayToDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t*a[0],r*a[1],n]},e.worldToView=function(e,t,r,n){return n.worldToView(e,t,r)},e.viewToWorld=function(e,t,r,n){return n.viewToWorld(e,t,r)},e.worldToDisplay=function(t,r,n,a){var o=a.worldToView(t,r,n),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,r,n,a){var o=e.displayToNormalizedDisplay(t,r,n),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,r,n,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,r,n);return[i[0]-o[0]-.5,i[1]-o[1]-.5,n]},e.viewportToNormalizedViewport=function(t,r,n,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),r/(o[1]-1),n]:[t,r,n]},e.normalizedViewportToViewport=function(t,r,n,a){var o=e.getViewportSize(a);return[t*(o[0]-1),r*(o[1]-1),n]},e.displayToLocalDisplay=function(t,r,n){return[t,e.getFramebufferSize()[1]-r-1,n]},e.viewportToNormalizedDisplay=function(t,r,n,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=r+o[1]+.5;return e.displayToNormalizedDisplay(i,s,n)},e.getPixelData=function(e,t,r,n){fe.vtkErrorMacro("not implemented")},e.createSelector=function(){fe.vtkErrorMacro("not implemented")}}var Wy={size:void 0,selector:void 0};function jy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,r),t.size||(t.size=[300,300]),fe.getArray(e,t,["size"],2),fe.get(e,t,["selector"]),Vs.extend(e,t,r),Uy(e,t)}var zy={newInstance:fe.newInstance(jy,"vtkRenderWindowViewNode"),extend:jy},Hy=fe.vtkDebugMacro,Ky=fe.vtkErrorMacro,Xy={position:"absolute",top:0,left:0,width:"100%",height:"100%"},qy=1,Yy=-.7,Zy=.25,Qy=-.5;function $y(e,t,r){var n=e.createFramebuffer(),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,r,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),o===e.FRAMEBUFFER_COMPLETE}var Jy=0,eb=[];function tb(){Jy++,eb.forEach((function(e){return e(Jy)}))}function rb(){Jy--,eb.forEach((function(e){return e(Jy)}))}function nb(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow"),e.getViewNodeFactory=function(){return t.myFactory};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(r){if(r){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=_y.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var r=t.context;r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),r.depthFunc(r.LEQUAL),r.enable(r.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(r){t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&Ky("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!==r&&(t.el=r,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(),r=e.width,n=e.height;t.containerSize=[r,n]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.getPixelData=function(e,r,n,a){var o=new Uint8Array((n-e+1)*(a-r+1)*4);return t.context.readPixels(e,r,n-e+1,a-r+1,t.context.RGBA,t.context.UNSIGNED_BYTE,o),o},e.get3DContext=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},n=null;void 0!==navigator.xr&&navigator.xr.isSessionSupported("immersive-vr")&&e.invokeHaveVRDisplay();var a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(n=t.canvas.getContext("webgl2",r))&&(t.webgl2=!0,Hy("using webgl2")),n||(Hy("using webgl1"),n=t.canvas.getContext("webgl",r)||t.canvas.getContext("experimental-webgl",r)),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),n},e.startXR=function(r){if(void 0===navigator.xr)throw new Error("WebXR is not available");t.xrSessionIsAR=r;var n=r?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(n))throw r?new Error("Device does not support AR session"):new Error("VR display is not available");if(null!==t.xrSession)throw new Error("XR Session already exists!");navigator.xr.requestSession(n).then(e.enterXR,(function(){throw new Error("Failed to create XR session!")}))},e.enterXR=function(){var n=Ph(Oh().mark((function n(a){var o,i;return Oh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.xrSession=a,t.oldCanvasSize=t.size.slice(),null===t.xrSession){n.next=15;break}return o=e.get3DContext(),n.next=6,o.makeXRCompatible();case 6:i=new r.g.XRWebGLLayer(t.xrSession,o),e.setSize(i.framebufferWidth,i.framebufferHeight),t.xrSession.updateRenderState({baseLayer:i}),t.xrSession.requestReferenceSpace("local").then((function(e){t.xrReferenceSpace=e})),e.resetXRScene(),t.renderable.getInteractor().switchToXRAnimation(),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),n.next=16;break;case 15:throw new Error("Failed to enter VR with a null xrSession.");case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),e.resetXRScene=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qy,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yy,n=e,a=r;t.xrSessionIsAR&&n===qy&&(n=Zy),t.xrSessionIsAR&&a===Yy&&(a=Qy);var o=t.renderable.getRenderers()[0];o.resetCamera();var i=o.getActiveCamera(),s=i.getPhysicalScale(),l=i.getPhysicalTranslation();a*=s/=n,l[2]+=a,i.setPhysicalScale(s),i.setPhysicalTranslation(l)},e.stopXR=Ph(Oh().mark((function r(){var n,a;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==navigator.xr){r.next=2;break}return r.abrupt("return");case 2:if(null===t.xrSession){r.next=10;break}return t.xrSession.cancelAnimationFrame(t.xrSceneFrame),t.renderable.getInteractor().returnFromXRAnimation(),(n=e.get3DContext()).bindFramebuffer(n.FRAMEBUFFER,null),r.next=9,t.xrSession.end().catch((function(e){if(!(e instanceof DOMException))throw e}));case 9:t.xrSession=null;case 10:void 0!==t.oldCanvasSize&&e.setSize.apply(e,f(t.oldCanvasSize)),(a=t.renderable.getRenderers()[0]).getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.traverseAllPasses();case 16:case"end":return r.stop()}}),r)}))),e.xrRender=function(){var r=Ph(Oh().mark((function r(n,a){var o,i,s,l,c;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=a.session,t.renderable.getInteractor().updateXRGamepads(o,a,t.xrReferenceSpace),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),(i=a.getViewerPose(t.xrReferenceSpace))&&(s=e.get3DContext(),t.xrSessionIsAR&&void 0!==t.oldCanvasSize&&(s.canvas.width=t.oldCanvasSize[0],s.canvas.height=t.oldCanvasSize[1]),l=o.renderState.baseLayer,s.bindFramebuffer(s.FRAMEBUFFER,l.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),c=t.renderable.getRenderers()[0],i.views.forEach((function(r){var n=l.getViewport(r);if(s.viewport(n.x,n.y,n.width,n.height),!t.xrSessionIsAR)if("left"===r.eye)c.setViewport(0,0,.5,1);else{if("right"!==r.eye)return;c.setViewport(.5,0,1,1)}c.getActiveCamera().computeViewParametersFromPhysicalMatrix(r.transform.inverse.matrix),c.getActiveCamera().setProjectionMatrix(r.projectionMatrix),e.traverseAllPasses()})));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.restoreContext=function(){var t=Py.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(r){var n=t._textureResourceIds.get(r);if(void 0===n){var a=e.getTextureUnitManager().allocate();a<0?Ky("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(r,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+n)},e.deactivateTexture=function(r){var n=t._textureResourceIds.get(r);void 0!==n&&(e.getTextureUnitManager().free(n),t._textureResourceIds.delete(r))},e.getTextureUnitForTexture=function(e){var r=t._textureResourceIds.get(e);return void 0!==r?r:-1},e.getDefaultTextureInternalFormat=function(e,r,n){if(t.webgl2){if(e===i.UNSIGNED_CHAR)switch(r){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;default:return t.context.RGBA8}switch(r){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;default:return t.context.RGBA16F}}switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.resetCamera,o=void 0!==a&&a,i=n.size,s=void 0===i?null:i,l=n.scale,c=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=r;var u=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==c?s||t.size.map((function(e){return e*c})):null},new Promise((function(r,n){var a=e.onImageReady((function(n){if(null===t._screenshot.size)t.notifyStartCaptureImage=u,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach((function(e){return(0,e.restoreParamsFn)(e.arg)})),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(n);else{var i=document.createElement("img");if(i.style=Xy,i.src=n,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o){var s=!0!==o;t._screenshot.cameras=t.renderable.getRenderers().map((function(e){var t=e.getActiveCamera(),r=t.get("focalPoint","position","parallelScale");return{resetCameraArgs:s?{renderer:e}:void 0,resetCameraFn:s?o:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(r))}})),t._screenshot.cameras.forEach((function(e){return(0,e.resetCameraFn)(e.resetCameraArgs)}))}e.traverseAllPasses()}}))}))},e.getGLInformations=function(){for(var r=e.get3DContext(),n=r.getExtension("OES_texture_float"),a=r.getExtension("OES_texture_half_float"),o=r.getExtension("WEBGL_debug_renderer_info"),i=r.getExtension("WEBGL_draw_buffers"),s=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",r.getParameter(r.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",r.getParameter(r.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",r.getParameter(r.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&r.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",r.getParameter(r.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",r.getParameter(r.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",r.getParameter(r.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",r.getParameter(r.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",r.getParameter(r.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",r.getParameter(r.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",r.getParameter(r.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",r.getParameter(r.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",r.getParameter(r.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",r.getParameter(r.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",r.getParameter(r.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",r.getParameter(r.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",r.getParameter(r.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.UNSIGNED_BYTE)?"RGBA":"",n&&$y(r,r.RGB,r.UNSIGNED_BYTE)?"RGB":"",n&&$y(r,r.LUMINANCE,r.UNSIGNED_BYTE)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.UNSIGNED_BYTE)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&$y(r,r.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&$y(r,r.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&$y(r,r.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&$y(r,r.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&$y(r,r.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.FLOAT)?"RGBA":"",n&&$y(r,r.RGB,r.FLOAT)?"RGB":"",n&&$y(r,r.LUMINANCE,r.FLOAT)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.FLOAT)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?r.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",r.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",r.getParameter(r.RENDERER)],["WebGL Vendor","VENDOR",r.getParameter(r.VENDOR)],["WebGL Version","VERSION",r.getParameter(r.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",r.getParameter(r.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&r.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],c={};l.length;){var d=u(l.pop(),3),f=d[0],p=d[1],g=d[2];p&&(c[p]={label:f,value:g})}return c},e.traverseAllPasses=function(){if(t.renderPasses)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,n=document.createElement("canvas"),a=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,r),zy.extend(e,t,r),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",tb(),t.selector||(t.selector=Qh.newInstance(),t.selector.setOpenGLRenderWindow(e)),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,t.myFactory=zs.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",ib),t.shaderCache=Ly.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=My.newInstance(),fe.event(e,t,"imageReady"),fe.event(e,t,"haveVRDisplay"),fe.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage","xrSupported"]),fe.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen","activeFramebuffer"]),fe.setGetArray(e,t,["size"],2),nb(e,t)}var ib=fe.newInstance(ob,"vtkOpenGLRenderWindow");my("WebGL",ib);var sb={newInstance:ib,extend:ob,pushMonitorGLContextCount:function(e){eb.push(e)},popMonitorGLContextCount:function(e){return eb.pop()}},lb=fe.vtkDebugMacro;function cb(e,t){t.classHierarchy.push("vtkCamera");var r=new Float64Array(3),n=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),o=Pa(new Float64Array(16)),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3),c=Pa(new Float64Array(16)),u=Pa(new Float64Array(16)),d=new Float64Array(3),p=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 r=e.getViewMatrix();t.viewUp[0]=r[4],t.viewUp[1]=r[5],t.viewUp[2]=r[6],e.modified()},e.setPosition=function(r,n,a){r===t.position[0]&&n===t.position[1]&&a===t.position[2]||(t.position[0]=r,t.position[1]=n,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(r,n,a){r===t.focalPoint[0]&&n===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=r,t.focalPoint[1]=n,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(r){if(t.distance!==r){t.distance=r,t.distance<1e-20&&(t.distance=1e-20,lb("Distance is set to minimum."));var n=t.directionOfProjection;t.focalPoint[0]=t.position[0]+n[0]*t.distance,t.focalPoint[1]=t.position[1]+n[1]*t.distance,t.focalPoint[2]=t.position[2]+n[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],r=t.focalPoint[1]-t.position[1],n=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+r*r+n*n),t.distance<1e-20){t.distance=1e-20,lb("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]=r/t.distance,t.directionOfProjection[2]=n/t.distance,g()},e.dolly=function(r){if(!(r<=0)){var n=t.distance/r;e.setPosition(t.focalPoint[0]-n*t.directionOfProjection[0],t.focalPoint[1]-n*t.directionOfProjection[1],t.focalPoint[2]-n*t.directionOfProjection[2])}},e.roll=function(r){var n=t.position,a=t.focalPoint,o=t.viewUp,i=new Float64Array([o[0],o[1],o[2],0]);Pa(c);var s=new Float64Array([a[0]-n[0],a[1]-n[1],a[2]-n[2]]);Da(c,c,Ce(r),s),ri(i,i,c),t.viewUp[0]=i[0],t.viewUp[1]=i[1],t.viewUp[2]=i[2],e.modified()},e.azimuth=function(r){var n=t.focalPoint;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.yaw=function(r){var n=t.position;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint(p[0],p[1],p[2])},e.elevation=function(r){var n=t.focalPoint,a=e.getViewMatrix(),o=[-a[0],-a[1],-a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.pitch=function(r){var n=t.position,a=e.getViewMatrix(),o=[a[0],a[1],a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint.apply(e,f(p))},e.zoom=function(r){r<=0||(t.parallelProjection?t.parallelScale/=r:t.viewAngle/=r,e.modified())},e.translate=function(r,n,a){var o=[r,n,a];Le(t.position,o,t.position),Le(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(r){var n=[].concat(f(t.viewUp),[1]),a=[],o=[],i=[];n[0]+=t.position[0],n[1]+=t.position[1],n[2]+=t.position[2],ri(a,[].concat(f(t.position),[1]),r),ri(o,[].concat(f(t.focalPoint),[1]),r),ri(i,n,r),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,f(a.slice(0,3))),e.setFocalPoint.apply(e,f(o.slice(0,3))),e.setViewUp.apply(e,f(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+n)},e.setThicknessFromFocalPoint=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.distance-n/2,t.distance+n/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,r,n=ii(e[0],e[1],e[2],e[3]),a=ni(),o=ii(0,0,1,0);return r=n,(t=a)[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],oi(o,n,o),oi(o,o,a),[o[0],o[1],o[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),Oa(t,t)},e.getWorldToPhysicalMatrix=function(e){Pa(e);var r=[3];_e(t.physicalViewNorth,t.physicalViewUp,r),e[0]=r[0],e[1]=r[1],e[2]=r[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],wa(e,e),In(i,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),Ea(e,e,i),Ra(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(c){Oa(o,c),Jn(i,r,o),e.computeDistance();var u=t.distance;e.setPosition(i[0],i[1],i[2]),Jn(s,n,o),En(s,s,i),Kn(s,s),e.setDirectionOfProjection(s[0],s[1],s[2]),Jn(l,a,o),En(l,l,i),Kn(l,l),e.setViewUp(l[0],l[1],l[2]),e.setDistance(u)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(o),Ia(o,t,o),e.computeViewParametersFromViewMatrix(o)},e.setViewMatrix=function(r){t.viewMatrix=r,t.viewMatrix&&(Sa(o,t.viewMatrix),e.computeViewParametersFromViewMatrix(o),wa(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;ao(o,t.position,t.focalPoint,t.viewUp),wa(o,o);var e=new Float64Array(16);return Sa(e,o),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,r,n){var a=new Float64Array(16);if(Pa(a),t.projectionMatrix){var s=1/t.physicalScale;return In(i,s,s,s),Sa(a,t.projectionMatrix),Ea(a,a,i),wa(a,a),a}Pa(o);var l=t.clippingRange[1]-t.clippingRange[0],c=[t.clippingRange[0]+(r+1)*l/2,t.clippingRange[0]+(n+1)*l/2];if(t.parallelProjection){var u=t.parallelScale*e,d=t.parallelScale,f=(t.windowCenter[0]-1)*u,p=(t.windowCenter[0]+1)*u,g=(t.windowCenter[1]-1)*d,m=(t.windowCenter[1]+1)*d;ro(o,f,p,g,m,c[0],c[1]),wa(o,o)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var v,h,y=Math.tan(Ce(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(v=t.clippingRange[0]*y,h=t.clippingRange[0]*y/e):(v=t.clippingRange[0]*y*e,h=t.clippingRange[0]*y);var b=(t.windowCenter[0]-1)*v,T=(t.windowCenter[0]+1)*v,S=(t.windowCenter[1]-1)*h,C=(t.windowCenter[1]+1)*h,x=c[0],P=c[1];o[0]=2*x/(T-b),o[5]=2*x/(C-S),o[2]=(b+T)/(T-b),o[6]=(S+C)/(C-S),o[10]=-(x+P)/(P-x),o[14]=-1,o[11]=-2*x*P/(P-x),o[15]=0}return Sa(a,o),a},e.getCompositeProjectionMatrix=function(t,r,n){var a=e.getViewMatrix(),o=e.getProjectionMatrix(t,r,n);return Ia(o,a,o),o},e.setDirectionOfProjection=function(e,r,n){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==r||t.directionOfProjection[2]!==n){t.directionOfProjection[0]=e,t.directionOfProjection[1]=r,t.directionOfProjection[2]=n;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(r,n,a,o){var i=[3];_e(t.physicalViewNorth,t.physicalViewUp,i);var s=Pa(new Float64Array(16));Da(s,s,Ce(r),t.physicalViewUp),Da(s,s,Ce(n),i),Da(s,s,Ce(a),t.physicalViewNorth),Da(s,s,Ce(-o),t.physicalViewUp);var l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),c=new Float64Array(t.physicalViewNorth);Jn(l,l,s),Jn(c,c,s),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(c[0],c[1],c[2]),e.modified()},e.setOrientationWXYZ=function(t,r,n,a){var o=Pa(new Float64Array(16));if(0!==t&&(0!==r||0!==n||0!==a)){var i=Ce(t),s=ni();ai(s,[r,n,a],i),Ya(o,s)}var l=new Float64Array(3);Jn(l,[0,0,-1],o);var c=new Float64Array(3);Jn(c,[0,1,0],o),e.setDirectionOfProjection.apply(e,f(l)),e.setViewUp.apply(e,f(c)),e.modified()},e.computeClippingRange=function(e){var r,n;r=t.viewPlaneNormal,n=t.position;for(var a=-r[0],o=-r[1],i=-r[2],s=-(a*n[0]+o*n[1]+i*n[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],c=0;c<2;c++)for(var u=0;u<2;u++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+u]+i*e[4+c]+s;l[0]=fl[1]?f:l[1]}return l}}var ub={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 db(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ub,r),fe.obj(e,t),fe.get(e,t,["distance"]),fe.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),fe.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),fe.setGetArray(e,t,["clippingRange","windowCenter"],2),fe.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),cb(e,t)}var fb={newInstance:fe.newInstance(db,"vtkCamera"),extend:db};function pb(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,gb,r),fe.obj(e,t),fe.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),fe.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),pb(e,t)}var vb={newInstance:fe.newInstance(mb,"vtkLight"),extend:mb,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},hb=fe.vtkErrorMacro;function yb(e,t){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var n=e.getNestedProps();if(n&&n.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bb,r),fe.obj(e,t),fe.event(e,t,"event"),fe.setGetArray(e,t,["viewport"],4),fe.setGetArray(e,t,["background","background2"],3),yb(e,t)}var Sb={newInstance:fe.newInstance(Tb,"vtkViewport"),extend:Tb},Cb=k,xb=F,Pb=G;function wb(e){return function(){return xb("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function Ob(e,t){t.classHierarchy.push("vtkRenderer");var r={type:"ComputeVisiblePropBoundsEvent",renderer:e},n={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(Cb("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var r=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(r.getPositionByReference()),e.setFocalPointFrom(r.getFocalPointByReference()),e.modified(r.getMTime())):xb("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=wb("allocateTime"),e.updateGeometry=wb("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(r){Cb(e.getClassName(),e,"setting Layer to ",r),t.layer!==r&&(t.layer=r,e.modified()),e.setPreserveColorBuffer(!!r)},e.setActiveCamera=function(r){return t.activeCamera!==r&&(t.activeCamera=r,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:r}),!0)},e.makeCamera=function(){var t=fb.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(r){t.actors=t.actors.filter((function(e){return e!==r})),e.removeViewProp(r),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(r){t.volumes=t.volumes.filter((function(e){return e!==r})),e.removeViewProp(r),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(r){t.lights=[].concat(t.lights,r),e.modified()},e.removeLight=function(r){t.lights=t.lights.filter((function(e){return e!==r})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(r){t.lights=r,e.modified()},e.makeLight=vb.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,r,n,a){var o=e.normalizedDisplayToProjection(t,r,n);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,r,n,a){var o=e.worldToView(t,r,n);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,r,n){if(null===t.activeCamera)return xb("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Oa(a,a),wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.projectionToView=function(e,r,n,a){if(null===t.activeCamera)return xb("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);Oa(o,o),wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.worldToView=function(e,r,n){if(null===t.activeCamera)return xb("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.viewToProjection=function(e,r,n,a){if(null===t.activeCamera)return xb("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.computeVisiblePropBounds=function(){t.allBounds[0]=Hr.INIT_BOUNDS[0],t.allBounds[1]=Hr.INIT_BOUNDS[1],t.allBounds[2]=Hr.INIT_BOUNDS[2],t.allBounds[3]=Hr.INIT_BOUNDS[3],t.allBounds[4]=Hr.INIT_BOUNDS[4],t.allBounds[5]=Hr.INIT_BOUNDS[5];var n=!0;e.invokeEvent(r);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 n&&(St(t.allBounds),Cb("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=r||e.computeVisiblePropBounds(),o=[0,0,0];if(!Ct(n))return Cb("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return xb("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),o[0]=(n[0]+n[1])/2,o[1]=(n[2]+n[3])/2,o[2]=(n[4]+n[5])/2;var s=n[1]-n[0],l=n[3]-n[2],c=n[5]-n[4],u=(s*=s)+(l*=l)+(c*=c);u=0===u?1:u,u=.5*Math.sqrt(u);var d=Ce(t.activeCamera.getViewAngle()),f=u,p=u/Math.sin(.5*d),g=t.activeCamera.getViewUp();return Math.abs(Ge(g,i))>.999&&(Pb("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(o[0],o[1],o[2]),t.activeCamera.setPosition(o[0]+p*i[0],o[1]+p*i[1],o[2]+p*i[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(f),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-o[0],-o[1],-o[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=r||e.computeVisiblePropBounds();if(!Ct(a))return Cb("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return xb("Trying to reset clipping range of non-existent camera"),!1;var o=t.activeCamera.computeClippingRange(a),i=0;if(t.activeCamera.getParallelProjection())i=.2*t.activeCamera.getParallelScale();else{var s=Ce(t.activeCamera.getViewAngle());i=.2*Math.tan(s/2)*o[1]}return o[1]-o[0]=o[1]?.01*o[1]:o[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),o[0]e&&(e=r);var n=t.createdLight?t.createdLight.getMTime():0;return n>e&&(e=n),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var Ab={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:Dt(),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 Mb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Object.assign(t,Ab,r),Sb.extend(e,t,r),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1),Q(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),te(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),re(e,t,["actors","volumes","lights"]),ae(e,t,["background"],4,1),Ob(e,t)}var Ib={newInstance:ie(Mb,"vtkRenderer"),extend:Mb},Rb={Unknown:0,LeftController:1,RightController:2},Eb={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},Db={Device:Rb,Input:Eb,Axis:{Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4}};function Bb(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}function Vb(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],o=document,i=r?"addEventListener":"removeEventListener",s=r?"removeEventListener":"addEventListener";!a&&!r&&n>0&&--n,n&&!a||(n=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&r&&++n}function u(){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){Fb("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(r){t.interactorStyle!==r&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=r,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 kb("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||a(0,0),t.currentRenderer},e.bindEvents=function(r){t.container=r,r.addEventListener("contextmenu",jb),r.addEventListener("wheel",e.handleWheel),r.addEventListener("DOMMouseScroll",e.handleWheel),r.addEventListener("mouseenter",e.handleMouseEnter),r.addEventListener("mouseleave",e.handleMouseLeave),r.addEventListener("mousemove",e.handleMouseMove),r.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),r.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){c(!1,!0),t.container.removeEventListener("contextmenu",jb),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.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var r=l(t);e.keyPressEvent(r)},e.handleKeyDown=function(t){var r=l(t);e.keyDownEvent(r)},e.handleKeyUp=function(t){var r=l(t);e.keyUpEvent(r)},e.handleMouseDown=function(t){if(!(t.button>2)){c(!0),jb(t);var r=Vb(Vb({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(r);break;case 1:e.middleButtonPressEvent(r);break;case 2:e.rightButtonPressEvent(r);break;default:Fb("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(n){void 0!==n?r.has(n)?kb("requester is already registered for animating"):(r.add(n),t.animationRequest||1!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Fb("undefined requester, can not start animating")},e.extendAnimation=function(n){var a=Date.now()+n;t._animationExtendedEnd=Math.max(t._animationExtendedEnd,a),t.animationRequest||0!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())},e.isAnimating=function(){return t.xrAnimation||null!==t.animationRequest},e.cancelAnimation=function(n){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.has(n))r.delete(n),t.animationRequest&&0===r.size&&Date.now()>t._animationExtendedEnd&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=n&&n.getClassName?n.getClassName():n;kb("".concat(o," did not request an animation"))}},e.switchToXRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.xrAnimation=!0},e.returnFromXRAnimation=function(){t.xrAnimation=!1,0!==r.size&&(t.recentAnimationFrameRate=10,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateXRGamepads=function(r,n,a){r.inputSources.forEach((function(r){var o=null==r.gripSpace?null:n.getPose(r.gripSpace,a),i=r.gamepad,s=r.handedness;if(i){i.index in t.lastGamepadValues||(t.lastGamepadValues[i.index]={left:{buttons:{}},right:{buttons:{}}});for(var l=0;l1e3&&t._animationFrameCount>1&&(t.recentAnimationFrameRate=1e3*(t._animationFrameCount-1)/(n-t._animationStartTime),t.lastFrameTime=1/t.recentAnimationFrameRate,e.animationFrameRateUpdateEvent(),t._animationStartTime=n,t._animationFrameCount=1),e.animationEvent(),u(),r.size>0||Date.now()1){var n=i(r.touches);if(2===r.touches.length){var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",n)}else{var s={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(r){if(jb(r),t.recognizeGestures&&r.touches.length>1){var n=i(r.touches);e.recognizeGesture("TouchMove",n)}else{var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(r){if(jb(r),t.recognizeGestures)if(0===r.touches.length)if(1===r.changedTouches.length){var n={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(n),c(!1)}else{var a=i(r.changedTouches);e.recognizeGesture("TouchEnd",a),c(!1)}else if(1===r.touches.length){var s=i(r.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var u=i(r.touches);e.recognizeGesture("TouchMove",u)}else{var d={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),c(!1)}},e.setView=function(r){t.view!==r&&(t.view=r,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){var e,r,n;return null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r||null===(n=r.getRenderersByReference())||void 0===n?void 0:n[0]},e.findPokedRenderer=function(){var e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var o=null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r?void 0:r.getRenderers();if(!o)return null;o.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var i=null,s=null,l=null,c=o.length;c--;){var u=o[c];if(t.view.isInViewport(n,a,u)&&u.getInteractive()){l=u;break}null===i&&u.getInteractive()&&(i=u),null===s&&t.view.isInViewport(n,a,u)&&(s=u)}return null===l&&(l=i),null===l&&(l=s),null==l&&(l=o[0]),l},e.render=function(){e.isAnimating()||t.inRender||u()},Wb.forEach((function(r){var n=r.charAt(0).toLowerCase()+r.slice(1);e["".concat(n,"Event")]=function(n){if(t.enabled)if(e.getCurrentRenderer()){var a=Vb({type:r,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},n);e["invoke".concat(r)](a)}else _b("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(r,n){if(!(Object.keys(n).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===r)return Object.keys(n).forEach((function(e){t.startingEventPositions[e]=n[e]})),void(t.currentGesture="Start");if("TouchEnd"===r)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,o=[],i=[];Object.keys(n).forEach((function(e){o[a]=n[e],i[a]=t.startingEventPositions[e],a++}));var s=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((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),c=xe(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),u=xe(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=u-c;u=u+180>=360?u-180:u+180,c=c+180>=360?c-180:c+180,Math.abs(u-c)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:n};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:n};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:n};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:n};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var S={scale:l/s,touches:n};e.pinchEvent(S)}if("Pan"===t.currentGesture){var C={translation:f,touches:n};e.panEvent(C)}}}},e.handleVisibilityChange=function(){t._animationStartTime=Date.now(),t._animationFrameCount=0},e.setCurrentRenderer=function(e){t._forcedRenderer=!!e,t.currentRenderer=e};var d=e.delete;e.delete=function(){for(;r.size;)e.cancelAnimation(r.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var Hb={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,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function Kb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hb,r),fe.obj(e,t),t._animationExtendedEnd=0,fe.event(e,t,"RenderEvent"),Wb.forEach((function(r){return fe.event(e,t,r)})),fe.get(e,t,["initialized","container","interactorStyle","lastFrameTime","recentAnimationFrameRate","view"]),fe.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),zb(e,t)}var Xb=Vb({newInstance:fe.newInstance(Kb,"vtkRenderWindowInteractor"),extend:Kb,handledEvents:Wb},Db);function qb(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}function Yb(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jb,r),fe.obj(e,t),fe.event(e,t,"InteractionEvent"),fe.event(e,t,"StartInteractionEvent"),fe.event(e,t,"EndInteractionEvent"),fe.get(e,t,["interactor","enabled"]),fe.setGet(e,t,["priority","processEvents"]),$b(e,t)}var tT=Yb({newInstance:fe.newInstance(eT,"vtkInteractorObserver"),extend:eT},{computeWorldToDisplay:function(e,t,r,n){return e.getRenderWindow().getViews()[0].worldToDisplay(t,r,n,e)},computeDisplayToWorld:function(e,t,r,n){return e.getRenderWindow().getViews()[0].displayToWorld(t,r,n,e)}}),rT={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 nT(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 aT=rT.States,oT={Rotate:aT.IS_ROTATE,Pan:aT.IS_PAN,Spin:aT.IS_SPIN,Dolly:aT.IS_DOLLY,CameraPose:aT.IS_CAMERA_POSE,WindowLevel:aT.IS_WINDOW_LEVEL,Slice:aT.IS_SLICE};function iT(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(oT).forEach((function(r){fe.event(e,t,"Start".concat(r,"Event")),e["start".concat(r)]=function(){t.state===aT.IS_NONE&&(t.state=oT[r],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(r,"Event")]({type:"Start".concat(r,"Event")}))},fe.event(e,t,"End".concat(r,"Event")),e["end".concat(r)]=function(){t.state===oT[r]&&(t.state=aT.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(r,"Event")]({type:"End".concat(r,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var r=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),r.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),r.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),r.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),r.render()}}}var sT={state:aT.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function lT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sT,r),tT.extend(e,t,r),iT(e,t)}var cT=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fT,r),cT.extend(e,t,r),fe.setGet(e,t,["motionFactor","zoomFactor"]),dT(e,t)}var gT={newInstance:fe.newInstance(pT,"vtkInteractorStyleTrackballCamera"),extend:pT};function mT(e,t){var r=e.invokeResize;delete e.invokeResize,t.renderWindow=Ty.newInstance(),t.renderer=Ib.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=sb.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Xb.newInstance(),t.interactor.setInteractorStyle(gT.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,f(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),n=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*n),Math.floor(e.height*n)),r(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=fe.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}var vT={background:[.32,.34,.43],listenWindowResize:!0,container:null};function hT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vT,r),fe.obj(e,t),fe.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),fe.event(e,t,"resize"),mT(e,t)}var yT={newInstance:fe.newInstance(hT),extend:hT},bT={PICKING_BUFFER:0,FRONT_BUFFER:1},TT={ViewTypes:{DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},RenderingTypes:bT,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}};function ST(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(r){var n=r.selectedState,a=r.representation;t.widgetState.activateOnly(n),t.activeState=n,n&&n.updateManipulator&&n.updateManipulator(),e.invokeActivateHandle({selectedState:n,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CT,r),fi.extend(e,t,r),tT.extend(e,t,r),fe.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),fe.get(e,t,["representations","widgetState"]),fe.event(e,t,"ActivateHandle"),ST(e,t)}var PT={newInstance:fe.newInstance(xT,"vtkAbstractWidget"),extend:xT};function wT(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,r,n,a,o){if(t.callback){var i=r.getCompositeProjectionMatrix(n,-1,1);wa(i,i);for(var s=e.getPoints(),l=new Float64Array(3),c=a.usize,u=a.vsize,d=c/2,f=u/2,p=[],g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OT,r),Jp.extend(e,t,r),fe.setGet(e,t,["callback","useZValues"]),wT(e,t)}var MT={newInstance:fe.newInstance(AT,"vtkPixelSpaceCallbackMapper"),extend:AT},IT=0,RT=1,ET=fe.vtkErrorMacro,DT=fe.vtkWarningMacro;function BT(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var r={mtimes:{},states:[]};function n(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),kp.forEach((function(r){if(t[r]){var n="setRelativeCoincidentTopology".concat(r,"OffsetParameters");if(e[n]){var a=t[r],o=a.factor,i=a.offset;e[n](o,i)}}})))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var r=arguments.length,n=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return r.mtimes.representation===e.getMTime()&&r.mtimes.input===n.getMTime()||(r.mtimes.representation=e.getMTime(),r.mtimes.input=n.getMTime(),r.states=[],t.labels.forEach((function(e){r.states=r.states.concat(n.getStatesWithLabel(e)||[])}))),r.states},e.getSelectedState=function(t,r){var n=e.getRepresentationStates();return r0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!0;switch(t.behavior){case IT:a=e===bT.PICKING_BUFFER||n;break;case RT:a=r;break;default:a=!0}for(var o=a,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,r),fi.extend(e,t,r),fe.algo(e,t,1,1),fe.get(e,t,["labels","coincidentTopologyParameters"]),fe.set(e,t,["displayScaleParams"]),fe.setGet(e,t,["scaleInPixels"]),BT(e,t)};var NT=function(e){return{name:e,attrs:{},eventListeners:{},textContent:null,children:[],setAttribute:function(e,t){this.attrs[e]=t},removeAttribute:function(e){delete this.attrs[e]},appendChild:function(e){this.children.push(e)},addEventListeners:function(e,t){this.eventListeners[e]=t}}};function kT(e){for(var t=document.createElementNS("http://www.w3.org/2000/svg",e.name),r=Object.keys(e.attrs),n=0;n=s;g--)p(g)}return r}var GT=TT.ViewTypes,_T=TT.RenderingTypes,UT=TT.CaptureOn,WT=fe.vtkErrorMacro,jT=fe.vtkWarningMacro,zT=NT,HT=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},KT=1;function XT(e){var t=e.getActiveCamera(),r=e.getRenderWindow(),n=r.getInteractor(),a=n.getView();return{renderer:e,renderWindow:r,interactor:n,apiSpecificRenderWindow:a,camera:t}}function qT(e,t){t.viewId||(t.viewId="view-".concat(KT++)),t.classHierarchy.push("vtkWidgetManager");var r,n=new WeakMap,a=new WeakMap,o=new WeakMap,i=[];function s(e){return e&&(e.isA("vtkAbstractWidget")?e:e.getWidgetForView({viewId:t.viewId}))}t.svgRoot=(t.viewId,(r=HT("svg")).setAttribute("style","position: absolute; top: 0; left: 0; width: 100%; height: 100%;"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r);var l=new WeakMap;function c(){var e=t.apiSpecificRenderWindow.getReferenceByName("el"),r=t.apiSpecificRenderWindow.getCanvas();e.insertBefore(t.svgRoot,r.nextSibling),"static"===window.getComputedStyle(e).position&&(e.style.position="relative")}function d(){var e=u(t.apiSpecificRenderWindow.getSize(),2),r=e[0],n=e[1],a=window.devicePixelRatio||1,o=String(r/a),i=String(n/a),s="0 0 ".concat(r," ").concat(n),l=t.svgRoot.getAttribute("width"),c=t.svgRoot.getAttribute("height"),d=t.svgRoot.getAttribute("viewBox");l!==o&&t.svgRoot.setAttribute("width",o),c!==i&&t.svgRoot.setAttribute("height",i),d!==s&&t.svgRoot.setAttribute("viewBox",s)}function f(){if(t.useSvgLayer)for(var e=function(e){var r=t.widgets[e],n=r.getRepresentations().filter((function(e){return e.isA("vtkSVGRepresentation")})),i=[];r.getVisibility()&&(i=n.filter((function(e){return e.getVisibility()})).map((function(e){return e.render()})));var s=Promise.all(i),c=l.get(r)||[];c.push(s),l.set(r,c),s.then((function(e){var n=l.get(r)||[],i=n.indexOf(s);if(!t.deleted&&!r.isDeleted()&&-1!==i){n=n.slice(i+1),l.set(r,n);for(var c=o.get(r),u=zT("g"),d=0;dc[2]||ac[3])){r.next=23;break}return r.next=23,h(n,a,n,a);case 23:t.selections=t._capturedBuffers.generateSelection(n,a,n,a);case 24:return r.abrupt("return",e.getSelectedData());case 25:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.updateSelectionFromXY=function(e,r){if(jT("updateSelectionFromXY is deprecated, please use getSelectedDataForXY"),t.pickingEnabled){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,YT,r),fe.obj(e,t),fe.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:GT}]),fe.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),qT(e,t)}var QT={newInstance:fe.newInstance(ZT,"vtkWidgetManager"),extend:ZT,Constants:TT};function $T(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}function JT(e){for(var t=1;t1&&(m[e]=fe.chain.apply(fe,f(t)))}))})),m.delete=fe.chain((function(){delete r[a]}),m.delete),m.setInteractor(u);var h=Object.freeze(m);return r[a]=h,h}return r[a]},e.getViewIds=function(){return Object.keys(r)},e.setVisibility=function(e){for(var t=Object.keys(r),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oS,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),aS(e,t)}var sS={intersectDisplayWithPlane:nS,extend:iS,newInstance:fe.newInstance(iS,"vtkPlaneManipulator")};function lS(e,t,r,n,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Ne(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];_e(n,s,l),_e(l,s,l);var c=Ge([i[0]-r[0],i[1]-r[1],i[2]-r[2]],l),u=Ge(l,n),d=n.slice();return ke(d,c/u),Le(r,d,d),d}function cS(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,r){return lS(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,r)}}var uS={origin:[0,0,0],normal:[0,0,1]};function dS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uS,r),fe.obj(e,t),fe.setGetArray(e,t,["origin","normal"],3),cS(e,t)}var fS={projectDisplayToLine:lS,extend:dS,newInstance:fe.newInstance(dS,"vtkLineManipulator")},pS={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function gS(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 mS=pS.OrientationModes,vS=pS.ScaleModes,hS=fe.vtkErrorMacro;function yS(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return fe.enumToString(mS,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode(mS.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode(mS.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode(mS.MATRIX)},e.getOrientationArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.orientationArray?r.getPointData().getArray(t.orientationArray):r.getPointData().getVectors():null},e.getScaleModeAsString=function(){return fe.enumToString(vS,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(vS.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(vS.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(vS.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.scaleArray?r.getPointData().getArray(t.scaleArray):r.getPointData().getScalars():null},e.getBounds=function(){var r=e.getInputData(0),n=e.getInputData(1);return r&&n?(e.buildArrays(),t.bounds):Dt()},e.buildArrays=function(){var r=e.getInputData(0),n=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=u[0]),u[1]>t.bounds[3]&&(t.bounds[3]=u[1]),u[2]>t.bounds[5]&&(t.bounds[5]=u[2]);var M=new Float32Array(y,36*T,9);yo(M,S),wo(M,M),Po(M,M)}var I=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var R=e.getLookupTable();R&&I&&(R.build(),t.colorArray=R.mapScalars(I,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),r=e.getInputData().getPoints().getNumberOfValues()/3;return{points:r*t.getPoints().getNumberOfValues()/3,verts:r*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:r*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:r*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var bS={orient:!0,orientationMode:mS.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:vS.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function TS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bS,r),Jp.extend(e,t,r),fe.algo(e,t,2,0),t.buildTime={},fe.obj(t.buildTime,{mtime:0}),t.boundsTime={},fe.obj(t.boundsTime,{mtime:0}),fe.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),fe.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),yS(e,t)}var SS=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=xS(xS({},wS),r);LT(e,t,n),fe.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),PS(0,t)};function AS(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,r){if(!t.deleted){var n=r[0],a=n?n.getPoints().getDataType():t.pointType;n=hm.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var c=t.startPhit.startPhi?t.endPhi:t.startPhi;u*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=fe.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var S=t.phiResolution-o,C=(u-c)/(t.phiResolution-1),x=0;x=180)for(var E=S-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,MS,r),fe.obj(e,t),fe.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),fe.setGetArray(e,t,["center"],3),fe.algo(e,t,0,1),AS(e,t)}var RS={newInstance:fe.newInstance(IS,"vtkSphereSource"),extend:IS};function ES(e,t){function r(r){if(t.displayCallback){for(var n=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DS,r),OS(e,t,r),fe.get(e,t,["glyph","mapper","actor"]),ES(e,t)}var VS={newInstance:fe.newInstance(BS,"vtkSphereHandleRepresentation"),extend:BS};function LS(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}function NS(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=NS(NS({},FS),r);LT(e,t,n),kS(0,t)},_S=fe.vtkErrorMacro,US=[2,0,1,2,0,2,2,0,4,2,1,3,2,1,5,2,2,3,2,2,6,2,3,7,2,4,5,2,4,6,2,5,7,2,6,7];function WS(e,t){var r;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=hm.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(US)),t.mapper=Jp.newInstance({scalarVisibility:!1}),t.actor=Cp.newInstance({parentProp:e}),(r=t.actor.getProperty()).setEdgeColor.apply(r,f(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(r,n){var a=e.getRepresentationStates(r[0]).filter((function(e){return e.getOrigin&&e.getOrigin()}));if(8===a.length){for(var o=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jS,r),GS(e,t,r),fe.setGetArray(e,t,["edgeColor"],3),fe.get(e,t,["mapper","actor"]),WS(e,t)}var HS={newInstance:fe.newInstance(zS,"vtkCroppingOutlineRepresentation"),extend:zS},KS=["-","=","+"];function XS(e,t){var r=new Float64Array(3);return Jn(r,e,t),r}function qS(e,t){var r=Pn(),n=ni();return Ka(n,t),ta(r,e,n),r}function YS(e){var t=u(e.split("").map((function(e){return KS.indexOf(e)-1})),3),r=t[0],n=t[1],a=t[2];return r*n*a!=0?"corners":r*n!=0||n*a!=0||a*r!=0?"edges":"faces"}function ZS(e,t){var r=null;e.setDisplayCallback=function(e){return t.representations[0].setDisplayCallback(e)},e.handleLeftButtonPress=function(){return t.activeState&&t.activeState.getActive()&&t.pickable?(r=!0,t.interactor.requestAnimation(e),fe.EVENT_ABORT):fe.VOID},e.handleMouseMove=function(n){return r&&t.pickable&&t.dragable?e.handleEvent(n):fe.VOID},e.handleLeftButtonRelease=function(){r&&t.pickable&&(r=!1,t.interactor.cancelAnimation(e),t.widgetState.deactivate())},e.handleEvent=function(e){if(t.pickable&&t.activeState&&t.activeState.getActive()){var r=t.activeState.getManipulator();if(r){var n=t.activeState.getName(),a=YS(n),o=n.split("").map((function(e){return KS.indexOf(e)})),i=t.widgetState.getCroppingPlanes().getPlanes(),s=t.widgetState.getIndexToWorldT(),l=[];if("corners"===a&&(r.setNormal(t.camera.getDirectionOfProjection()),l=r.handleEvent(e,t.apiSpecificRenderWindow)),"faces"===a){var c=[1-o[0],1-o[1],1-o[2]],u=[(i[0]+i[1])/2,(i[2]+i[3])/2,(i[4]+i[5])/2];r.setOrigin(XS(u,s)),r.setNormal(qS(c,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if("edges"===a){var d=o.map((function(e){return 1===e?e:0}));r.setNormal(qS(d,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if(l.length){for(var p,g,m=XS(l,t.widgetState.getWorldToIndexT()),v=0;v<3;v++)0===o[v]?i[2*v]=m[v]:2===o[v]&&(i[2*v+1]=m[v]);return(p=t.activeState).setOrigin.apply(p,f(l)),(g=t.widgetState.getCroppingPlanes()).setPlanes.apply(g,f(i)),fe.EVENT_ABORT}}}return fe.VOID},t.camera=t.renderer.getActiveCamera(),t.classHierarchy.push("vtkImageCroppingWidgetProp")}var QS="default";function $S(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}function JS(e,t){t.classHierarchy.push("vtkWidgetState");var r=[];t.labels={},t.nestedStates=[],e.bindState=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[QS];if(t.nestedStates.push(n),r.push(n.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,eC,r),fe.obj(e,t),fe.setGet(e,t,["active"]),JS(e,t)};function rC(e,t){var r=[],n=f(Hr.INIT_BOUNDS);e.containsPoint=function(e,t,r){return Array.isArray(e)?Hr.containsPoint(n,e[0],e[1],e[2]):Hr.containsPoint(n,e,t,r)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];r[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(r[0]+r[1])/2,(r[2]+r[3])/2,(r[4]+r[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(r[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}var nC={bounds:[-1,1,-1,1,-1,1],placeFactor:1},aC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nC,r),fe.setGetArray(e,t,["bounds"],6),fe.get(e,t,["placeFactor"]),fe.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),rC(e,t)}},oC={color:.5},iC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oC,r),fe.setGet(e,t,["color"])}};function sC(e,t){e.translate=function(t,r,n){var a=u(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+r,s+n)}}var lC={corner:[0,0,0]},cC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lC,r),fe.setGetArray(e,t,["corner"],3),sC(e)}},uC=function(e){return e},dC=Pa(new Float64Array(16)),fC=1e-6,pC=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];S(this,t),this.matrix=Pa(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?xn:uC}return x(t,[{key:"rotateFromDirections",value:function(e,t){var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(16);In(r,e[0],e[1],e[2]),In(n,t[0],t[1],t[2]),Kn(r,r),Kn(n,n);var o=Xn(r,n);return o>=1||(qn(this.tmp,r,n),On(this.tmp)1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(tt(dC,this.matrix))return this;for(var n=-1===r?e.length:t+3*r,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hC,r),fe.setGetArray(e,t,["direction"],3),vC(e,t)}};function bC(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,r=t.normal,n=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),n&&l?l(n):n&&!r&&s?s(n):r&&l&&l(r)}}}var TC={manipulator:null},SC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,TC,r),fe.setGet(e,t,["manipulator"]),bC(e,t)}},CC={name:""},xC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CC,r),fe.setGet(e,t,["name"])}};function PC(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function wC(e,t){var r={o:[],p1:[],p2:[]};e.normalize=function(){We(t.up),We(t.right),We(t.direction),e.modified()},e.updateFromOriginRightUp=function(n,a,o){(function(e,t,r,n){return PC(e,n.o)&&PC(t,n.p1)&&PC(r,n.p2)})(n,a,o,r)||(r.o=n.slice(),r.p1=a.slice(),r.p2=o.slice(),t.up=[o[0]-n[0],o[1]-n[1],o[2]-n[2]],t.right=[a[0]-n[0],a[1]-n[1],a[2]-n[2]],_e(t.up,t.right,t.direction),_e(t.direction,t.up,t.right),e.normalize(),e.modified())}}var OC={up:[0,1,0],right:[1,0,0],direction:[0,0,1]},AC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,r),fe.setGetArray(e,t,["up","right","direction"],3),wC(e,t)}};function MC(e,t){e.translate=function(t,r,n){var a=u(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+r,s+n)}}var IC={origin:null},RC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,IC,r),fe.setGetArray(e,t,["origin"],3),MC(e)}},EC={scale1:.5},DC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EC,r),fe.setGet(e,t,["scale1"])}},BC={scale3:[1,1,1]},VC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BC,r),fe.setGetArray(e,t,["scale3"],3)}},LC={text:"DefaultText"},NC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,r),fe.setGet(e,t,["text"])}},kC={visible:!0},FC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kC,r),fe.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},GC={shape:""},_C={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,GC,r),fe.setGet(e,t,["shape"])}},UC=fe.vtkErrorMacro,WC={bounds:aC,color:iC,corner:cC,direction:yC,manipulator:SC,name:xC,orientation:AC,origin:RC,scale1:DC,scale3:VC,text:NC,visible:FC,shape:_C};function jC(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];a||tC(r,n,t);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ex,r),rS.extend(e,t,r),JC(e,t)}var rx={newInstance:fe.newInstance(tx,"vtkImageCroppingWidget"),extend:tx},nx=fe.vtkErrorMacro;function ax(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,f(t.getExtent()))},e.requestData=function(e,r){var n=e[0];if(n){var a=n.getPointData().getScalars();if(a){var o=n.getExtent(),i=t.croppingPlanes&&6===t.croppingPlanes.length?o.map((function(e,r){return r%2==0?Math.max(e,Math.round(t.croppingPlanes[r])):Math.min(e,Math.round(t.croppingPlanes[r]))})):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=ei.newInstance();return s.shallowCopy(n),void(r[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var c=[i[2*l+1],i[2*l]];i[2*l]=c[0],i[2*l+1]=c[1]}for(var u=0;u<6;u+=2)i[u]=Math.max(i[u],o[u]),i[u+1]=Math.min(i[u+1],o[u+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=n.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,S=i[4];S<=i[5];++S)for(var C=i[2];C<=i[3];++C){var x=h+(C-o[2])*m+(S-o[4])*v,P=x+y,w=p.subarray(x,P);b.set(w,T),T+=w.length}var O=ei.newInstance({extent:i,origin:n.getOrigin(),direction:n.getDirection(),spacing:n.getSpacing()}),A=qt.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(A),r[0]=O}else nx("No scalars from input")}else nx("Invalid or missing input")},e.isResetAvailable=function(){if(null==t.croppingPlanes||0===t.croppingPlanes.length)return!1;var r=e.getInputData();if(r){var n=r.getExtent().find((function(e,r){return Math.abs(t.croppingPlanes[r]-e)>Number.EPSILON}));return void 0!==n}return!1}}var ox={};fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ox,r),fe.obj(e,t),fe.algo(e,t,1,1),fe.setGetArray(e,t,["croppingPlanes"],6),ax(e,t)}),"vtkImageCropFilter");var ix=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){ix[e.Name]=e}));var sx=Object.keys(ix);sx.sort();var lx,cx,ux={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(ix[e.Name]||(sx.push(e.Name),sx.sort()),ix[e.Name]=e)},removePresetByName:function(e){var t=sx.indexOf(e);t>-1&&sx.splice(t,1),delete ix[e]},getPresetByName:function(e){return ix[e]},rgbPresetNames:sx},dx=r(146),fx=r.n(dx),px=(lx=function(){!function(){var e={exports:{}},t=function(){function e(e,t){for(var r=0;r1?t-1:0),n=1;n1?t-1:0),a=1;a1?r-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:[];r([0,e,t,n],a)},v=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([1,e,t,n])};return self.addEventListener("message",(function(e){var t=e.data;Array.isArray(t)?p.apply(void 0,s(t)):t&&t.eventName&&n.emitLocally.apply(n,[t.eventName].concat(s(t.args)))})),n},e.exports.TransferableResponse=f;var p=e.exports;p((function(e,t){var r=e.array,n=e.min,a=e.max,o=e.component||0,i=e.numberOfComponents||1,s=e.numberOfBins,l=a-n,c=new Float32Array(s);c.fill(0);for(var u=r.length,d=o;d1&&void 0!==arguments[1]?arguments[1]:256,r=[];r.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=1,h=i*(c<1?c*m+(1-c)*g:(2-c)*m+(c-1)*v);h>r[u]&&(r[u]=h)}}return r}function Sx(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(r.length-1),i=!!n.fillStyle,s=a+t[1];e.lineWidth=n.lineWidth,e.strokeStyle=n.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[n[0]+(e-r[0])/r[2]*(n[1]-n[0]),(t-r[1])/r[3]]}function xx(e,t){var r=t.map((function(t){return Math.abs(t.position-e)})),n=Math.min.apply(Math,f(r));return r.indexOf(n)}function Px(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(r){var n=r.offsetX,a=r.offsetY;t&&r.preventDefault(),e(n,a)}}function wx(){yx.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,f(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function Ox(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,(function(e){return[e.pageX-o.left,e.pageY-o.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(yx[e].timeout),yx[e].ts=a.timeStamp,yx[e].singleTouche=i,yx[e].touches=a.touches.length):"touchmove"===a.type?(yx[e].ts=0,yx[e].count=0,yx[e].ready=!1):"touchend"===a.type&&(a.timeStamp-yx[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=n.numberOfBinToConsiders,o=void 0===a?1:a,i=n.numberOfBinsToSkip,s=void 0===i?1:i,l=n.numberOfComponents,c=void 0===l?1:l,d=n.component,f=void 0===d?0:d;t.histogram=null,t.histogramArray=r,t.dataRange=Ie(r,f,c);var p=u(t.dataRange,2),g=p[0],m=p[1],v=4,h=Math.floor(r.length/v)||1;h+=h%c;for(var y=0,b=[],T=[];yn;)a.shift();for(var l=a.reduce((function(e,t){return e+t}),0)/n,c=0,u=t.histogram.length;c1){for(var s=t.style.iconSize+t.style.padding,l=s,c=0;n>l;)c+=1,l+=s;switch(c){case 0:var d=e.addGaussian(0,1,.1,0,0),f=t.gaussians[d],p=mx({},f),g=bx.adjustPosition;t.activeGaussian=d,t.selectedGaussian=d,fe.setImmediate((function(){e.onDown(r,n),t.dragAction={originalXY:[0,0],action:g,gaussian:f,originalGaussian:p}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var m=xx(o,t.gaussians);m!==t.selectedGaussian&&(t.selectedGaussian=m,e.modified())}return!0},e.onHover=function(r,n){var a=20/t.canvas.height,o=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=u(Cx(r,n,t.graphArea),1)[0],c=i<0?t.selectedGaussian:xx(i,t.gaussians);t.canvas.style.cursor="default";var d=t.gaussians[c];if(t.enableRangeZoom&&l>=0&&nt.rangeZoom[1]-f?t.canvas.style.cursor=hx.adjustZoom:t.canvas.style.cursor=hx.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:bx.adjustZoom}}else if(d&&l>=0){var p,g=1-s;p=g>d.height+a?"adjustPosition":g>d.height-a?Math.abs(i-d.position).5*d.height+a?"adjustPosition":g>.5*d.height-a?Math.abs(i-d.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=hx[p];var m=bx[p],v=mx({},d);t.dragAction={originalXY:[i,s],action:m,gaussian:d,originalGaussian:v}}return c!==t.activeGaussian&&(t.activeGaussian=c,e.modified()),!0},e.onDown=function(r,n){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(r,n){if(t.dragAction){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,mx({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=Tx(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(r,n){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(r,n){return e.onUp(r,n),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(r,n){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(r,n){var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var r=function(){return!!t.mouseIsDown},n=function(){for(var e=yx.length,t=arguments.length,r=new Array(t),n=0;n1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),c=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(c-o/2,c,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c),e.stroke(),e.moveTo(c-o/2,c-l+t.style.strokeWidth+2),e.lineTo(c-o/2,c+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(c-o/2,c+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c+o/2+t.style.iconSize),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&Sx(e,i,Mx(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),Sx(e,i,Mx(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var d=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,r,n){var a=n||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(r[0],r[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var c=256*t*4,u=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[r[0]+a*n,r[0]+o*n]};var r=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var n=r(e);return n&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),n};var n=e.setRangeZoom;e.setRangeZoom=function(){var e=n.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,f(t.size))}var Ex={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 Dx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ex,r),fe.obj(e,t),fe.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),fe.setGetArray(e,t,["rangeZoom"],2),fe.get(e,t,["size","canvas","gaussians"]),fe.event(e,t,"opacityChange"),fe.event(e,t,"animation"),fe.event(e,t,"zoomChange"),Rx(e,t)}var Bx=mx({newInstance:fe.newInstance(Dx,"vtkPiecewiseGaussianWidget"),extend:Dx},Ix);function Vx(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,r){var n=e.computeWorldToDisplay(r,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=n[0],t.displayCenter[1]=n[1]}}var Lx={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]},Nx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lx,r),fe.setGet(e,t,["rotationFactor"]),fe.setGetArray(e,t,["displayCenter"],2),fe.setGetArray(e,t,["center"],3),Vx(e,t)};function kx(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,r){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,r){},e.onStartScroll=function(e,t,r){},e.onScroll=function(e,t,r){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var Fx={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1},Gx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fx,r),fe.setGet(e,t,["button","shift","control","alt"]),fe.set(e,t,["dragEnabled","scrollEnabled"]),kx(e,t)};function _x(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(3),o=new Float64Array(16),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,c,u){if(u){var d=c.getActiveCamera(),f=d.getPosition(),p=d.getFocalPoint();Pa(o);var g=t.center,m=t.rotationFactor;t.useFocalPointAsCenterOfRotation&&(g[0]=p[0],g[1]=p[1],g[2]=p[2]);var v=t.previousPosition.x-u.x,h=t.previousPosition.y-u.y,y=e.getView().getSize(),b=d.getViewUp();if(t.useWorldUpVec){var T=new Float64Array(3);Mn(T,t.worldUpVec),ke(T,Ge(f,t.worldUpVec)/Ge(t.worldUpVec,t.worldUpVec)),Le(g,T,T),Ra(o,o,T),Da(o,o,Ce(360*v/y[0]*m),t.worldUpVec),T[0]=-T[0],T[1]=-T[1],T[2]=-T[2],Ra(o,o,T),Ra(o,o,g)}else Ra(o,o,g),Da(o,o,Ce(360*v/y[0]*m),b);_e(d.getDirectionOfProjection(),b,i),Da(o,o,Ce(-360*h/y[1]*m),i),s[0]=-g[0],s[1]=-g[1],s[2]=-g[2],Ra(o,o,s),Jn(r,f,o),Jn(n,p,o),l[0]=b[0]+f[0],l[1]=b[1]+f[1],l[2]=b[2]+f[2],Jn(a,l,o),d.setPosition(r[0],r[1],r[2]),d.setFocalPoint(n[0],n[1],n[2]),d.setViewUp(a[0]-r[0],a[1]-r[1],a[2]-r[2]),d.orthogonalizeViewUp(),c.resetCameraClippingRange(),e.getLightFollowCamera()&&c.updateLightsGeometryToFollowCamera(),t.previousPosition=u}}}var Ux={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function Wx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ux,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["useWorldUpVec"]),fe.setGetArray(e,t,["worldUpVec"],3),fe.setGet(e,t,["useFocalPointAsCenterOfRotation"]),_x(e,t)}var jx={newInstance:fe.newInstance(Wx,"vtkMouseCameraTrackballRotateManipulator"),extend:Wx};function zx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,r,n){if(n){var a=n,o=t.previousPosition;t.previousPosition=n;var i=r.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var c=i.getViewUp(),u=[0,0,0];_e(i.getViewPlaneNormal(),c,u);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=u[0]*(f*=2*g)+c[0]*p;s[0]+=m,l[0]+=m,m=u[1]*f+c[1]*p,s[1]+=m,l[1]+=m,m=u[2]*f+c[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(r,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(r,a.x,a.y,y),T=h.computeDisplayToWorld(r,o.x,o.y,y),S=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],C=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(S[0],S[1],S[2]),i.setFocalPoint(C[0],C[1],C[2])}r.resetCameraClippingRange(),e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}}var Hx={};function Kx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hx,r),fe.obj(e,t),Nx(e,t,r),Gx(e,t,r),zx(e,t)}var Xx={newInstance:fe.newInstance(Kx,"vtkMouseCameraTrackballPanManipulator"),extend:Kx};function qx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView().getSize(),o=r.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,r,n){if(n){var a=t.previousPosition.y-n.y,o=r.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),c=o.getDirectionOfProjection(),u=a*t.zoomScale,d=u*c[0];s[0]+=d,l[0]+=d,d=u*c[1],s[1]+=d,l[1]+=d,d=u*c[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),r.resetCameraClippingRange()}e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),t.previousPosition=n}},e.onScroll=function(e,t,r){if(r){var n=t.getActiveCamera(),a=1-r/10;n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var Yx={zoomScale:0,flipDirection:!1};function Zx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yx,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["flipDirection"]),qx(e,t)}var Qx={newInstance:fe.newInstance(Zx,"vtkMouseCameraTrackballZoomManipulator"),extend:Zx};function $x(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var r=new Map;function n(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var n=e.getValue(),a=t*e.scale+r.get(e),o=n+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==n?(e.setValue(o),r.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?r.set(e,0):r.set(e,a)}e.setHorizontalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(r.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(r.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(r.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(r);t.containerSize=i.map((function(e){return e*o}))},e.onMouseMove=function(e,r,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=n(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],c=n(t.verticalListener,l);a(t.verticalListener,c)}t.previousPosition=o}},e.onScroll=function(e,r,n){t.scrollListener&&n&&a(t.scrollListener,n*t.scrollListener.step)},e.onStartScroll=e.onScroll}var Jx={horizontalListener:null,verticalListener:null,scrollListener:null};function eP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jx,r),fe.obj(e,t),Gx(e,t,r),$x(e,t)}var tP={newInstance:fe.newInstance(eP,"vtkMouseRangeManipulator"),extend:eP};function rP(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 nP=fe.vtkDebugMacro,aP=cT.States,oP={type:"StartInteractionEvent"},iP={type:"InteractionEvent"},sP={type:"EndInteractionEvent"};function lP(e,t,r,n,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],c=t.getInteractorStyle().computeDisplayToWorld(e,r,n,l),u=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[u[0]-c[0],u[1]-c[1],u[2]-c[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var cP={dollyToPosition:function(e,t,r,n){var a=r.getActiveCamera();if(a.getParallelProjection()){var o=n.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,c=t.y;lP(r,n,i,s,l,c),a.setParallelScale(a.getParallelScale()/e),lP(r,n,l,c,i,s)}else{var u=a.getFocalPoint(),d=a.getViewPlaneNormal();u=n.getInteractorStyle().computeWorldToDisplay(r,u[0],u[1],u[2]);var f=n.getInteractorStyle().computeDisplayToWorld(r,t.x,t.y,u[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),r.resetCameraClippingRange();var p=a.getPosition();u=a.getFocalPoint();var g=[0,0,0],m=d[0]*(u[0]-p[0])+d[1]*(u[1]-p[1])+d[2]*(u[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),r.resetCameraClippingRange()}},translateCamera:lP,dollyByFactor:function(e,t,r){if(!Number.isNaN(r)){var n=t.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/r):(n.dolly(r),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};function uP(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var r=function(t,r){var n=r.indexOf(t);return-1!==n&&(r.splice(n,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return r(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return r(e,t.gestureManipulators)};var n=function(t,r){return-1===r.indexOf(t)&&(r.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return n(e,t.vrManipulators)},e.addGestureManipulator=function(e){return n(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(1,r)},e.handleMiddleButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(2,r)},e.handleRightButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(3,r)},e.handleButton3D=function(r){r&&(t.currentManipulator=e.findVRManipulator(r.device,r.input,r.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,r.pokedRenderer,t.state,r.device,r.input,r.pressed),r.pressed?e.startCameraPose():e.endCameraPose()):nP("No manipulator found"))},e.handleMove3D=function(r){t.currentManipulator&&t.state===aP.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,r.pokedRenderer,t.state,r)},e.onButtonDown=function(r,n){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(r,n.shiftKey,n.controlKey,n.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,n.pokedRenderer,n.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(oP)):nP("No manipulator found"))},e.findMouseManipulator=function(e,r,n,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===r&&s.getControl()===n&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,r){for(var n=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===r&&(n=o)}return n},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(r){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===r&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(sP))},e.handleStartMouseWheel=function(r){if(!t.currentWheelManipulator){for(var n=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===r.shiftKey&&o.getControl()===r.controlKey&&o.getAlt()===r.altKey&&(n=o)}n?(t.currentWheelManipulator=n,t.currentWheelManipulator.onStartScroll(t.interactor,r.pokedRenderer,r.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(oP)):nP("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(sP))},e.handleMouseWheel=function(r){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,r.pokedRenderer,r.spinY,t.cachedMousePosition),e.invokeInteractionEvent(iP))},e.handleMouseMove=function(r){t.cachedMousePosition=r.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,r.pokedRenderer,r.position),e.invokeInteractionEvent(iP))},e.handleKeyPress=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyPress})).forEach((function(n){n.onKeyPress(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyDown=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyDown})).forEach((function(n){n.onKeyDown(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyUp=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyUp})).forEach((function(n){n.onKeyUp(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleStartPinch=function(r){e.startDolly();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,r.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(oP)},e.handleEndPinch=function(){e.endDolly();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPinchEnabled()&&(n.onEndPinch(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(sP)},e.handleStartRotate=function(r){e.startRotate();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,r.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(oP)},e.handleEndRotate=function(){e.endRotate();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isRotateEnabled()&&(n.onEndRotate(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(sP)},e.handleStartPan=function(r){e.startPan();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,r.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(oP)},e.handleEndPan=function(){e.endPan();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPanEnabled()&&(n.onEndPan(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(sP)},e.handlePinch=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,r.pokedRenderer,r.scale),a++)}a&&e.invokeInteractionEvent(iP)},e.handlePan=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPanEnabled()&&(o.onPan(t.interactor,r.pokedRenderer,r.translation),a++)}a&&e.invokeInteractionEvent(iP)},e.handleRotate=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,r.pokedRenderer,r.rotation),a++)}a&&e.invokeInteractionEvent(iP)}}var dP={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function fP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dP,r),cT.extend(e,t,r),fe.setGet(e,t,["rotationFactor"]),fe.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),fe.setGetArray(e,t,["centerOfRotation"],3),uP(e,t)}var pP=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mP,r),fe.obj(e,t),fe.get(e,t,["renderer"]),fe.getArray(e,t,["selectionPoint","pickPosition"]),fe.setGet(e,t,["pickFromList","pickList"]),gP(e,t)}var hP={newInstance:fe.newInstance(vP,"vtkAbstractPicker"),extend:vP};function yP(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 bP=fe.vtkErrorMacro,TP=fe.vtkWarningMacro;function SP(e,t){t.classHierarchy.push("vtkPicker");var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CP,r),hP.extend(e,t,r),fe.setGet(e,t,["tolerance"]),fe.setGetArray(e,t,["mapperPosition"],3),fe.get(e,t,["mapper","dataSet","actors","pickedPositions"]),fe.event(e,t,"pickChange"),SP(e,t)}var PP={newInstance:fe.newInstance(xP,"vtkPicker"),extend:xP},wP=fe.vtkErrorMacro;function OP(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(r,n,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(r,n);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(r,n,a,o));return i},e.intersectActorWithLine=function(e,r,n,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],c=0;c<3;c++)l[c]=r[c]-e[c];var u,d=Ge(l,l);if(0===d)return wP("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=o.getPoints();if(t.useCells)for(var y=o.getPolys().getData(),b=y[0],T=o.getPolys().getNumberOfCells(),S=0;S=0&&u<=1&&u<=p+t.tolerance){for(var O=0,A=0;A<3;A++){m[A]=e[A]+u*l[A];var M=Math.abs(v[A]-m[A]);M>O&&(O=M)}O<=n&&O=0&&u<=1&&u<=p+t.tolerance){for(var I=0,R=0;R<3;R++){m[R]=e[R]+u*l[R];var E=Math.abs(v[R]-m[R]);E>I&&(I=E)}I<=n&&I2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,AP,r),PP.extend(e,t,r),fe.getArray(e,t,["pointIJK"]),fe.get(e,t,["pointId"]),fe.setGet(e,t,["useCells"]),OP(e,t)}var IP={newInstance:fe.newInstance(MP,"vtkPointPicker"),extend:MP},RP=fe.vtkWarningMacro;function EP(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(r,n){if(!t.deleted){var a=n[0],o=a?a.getPoints().getDataType():t.pointType,i=hm.newInstance(),s=[],l=[];if(Ne(t.point1,t.origin,s),Ne(t.point2,t.origin,l),e.updatePlane(s,l)){var c=t.xResolution,u=t.yResolution,d=(c+1)*(u+1),f=c*u,p=fe.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=qt.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=qt.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,S=0;S2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DP,r),t.normal=[0,0,1],t.center=[0,0,0],fe.obj(e,t),fe.setGet(e,t,["xResolution","yResolution"]),fe.setGetArray(e,t,["origin"],3),fe.getArray(e,t,["point1","point2","normal","center"],3),fe.algo(e,t,0,1),EP(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}var VP={newInstance:fe.newInstance(BP,"vtkPlaneSource"),extend:BP},LP={Coordinate:{DISPLAY:0,NORMALIZED_DISPLAY:1,VIEWPORT:2,NORMALIZED_VIEWPORT:3,PROJECTION:4,VIEW:5,WORLD:6}};function NP(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 kP=LP.Coordinate,FP=fe.vtkErrorMacro;function GP(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return FP("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_P,r),fe.obj(e,t),fe.set(e,t,["property"]),fe.get(e,t,["value"]),fe.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),fe.getArray(e,t,["value"],3),GP(e,t)}var WP=function(e){for(var t=1;t1?1e3*e:1e3;this.actor.getMapper().setMaximumSamplesPerRay(t),this.renderWindow.render()}get resolution(){return Math.round(1/this._raysDistance)}get presetsList(){return ux.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,r=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(r,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set rangeLUT([e,t]){this._rangeLUT=[e,t],this.actor.getProperty().getRGBTransferFunction(0).setMappingRange(e,t)}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Xi.newInstance();let r;t.applyColorMap(ux.getPresetByName(e)),r=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...r),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const n=$i.newInstance();this.actor.getProperty().setScalarOpacity(0,n),this.ctfun=t,this.ofun=n,this.updateWidget()}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),r=this.actor.getMapper();e?(t.onLeftButtonPress((()=>{r.setSampleDistance(5*this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))):(t.onLeftButtonPress((()=>{r.setSampleDistance(this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})))}initVR(){const e=yT.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize((()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)})),window.addEventListener("resize",(t=>{e.resize()})),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=Is(e);this.actor=t,this.lut="Grayscale",this.resolution=2,this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setActorProperties(),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return ux.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(.3),this.actor.getProperty().setDiffuse(.7),this.actor.getProperty().setSpecular(.3),this.actor.getProperty().setSpecularPower(.8)}setupCropWidget(){const e=QT.newInstance();e.setRenderer(this.renderer);const t=rx.newInstance(),r=(e.addWidget(t),t.getWidgetState().getCroppingPlanes());r.onModified((()=>{const e=function(e,t){const r=ni();Ka(r,e.getIndexToWorld());const n=e=>{const t=[0,0,0];return ta(t,e,r),t},[a,o,i,s,l,c]=t,u=e.indexToWorld([a,i,l]),d=e.indexToWorld([o,s,c]);return[cr.newInstance({normal:n([1,0,0]),origin:u}),cr.newInstance({normal:n([-1,0,0]),origin:d}),cr.newInstance({normal:n([0,1,0]),origin:u}),cr.newInstance({normal:n([0,-1,0]),origin:d}),cr.newInstance({normal:n([0,0,1]),origin:u}),cr.newInstance({normal:n([0,0,-1]),origin:d})]}(a,r.getPlanes());n.removeAllClippingPlanes(),e.forEach((e=>{n.addClippingPlane(e)})),n.modified()}));let n=this.actor.getMapper(),a=n.getInputData();t.copyImageDataDescription(a),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const r=Bx.newInstance({numberOfBins:256,size:[e,t]});r.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",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:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),r.setContainer(this.PGwidgetElement),window.addEventListener("resize",(e=>{r.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),r.render()})),this.PGwidget=r}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,r=1.8;this.PGwidget.addGaussian(this.wl,e,this.ww,t,r)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified((()=>{this.PGwidget.render(),this.renderWindow.render()})),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation((e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)})),this.PGwidget.onOpacityChange((e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}}))}setupInteractor(){const e=jx.newInstance({button:1}),t=Xx.newInstance({button:3,control:!0}),r=Qx.newInstance({button:3,scrollEnabled:!0}),n=tP.newInstance({button:1,shift:!0});let a=this;n.setVerticalListener(-1,1,.001,(function(){return a.wl}),(function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let r=a.PGwidget.getGaussians().slice();r[0].position=a.wl,a.PGwidget.setGaussians(r)})),n.setHorizontalListener(.1,2.1,.001,(function(){return a.ww}),(function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let r=a.PGwidget.getGaussians().slice();r[0].width=a.ww,a.PGwidget.setGaussians(r)}));const o=pP.newInstance();o.addMouseManipulator(n),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(r),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel((()=>this.resetMeasurementState())),this.renderWindow.getInteractor().onRightButtonPress((()=>this.resetMeasurementState()))}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,r){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(r,e);break;case"Rotation":this.resetMeasurementState(r),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let r=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter((e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName())).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(r);const n=IP.newInstance();if(n.setPickFromList(1),n.initializePickList(),!this._pickingPlane){const e=VP.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const r=Jp.newInstance();r.setInputConnection(e.getOutputPort());const n=Cp.newInstance();n.setMapper(r),n.getProperty().setOpacity(.01),this.renderer.addActor(n),this._pickingPlane=e,this._planeActor=n}n.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress((r=>{if(this.renderer!==r.pokedRenderer)return;const a=r.position,o=[a.x,a.y,0];if(n.pick(o,this.renderer),0===n.getActors().length){const e=n.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const r=n.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${r}`);const a=WP.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...r);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,r,n){jP[n](e,t,r)}(e,o,r,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()}))}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor&&(this.actor.getMapper().delete(),this.actor.delete(),this.actor=null),this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.getCanvas().remove(),this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}const qP=fe;const YP={slabThickness:.1};function ZP(e,t,r={}){Object.assign(t,YP,r),pP.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onScroll"]),qP.get(e,t,["slabThickness","viewUp"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulator=Xx.newInstance({button:1,shift:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function n(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=r=>{if(i(r),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),r){const i=r.getCurrentRenderer().getActiveCamera();a=i.onModified((()=>{n(),e.modified()})),o=r.onAnimation((()=>{const{slabThickness:e}=t,r=i.getDistance(),n=r-e/2,a=r+e/2;i.setClippingRange(n,a)}))}},e.handleMouseMove=qP.chain(e.handleMouseMove,(()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:r}=t,n=e.getActiveCamera(),a=n.getDistance(),o=a-r/2,i=a+r/2;n.setClippingRange(o,i)}));const s=e.setVolumeMapper;e.setVolumeMapper=e=>{if(s(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.getSlice=()=>{const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=e.getSliceNormal(),a=gC().identity().rotateFromDirections(n,[1,0,0]),o=r.getFocalPoint();return a.apply(o),o[0]},e.setSlice=r=>{const n=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,r){return er?r:e}(r,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=n.getDistance(),c=n.getDirectionOfProjection();Lt.normalize(c);const u=(a[1]+a[0])/2,d=[s[0]-c[0]*u,s[1]-c[1]*u,s[2]-c[2]*u],f=[d[0]+c[0]*i,d[1]+c[1]*i,d[2]+c[2]*i],p=[f[0]-c[0]*l,f[1]-c[1]*l,f[2]-c[2]*l];n.setPosition(...p),n.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}},e.getSliceRange=()=>{if(t.volumeMapper){const n=e.getSliceNormal();if(n[0]===r.sliceNormal[0]&&n[1]===r.sliceNormal[1]&&n[2]===r.sliceNormal[2])return r.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=gC().identity().rotateFromDirections(n,[1,0,0]);a.forEach((e=>o.apply(e)));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),tt.volumeMapper&&t.interactor?t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection():[0,0,0],e.setSliceNormal=(r,n=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...r],t.viewUp=[...n];const o=[...r],i=[...n];if(t.volumeMapper){Lt.normalize(o);let r=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(r=t.volumeMapper.getMapper());let n=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(r.getInputData().getDirection());Lt.transpose3x3(n,n),Lt.multiply3x3_vect3(n,o,o);let s=a.getFocalPoint(),l=a.getDistance(),c=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),r=Math.sqrt(Lt.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],c=90,l=r/(2*Math.tan(c/360*Math.PI))}const u=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Lt.multiply3x3_vect3(n,i,i);const{slabThickness:d}=t;a.setPosition(...u),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(c),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}},e.setSlabThickness=e=>{t.slabThickness=e;const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=r.getDistance();r.setClippingRange(n-e/2,n+e/2)},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),n()}(e,t)}const QP=qP.newInstance(ZP,"vtkInteractorStyleMPRSlice"),$P=Object.assign({newInstance:QP,extend:ZP}),{States:JP}=rT;const ew={wlStartPos:[0,0],levelScale:1};function tw(e,t,r={}){Object.assign(t,ew,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=n=>{const a=[n.position.x,n.position.y];t.state===JP.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),r&&r(n)};const n=e.setVolumeMapper;e.setVolumeMapper=e=>{if(n(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.windowLevelFromMouse=([r,n])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(r-t.wlStartPos[0])*o,s=(n-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:c}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),c=Math.round(c+s),e.setWindowLevel(l,c),t.wlStartPos=[r,n];const u=e.getOnLevelsChanged();u&&u({windowCenter:c,windowWidth:l})},e.getWindowLevel=()=>function(e,t){const r=Math.abs(e-t);return{windowWidth:r,windowCenter:e+r/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice()),e.setWindowLevel=(e,r)=>{const n=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,r);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(n.lower,n.upper)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=r=>{t.wlStartPos=[r.position.x,r.position.y],r.shiftKey||r.controlKey?a&&a(r):e.startWindowLevel()},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===JP.IS_WINDOW_LEVEL?e.endWindowLevel():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const rw=qP.newInstance(tw,"vtkInteractorStyleMPRWindowLevel"),nw=Object.assign({newInstance:rw,extend:tw}),{States:aw}=rT;const ow={};function iw(e,t,r={}){Object.assign(t,ow,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onClickCallback"]),function(e,t){function r(t){const r=[t.position.x,t.position.y],n=t.pokedRenderer,a=e.getOnClickCallback(),o=WP.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(r[0],r[1],0);const i=o.getComputedWorldValue(n);i.length&&a({worldPos:i,displayPos:r}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=e=>{t.state===aw.IS_SLICE&&r(e),n&&n(e)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=n=>{n.shiftKey||n.controlKey?a&&a(n):t.volumeMapper&&(r(n),e.startSlice())};const o=e.setVolumeMapper;e.setVolumeMapper=e=>{if(o(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===aw.IS_SLICE?e.endSlice():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const sw=qP.newInstance(iw,"vtkInteractorStyleMPRCrosshairs"),lw=Object.assign({newInstance:sw,extend:iw}),{States:cw}=rT;const uw={wlStartPos:[0,0],levelScale:1};function dw(e,t,r={}){Object.assign(t,uw,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),function(e,t){function r(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=e=>{"zoom"==e?t.leftManipulator=Qx.newInstance({button:1}):"pan"==e?t.leftManipulator=Xx.newInstance({button:1}):console.error("No tool found for",e),r()},t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),r();const n=e.setInteractor;e.setInteractor=r=>{if(n(r),null===r)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();r.onAnimation(a)}}(e,t)}const fw=qP.newInstance(dw,"vtkInteractorStyleMPRPanZoom"),pw=Object.assign({newInstance:fw,extend:dw}),gw=[[0,0,1],[-1,0,0],[0,1,0]],mw=[[0,-1,0],[0,0,1],[0,0,1]];class vw{constructor(e,t,r){this.VERBOSE=!1,this._key=e,this._element=r,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=gw[t],this.sliceViewUp=mw[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=yT.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(r),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,r,n){this._volume=e;const a=$P.newInstance();a.setOnScroll(r),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),n()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,r=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let n=[];qn(n,e.sliceViewUp,e.slicePlaneNormal),Kn(n,n);let a=e.sliceViewUp;const o=ba();Da(o,o,Ms(e.slicePlaneYRotation),a),Da(o,o,Ms(e.slicePlaneXRotation),n),this.VERBOSE&&console.log(t,e.slicePlaneNormal,o),Jn(t,e.slicePlaneNormal,o);const i=ni();ai(i,t,Ms(-e.viewRotation)),si(i,i);const s=ni();ai(s,n,Ms(e.slicePlaneXRotation)),si(s,s);(function(e,t,r){e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3]})(ni(),s,i),ta(r,e.sliceViewUp,i);const l=this._genericRenderWindow.getRenderWindow(),c=l.getInteractor().getInteractorStyle();c&&c.setSliceNormal&&c.setSliceNormal(t,r),l.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],r=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let n,a;"left"===this._key?(n=t[1],a=t[2]):"front"===this._key?(n=t[0],a=t[2]):"top"===this._key&&(n=t[0],a=t[1]),r>=n/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(n/r+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),r=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&r.getSliceNormal()&&e.setSliceNormal(r.getSliceNormal(),r.getViewUp()),e.setSlabThickness&&r.getSlabThickness()&&e.setSlabThickness(r.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class hw{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const r=t-e/2,n=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(r,n),Object.keys(this.elements).forEach(((r,n)=>{this.mprViews[r].wwwl=[e,t]}))}initMPR(){Object.keys(this.elements).forEach(((e,t)=>{try{this.mprViews[e]=new vw(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}})),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce(((e,t)=>{let{slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:c}=e[t];return e[t]={slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:c},e}),Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce(((e,t)=>({...e,[t]:[0,0]})),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let r=Is(t);this.volume=r,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(r.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach((t=>{this.mprViews[t].initView(r,e,(()=>{this.onScrolled.call(this,e)}),(()=>{this.onScrolled.call(this,e)}))})),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"pan"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnPanChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"zoom"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnZoomChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach((([t])=>{const r=nw.newInstance();r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnLevelsChanged((r=>{this.updateLevels({...r,srcKey:t},e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach((([r])=>{const n=lw.newInstance();n.setOnScroll((()=>{t.onScrolled(e)})),n.setOnClickCallback((({worldPos:n})=>{t.onCrosshairPointSelected({worldPos:n,srcKey:r},e)})),this.mprViews[r].setInteractor(n)})),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},r){Object.keys(this.elements).forEach((n=>{if(n!==e){const e=this.mprViews[n]._genericRenderWindow.getRenderWindow(),r=e.getInteractor().getInteractorStyle(),a=r.getSliceNormal(),o=gC().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];r.setSlice(s),e.render()}this.updateInteractorCenters(r)})),this.sliceIntersection=[...t],r.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:r},n){n.views[r].window.center=e,n.views[r].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter((e=>e!==r)).forEach((r=>{this.mprViews[r].wwwl=[t,e]}))}onScrolled(e){let t=[];Object.keys(this.elements).forEach((e=>{const r=this.mprViews[e].camera;t.push({position:r.getFocalPoint(),normal:r.getDirectionOfProjection()})}));const r=((e,t,r)=>{try{let n=cr.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(n.intersection){const{l0:e,l1:t}=n,a=cr.intersectWithLine(e,t,r.position,r.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN})(...t);return Number.isNaN(r)||r.some((e=>Number.isNaN(e)))||(this.sliceIntersection=[...r],e.sliceIntersection=[...r],this.VERBOSE&&console.log("updating slice intersection",r)),this.updateInteractorCenters(e),r}onRotate(e,t,r,n){switch(e){case"top":"x"===t?n.views.front.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneYRotation=r);break;case"left":"x"===t?n.views.top.slicePlaneXRotation=r:"y"===t&&(n.views.front.slicePlaneXRotation=r);break;case"front":"x"===t?n.views.top.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneXRotation=r)}Object.keys(this.elements).filter((t=>t!==e)).forEach((e=>{this.mprViews[e].updateSlicePlane(n.views[e])})),this.VERBOSE&&console.log("afterOnRotate",n)}onThickness(e,t,r,n){const a=r>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",n.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=r,n.views[o].sliceThickness=r}updateInteractorCenters(e){Object.keys(this.elements).forEach((t=>{const r=this.mprViews[t]._genericRenderWindow.getRenderer(),n=WP.newInstance();n.setCoordinateSystemToWorld(),n.setValue(...this.sliceIntersection);const a=n.getComputedDisplayValue(r);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a}))}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach((e=>{e.onResize()})),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach((e=>{this.mprViews[e].destroy()}))}}console.groupCollapsed("%c** dtk **","background: #0aa658; color: #000000; line-height: 1.6"),console.log("Version 1.0.0"),console.log("Detected graphic card:"),console.log(function(){const e=document.createElement("canvas").getContext("webgl");if(!e)return{error:"no webgl"};const t=e.getExtension("WEBGL_debug_renderer_info");return t?{vendor:e.getParameter(t.UNMASKED_VENDOR_WEBGL),renderer:e.getParameter(t.UNMASKED_RENDERER_WEBGL)}:{error:"no WEBGL_debug_renderer_info"}}()),console.groupEnd("dtk")})(),n})()})); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(self,(function(){return(()=>{var e={757:(e,t,r)=>{e.exports=r(666)},289:(e,t,r)=>{"use strict";var n=r(215),a="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,i=Array.prototype.concat,s=Object.defineProperty,l=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,r,n){var a;(!(t in e)||"function"==typeof(a=n)&&"[object Function]"===o.call(a)&&n())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);a&&(o=i.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,r)=>{"use strict";var n=r(289),a=r(221),o=r(168),i=r(471),s=o(),l=function(){return s};n(l,{getPolyfill:o,implementation:a,shim:i}),e.exports=l},168:(e,t,r)=>{"use strict";var n=r(221);e.exports=function(){return"object"==typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},471:(e,t,r)=>{"use strict";var n=r(289),a=r(168);e.exports=function(){var e=a();if(n.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=r(414),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&a.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=i(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var g=c&&r;if(s&&e.length>0&&!a.call(e,0))for(var m=0;m0)for(var v=0;v{"use strict";var n=Array.prototype.slice,a=r(414),o=Object.keys,i=o?function(e){return o(e)}:r(987),s=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return a(e)?s(n.call(e)):s(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),i=new M(n||[]);return o._invoke=function(e,t,r){var n=d;return function(a,o){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===a)throw o;return R()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=w(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=g,r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function v(){}function h(){}function y(){}var b={};l(b,o,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(I([])));S&&S!==r&&n.call(S,o)&&(b=S);var C=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(a,o,i,s){var l=u(e[a],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(l.arg)}var a;this._invoke=function(e,n){function o(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(o,o):o()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function I(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},377:(e,t,r)=>{var n=r(832),a=r(652),o=r(801),i=r(30),s=r(618),l=r(49),c=r(971);c.alea=n,c.xor128=a,c.xorwow=o,c.xorshift7=i,c.xor4096=s,c.tychei=l,e.exports=c},832:function(e,t,r){var n;!function(e,a,o){function i(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new i(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},49:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>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):r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},652:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},618:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,o=t.i;return t.w=n=n+1640531527|0,r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,a,o,i,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(i=i+1640531527|0,a=0==(r=s[127&o]^=n+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=i,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},30:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},801:function(e,t,r){var n;!function(e,a,o){function i(e){var t=this,r="";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:r+=e;for(var n=0;n>>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 l(e,t){var r=new i(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},971:function(e,t,r){var n;!function(a,o,i){var s,l=256,c=i.pow(l,6),u=i.pow(2,52),d=2*u,f=255;function p(e,t,r){var n=[],f=h(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,r=t&&t.plugins;return[+new Date,a,r,a.screen,y(o)]}}():e,3),n),p=new g(n),b=function(){for(var e=p.g(6),t=c,r=0;e=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|p.g(4)},b.quick=function(){return p.g(4)/4294967296},b.double=b,h(y(p.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,p),e.state=function(){return m(p,{})}),r?(i.random=e,t):e})(b,f,"global"in t?t.global:this==i,t.state)}function g(e){var t,r=e.length,n=this,a=0,o=n.i=n.j=0,i=n.S=[];for(r||(e=[r++]);a{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],a=e[2],o=e[3];n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&a)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+t[2]+606105819|0)<<17|a>>>15)+o|0)&o|~a&r)+t[3]-1044525330|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&a)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+t[6]-1473231341|0)<<17|a>>>15)+o|0)&o|~a&r)+t[7]-45705983|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&a)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+t[10]-42063|0)<<17|a>>>15)+o|0)&o|~a&r)+t[11]-1990404162|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&a|~n&o)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&a)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+t[14]-1502002290|0)<<17|a>>>15)+o|0)&o|~a&r)+t[15]+1236535329|0)<<22|n>>>10)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[1]-165796510|0)<<5|r>>>27)+n|0)&a|n&~a)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|a>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[5]-701558691|0)<<5|r>>>27)+n|0)&a|n&~a)+t[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|a>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[9]+568446438|0)<<5|r>>>27)+n|0)&a|n&~a)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|a>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n&o|a&~o)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&a|n&~a)+t[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|a>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|n>>>12)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^a)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|a>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^a)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|a>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^a)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|a>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|n>>>9)+a|0,n=((n+=((a=((a+=((o=((o+=((r=((r+=(n^a^o)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^a)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|a>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|n>>>9)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~a))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[14]-1416354905|0)<<15|a>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~a))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[10]-1051523|0)<<15|a>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~a))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[6]-1560198380|0)<<15|a>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+a|0,n=((n+=((o=((o+=(n^((r=((r+=(a^(n|~o))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~a))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((a=((a+=(r^(o|~n))+t[2]+718787259|0)<<15|a>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+a|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=a+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function a(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var t,a,o,i,s,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,n(e.substring(t-64,t)));for(a=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}function i(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;tc?new ArrayBuffer(0):(n=c-l,a=new ArrayBuffer(n),o=new Uint8Array(a),i=new Uint8Array(this,l,n),o.set(i),a)}}(),u.prototype.append=function(e){return this.appendBinary(l(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,a=this._buff.length;for(t=64;t<=a;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.prototype.end=function(e){var t,r,n=this._buff,a=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var n,a,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(r(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=a,e[15]=o,r(this._hash,e)},u.hash=function(e,t){return u.hashBinary(l(e),t)},u.hashBinary=function(e,t){var r=s(o(e));return t?c(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var t,n,o,i,s,l=(n=this._buff.buffer,o=e,i=!0,(s=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(o),n.byteLength),i?s:s.buffer),c=l.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)r(this._hash,a(l.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(o,a),r=s(this._hash),e&&(r=c(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,a=new ArrayBuffer(n),o=new Uint8Array(a);for(r=0;r>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(u,o),t=0;t<16;t+=1)o[t]=0;return i=(i=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(i[2],16),l=parseInt(i[1],16)||0,o[14]=s,o[15]=l,r(u,o),u}(new Uint8Array(e)));return t?c(n):n},u}()},146:(e,t,r)=>{const n=r(544);e.exports=class extends n{constructor(e){super(),this._messageId=1,this._messages=new Map,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._id=Math.ceil(1e7*Math.random())}terminate(){this._worker.terminate()}isFree(){return 0===this._messages.size}jobsLength(){return this._messages.size}exec(e,t=null,r=[],n){return new Promise(((a,o)=>{const i=this._messageId++;this._messages.set(i,[a,o,n]),this._worker.postMessage([i,t,e],r||[])}))}postMessage(e=null,t=[],r){return new Promise(((n,a)=>{const o=this._messageId++;this._messages.set(o,[n,a,r]),this._worker.postMessage([o,e],t||[])}))}emit(e,...t){this._worker.postMessage({eventName:e,args:t})}_onMessage(e){if(!Array.isArray(e.data)&&e.data.eventName)return super.emit(e.data.eventName,...e.data.args);const[t,...r]=e.data;if(1===t)this._onEvent(...r);else{if(0!==t)throw new Error(`Wrong message type '${t}'`);this._onResult(...r)}}_onResult(e,t,r){const[n,a]=this._messages.get(e);return this._messages.delete(e),1===t?n(r):a(r)}_onEvent(e,t,r){const[,,n]=this._messages.get(e);n&&n(t,r)}}},544:e=>{e.exports=class{constructor(){Object.defineProperty(this,"__listeners",{value:{},enumerable:!1,writable:!1})}emit(e,...t){if(!this.__listeners[e])return this;for(const r of this.__listeners[e])r(...t);return this}once(e,t){const r=(...n)=>{this.off(e,r),t(...n)};return this.on(e,r)}on(e,t){return this.__listeners[e]||(this.__listeners[e]=[]),this.__listeners[e].push(t),this}off(e,t){return this.__listeners[e]=t?this.__listeners[e].filter((e=>e!==t)):[],this}}},42:()=>{}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{MPRManager:()=>hw,VRView:()=>XP,buildVtkVolume:()=>ws,loadDemoSerieWithLarvitar:()=>As});var e={};r.r(e),r.d(e,{add:()=>Rn,angle:()=>oa,bezier:()=>Qn,ceil:()=>Vn,clone:()=>wn,copy:()=>Mn,create:()=>Pn,cross:()=>qn,dist:()=>ga,distance:()=>Un,div:()=>pa,divide:()=>Bn,dot:()=>Xn,equals:()=>ca,exactEquals:()=>la,floor:()=>Ln,forEach:()=>ya,fromValues:()=>An,hermite:()=>Zn,inverse:()=>Hn,len:()=>va,length:()=>On,lerp:()=>Yn,max:()=>kn,min:()=>Nn,mul:()=>fa,multiply:()=>Dn,negate:()=>zn,normalize:()=>Kn,random:()=>$n,rotateX:()=>ra,rotateY:()=>na,rotateZ:()=>aa,round:()=>Fn,scale:()=>Gn,scaleAndAdd:()=>_n,set:()=>In,sqrDist:()=>ma,sqrLen:()=>ha,squaredDistance:()=>Wn,squaredLength:()=>jn,str:()=>sa,sub:()=>da,subtract:()=>En,transformMat3:()=>ea,transformMat4:()=>Jn,transformQuat:()=>ta,zero:()=>ia});var t={};r.r(t),r.d(t,{add:()=>lo,adjoint:()=>Aa,clone:()=>Ta,copy:()=>Sa,create:()=>ba,determinant:()=>Ma,equals:()=>go,exactEquals:()=>po,frob:()=>so,fromQuat:()=>Ya,fromQuat2:()=>ja,fromRotation:()=>Fa,fromRotationTranslation:()=>Wa,fromRotationTranslationScale:()=>Xa,fromRotationTranslationScaleOrigin:()=>qa,fromScaling:()=>ka,fromTranslation:()=>Na,fromValues:()=>Ca,fromXRotation:()=>Ga,fromYRotation:()=>_a,fromZRotation:()=>Ua,frustum:()=>Za,getRotation:()=>Ka,getScaling:()=>Ha,getTranslation:()=>za,identity:()=>Pa,invert:()=>Oa,lookAt:()=>ao,mul:()=>mo,multiply:()=>Ia,multiplyScalar:()=>uo,multiplyScalarAndAdd:()=>fo,ortho:()=>ro,orthoNO:()=>to,orthoZO:()=>no,perspective:()=>$a,perspectiveFromFieldOfView:()=>eo,perspectiveNO:()=>Qa,perspectiveZO:()=>Ja,rotate:()=>Da,rotateX:()=>Ba,rotateY:()=>Va,rotateZ:()=>La,scale:()=>Ea,set:()=>xa,str:()=>io,sub:()=>vo,subtract:()=>co,targetTo:()=>oo,translate:()=>Ra,transpose:()=>wa});var a={};function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{add:()=>Uo,adjoint:()=>Oo,clone:()=>bo,copy:()=>To,create:()=>ho,determinant:()=>Ao,equals:()=>Ko,exactEquals:()=>Ho,frob:()=>_o,fromMat2d:()=>Lo,fromMat4:()=>yo,fromQuat:()=>No,fromRotation:()=>Bo,fromScaling:()=>Vo,fromTranslation:()=>Do,fromValues:()=>So,identity:()=>xo,invert:()=>wo,mul:()=>Xo,multiply:()=>Mo,multiplyScalar:()=>jo,multiplyScalarAndAdd:()=>zo,normalFromMat4:()=>ko,projection:()=>Fo,rotate:()=>Ro,scale:()=>Eo,set:()=>Co,str:()=>Go,sub:()=>qo,subtract:()=>Wo,translate:()=>Io,transpose:()=>Po});var i={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:i.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:i};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?t-1:0),n=1;n1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(t);var r=[];function n(e){r[e]=null}function a(e){return Object.freeze({unsubscribe:function(){n(e)}})}return Number.isInteger(t.mtime)||(t.mtime=++D),"classHierarchy"in t?t.classHierarchy instanceof I||(t.classHierarchy=I.from(t.classHierarchy)):t.classHierarchy=new I("vtkObject"),e.isDeleted=function(){return!!t.deleted},e.modified=function(n){t.deleted?F("instance deleted - cannot call any method"):n&&n0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(r).forEach((function(i){var s=a?null:e["set".concat(H(i))];s&&Array.isArray(r[i])&&s.length>1?o=s.apply(void 0,f(r[i]))||o:s?o=s(r[i])||o:(-1!==["mtime"].indexOf(i)||n||G("Warning: Set value to model directly ".concat(i,", ").concat(r[i])),o=t[i]!==r[i]||o,t[i]=r[i])})),o},e.get=function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&void 0!==arguments[1]&&arguments[1];if(r.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(r.getClassName()," into ").concat(e.getClassName()));var a=r.get(),o=Object.keys(t).sort(),i=Object.keys(a).sort();i.forEach((function(e){var r=o.indexOf(e);-1===r?n&&k("add ".concat(e," in shallowCopy")):o.splice(r,1),t[e]=a[e]})),o.length&&n&&k("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function Q(e,t,r){r.forEach((function(r){"object"===d(r)?e["get".concat(H(r.name))]=function(){return t[r.name]}:e["get".concat(H(r))]=function(){return t[r]}}))}W.Float32Array=Float32Array,W.Float64Array=Float64Array,W.Uint8Array=Uint8Array,W.Int8Array=Int8Array,W.Uint16Array=Uint16Array,W.Int16Array=Int16Array,W.Uint32Array=Uint32Array,W.Int32Array=Int32Array,W.Uint8ClampedArray=Uint8ClampedArray;var $={enum:function(e,t,r){return function(n){if("string"==typeof n){if(void 0!==r.enum[n])return t[r.name]!==r.enum[n]&&(t[r.name]=r.enum[n],e.modified(),!0);throw F("Set Enum with invalid argument ".concat(r,", ").concat(n)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof n){if(t[r.name]!==n){if(-1!==Object.keys(r.enum).map((function(e){return r.enum[e]})).indexOf(n))return t[r.name]=n,e.modified(),!0;throw F("Set Enum outside numeric range ".concat(r,", ").concat(n)),new RangeError("Set Enum outside numeric range")}return!1}throw F("Set Enum with invalid argument (String/Number) ".concat(r,", ").concat(n)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function J(e){if("object"===d(e)){var t=$[e.type];if(t)return function(r,n){return t(r,n,e)};throw F("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,r){return function(n){return r.deleted?(F("instance deleted - cannot call any method"),!1):r[e]!==n&&(r[e]=n,t.modified(),!0)}}}function ee(e,t,r){r.forEach((function(r){"object"===d(r)?e["set".concat(H(r.name))]=J(r)(e,t):e["set".concat(H(r))]=J(r)(e,t)}))}function te(e,t,r){Q(e,t,r),ee(e,t,r)}function re(e,t,r){r.forEach((function(r){e["get".concat(H(r))]=function(){return t[r]?[].concat(t[r]):t[r]},e["get".concat(H(r),"ByReference")]=function(){return t[r]}}))}function ne(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;r.forEach((function(r){if(t[r]&&n&&t[r].length!==n)throw new RangeError("Invalid initial number of values for array (".concat(r,")"));e["set".concat(H(r))]=function(){if(t.deleted)return F("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s=0)&&(c=c[0],u=!0),null==c)l=t[r]!==c;else{if(n&&c.length!==n){if(!(c.length4&&void 0!==arguments[4]?arguments[4]:void 0;re(e,t,r),ne(e,t,r,n,a)}var oe=Symbol("Event abort");function ie(e,t){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},n={};return e(n,r,t),Object.freeze(n)};return t&&T.register(t,r),r}function se(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},r),e.setKey=function(e,r){t.keystore[e]=r},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 ue=1,de="__root__",fe={algo:function(e,t,r,n){function a(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?F("instance deleted - cannot call any method"):n>=t.numberOfInputs?F("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[n]!==r||t.inputConnection[n])&&(t.inputData[n]=r,t.inputConnection[n]=null,e.modified&&e.modified())}function o(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)F("instance deleted - cannot call any method");else{if(n>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void F(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[n]=null,t.inputConnection[n]=r}}function i(){for(var e=t.numberOfInputs;e&&!t.inputData[e-1]&&!t.inputConnection[e-1];)e--;return e===t.numberOfInputs&&t.numberOfInputs++,e}function s(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(F("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[r])}if(t.inputData?t.inputData=t.inputData.map(T):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(T):t.inputConnection=[],t.output?t.output=t.output.map(T):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(T):t.inputArrayToProcess=[],t.numberOfInputs=r,e.shouldUpdate=function(){for(var r=e.getMTime(),a=1/0,o=n;o--;){if(!t.output[o]||t.output[o].isDeleted())return!0;var i=t.output[o].getMTime();if(ia)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=o,e.addInputData=function(e){t.deleted?F("instance deleted - cannot call any method"):a(e,i())},e.addInputConnection=function(e){t.deleted?F("instance deleted - cannot call any method"):o(e,i())},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]}}n&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=function(){return s(t)};return r.filter=e,r}),e.update=function(){var r=[];if(t.numberOfInputs)for(var n=0;n3&&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(r)),null;if(t.deleted)return F("instance deleted - cannot call any method"),null;var i=o++;return n.push([i,e,a]),n.sort((function(e,t){return t[2]-e[2]})),s(i)},e.delete=function(){a(),n.forEach((function(e){return i(u(e,1)[0])}))}},EVENT_ABORT:oe,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=["TB","GB","MB","KB"],a=Number(e),o="B";a>r;)a/=r,o=n.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=[],n=e;n>1e3;)r.push("000".concat(n%1e3).slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(t)},get:Q,getArray:re,getCurrentGlobalMTime:function(){return D},getStateArrayMapFunc:q,isVtkObject:le,keystore:ce,newInstance:ie,newTypedArray:j,newTypedArrayFrom:z,normalizeWheel:function(e){var t=0,r=0,n=0,a=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,a=10*r,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||a)&&e.deltaMode&&(1===e.deltaMode?(n*=40,a*=40):(n*=800,a*=800)),n&&!t&&(t=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:a}},obj:Z,proxy:function(e,t){ce(e,t);var r=e.delete;t.proxyId="".concat(ue++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),Q(e,t,["proxyId","proxyGroup","proxyName"]),te(e,t,["proxyManager"]);var n={},a={};function i(e,t){a[t]||(a[t]=[]);for(var r=a[t],o=0;o0&&void 0!==arguments[0]?arguments[0]:de;return a[e]}function l(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,n=[],a=t.proxyId,o=s(r)||[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var n=null,a=[],i=0,s=!1;function l(r){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(s)return null;var c=[],u=null;for(i=a.length;i--;){var d=a[i];d.instance===r?u=d:c.push(d)}if(!u)return null;var f=u.instance["get".concat(H(u.propertyName))]();if(!X(f,n)||l){for(n=f,s=!0;c.length;){var p=c.pop();p.instance.set(o({},p.propertyName,n))}s=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=f),f}function c(e,t){var r=[];for(i=a.length;i--;){var n=a[i];n.instance!==e||n.propertyName!==t&&void 0!==t||(n.subscription.unsubscribe(),r.push(i))}for(;r.length;)a.splice(r.pop(),1)}function u(r,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=r.onModified(l),u=a[0];return a.push({instance:r,propertyName:n,subscription:s}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?r.set(o({},n,t.propertyLinkMap[e].value)):u&&l(u.instance,!0)),{unsubscribe:function(){return c(r,n)}}}function d(){for(;a.length;)a.pop().subscription.unsubscribe()}var f={bind:u,unbind:c,unsubscribe:d,persistent:r};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(n[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:l()}},e.delete=function(){for(var n=Object.keys(t.propertyLinkMap),a=n.length;a--;)t.propertyLinkMap[n[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),r()},Y((function(){if(t.links)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function a(e){for(var r=Object.keys(e),n=r.length;n--;){var a=r[n];t[a].set(e[a])}}t.this=e;for(var o=Object.keys(n),i=o.length,s=function(){var s=o[i];t[s]=n[s];var l=r[s];e["set".concat(H(s))]=function(r){r!==t[s]&&(t[s]=r,a(l[r]),e.modified())}};i--;)s();o.length&&Q(e,t,o)},safeArrays:K,set:ee,setArray:ne,setGet:te,setGetArray:ae,setImmediate:Y,setLoggerFunction:function(e,t){N[e]&&(N[e]=t||L)},throttle:function(e,t){var r=!1,n=null;function a(){r=!1,null!==n&&(o.apply(void 0,f(n)),n=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(le(t)){if(a.indexOf(t)>=0)return n;a.push(t);var o=r(t);void 0!==o&&n.push(o);var i=t.get();Object.keys(i).forEach((function(t){var o=i[t];Array.isArray(o)?o.forEach((function(t){e(t,r,n,a)})):e(o,r,n,a)}))}return n},TYPED_ARRAYS:W,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:B,vtkDebugMacro:k,vtkErrorMacro:F,vtkInfoMacro:function(){N.info.apply(N,arguments)},vtkLogMacro:function(){N.log.apply(N,arguments)},vtkOnceErrorMacro:function(e){U[e]||(N.error(e),U[e]=!0)},vtkWarningMacro:G},pe=r(377),ge=r.n(pe),me=fe.vtkErrorMacro,ve=fe.vtkWarningMacro,he=0,ye=1e-12;function be(e){return function(){return me("vtkMath::".concat(e," - NOT IMPLEMENTED"))}}function Te(e,t){for(var r=0;r<3;r++){var n=e[r];e[r]=t[r],t[r]=n}}function Se(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=-1/0,o=t,i=e.length;o1&&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 r=0,n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;function n(e,n){return Math.abs(e-t[n])<=r}return e.every(n)}var tt=et;function rt(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 r="".concat(e).split("e"),n="";return+r[1]+t>0&&(n="+"),+"".concat(Math.round("".concat(+r[0],"e").concat(n).concat(+r[1]+t)),"e-").concat(t)}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=rt(e[0],r),t[1]=rt(e[1],r),t[2]=rt(e[2],r),t}function at(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g,m,v,h,y,b,T=Se(t),S=Se(t),C=function(e,t,r,n,a){h=e[t][r],v=e[n][a],e[t][r]=h-m*(v+h*p),e[n][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(r[l])+h===Math.abs(r[l])&&Math.abs(r[s])+h===Math.abs(r[s]))e[l][s]=0;else if(Math.abs(e[l][s])>u){for(v=r[s]-r[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],S[l]-=v,S[s]+=v,r[l]-=v,r[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)C(e,o,l,o,s);for(o=l+1;o<=s-1;o++)C(e,l,o,o,s);for(o=s+1;o=20)return ve("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=r[i=a]);if(i!==o)for(r[i]=r[o],r[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&c++;if(c(n=l>s?l:s)?c:n,a[i]=1,0!==n&&(a[i]/=n)}var u=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(n=u)&&(n=d,o[0]=1),f>=n&&(o[0]=2),0!==o[0]&&(Te(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(n=p)&&(o[1]=2,Te(t[2],t[1])),o[2]=2;var m=0;if($e(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Se(4);if(ot(t,h),Je(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Te(t[o[1]],t[1]),0!==o[0]&&Te(t[o[0]],t[0])}function st(e,t,r){var n,a,o,i,s,l,c=[Se(3),Se(3),Se(3)],u=Se(3),d=Se(3);for(n=0;n<3;n++)c[n][0]=e[n][0],c[n][1]=e[n][1],c[n][2]=e[n][2],u[n]=c[n],d[n]=r[n];if(at(u,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(Ze(r,r),n=0;n<3;n++)if(t[(n+1)%3]===t[(n+2)%3]){for(l=Math.abs(r[n][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(r[n][a]))&&(l=s,i=a);return i!==n&&(s=t[i],t[i]=t[n],t[n]=s,Te(r[n],r[i])),r[i][i]<0&&(r[i][0]=-r[i][0],r[i][1]=-r[i][1],r[i][2]=-r[i][2]),o=(i+2)%3,r[a=(i+1)%3][0]=0,r[a][1]=0,r[a][2]=0,r[a][a]=1,_e(r[i],r[a],r[o]),We(r[o]),_e(r[o],r[i],r[a]),void Ze(r,r)}for(l=Math.abs(r[0][0]),i=0,n=1;n<3;n++)l<(s=Math.abs(r[n][0]))&&(l=s,i=n);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Te(r[i],r[0])),Math.abs(r[1][1])i&&(i=c);if(0===i)return ve("Unable to factor linear system"),0;d[n]=1/i}for(a=0;a=i&&(i=l,u=n)}if(a!==u){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*r[o];else 0!==l&&(i=a);r[a]=l}for(a=n-1;a>=0;a--){for(l=r[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=n||Se(r),i=a||Se(r);if(0===lt(e,o,r))return 0;for(var s=0;sc?c=i:ic?c=s:s0?(c-d)/c:0)>0?(r=o===c?l*(i-s)/(c-d):i===c?1/3+l*(s-o)/(c-d):2/3+l*(o-i)/(c-d))<0&&(r+=1):r=0,t[0]=r,t[1]=n,t[2]=f}function gt(e,t){var r,n,a,o=u(e,3),i=o[0],s=o[1],l=o[2],c=1/3,d=1/6,f=2/3,p=5/6;i>d&&i<=c?(n=1,r=(c-i)/d,a=0):i>c&&i<=.5?(n=1,a=(i-c)/d,r=0):i>.5&&i<=f?(a=1,n=(f-i)/d,r=0):i>f&&i<=p?(a=1,r=(i-f)/d,n=0):i>p&&i<=1?(r=1,a=(1-i)/d,n=0):(r=1,n=i/d,a=0),r=s*r+(1-s),n=s*n+(1-s),a=s*a+(1-s),r*=l,n*=l,a*=l,t[0]=r,t[1]=n,t[2]=a}function mt(e,t){var r=u(e,3),n=(r[0]+16)/116,a=r[1]/500+n,o=n-r[2]/200;n=Math.pow(n,3)>.008856?Math.pow(n,3):(n-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787,t[0]=.9505*a,t[1]=1*n,t[2]=1.089*o}function vt(e,t){var r=u(e,3),n=r[0]/.9505,a=r[1]/1,o=r[2]/1.089;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(n-a),t[2]=200*(a-o)}function ht(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2],i=3.2406*n+-1.5372*a+-.4986*o,s=-.9689*n+1.8758*a+.0415*o,l=.0557*n+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var c=i;c1&&(i/=c,s/=c,l/=c),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function yt(e,t){var r=u(e,3),n=r[0],a=r[1],o=r[2];n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*n+.3576*a+.1805*o,t[1]=.2126*n+.7152*a+.0722*o,t[2]=.0193*n+.1192*a+.9505*o}function bt(e,t){var r=[0,0,0];yt(e,r),vt(r,t)}function Tt(e,t){var r=[0,0,0];mt(e,r),ht(r,t)}function St(e){return e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1,e}function Ct(e){return!(e[1]-e[0]<0)}function xt(e,t,r){return r[0]=Math.min(e[0],t[0]),r[1]=Math.max(e[0],t[0]),r[2]=Math.min(e[1],t[1]),r[3]=Math.max(e[1],t[1]),r[4]=Math.min(e[2],t[2]),r[5]=Math.max(e[2],t[2]),r}function Pt(e,t,r){return er?r:e}function wt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0,0];return n[0]=Pt(e[0],t[0],r[0]),n[1]=Pt(e[1],t[1],r[1]),n[2]=Pt(e[2],t[2],r[2]),n}var Ot=be("GetScalarTypeFittingRange"),At=be("GetAdjustedScalarRange");var Mt=function(e){return!Number.isFinite(e)},It=Number.isFinite,Rt=Number.isNaN,Et=Rt;function Dt(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Bt(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function Vt(e){return Math.round(255*e)}var Lt={Pi:function(){return Math.PI},radiansFromDegrees:Ce,degreesFromRadians:xe,round:Pe,floor:we,ceil:Oe,ceilLog2:Re,min:Ae,max:Me,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=-1/0,a=t,o=e.length;a=0;--a)if(r[a]0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=t-e;return e+r*Math.random()},gaussian:Ve,add:Le,subtract:Ne,multiplyScalar:ke,multiplyScalar2D:Fe,multiplyAccumulate:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n},multiplyAccumulate2D:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n},dot:Ge,outer:function(e,t,r){for(var n=0;n<3;n++)for(var a=0;a<3;a++)r[n][a]=e[n]*t[a]},cross:_e,norm:Ue,normalize:We,perpendiculars:function(e,t,r,n){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],c=e[2]*e[2],u=Math.sqrt(s+l+c);s>l&&s>c?(a=0,o=1,i=2):l>c?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/u,f=e[o]/u,p=e[i]/u,g=Math.sqrt(d*d+p*p);if(0!==n){var m=Math.sin(n),v=Math.cos(n);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),r&&(r[a]=(-p*m-d*f*v)/g,r[o]=v*g,r[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),r&&(r[a]=-d*f/g,r[o]=g,r[i]=-f*p/g)},projectVector:function(e,t,r){var n=Ge(t,t);if(0===n)return r[0]=0,r[1]=0,r[2]=0,!1;for(var a=Ge(e,t)/n,o=0;o<3;o++)r[o]=t[o];return ke(r,a),!0},projectVector2D:function(e,t,r){var n=je(t,t);if(0===n)return r[0]=0,r[1]=0,!1;for(var a=je(e,t)/n,o=0;o<2;o++)r[o]=t[o];return Fe(r,a),!0},distance2BetweenPoints:ze,angleBetweenVectors:He,gaussianAmplitude:function(e,t,r){var n=Math.abs(e-r);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(n,2)/(2*t))},gaussianWeight:function(e,t,r){var n=Math.abs(e-r);return Math.exp(-Math.pow(n,2)/(2*t))},dot2D:je,outer2D:function(e,t,r){for(var n=0;n<2;n++)for(var a=0;a<2;a++)r[n][a]=e[n]*t[a]},norm2D:Ke,normalize2D:Xe,determinant2x2:qe,LUFactor3x3:function(e,t){for(var r,n,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(n=Math.abs(e[i][1]))>a&&(a=n),(n=Math.abs(e[i][2]))>a&&(a=n),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),r=0,(n=o[1]*Math.abs(e[1][0]))>=a&&(a=n,r=1),(n=o[2]*Math.abs(e[2][0]))>=a&&(r=2),0!==r&&(Te(e[r],e[0]),o[r]=o[0]),t[0]=r,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),r=1,(n=o[2]*Math.abs(e[2][1]))>=a&&(r=2,Te(e[2],e[1]),o[2]=o[1]),t[1]=r,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,r){var n=r[t[0]];r[t[0]]=r[0],r[0]=n,n=r[t[1]],r[t[1]]=r[1],r[1]=n-e[1][0]*r[0],n=r[t[2]],r[t[2]]=r[2],r[2]=n-e[2][0]*r[0]-e[2][1]*r[1],r[2]/=e[2][2],r[1]=(r[1]-e[1][2]*r[2])/e[1][1],r[0]=(r[0]-e[0][1]*r[1]-e[0][2]*r[2])/e[0][0]},linearSolve3x3:function(e,t,r){var n=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],u=e[2][1],d=e[2][2],f=+qe(s,u,l,d),p=-qe(i,c,l,d),g=+qe(i,c,s,u),m=-qe(a,u,o,d),v=+qe(n,c,o,d),h=-qe(n,c,a,u),y=+qe(a,s,o,l),b=-qe(n,i,o,l),T=+qe(n,i,a,s),S=n*f+a*p+o*g,C=f*t[0]+m*t[1]+y*t[2],x=p*t[0]+v*t[1]+b*t[2],P=g*t[0]+h*t[1]+T*t[2];r[0]=C/S,r[1]=x/S,r[2]=P/S},multiply3x3_vect3:function(e,t,r){var n=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];r[0]=n,r[1]=a,r[2]=o},multiply3x3_mat3:Ye,multiplyMatrix:function(e,t,r,n,a,o,i){n!==a&&me("Number of columns of A must match number of rows of B.");for(var s=0;sMe&&(n=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eye&&(f=0,d[c]=0);if(f&&1===a)return ve("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),ft(e,t,r,o);if(f)g=1;else for(c=0;c1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:pt,hsv2rgb:gt,lab2xyz:mt,xyz2lab:vt,xyz2rgb:ht,rgb2xyz:yt,rgb2lab:bt,lab2rgb:Tt,uninitializeBounds:St,areBoundsInitialized:Ct,computeBoundsFromPoints:xt,clampValue:Pt,clampVector:wt,clampAndNormalizeValue:function(e,t){var r=0;return t[0]!==t[1]&&(r=((r=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),r},getScalarTypeFittingRange:Ot,getAdjustedScalarRange:At,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]t[r+1]||e[r+1]t[r+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,r){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]+r[n/2]t[n+1]||e[n+1]+r[n/2]t[n+1])return 0;return 1},pointIsWithinBounds:function(e,t,r){if(!e||!t||!r)return 0;for(var n=0;n<3;n++)if(e[n]+r[n]t[2*n+1])return 0;return 1},solve3PointCircle:function(e,t,r,n){for(var a=Se(3),o=Se(3),i=Se(3),s=Se(3),l=Se(3),c=Se(3),u=0;u<3;++u)a[u]=e[u]-t[u],o[u]=t[u]-r[u],i[u]=r[u]-e[u],s[u]=-a[u],l[u]=-o[u],c[u]=-i[u];var d=Ue(s),f=Ue(l),p=Ue(i),g=Se(3);_e(a,o,g);for(var m=Ue(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*Ge(a,c)/h,b=p*p*Ge(s,o)/h,T=d*d*Ge(i,l)/h,S=0;S<3;++S)n[S]=y*e[S]+b*t[S]+T*r[S];return v},inf:1/0,negInf:-1/0,isInf:Mt,isNan:Rt,isNaN:Rt,isFinite:It,createUninitializedBounds:Dt,getMajorAxisIndex:function(e){for(var t=-1,r=-1,n=0;nt&&(r=n,t=a)}return r},floatToHex2:Bt,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Bt).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(Vt).join(", "),")"):"rgba(".concat(Vt(e[0]||0),", ").concat(Vt(e[1]||0),", ").concat(Vt(e[2]||0),", ").concat(e[3]||0,")")}};function Nt(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}function kt(e){for(var t=1;ta&&(a=o);return{min:n,max:a}}function _t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<0&&r>1){for(var n=e.length,a=n/r,o=new Float64Array(a),i=0,s=0;i1&&void 0!==arguments[1]?arguments[1]:0,r=e||[];r.length<=t;)r.push(null);return r}function Wt(e){return Object.prototype.toString.call(e).slice(8,-1)}var jt={computeRange:_t,createRangeHelper:function(){var e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=0,n=0;return{add:function(a){e>a&&(e=a),tr&&(r=a)}return r}};function zt(e,t){function r(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=function(e,n,a){a!==t.values[e*t.numberOfComponents+n]&&(t.values[e*t.numberOfComponents+n]=a,r())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,r=e<0?t.numberOfComponents:e,n=null;return t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents)),(n=t.ranges[r])?(t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple):(n=_t(t.values,e,t.numberOfComponents),t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple)},e.setRange=function(e,r){t.ranges||(t.ranges=Ut(t.ranges,t.numberOfComponents));var n={min:e.min,max:e.max};return t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple},e.setTuple=function(e,r){for(var n=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:Ft,n=t.numberOfComponents||1;r.length!==n&&(r.length=n);var a=e*n;if(1===n)r[0]=t.values[a];else if(2===n)r[0]=t.values[a],r[1]=t.values[a+1];else if(3===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2];else if(4===n)r[0]=t.values[a],r[1]=t.values[a+1],r[2]=t.values[a+2],r[3]=t.values[a+3];else for(var o=0;o0&&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 Xt({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,n){t.values=e,t.size=e.length,t.dataType=Wt(e),n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),r()},e.getState=function(){var r=kt(kt({},t),{},{vtkClass:e.getClassName()});r.values=Array.from(r.values),delete r.buffer,Object.keys(r).forEach((function(e){r[e]||delete r[e]}));var n={};return Object.keys(r).sort().forEach((function(e){n[e]=r[e]})),n.mtime&&delete n.mtime,n}}var Ht={name:"",numberOfComponents:1,size:0,dataType:s.DefaultDataType,rangeTuple:[0,0]};function Kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Ht,r),!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=z(t.dataType,t.values)):t.values=j(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=Wt(t.values)),Z(e,t),ee(e,t,["name","numberOfComponents"]),zt(e,t)}var Xt=ie(Kt,"vtkDataArray"),qt=kt(kt({newInstance:Xt,extend:Kt},jt),s);function Yt(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 Zt=1e-6,Qt="coincide",$t="disjoint";function Jt(e,t,r){var n=r[0]*(e[0]-t[0])+r[1]*(e[1]-t[1])+r[2]*(e[2]-t[2]);return Math.abs(n)}function er(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a);n[0]=e[0]-o*r[0],n[1]=e[1]-o*r[1],n[2]=e[2]-o*r[2]}function tr(e,t,r){var n=Ge(e,t),a=Ge(t,t);return 0===a&&(a=1),r[0]=e[0]-n*t[0]/a,r[1]=e[1]-n*t[1]/a,r[2]=e[2]-n*t[2]/a,r}function rr(e,t,r,n){var a=[];Ne(e,t,a);var o=Ge(r,a),i=Ge(r,r);0!==i?(n[0]=e[0]-o*r[0]/i,n[1]=e[1]-o*r[1]/i,n[2]=e[2]-o*r[2]/i):(n[0]=e[0],n[1]=e[1],n[2]=e[2])}function nr(e,t,r,n){var a={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},o=[],i=[];Ne(t,e,o),Ne(r,e,i);var s=Ge(n,i),l=Ge(n,o);return(l<0?-l:l)<=(s<0?-s*Zt:s*Zt)||(a.t=s/l,a.x[0]=e[0]+a.t*o[0],a.x[1]=e[1]+a.t*o[1],a.x[2]=e[2]+a.t*o[2],a.intersection=!0,a.betweenPoints=a.t>=0&&a.t<=1),a}function ar(e,t,r,n){var a={intersection:!1,l0:[],l1:[],error:null},o=[];_e(t,n,o);var i,s=o.map((function(e){return Math.abs(e)}));if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var c=[],u=-Ge(t,e),d=-Ge(n,r);switch(i){case"x":c[0]=0,c[1]=(d*t[2]-u*n[2])/o[0],c[2]=(u*n[1]-d*t[1])/o[0];break;case"y":c[0]=(u*n[2]-d*t[2])/o[1],c[1]=0,c[2]=(d*t[0]-u*n[0])/o[1];break;case"z":c[0]=(d*t[1]-u*n[1])/o[2],c[1]=(u*n[0]-d*t[0])/o[2],c[2]=0}return a.l0=c,Le(c,o,a.l1),a.intersection=!0,a}var or={evaluate:function(e,t,r){return e[0]*(r[0]-t[0])+e[1]*(r[1]-t[1])+e[2]*(r[2]-t[2])},distanceToPlane:Jt,projectPoint:er,projectVector:tr,generalizedProjectPoint:rr,intersectWithLine:nr,intersectWithPlane:ar,DISJOINT:$t,COINCIDE:Qt};function ir(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return Jt(e,t.origin,t.normal)},e.projectPoint=function(e,r){er(e,t.origin,t.normal,r)},e.projectVector=function(e,r){return tr(e,t.normal,r)},e.push=function(e){if(0!==e)for(var r=0;r<3;r++)t.origin[r]+=e*t.normal[r]},e.generalizedProjectPoint=function(e,r){rr(e,t.origin,t.normal,r)},e.evaluateFunction=function(e,r,n){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]*(r-t.origin[1])+t.normal[2]*(n-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,r){return nr(e,r,t.origin,t.normal)},e.intersectWithPlane=function(e,r){return ar(e,r,t.origin,t.normal)}}var sr={normal:[0,0,1],origin:[0,0,0]};function lr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sr,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),ir(e,t)}var cr=function(e){for(var t=1;t(arguments.length<=1?void 0:arguments[1])?n: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]=o>(arguments.length<=2?void 0:arguments[2])?o: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]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function hr(e,t,r,n,a,o,i){var s=u(e,6),l=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],c),e[2]=Math.min(t[2],d),e[3]=Math.max(t[3],f),e[4]=Math.min(t[4],p),e[5]=Math.max(t[5],g)):(e[0]=Math.min(t,l),e[1]=Math.max(r,c),e[2]=Math.min(n,d),e[3]=Math.max(a,f),e[4]=Math.min(o,p),e[5]=Math.max(i,g))}function yr(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=r,e[3]=r>l?r:l,e[4]=n,e[5]=n>d?n:d,o!==t||s!==r||c!==n}function br(e,t,r,n){var a=u(e,6),o=a[0],i=a[1],s=a[2],l=a[3],c=a[4],d=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),r>=0?(e[2]*=r,e[3]*=r):(e[2]=r*e[3],e[3]=r*e[2]),n>=0?(e[4]*=n,e[5]*=n):(e[4]=n*e[5],e[5]=n*e[4]),!0)}function Cr(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function xr(e,t){return e[2*t+1]-e[2*t]}function Pr(e){return[xr(e,0),xr(e,1),xr(e,2)]}function wr(e){return e.slice(0,2)}function Or(e){return e.slice(2,4)}function Ar(e){return e.slice(4,6)}function Mr(e){var t=Pr(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function Ir(e){if(pr(e)){var t=Pr(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Rr(e){return[e[0],e[2],e[4]]}function Er(e){return[e[1],e[3],e[5]]}function Dr(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Br(e,t){for(var r=0,n=0;n<2;n++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[r]=[e[n],e[a],e[o]],r++}function Vr(e,t,r){t[0]=e[0],t[1]=e[2],t[2]=e[4],r[0]=e[1],r[1]=e[3],r[2]=e[5]}function Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Cr(e);return t[0]=e[1]-r[0],t[1]=e[3]-r[1],t[2]=e[5]-r[2],t}function Nr(e,t,r,n){for(var a=[].concat(dr),o=e.getData(),i=0;ie[2*u+1]?(i[u]=0,c[u]=e[2*u+1],o=!1):i[u]=2;if(o)return n[0]=t[0],n[1]=t[1],n[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==r[d]?l[d]=(c[d]-t[d])/r[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(n[p]=t[p]+l[s]*r[p],n[p]e[2*p+1])return 0}else n[p]=c[p];return 1}function Fr(e,t,r){for(var n=[],a=0,o=1,i=1,s=4;s<=5;++s){n[2]=e[s];for(var l=2;l<=3;++l){n[1]=e[l];for(var c=0;c<=1;++c)if(n[0]=e[c],a=cr.evaluate(r,t,n),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Gr(e,t){if(!pr(e)||!pr(t))return!1;for(var r,n=[0,0,0,0,0,0],a=0;a<3;a++)if(r=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(r=!0,n[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(r=!0,n[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(r=!0,n[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(r=!0,n[2*a+1]=e[2*a+1]),!r)return!1;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],!0}function _r(e,t){if(!pr(e)||!pr(t))return!1;for(var r=0;r<3;r++)if(!(t[2*r]>=e[2*r]&&t[2*r]<=e[2*r+1]||e[2*r]>=t[2*r]&&e[2*r]<=t[2*r+1]||t[2*r+1]>=e[2*r]&&t[2*r+1]<=e[2*r+1]||e[2*r+1]>=t[2*r]&&e[2*r+1]<=t[2*r+1]))return!1;return!0}function Ur(e,t,r,n){return!(te[1]||re[3]||ne[5])}function Wr(e,t,r){for(var n=[[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],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var c=[e[i],e[s],e[l]];a[o++]=cr.evaluate(r,t,c)}for(var u=2;u--&&!(Dr(a[n[u][0]],a[n[u][4]])&&Dr(a[n[u][1]],a[n[u][5]])&&Dr(a[n[u][2]],a[n[u][6]])&&Dr(a[n[u][3]],a[n[u][7]])););if(u<0)return!1;for(var d=Math.sign(r[u]),f=Math.abs((e[2*u+1]-e[2*u])*r[u]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[n[u][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*u]+p*e[2*u+1];return d>0?e[2*u]=v:e[2*u+1]=v,!0}var jr=function(){function e(t){S(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),gr(this.bounds,dr))}return x(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return fr(this.bounds,e)}},{key:"isValid",value:function(){return pr(this.bounds)}},{key:"setBounds",value:function(e){return gr(this.bounds,e)}},{key:"reset",value:function(){return mr(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r=0&&e=0},e.getArrayName=function(e){var r=t.arrays[e];return r?r.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r.getArrays().forEach((function(r){var o=e.getFlag(r.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&r){var i=e.getArrayByName(r.getName());if(i){if(r.getNumberOfComponents()===i.getNumberOfComponents())if(n>-1&&n-1?a:n;i.setTuple(s,r.getTuple(n))}else for(var l=0;lr.getNumberOfTuples())e.addArray(r);else{var c=r.getNumberOfComponents(),u=r.getNumberOfValues(),d=a>-1?a:n;ue?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=r();return e.arrays=t.arrays.map((function(e){return{data:e.data.getState()}})),e}}var Xr={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function qr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xr,r),fe.obj(e,t),Kr(e,t)}var Yr={newInstance:fe.newInstance(qr,"vtkFieldData"),extend:qr},Zr={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Qr(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 $r=Zr.AttributeTypes,Jr=Zr.AttributeCopyOperations,en=fe.vtkWarningMacro;function tn(e,t){var r=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(e){var t=r.find((function(t){return $r[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(r,a){var o=n(a);if(r&&"PEDIGREEIDS"===o.toUpperCase()&&!r.isA("vtkDataArray"))return en("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(r&&!e.checkNumberOfComponents(r,o))return en("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rn,r),Yr.extend(e,t,r),fe.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),tn(e,t)}var an=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),cn.forEach((function(r){t[r]=an.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))}}var dn={};function fn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dn,r),fe.obj(e,t),fe.setGet(e,t,cn),un(e,t)}var pn=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?hn.EMPTY:3===t?hn.XYZ_GRID:2===t?e[0]===e[1]?hn.YZ_PLANE:e[2]===e[3]?hn.XZ_PLANE:hn.XY_PLANE:1===t?e[0]0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Xn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[0],s=r[1],l=r[2];return e[0]=a*l-o*s,e[1]=o*i-n*l,e[2]=n*s-a*i,e}function Yn(e,t,r,n){var a=t[0],o=t[1],i=t[2];return e[0]=a+n*(r[0]-a),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function Zn(e,t,r,n,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,c=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*s+r[0]*l+n[0]*c+a[0]*u,e[1]=t[1]*s+r[1]*l+n[1]*c+a[1]*u,e[2]=t[2]*s+r[2]*l+n[2]*c+a[2]*u,e}function Qn(e,t,r,n,a,o){var i=1-o,s=i*i,l=o*o,c=s*i,u=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*d+a[0]*f,e[1]=t[1]*c+r[1]*u+n[1]*d+a[1]*f,e[2]=t[2]*c+r[2]*u+n[2]*d+a[2]*f,e}function $n(e,t){t=t||1;var r=2*Sn()*Math.PI,n=2*Sn()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}function Jn(e,t,r){var n=t[0],a=t[1],o=t[2],i=r[3]*n+r[7]*a+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*a+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*a+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*a+r[10]*o+r[14])/i,e}function ea(e,t,r){var n=t[0],a=t[1],o=t[2];return e[0]=n*r[0]+a*r[3]+o*r[6],e[1]=n*r[1]+a*r[4]+o*r[7],e[2]=n*r[2]+a*r[5]+o*r[8],e}function ta(e,t,r){var n=r[0],a=r[1],o=r[2],i=r[3],s=t[0],l=t[1],c=t[2],u=a*c-o*l,d=o*s-n*c,f=n*l-a*s,p=a*f-o*d,g=o*u-n*f,m=n*d-a*u,v=2*i;return u*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+u+p,e[1]=l+d+g,e[2]=c+f+m,e}function ra(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0],o[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),o[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function na(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),o[1]=a[1],o[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function aa(e,t,r,n){var a=[],o=[];return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],o[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),o[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),o[2]=a[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function oa(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(r*r+n*n+a*a)*Math.sqrt(o*o+i*i+s*s),c=l&&Xn(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function ia(e){return e[0]=0,e[1]=0,e[2]=0,e}function sa(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function la(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ca(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(r-o)<=bn*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=bn*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-s)<=bn*Math.max(1,Math.abs(a),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ua,da=En,fa=Dn,pa=Bn,ga=Un,ma=Wn,va=On,ha=jn,ya=(ua=Pn(),function(e,t,r,n,a,o){var i,s;for(t||(t=3),r||(r=0),s=n?Math.min(n*t+r,e.length):e.length,i=r;i0?(r[0]=2*(s*i+u*n+l*o-c*a)/d,r[1]=2*(l*i+u*a+c*n-s*o)/d,r[2]=2*(c*i+u*o+s*a-l*n)/d):(r[0]=2*(s*i+u*n+l*o-c*a),r[1]=2*(l*i+u*a+c*n-s*o),r[2]=2*(c*i+u*o+s*a-l*n)),Wa(e,t,r),e}function za(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ha(e,t){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(r,n,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,c,u),e}function Ka(e,t){var r=new Tn(3);Ha(r,t);var n=1/r[0],a=1/r[1],o=1/r[2],i=t[0]*n,s=t[1]*a,l=t[2]*o,c=t[4]*n,u=t[5]*a,d=t[6]*o,f=t[8]*n,p=t[9]*a,g=t[10]*o,m=i+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),e[3]=.25*v,e[0]=(d-p)/v,e[1]=(f-l)/v,e[2]=(s-c)/v):i>u&&i>g?(v=2*Math.sqrt(1+i-u-g),e[3]=(d-p)/v,e[0]=.25*v,e[1]=(s+c)/v,e[2]=(f+l)/v):u>g?(v=2*Math.sqrt(1+u-i-g),e[3]=(f-l)/v,e[0]=(s+c)/v,e[1]=.25*v,e[2]=(d+p)/v):(v=2*Math.sqrt(1+g-i-u),e[3]=(s-c)/v,e[0]=(f+l)/v,e[1]=(d+p)/v,e[2]=.25*v),e}function Xa(e,t,r,n){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,c=o+o,u=i+i,d=a*l,f=a*c,p=a*u,g=o*c,m=o*u,v=i*u,h=s*l,y=s*c,b=s*u,T=n[0],S=n[1],C=n[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*S,e[5]=(1-(d+v))*S,e[6]=(m+h)*S,e[7]=0,e[8]=(p+y)*C,e[9]=(m-h)*C,e[10]=(1-(d+g))*C,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function qa(e,t,r,n,a){var o=t[0],i=t[1],s=t[2],l=t[3],c=o+o,u=i+i,d=s+s,f=o*c,p=o*u,g=o*d,m=i*u,v=i*d,h=s*d,y=l*c,b=l*u,T=l*d,S=n[0],C=n[1],x=n[2],P=a[0],w=a[1],O=a[2],A=(1-(m+h))*S,M=(p+T)*S,I=(g-b)*S,R=(p-T)*C,E=(1-(f+h))*C,D=(v+y)*C,B=(g+b)*x,V=(v-y)*x,L=(1-(f+m))*x;return e[0]=A,e[1]=M,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=B,e[9]=V,e[10]=L,e[11]=0,e[12]=r[0]+P-(A*P+R*w+B*O),e[13]=r[1]+w-(M*P+E*w+V*O),e[14]=r[2]+O-(I*P+D*w+L*O),e[15]=1,e}function Ya(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=u+h,e[2]=f-v,e[3]=0,e[4]=u-h,e[5]=1-c-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Za(e,t,r,n,a,o,i){var s=1/(r-t),l=1/(a-n),c=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*l,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function Qa(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=(a+n)*o,e[14]=2*a*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=Qa;function Ja(e,t,r,n,a){var o,i=1/Math.tan(t/2);return e[0]=i/r,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?(o=1/(n-a),e[10]=a*o,e[14]=a*n*o):(e[10]=-1,e[14]=-n),e}function eo(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),c=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function to(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(i+o)*c,e[15]=1,e}var ro=to;function no(e,t,r,n,a,o,i){var s=1/(t-r),l=1/(n-a),c=1/(o-i);return e[0]=-2*s,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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=o*c,e[15]=1,e}function ao(e,t,r,n){var a,o,i,s,l,c,u,d,f,p,g=t[0],m=t[1],v=t[2],h=n[0],y=n[1],b=n[2],T=r[0],S=r[1],C=r[2];return Math.abs(g-T)0&&(u*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-c*d,m=c*u-s*f,v=s*d-l*u;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-u*v,e[6]=u*m-d*g,e[7]=0,e[8]=u,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function io(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]+")"}function so(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])}function lo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function co(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function uo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function fo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function po(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]}function go(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],h=e[15],y=t[0],b=t[1],T=t[2],S=t[3],C=t[4],x=t[5],P=t[6],w=t[7],O=t[8],A=t[9],M=t[10],I=t[11],R=t[12],E=t[13],D=t[14],B=t[15];return Math.abs(r-y)<=bn*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-b)<=bn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-T)<=bn*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(o-S)<=bn*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-C)<=bn*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-x)<=bn*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-P)<=bn*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-w)<=bn*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(u-O)<=bn*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(d-A)<=bn*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-M)<=bn*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(p-I)<=bn*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=bn*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=bn*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=bn*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-B)<=bn*Math.max(1,Math.abs(h),Math.abs(B))}var mo=Ia,vo=co;function ho(){var e=new Tn(9);return Tn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function yo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function bo(e){var t=new Tn(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function To(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}function So(e,t,r,n,a,o,i,s,l){var c=new Tn(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=a,c[5]=o,c[6]=i,c[7]=s,c[8]=l,c}function Co(e,t,r,n,a,o,i,s,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i,e[6]=s,e[7]=l,e[8]=c,e}function xo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Po(e,t){if(e===t){var r=t[1],n=t[2],a=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=a}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function wo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*i-s*c,f=-u*o+s*l,p=c*o-i*l,g=r*d+n*f+a*p;return g?(g=1/g,e[0]=d*g,e[1]=(-u*n+a*c)*g,e[2]=(s*n-a*i)*g,e[3]=f*g,e[4]=(u*r-a*l)*g,e[5]=(-s*r+a*o)*g,e[6]=p*g,e[7]=(-c*r+n*l)*g,e[8]=(i*r-n*o)*g,e):null}function Oo(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=i*u-s*c,e[1]=a*c-n*u,e[2]=n*s-a*i,e[3]=s*l-o*u,e[4]=r*u-a*l,e[5]=a*o-r*s,e[6]=o*c-i*l,e[7]=n*l-r*c,e[8]=r*i-n*o,e}function Ao(e){var t=e[0],r=e[1],n=e[2],a=e[3],o=e[4],i=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-i*l)+r*(-c*a+i*s)+n*(l*a-o*s)}function Mo(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],h=r[5],y=r[6],b=r[7],T=r[8];return e[0]=f*n+p*i+g*c,e[1]=f*a+p*s+g*u,e[2]=f*o+p*l+g*d,e[3]=m*n+v*i+h*c,e[4]=m*a+v*s+h*u,e[5]=m*o+v*l+h*d,e[6]=y*n+b*i+T*c,e[7]=y*a+b*s+T*u,e[8]=y*o+b*l+T*d,e}function Io(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=r[0],p=r[1];return e[0]=n,e[1]=a,e[2]=o,e[3]=i,e[4]=s,e[5]=l,e[6]=f*n+p*i+c,e[7]=f*a+p*s+u,e[8]=f*o+p*l+d,e}function Ro(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=Math.sin(r),p=Math.cos(r);return e[0]=p*n+f*i,e[1]=p*a+f*s,e[2]=p*o+f*l,e[3]=p*i-f*n,e[4]=p*s-f*a,e[5]=p*l-f*o,e[6]=c,e[7]=u,e[8]=d,e}function Eo(e,t,r){var n=r[0],a=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Do(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Bo(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Vo(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function No(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r+r,s=n+n,l=a+a,c=r*i,u=n*i,d=n*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[3]=u-h,e[6]=f+v,e[1]=u+h,e[4]=1-c-g,e[7]=p-m,e[2]=f-v,e[5]=p+m,e[8]=1-c-d,e}function ko(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],h=t[15],y=r*s-n*i,b=r*l-a*i,T=r*c-o*i,S=n*l-a*s,C=n*c-o*s,x=a*c-o*l,P=u*m-d*g,w=u*v-f*g,O=u*h-p*g,A=d*v-f*m,M=d*h-p*m,I=f*h-p*v,R=y*I-b*M+T*A+S*O-C*w+x*P;return R?(R=1/R,e[0]=(s*I-l*M+c*A)*R,e[1]=(l*O-i*I-c*w)*R,e[2]=(i*M-s*O+c*P)*R,e[3]=(a*M-n*I-o*A)*R,e[4]=(r*I-a*O+o*w)*R,e[5]=(n*O-r*M-o*P)*R,e[6]=(m*x-v*C+h*S)*R,e[7]=(v*T-g*x-h*b)*R,e[8]=(g*C-m*T+h*y)*R,e):null}function Fo(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Go(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function _o(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Uo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Wo(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function jo(e,t,r){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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function zo(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function Ho(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]}function Ko(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=t[0],f=t[1],p=t[2],g=t[3],m=t[4],v=t[5],h=t[6],y=t[7],b=t[8];return Math.abs(r-d)<=bn*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-f)<=bn*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=bn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=bn*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-m)<=bn*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-v)<=bn*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-h)<=bn*Math.max(1,Math.abs(l),Math.abs(h))&&Math.abs(c-y)<=bn*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=bn*Math.max(1,Math.abs(u),Math.abs(b))}var Xo=Mo,qo=Wo,Yo=fe.vtkErrorMacro;function Zo(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&(r*=t[n]-1)}return r},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(r){var n=e.getDimensions();if(0===n[0]||0===n[1]||0===n[2])return Yo("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case gn.EMPTY:return null;case gn.SINGLE_POINT:break;case gn.X_LINE:a[0]=r;break;case gn.Y_LINE:a[1]=r;break;case gn.Z_LINE:a[2]=r;break;case gn.XY_PLANE:a[0]=r%n[0],a[1]=r/n[0];break;case gn.YZ_PLANE:a[1]=r%n[1],a[2]=r/n[1];break;case gn.XZ_PLANE:a[0]=r%n[0],a[2]=r/n[0];break;case gn.XYZ_GRID:a[0]=r%n[0],a[1]=r/n[0]%n[1],a[2]=r/(n[0]*n[1]);break;default:Yo("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var r=[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]],n=new Float64Array([r[0],r[1],r[2]]),a=new Float64Array(3);e.indexToWorld(n,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],i=3;i<24;i+=3)In(n,r[i],r[i+1],r[i+2]),e.indexToWorld(n,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){Na(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],Ea(t.indexToWorld,t.indexToWorld,t.spacing),Oa(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return Yo("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.indexToWorld),r},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Jn(r,e,t.worldToIndex),r},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.indexToWorld),Jn(i,a,t.indexToWorld),xt(o,i,r)},e.worldToIndexBounds=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[0,0,0],a=[0,0,0];Hr.computeCornerPoints(e,n,a);var o=[0,0,0],i=[0,0,0];return Jn(o,n,t.worldToIndex),Jn(i,a,t.worldToIndex),xt(o,i,r)},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),r=[],n=0;n<3;n++)r[n]=(t[2*n+1]+t[2*n])/2;return r},e.computeHistogram=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[0,0,0,0,0,0];e.worldToIndexBounds(t,n);var a=[0,0,0],o=[0,0,0];Hr.computeCornerPoints(n,a,o),nt(a,a),nt(o,o);var i=e.getDimensions();wt(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),wt(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],c=e.getPointData().getScalars().getData(),u=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!r||r([y,v,m],n)){var b=c[h];b>u&&(u=b),b0?p/g:0,S=g?Math.abs(f/g-T*T):0,C=Math.sqrt(S);return{minimum:d,maximum:u,average:T,variance:S,sigma:C,count:g}},e.computeIncrements=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=t,a=0;a<3;++a)r[a]=n,n*=e[2*a+1]-e[2*a]+1;return r},e.computeOffsetIndex=function(t){var r=u(t,3),n=r[0],a=r[1],o=r[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(n)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var r=e.getExtent(),n=e.worldToIndex(t),a=0;a<3;++a)if(n[a]r[2*a+1])return Yo("GetScalarPointer: Pixel ".concat(n," is not in memory. Current extent = ").concat(r)),NaN;return e.computeOffsetIndex(n)},e.getScalarValueFromWorld=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=n)return Yo("GetScalarPointer: Scalar Component ".concat(r," is not within bounds. Current Scalar numberOfComponents: ").concat(n)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,r)}}var Qo={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:gn.EMPTY};function $o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qo,r),pn.extend(e,t,r),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=xo(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),fe.get(e,t,["direction","indexToWorld","worldToIndex"]),fe.setGetArray(e,t,["origin","spacing"],3),fe.getArray(e,t,["extent"],6),Zo(e,t)}var Jo,ei={newInstance:fe.newInstance($o,"vtkImageData"),extend:$o};function ti(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function ri(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*a+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*a+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*a+r[11]*o+r[15]*i,e}function ni(){var e=new Tn(4);return Tn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ai(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function oi(e,t,r){var n=t[0],a=t[1],o=t[2],i=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+i*s+a*c-o*l,e[1]=a*u+i*l+o*s-n*c,e[2]=o*u+i*c+n*l-a*s,e[3]=i*u-n*s-a*l-o*c,e}Jo=new Tn(4),Tn!=Float32Array&&(Jo[0]=0,Jo[1]=0,Jo[2]=0,Jo[3]=0);var ii=function(e,t,r,n){var a=new Tn(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a},si=function(e,t){var r=t[0],n=t[1],a=t[2],o=t[3],i=r*r+n*n+a*a+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=a*i,e[3]=o*i,e};function li(e){return function(){return fe.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}function ci(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,r=0;re&&(e=n)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=li("pick"),e.hasKey=li("hasKey"),e.getNestedVisibility=function(){return t.visibility&&(!t.parentProp||t.parentProp.getNestedVisibility())},e.getNestedPickable=function(){return t.pickable&&(!t.parentProp||t.parentProp.getNestedPickable())},e.getNestedDragable=function(){return t.dragable&&(!t.parentProp||t.parentProp.getNestedDragable())},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(r){r&&!e.hasTexture(r)&&(t.textures=t.textures.concat(r),e.modified())},e.removeTexture=function(r){var n=t.textures.filter((function(e){return e!==r}));t.textures.length!==n.length&&(t.textures=n,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}Pn(),An(1,0,0),An(0,1,0),ni(),ni(),ho();var ui={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function di(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ui,r),fe.obj(e,t),fe.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),fe.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier","parentProp"]),ci(e,t)}var fi={newInstance:fe.newInstance(di,"vtkProp"),extend:di};function pi(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(r){t.position=t.position.map((function(e,t){return e+r[t]})),e.modified()},e.getOrientationWXYZ=function(){var e=ni();Ka(e,t.rotation);var r=new Float64Array(3),n=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>bn?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}(r,e);return[xe(n),r[0],r[1],r[2]]},e.rotateX=function(r){0!==r&&(Ba(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateY=function(r){0!==r&&(Va(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateZ=function(r){0!==r&&(La(t.rotation,t.rotation,Ce(r)),e.modified())},e.rotateWXYZ=function(r,n,a,o){if(0!==r&&(0!==n||0!==a||0!==o)){var i=Ce(r),s=ni();ai(s,[n,a,o],i);var l=new Float64Array(16);Ya(l,s),Ia(t.rotation,t.rotation,l),e.modified()}},e.setOrientation=function(r,n,a){return(r!==t.orientation[0]||n!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[r,n,a],Pa(t.rotation),e.rotateZ(a),e.rotateX(r),e.rotateY(n),e.modified(),!0)},e.setUserMatrix=function(r){Sa(t.userMatrix,r),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){Pa(t.matrix),t.userMatrix&&Ia(t.matrix,t.matrix,t.userMatrix),Ra(t.matrix,t.matrix,t.origin),Ra(t.matrix,t.matrix,t.position),Ia(t.matrix,t.matrix,t.rotation),Ea(t.matrix,t.matrix,t.scale),Ra(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),wa(t.matrix,t.matrix),t.isIdentity=!0;for(var r=0;r<4;++r)for(var n=0;n<4;++n)(r===n?1:0)!==t.matrix[r+4*n]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return Hr.getCenter(t.bounds)},e.getLength=function(){return Hr.getLength(t.bounds)},e.getXRange=function(){return Hr.getXRange(t.bounds)},e.getYRange=function(){return Hr.getYRange(t.bounds)},e.getZRange=function(){return Hr.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified((function(){e.computeMatrix()}))}var gi={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 mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gi,r),fi.extend(e,t,r),t.matrixMTime={},fe.obj(t.matrixMTime),fe.get(e,t,["bounds","isIdentity"]),fe.getArray(e,t,["orientation"]),fe.setGetArray(e,t,["origin","position","scale"],3),t.matrix=Pa(new Float64Array(16)),t.rotation=Pa(new Float64Array(16)),t.userMatrix=Pa(new Float64Array(16)),t.transform=null,pi(e,t)}var vi={newInstance:fe.newInstance(mi,"vtkProp3D"),extend:mi},hi={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},yi={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:hi},bi={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Ti={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:bi};function Si(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 Ci=yi.ScalarMappingTarget,xi=yi.VectorMode,Pi=qt.VtkDataTypes,wi=Ti.ColorMode,Oi=fe.vtkErrorMacro;function Ai(e){return e}function Mi(e){return Math.floor(255*e+.5)}function Ii(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(xi.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(xi.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(xi.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(r,n){if(!(r&&!n||!r&&n))if(r&&n&&r.length!==n.length)Oi("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],n&&r)for(var a=n.length,o=0;o=0?t.annotationArray[a].annotation!==n&&(t.annotationArray[a].annotation=n,o=!0):(t.annotationArray.push({value:r,annotation:n}),a=t.annotationArray.length-1,o=!0),o&&(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(r){return t.annotationArray.length?e.checkForAnnotatedValue(r):-1},e.removeAnnotation=function(r){var n=e.checkForAnnotatedValue(r),a=n>=0;return a&&(t.annotationArray.splice(n,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(r,n){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(r);e.getIndexedColor(a,n)}else e.getColor(parseFloat(r),n),n[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var r=t.annotationArray.length;return t.annotatedValueMap[e]%r}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,r=0;r1?e.mapVectorsThroughTable(t,o,Ci.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Ci.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,r){for(var n=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=c&&(l=c-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=c):(l<0&&(l=0),l>=c&&(l=c-1),l+s>c&&(s=c-l)),i!==xi.MAGNITUDE||1!==c&&1!==s||(i=xi.COMPONENT));var u=0;switch(l>0&&(u=l),i){case xi.COMPONENT:e.mapScalarsThroughTable(t,r,n,u);break;case xi.RGBCOLORS:break;case xi.MAGNITUDE:default:var d=qt.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,r,n,0)}},e.luminanceToRGBA=function(e,t,r,n){for(var a=n(r),o=t.getData(),i=e.getData(),s=o.length,l=0,c=0;c=1&&r.getDataType()===Pi.UNSIGNED_CHAR)return r;var i=qt.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Pi.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ai;switch(r.getDataType()!==Pi.FLOAT&&r.getDataType()!==Pi.DOUBLE||(s=Mi),n){case 1:e.luminanceToRGBA(i,r,o,s);break;case 2:e.luminanceAlphaToRGBA(i,r,s);break;case 3:e.rGBToRGBA(i,r,o,s);break;case 4:e.rGBAToRGBA(i,r,o,s);break;default:return Oi("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,r){return e.setMappingRange(t,r)},e.getRange=function(t,r){return e.getMappingRange()}}var Ri={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:xi.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Ei(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ri,r),fe.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],fe.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),fe.setArray(e,t,["mappingRange"],2),fe.getArray(e,t,["mappingRange"]),Ii(e,t)}var Di=function(e){for(var t=1;t.001?Math.acos(r/o):0,s=i>.001?Math.atan2(a,n):0;t[0]=o,t[1]=i,t[2]=s}function Wi(e,t){if(e[0]>=t-.1)return e[2];var r=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+r:e[2]-r}function ji(e,t,r,n){var a=[],o=[];bt(t,a),bt(r,o);var i=[],s=[];Ui(a,i),Ui(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var r=e-t;for(r<0&&(r=-r);r>=2*Math.PI;)r-=2*Math.PI;return r>Math.PI&&(r=2*Math.PI-r),r}(i[2],s[2])>.33*Math.PI){var c=Math.max(i[0],s[0]);c=Math.max(88,c),e<.5?(s[0]=c,s[1]=0,s[2]=0,l*=2):(i[0]=c,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Wi(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Wi(i,s[0]));var u=[];u[0]=(1-l)*i[0]+l*s[0],u[1]=(1-l)*i[1]+l*s[1],u[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var r=e[0],n=e[1],a=e[2];t[0]=r*Math.cos(n),t[1]=r*Math.sin(n)*Math.cos(a),t[2]=r*Math.sin(n)*Math.sin(a)}(u,d),Tt(d,n)}function zi(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,r,n,a){return e.addRGBPointLong(t,r,n,a,.5,0)},e.addRGBPointLong=function(r,n,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Gi("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Gi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var l={x:r,r:n,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[],l=[r,n,a];return gt(l,s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(r){if(t.nodes!==r){var n=JSON.stringify(t.nodes);t.nodes=r;var a=JSON.stringify(t.nodes);if(e.sortAndUpdateRange()||n!==a)return e.modified(),!0}return!1},e.sortAndUpdateRange=function(){var r=JSON.stringify(t.nodes);t.nodes.sort((function(e,t){return e.x-t.x}));var n=JSON.stringify(t.nodes),a=e.updateRange();return a||r===n?a:(e.modified(),!0)},e.updateRange=function(){var r=[2];r[0]=t.mappingRange[0],r[1]=t.mappingRange[1];var n=t.nodes.length;return n?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[n-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(r[0]!==t.mappingRange[0]||r[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(r){for(var n=0;n=t.nodes.length)return-1;var o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(r,n){if(r!==n){e.removePoint(n);for(var a=0;a=r&&t.nodes[u].x<=i?t.nodes.splice(u,1):u++;e.addRGBPointLong(r,n,a,o,.5,0),e.addRGBPointLong(i,s,l,c,.5,0),e.modified()},e.addHSVSegment=function(t,r,n,a,o,i,s,l){var c=[i,s,l],u=[],d=[];gt([r,n,a],u),gt(c,d),e.addRGBSegment(t,u[0],u[1],u[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var r=[];return e.getColor(t,r),[Math.floor(255*r[0]+.5),Math.floor(255*r[1]+.5),Math.floor(255*r[2]+.5),255]},e.getColor=function(r,n){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(r);if(o<0||0===a)e.getNanColor(n);else{var i=[];e.getNodeValue(o%a,i),n[0]=i.r,n[1]=i.g,n[2]=i.b}}else e.getTable(r,r,1,n)},e.getRedValue=function(t){var r=[];return e.getColor(t,r),r[0]},e.getGreenValue=function(t){var r=[];return e.getColor(t,r),r[1]},e.getBlueValue=function(t){var r=[];return e.getColor(t,r),r[2]},e.getTable=function(r,n,a,o){if(Et(r)||Et(n))for(var i=0;i0);var S=0,C=0,x=0;T&&(S=Math.log10(r),C=Math.log10(n));for(var P=0;P1?T?(x=S+P/(a-1)*(C-S),f=Math.pow(10,x)):f=r+P/(a-1)*(n-r):T?(x=.5*(S+C),f=Math.pow(10,x)):f=.5*(r+n),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var A=t.numberOfValues,M=O[1]-O[0];if(A<=1)f=O[0]+M/2;else{var I=(f-O[0])/M,R=we(A*I);f=O[0]+R/(A-1)*M}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[w]=0,o[w+1]=0,o[w+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[w]=t.aboveRangeColor[0],o[w+1]=t.aboveRangeColor[1],o[w+2]=t.aboveRangeColor[2]):(o[w]=c,o[w+1]=u,o[w+2]=d));else if(f0&&(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-r)<1e-6||t.discretize))l>0?(o[w]=t.nodes[0].r,o[w+1]=t.nodes[0].g,o[w+2]=t.nodes[0].b):(o[w]=0,o[w+1]=0,o[w+2]=0);else{var E=0;if(E=(E=T?(x-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[w]=m[0],o[w+1]=m[1],o[w+2]=m[2];continue}o[w]=v[0],o[w+1]=v[1],o[w+2]=v[2];continue}if(y<.01){if(t.colorSpace===Li.RGB)o[w]=(1-E)*m[0]+E*v[0],o[w+1]=(1-E)*m[1]+E*v[1],o[w+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Li.HSV){var D=[],B=[];pt(m,D),pt(v,B),t.hSVWrap&&(D[0]-B[0]>.5||B[0]-D[0]>.5)&&(D[0]>B[0]?D[0]-=1:B[0]-=1);var V=[];V[0]=(1-E)*D[0]+E*B[0],V[0]<0&&(V[0]+=1),V[1]=(1-E)*D[1]+E*B[1],V[2]=(1-E)*D[2]+E*B[2],gt(V,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var L=[],N=[];bt(m,L),bt(v,N);var k=[];k[0]=(1-E)*L[0]+E*N[0],k[1]=(1-E)*L[1]+E*N[1],k[2]=(1-E)*L[2]+E*N[2],Tt(k,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,W=G-2*F+E,j=G-F,z=void 0;if(t.colorSpace===Li.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[w+H]=_*m[H]+U*v[H]+W*z+j*z;else if(t.colorSpace===Li.HSV){var K=[],X=[];pt(m,K),pt(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+W*z+j*z,0===Y&&q[Y]<0&&(q[Y]+=1);gt(q,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else if(t.colorSpace===Li.LAB){var Z=[],Q=[];bt(m,Z),bt(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+W*z+j*z;Tt($,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]}else t.colorSpace===Li.DIVERGING?(ji(E,m,v,b),o[w]=b[0],o[w+1]=b[1],o[w+2]=b[2]):Gi("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[w+ee]=o[w+ee]<0?0:o[w+ee],o[w+ee]=o[w+ee]>1?1:o[w+ee]}}}},e.getUint8Table=function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Gi("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(r,n,a,s);for(var l=0;l1&&(i=(n-r)/(a-1));for(var s=0;s=t.nodes.length?(Gi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].r,r[2]=t.nodes[e].g,r[3]=t.nodes[e].b,r[4]=t.nodes[e].midpoint,r[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){if(r<0||r>=t.nodes.length)return Gi("Index out of range!"),-1;var a=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].r=n[1],t.nodes[r].g=n[2],t.nodes[r].b=n[3],t.nodes[r].midpoint=n[4],t.nodes[r].sharpness=n[5],a!==n[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,r){var n=e.getSize();if(n>0&&t>=0){var a=[];e.getNodeValue(t%n,a);for(var o=0;o<3;++o)r[o]=a[o+1];r[3]=1}else e.getNanColor(r),r[3]=1},e.fillFromDataPointer=function(t,r){if(!(t<=0)&&r){e.removeAllPoints();for(var n=0;nr[1]?(e.getColor(r[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])):(e.getColor(n[1],a),e.addRGBPoint(r[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=r[0]&&t.nodes[o].x<=r[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,r),Di.extend(e,t,r),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},fe.obj(t.buildTime),fe.get(e,t,["buildTime","mappingRange"]),fe.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),zi(e,t)}var Xi=function(e){for(var t=1;t0&&(r=t.nodes[0].y);for(var a=1;ar)switch(n){case 0:case 1:n=1;break;default:n=3}else switch(n){case 0:case 2:n=2;break;default:n=3}if(r=e,3===n)break}switch(n){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var r=0;r0?t.nodes[r-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,r){var n=t.nodes.length;return e<0||e>=n?(qi("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].y,r[2]=t.nodes[e].midpoint,r[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(r,n){var a=t.nodes.length;if(r<0||r>=a)return qi("Index out of range!"),-1;var o=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].y=n[1],t.nodes[r].midpoint=n[2],t.nodes[r].sharpness=n[3],o!==n[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,r){return e.addPointLong(t,r,.5,0)},e.addPointLong=function(r,n,a,o){if(a<0||a>1)return qi("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return qi("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);var i,s={x:r,y:n,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=n,o=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(r,n,a,o){e.sortAndUpdateRange();for(var i=0;i=r&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(r,n,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var r=[];return e.getTable(t,t,1,r),r[0]},e.adjustRange=function(r){if(r.length<2)return 0;var n=e.getRange();n[0]r[1]?e.addPoint(r[1],e.getValue(r[1])):e.addPoint(r[1],e.getValue(n[1])),e.sortAndUpdateRange();for(var a=0;a=r[0]&&t.nodes[a].x<=r[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,r){var n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var r=t.nodes[1].x-t.nodes[0].x,n=0;n4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,c=0;0!==l&&(c=t.nodes[l-1].y);var u=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(n-1)*(r-e):.5*(e+r);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?c:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(u-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,S=2*T-3*b+1,C=-2*T+3*b,x=T-2*b+y,P=T-b,w=g-p,O=(1-v)*w;a[h]=S*p+C*g+x*O+P*O;var A=pg?p:g;a[h]=a[h]M?M:a[h]}}}}var Zi={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function Qi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zi,r),fe.obj(e,t),t.nodes=[],fe.setGet(e,t,["allowDuplicateScalars","clamping"]),fe.setArray(e,t,["range"],2),fe.getArray(e,t,["range"]),Yi(e,t)}var $i={newInstance:fe.newInstance(Qi,"vtkPiecewiseFunction"),extend:Qi},Ji={NEAREST:0,LINEAR:1,FAST_LINEAR:2},es={FRACTIONAL:0,PROPORTIONAL:1},ts={InterpolationType:Ji,OpacityMode:es};function rs(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 ns=ts.InterpolationType,as=ts.OpacityMode,os=fe.vtkErrorMacro;function is(e,t){t.classHierarchy.push("vtkVolumeProperty"),e.getMTime=function(){for(var e,r=t.mtime,n=0;n<4;n++)1===t.componentData[n].colorChannels?t.componentData[n].grayTransferFunction&&(r=r>(e=t.componentData[n].grayTransferFunction.getMTime())?r:e):3===t.componentData[n].colorChannels&&t.componentData[n].rGBTransferFunction&&(r=r>(e=t.componentData[n].rGBTransferFunction.getMTime())?r:e),t.componentData[n].scalarOpacity&&(r=r>(e=t.componentData[n].scalarOpacity.getMTime())?r:e),t.componentData[n].gradientOpacity&&(t.componentData[n].disableGradientOpacity||(r=r>(e=t.componentData[n].gradientOpacity.getMTime())?r:e));return r},e.getColorChannels=function(e){return e<0||e>3?(os("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(r,n){var a=!1;return t.componentData[r].grayTransferFunction!==n&&(t.componentData[r].grayTransferFunction=n,a=!0),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(r){return null===t.componentData[r].grayTransferFunction&&(t.componentData[r].grayTransferFunction=$i.newInstance(),t.componentData[r].grayTransferFunction.addPoint(0,0),t.componentData[r].grayTransferFunction.addPoint(1024,1),1!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=1),e.modified()),t.componentData[r].grayTransferFunction},e.setRGBTransferFunction=function(r,n){var a=!1;return t.componentData[r].rGBTransferFunction!==n&&(t.componentData[r].rGBTransferFunction=n,a=!0),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(r){return null===t.componentData[r].rGBTransferFunction&&(t.componentData[r].rGBTransferFunction=Xi.newInstance(),t.componentData[r].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[r].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[r].colorChannels&&(t.componentData[r].colorChannels=3),e.modified()),t.componentData[r].rGBTransferFunction},e.setScalarOpacity=function(r,n){return t.componentData[r].scalarOpacity!==n&&(t.componentData[r].scalarOpacity=n,e.modified(),!0)},e.getScalarOpacity=function(r){return null===t.componentData[r].scalarOpacity&&(t.componentData[r].scalarOpacity=$i.newInstance(),t.componentData[r].scalarOpacity.addPoint(0,1),t.componentData[r].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[r].scalarOpacity},e.setComponentWeight=function(r,n){if(r<0||r>=4)return os("Invalid index"),!1;var a=Math.min(1,Math.max(0,n));return t.componentData[r].componentWeight!==a&&(t.componentData[r].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=4?(os("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(ns.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(ns.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(ns.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return fe.enumToString(ns,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["set".concat(n)]=function(n,a){return t.componentData[n]["".concat(r)]!==a&&(t.componentData[n]["".concat(r)]=a,e.modified(),!0)}})),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach((function(r){var n=fe.capitalize(r);e["get".concat(n)]=function(e){return t.componentData[e]["".concat(r)]}}))}var ss={independentComponents:!0,interpolationType:ns.FAST_LINEAR,shade:0,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:1};function ls(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,ss,r),fe.obj(e,t),!t.componentData){t.componentData=[];for(var n=0;n<4;++n)t.componentData.push({colorChannels:1,grayTransferFunction:null,rGBTransferFunction:null,scalarOpacity:null,scalarOpacityUnitDistance:1,opacityMode:as.FRACTIONAL,gradientOpacityMinimumValue:0,gradientOpacityMinimumOpacity:0,gradientOpacityMaximumValue:1,gradientOpacityMaximumOpacity:1,useGradientOpacity:!1,componentWeight:1})}fe.setGet(e,t,["independentComponents","interpolationType","shade","ambient","diffuse","specular","specularPower","useLabelOutline","labelOutlineThickness"]),is(e,t)}var cs=function(e){for(var t=1;tn[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!(r=[n,t.mapperBounds],r[0].map((function(e,t){return r.map((function(e){return e[t]}))}))).reduce((function(e,t){return e&&t[0]===t[1]}),!0)||e.getMTime()>t.boundsMTime.getMTime()){us("Recomputing bounds..."),t.mapperBounds=n.map((function(e){return e}));var a=[];Hr.getCorners(n,a),e.computeMatrix();var o=new Float64Array(16);wa(o,t.matrix),a.forEach((function(e){return Jn(e,e,o)})),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,r){return e>r[t/2]?r[t/2]:e}),e):a.reduce((function(e,r){return ee?r:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e}}var fs={mapper:null,property:null,bounds:[1,-1,1,-1,1,-1]};function ps(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fs,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["mapper"]),fe.getArray(e,t,["bounds"],6),ds(e,t)}var gs={newInstance:fe.newInstance(ps,"vtkVolume"),extend:ps},ms={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4};function vs(e,t){t.classHierarchy.push("vtkAbstractMapper"),e.update=function(){e.getInputData()},e.addClippingPlane=function(r){return!!r.isA("vtkPlane")&&!t.clippingPlanes.includes(r)&&(t.clippingPlanes.push(r),e.modified(),!0)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(r){var n=t.clippingPlanes.indexOf(r);return-1!==n&&(t.clippingPlanes.splice(n,1),e.modified(),!0)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var r=t.length,n=0;n=0&&r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,r),fe.obj(e,t),fe.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),vs(e,t)},bs=ms,Ts={OFF:0,NORMALIZED:1,RAW:2};function Ss(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var r=e.getInputData();return r?(t.static||e.update(),t.bounds=r.getBounds()):t.bounds=Dt(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(bs.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(bs.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(bs.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(bs.AVERAGE_INTENSITY_BLEND)},e.setBlendModeToAdditiveIntensity=function(){e.setBlendMode(bs.ADDITIVE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return fe.enumToString(bs,t.blendMode)},e.setAverageIPScalarRange=function(t,r){console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),e.setIpScalarRange(t,r)},e.getFilterModeAsString=function(){return fe.enumToString(Ts,t.filterMode)},e.setFilterModeToOff=function(){e.setFilterMode(Ts.OFF)},e.setFilterModeToNormalized=function(){e.setFilterMode(Ts.NORMALIZED)},e.setFilterModeToRaw=function(){e.setFilterMode(Ts.RAW)}}var Cs={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:bs.COMPOSITE_BLEND,ipScalarRange:[-1e6,1e6],filterMode:Ts.OFF,preferSizeOverAccuracy:!1};function xs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cs,r),ys(e,t,r),fe.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode","filterMode","preferSizeOverAccuracy"]),fe.setGetArray(e,t,["ipScalarRange"],2),fe.event(e,t,"lightingActivated"),Ss(e,t)}var Ps={newInstance:fe.newInstance(xs,"vtkVolumeMapper"),extend:xs};function ws(e,t){const r=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(r[0]*r[1]*r[2]<1||r[1]<2||r[1]<2||r[2]<2)return;const n=ei.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);n.setDimensions(r),n.setOrigin(a),n.setSpacing(o);const i=qt.newInstance({name:"Scalars",values:t,numberOfComponents:1});return n.getPointData().setScalars(i),n.modified(),n}let Os=!1;function As(e,t,r){let n=[],a=0,o=function(){let t={knee:24,thorax:364,abdomen:147}[e],r=[];for(let n=1;n{t.resetImageParsing(),t.readFiles(n,(function(e,n){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),r&&setTimeout(r,3e3,a)}))}))}))}function Ms(e){return e*Math.PI/180}function Is(e){const t=gs.newInstance(),r=Ps.newInstance();r.setSampleDistance(1),t.setMapper(r),r.setInputData(e);const n=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(n[0],n[1]),t}r(666);var Rs=fe.vtkErrorMacro;function Es(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(r){var n=r.getTraverseOperation(),a=e[n];if(a)a(r);else{e.apply(r,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ds,r),fe.obj(e,t),fe.event(e,t,"event"),t._renderableChildMap=new Map,fe.get(e,t,["visited"]),fe.setGet(e,t,["parent","renderable","myFactory"]),fe.getArray(e,t,["children"]),Es(e,t)}var Vs={newInstance:fe.newInstance(Bs,"vtkViewNode"),extend:Bs,PASS_TYPES:["Build","Render"]};function Ls(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(r){if(r.isDeleted())return null;for(var n=0,a=r.getClassName(n++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=r.getClassName(n++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,r){t.overrides[e]=r}}var Ns={};function ks(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ns,r),fe.obj(e,t),Ls(e,t)}var Fs={newInstance:fe.newInstance(ks,"vtkViewNodeFactory"),extend:ks},Gs=Object.create(null);function _s(e,t){Gs[e]=t}function Us(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Ws={};function js(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ws,r),t.overrides=Gs,Fs.extend(e,t,r),Us(0,t)}var zs={newInstance:fe.newInstance(js,"vtkOpenGLViewNodeFactory"),extend:js};function Hs(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var r=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),t.context.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(r){if(r!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||r.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){Sa(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),yo(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var n=t.openGLRenderer.getAspectRatio();Sa(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(n,-1,1)),wa(t.keyMatrices.vcpc,t.keyMatrices.vcpc),Ia(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=r}return t.keyMatrices}}var Ks={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};var Xs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},te(e,t,["context","keyMatrixTime"]),Hs(e,t)}));_s("vtkCamera",Xs);var qs=k;function Ys(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(qs("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(r){if(r){var n=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),n|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),n|=a.DEPTH_BUFFER_BIT,t.context.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(n),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],a=e[1]-r[1],o=t.parent.normalizedDisplayToDisplay(n,a),i=Math.round(o[0]),s=Math.round(o[1]),l=e[2]-r[0],c=e[3]-r[1],u=t.parent.normalizedDisplayToDisplay(l,c),d=Math.round(u[0])-i,f=Math.round(u[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var r=0,n=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),r|=n.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,t.context.depthMask(!0)),n.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.clear(r),n.enable(n.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(t.context=t.openGLRenderWindow.getContext()))}}var Zs={context:null,openGLRenderWindow:null,selector:null};var Qs=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zs,r),Vs.extend(e,t,r),Q(e,t,["shaderCache"]),te(e,t,["selector"]),Ys(e,t)}),"vtkOpenGLRenderer");_s("vtkRenderer",Qs);var $s={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},Js={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},el={ObjectType:Js};function tl(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}function rl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ol,r),fe.obj(e,t),fe.get(e,t,["openGLRenderWindow"]),al(e,t)}var sl=rl(rl({newInstance:fe.newInstance(il),extend:il},{}),el),ll={FLAT:0,GOURAUD:1,PHONG:2},cl={POINTS:0,WIREFRAME:1,SURFACE:2},ul={Shading:ll,Representation:cl,Interpolation:ll},dl=fe.vtkErrorMacro;function fl(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(Js.ARRAY_BUFFER),e.createVBO=function(r,n,a,o){if(!r.getData()||!r.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=o.points.getData(),s=null,l=null,c=null,u=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.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())})),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,c=o.colors.getData(),t.colorBO||(t.colorBO=sl.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,r){for(var n=0;n2)for(var n=0;n2){for(var n=0;n1?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,r){return e>2?3*(e-2):0}},S=null,C=null;a===cl.POINTS||"verts"===n?(S=b.anythingToPoints,C=T.anythingToPoints):a===cl.WIREFRAME||"lines"===n?(S=b["".concat(n,"ToWireframe")],C=T["".concat(n,"ToWireframe")]):(S=b["".concat(n,"ToSurface")],C=T["".concat(n,"ToSurface")]);for(var x=r.getData(),P=x.length,w=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(M[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],M[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],M[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(M[I++]=i[p++],M[I++]=i[p++],M[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,M[I++]=s[g++],M[I++]=s[g++],M[I++]=s[g++]),t.customData.forEach((function(t){h=e*t.components;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pl,r),sl.extend(e,t,r),fe.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),fe.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),fl(e,t)}var ml={newInstance:fe.newInstance(gl),extend:gl},vl=fe.vtkErrorMacro;function hl(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;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,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 r=t.context.getShaderInfoLog(t.handle);return vl("Error compiling shader '".concat(t.source,"': ").concat(r)),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 yl={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function bl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yl,r),fe.obj(e,t),fe.setGet(e,t,["shaderType","source","error","handle","context"]),hl(e,t)}var Tl={newInstance:fe.newInstance(bl,"vtkShader"),extend:bl},Sl=fe.vtkErrorMacro;function Cl(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):(Sl("Links failed: ".concat(t.error)),0):(Sl(t.error),0):(Sl(t.fragmentShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(t.fragmentShader.getError()),0):(Sl(t.vertexShader.getSource().split("\n").map((function(e,t){return"".concat(t,": ").concat(e)})).join("\n")),Sl(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 r=t.context.getProgramInfoLog(t.handle);return Sl("Error linking shader ".concat(r)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;var o=new Float32Array(n);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1f(a,n),!0)},e.setUniformfv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1fv(a,n),!0)},e.setUniformi=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1i(a,n),!0)},e.setUniformiv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform1iv(a,n),!0)},e.setUniform2f=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,n,a),!0},e.setUniform2fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2fv(a,n),!0)},e.setUniform2i=function(r,n,a){var o=e.findUniform(r);if(-1===o)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,n,a),!0},e.setUniform2iv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform2iv(a,n),!0)},e.setUniform3f=function(r,n,a,o){var i=e.findUniform(r);if(-1===i)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,n,a,o),!0},e.setUniform3fArray=function(r,n){var a=e.findUniform(r);if(-1===a)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;if(!Array.isArray(n)||3!==n.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,n[0],n[1],n[2]),!0},e.setUniform3fv=function(r,n){var a=e.findUniform(r);return-1===a?(t.error="Could not set uniform ".concat(r," . No such uniform."),!1):(t.context.uniform3fv(a,n),!0)},e.setUniform3i=function(r){var n=e.findUniform(r);if(-1===n)return t.error="Could not set uniform ".concat(r," . No such uniform."),!1;for(var a=arguments.length,o=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,xl,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Tl.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Tl.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Tl.newInstance(),t.geometryShader.setShaderType("Geometry"),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),Cl(e,t)}var wl={newInstance:fe.newInstance(Pl,"vtkShaderProgram"),extend:Pl,substitute:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}}};function Ol(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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):r.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 r=t.context,n=0;n0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):r.vertexAttribDivisor(i.index+l,0)),r.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,r,n,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,r,n,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(r,n,a,o,i,s,l,c,u,d){if(!r)return!1;if(!r.isBound()||0===n.getHandle()||n.getType()!==Js.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=c,p.isMatrix=d,p.divisor=u,-1===p.Index)return!1;if(n.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),u>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=n.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(r){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Al,r),t.buffers=[],fe.obj(e,t),fe.get(e,t,["supported"]),fe.setGet(e,t,["forceEmulation"]),Ol(e,t)}var Il={newInstance:fe.newInstance(Ml,"vtkOpenGLVertexArrayObject"),extend:Ml};function Rl(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 El={program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0};function Dl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,El,r),fe.obj(e,t),t.shaderSourceTime={},fe.obj(t.shaderSourceTime),t.attributeUpdateTime={},fe.obj(t.attributeUpdateTime),fe.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=wl.newInstance(),t.VAO=Il.newInstance(),t.CABO=ml.newInstance(),Rl(e,t)}var Bl={newInstance:fe.newInstance(Dl),extend:Dl},Vl={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Ll={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Nl={Wrap:Vl,Filter:Ll},kl=new Float32Array(1),Fl=new Int32Array(kl.buffer),Gl=function(e){var t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))},_l=function(e){kl[0]=e;var t=Fl[0],r=t>>16&32768,n=t>>12&2047,a=t>>23&255;return a<103?r:a>142?(r|=31744,r|=(255===a?0:1)&&8388607&t):a<113?r|=((n|=2048)>>114-a)+(n>>113-a&1):(r|=a-112<<10|n>>1,r+=1&n)};function Ul(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 Wl=Nl.Wrap,jl=Nl.Filter,zl=qt.VtkDataTypes,Hl=k,Kl=F,Xl=G;function ql(e,t){var r=this;function n(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],o=t.width*t.height*t.components;if(n&&(o*=t.depth),e!==zl.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var i=0;i=a&&(b=a-1);var T=h-y,S=1-T;y=y*n*o,b=b*n*o;for(var C=0;C=n&&(O=n-1);var A=P-w;w*=o,O*=o;for(var M=0;Ma[l]&&(a[l]=r[i]),i++;for(var c=[],u=[],d=0;d2048||a<-2048||a>2048)return!1}return!0}(n,a)&&!o)}t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t.openGLRenderWindow=r:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(jl.LINEAR),e.setMagnificationFilter(jl.LINEAR)):(e.setMinificationFilter(jl.NEAREST),e.setMagnificationFilter(jl.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Wl.REPEAT),e.setWrapS(Wl.REPEAT),e.setWrapT(Wl.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR));var n=t.renderable.getCanvas();e.create2DFromRaw(n.width,n.height,4,zl.UNSIGNED_CHAR,n,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){var a=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(jl.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw(a.width,a.height,4,zl.UNSIGNED_CHAR,a.data,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}var o=t.renderable.getInputData(0);if(o&&o.getPointData().getScalars()){for(var i=o.getExtent(),s=o.getPointData().getScalars(),l=[],c=0;ct.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:Xl("impossible case"),e=t.context.getIntegerv(r)===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(r,n){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||Hl("Unable to find suitable internal format for T=".concat(r," NC= ").concat(n)),t.internalFormat},e.getDefaultInternalFormat=function(e,n){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!1))||(a=r.openGLRenderWindow.getDefaultTextureInternalFormat(e,n,!0))||(Hl("Unsupported internal texture type!"),Hl("Unable to find suitable internal format for T=".concat(e," NC= ").concat(n))),a},e.setInternalFormat=function(r){r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=function(r,n){return t.format=e.getDefaultFormat(r,n),t.format},e.getDefaultFormat=function(e,r){if(t.openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.openGLRenderWindow.getWebgl2())switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case r&&zl.SHORT:case r&&zl.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case zl.FLOAT:case zl.VOID:default:return t.context.FLOAT}switch(e){case zl.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case zl.FLOAT:case zl.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;var n=t.context.getExtension("OES_texture_half_float");return n&&t.context.getExtension("OES_texture_half_float_linear")?n.HALF_FLOAT_OES:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.openGLDataType=e.getDefaultDataType(r,n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:e=(r=127.5)-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:e=(r=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:e=(r=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=function(e){switch(e){case jl.NEAREST:return t.context.NEAREST;case jl.LINEAR:return t.context.LINEAR;case jl.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case jl.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case jl.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case jl.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Wl.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Wl.REPEAT:return t.context.REPEAT;case Wl.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(r,o,i,s,l){var c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=[l],d=n(s,u),f=a(d);return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,c),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,f[0]),t.generateMipmap&&t.context.generateMipmap(t.target),c&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),e.deactivate(),!0},e.createCubeFromRaw=function(r,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var c=a(n(s,l)),u=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var S=null;y<=t.maxLevel&&(S=u[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,S),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(r,n,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===zl.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=r,t.height=n,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,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(Kl("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(r){if(e.getOpenGLDataType(zl.UNSIGNED_CHAR),e.getInternalFormat(zl.UNSIGNED_CHAR,4),e.getFormat(zl.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=r.width,t.height=r.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var n=!Be(r.width)||!Be(r.height),a=document.createElement("canvas");a.width=n?De(r.width):r.width,a.height=n?De(r.height):r.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(r,0,0,r.width,r.height,0,0,a.width,a.height);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(r,o,i,s,l,c){if(e.getOpenGLDataType(l,!0),e.getInternalFormat(l,s),e.getFormat(l,s),!t.internalFormat||!t.format||!t.openGLDataType)return Kl("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=s,t.width=r,t.height=o,t.depth=i,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(n(l,[c],!0));return t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFilterableFromRaw=function(r,n,a,s,l,c){for(var u=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=r*n*a,f=[],p=[],g=0;g4096&&(A===zl.FLOAT||s>=3)&&(I=4096);var R=1,E=1;d>I*I&&(E=R=Math.ceil(Math.sqrt(d/(I*I))));var D=Math.sqrt(d)/R;D=De(D);var B,V=Math.floor(D*R/r),L=Math.ceil(a/V),N=De(n*L/E);t.width=D,t.height=N,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=V,t.volumeInfo.yreps=L,t.volumeInfo.xstride=R,t.volumeInfo.ystride=E,t.volumeInfo.offset=w.offset,t.volumeInfo.scale=w.scale;var k=D*N*s;B=A===zl.FLOAT?new Float32Array(k):new Uint8Array(k);for(var F=0,G=Math.floor(r/R),_=Math.floor(n/E),U=0;U2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yl,r),Vs.extend(e,t,r),t.sendParametersTime={},Z(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},Z(t.textureBuildTime,{mtime:0}),ee(e,t,["format","openGLDataType"]),te(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),Q(e,t,["width","height","volumeInfo","components","handle","target"]),ql(e,t)}var Ql=ie(Zl,"vtkOpenGLTexture"),$l=function(e){for(var t=1;t6&&(F("OpenGL has a limit of 6 clipping planes"),i=6),a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=wl.substitute(o,"//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=o},e.getNeedToRebuildShaders=function(e,r,n){var a=t.openGLTexture.getComponents(),o=n.getProperty().getIndependentComponents();return(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===e.getProgram()||t.lastTextureComponents!==a||t.lastIndependentComponents!==o)&&(t.lastHaveSeenDepthRequest=t.haveSeenDepthRequest,t.lastTextureComponents=a,t.lastIndependentComponents=o,!0)},e.updateShaders=function(r,n,a){if(t.lastBoundBO=r,e.getNeedToRebuildShaders(r,n,a)){var o={Vertex:null,Fragment:null,Geometry:null};e.buildShaders(o,n,a);var i=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);i!==r.getProgram()&&(r.setProgram(i),r.getVAO().releaseGraphicsResources()),r.getShaderSourceTime().modified()}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(r.getProgram());r.getVAO().bind(),e.setMapperShaderParameters(r,n,a),e.setCameraShaderParameters(r,n,a),e.setPropertyShaderParameters(r,n,a)},e.setMapperShaderParameters=function(r,n,a){r.getCABO().getElementCount()&&(t.VBOBuildTime>r.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(r.getProgram().isAttributeUsed("vertexMC")&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"vertexMC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||nc("Error setting vertexMC in shader VAO.")),r.getProgram().isAttributeUsed("tcoordMC")&&r.getCABO().getTCoordOffset()&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"tcoordMC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getTCoordComponents(),t.context.FALSE)||nc("Error setting tcoordMC in shader VAO.")),r.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();r.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l6&&(F("OpenGL has a limit of 6 clipping planes"),I=6);var R=t.currentInput.getWorldToIndex(),E=r.getCABO().getCoordShiftAndScaleEnabled()?r.getCABO().getInverseShiftAndScaleMatrix():null,D=E?Sa(t.imagematinv,a.getMatrix()):a.getMatrix();E&&(wa(D,D),Ia(D,D,E),wa(D,D)),Ia(t.imagematinv,D,R);for(var B=[],V=0;V1?1:0;var H=o.getData(),K=null;if(V===ac.I){K=new H.constructor(_[2]*_[1]*c);for(var X=0,q=0;q<_[2];q++)for(var Y=0;Y<_[1];Y++){var Z=(N+Y*_[0]+q*_[0]*_[1])*c;X=(q*_[1]+Y)*c,K.set(H.subarray(Z,Z+c),X)}_[0]=_[1],_[1]=_[2],W[0]=L,W[1]=F[2],W[2]=F[4],W[3]=L,W[4]=F[3],W[5]=F[4],W[6]=L,W[7]=F[2],W[8]=F[5],W[9]=L,W[10]=F[3],W[11]=F[5]}else if(V===ac.J){K=new H.constructor(_[2]*_[0]*c);for(var Q=0,$=0;$<_[2];$++)for(var J=0;J<_[0];J++){var ee=(J+N*_[0]+$*_[0]*_[1])*c;Q=($*_[0]+J)*c,K.set(H.subarray(ee,ee+c),Q)}_[1]=_[2],W[0]=F[0],W[1]=L,W[2]=F[4],W[3]=F[1],W[4]=L,W[5]=F[4],W[6]=F[0],W[7]=L,W[8]=F[5],W[9]=F[1],W[10]=L,W[11]=F[5]}else V===ac.K||V===ac.NONE?(K=H.subarray(N*U,(N+1)*U),W[0]=F[0],W[1]=F[2],W[2]=L,W[3]=F[1],W[4]=F[2],W[5]=L,W[6]=F[0],W[7]=F[3],W[8]=L,W[9]=F[1],W[10]=F[3],W[11]=L):nc("Reformat slicing not yet supported.");t.openGLTexture.create2DFromRaw(_[0],_[1],c,o.getDataType(),K),t.openGLTexture.activate(),t.openGLTexture.sendParameters(),t.openGLTexture.deactivate();var te=qt.newInstance({numberOfComponents:3,values:W});te.setName("points");var re=qt.newInstance({numberOfComponents:2,values:j});re.setName("tcoords");var ne=new Uint16Array(8);ne[0]=3,ne[1]=0,ne[2]=1,ne[3]=3,ne[4]=3,ne[5]=0,ne[6]=3,ne[7]=2;var ae=qt.newInstance({numberOfComponents:1,values:ne});t.tris.getCABO().createVBO(ae,"polys",cl.SURFACE,{points:te,tcoords:re,cellOffset:0}),t.VBOBuildTime.modified(),t.VBOBuildString=G}}}}}var sc={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};var lc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sc,r),Vs.extend(e,t,r),rc(e,t,r),t.tris=Bl.newInstance(),t.openGLTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.pwfTexture=$l.newInstance(),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),te(e,t,[]),t.VBOBuildTime={},Z(t.VBOBuildTime),ic(e,t)}),"vtkOpenGLImageMapper");function cc(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,r){return e.opaquePass(t,r)},e.opaquePass=function(e,r){e&&t.context.depthMask(!0)},e.translucentPass=function(e,r){t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}_s("vtkImageMapper",lc);var uc={context:null,keyMatrixTime:null,keyMatrices:null};var dc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),cc(e,t)}),"vtkOpenGLImageSlice");function fc(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementVolumeCount()}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.volumePass=function(e){t.renderable&&t.renderable.getVisibility()&&t.context.depthMask(!e)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.MCWCMatrix,t.renderable.getMatrix()),wa(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?xo(t.normalMatrix):(yo(t.normalMatrix,t.MCWCMatrix),wo(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}_s("vtkImageSlice",dc);var pc={};var gc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pc,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),te(e,t,["context"]),fc(e,t)}),"vtkOpenGLVolume");function mc(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(r),e.saveCurrentBuffers(r)},e.saveCurrentBindings=function(e){var r=t.context;t.previousDrawBinding=r.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var r=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(r),e.restorePreviousBuffers(r)},e.restorePreviousBindings=function(e){var r=t.context;r.bindFramebuffer(r.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,r){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=r},e.setColorBuffer=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.context,a=n.COLOR_ATTACHMENT0;if(r>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");a+=r}t.colorTexture=e,n.framebufferTexture2D(n.FRAMEBUFFER,a,n.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=t.context,n=r.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void F("Using multiple framebuffer attachments requires WebGL 2");n+=e}r.framebufferTexture2D(r.FRAMEBUFFER,n,r.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var r=t.context;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,e.getHandle(),0)}else F("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 F("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(r){t.openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t.openGLRenderWindow=r,t.context=null,r&&(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 r=t.context,n=$l.newInstance();n.setOpenGLRenderWindow(t.openGLRenderWindow),n.setMinificationFilter(Ll.LINEAR),n.setMagnificationFilter(Ll.LINEAR),n.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,i.UNSIGNED_CHAR,null),e.setColorBuffer(n),t.depthTexture=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthTexture),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthTexture)}}_s("vtkVolume",gc);var vc={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function hc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vc,r),Z(e,t),te(e,t,["colorTexture"]),mc(e,t)}var yc={newInstance:ie(hc,"vtkFramebuffer"),extend:hc};function bc(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 Tc=G,Sc=F;function Cc(e,t){t.classHierarchy.push("vtkOpenGLVolumeMapper"),e.buildPass=function(){t.zBufferTexture=null},e.opaqueZBufferPass=function(e,r){if(e){var n=r.getZBufferTexture();n!==t.zBufferTexture&&(t.zBufferTexture=n)}},e.volumePass=function(r,n){if(r){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.jitterTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.framebuffer.setOpenGLRenderWindow(t.openGLRenderWindow),t.scalarTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.opacityTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLVolume=e.getFirstAncestorOfType("vtkOpenGLVolume");var a=t.openGLVolume.getRenderable();t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer");var o=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(o.getActiveCamera()),e.renderPiece(o,a)}},e.buildShaders=function(t,r,n){e.getShaderTemplate(t,r,n),e.replaceShaderValues(t,r,n)},e.getShaderTemplate=function(e,t,r){e.Vertex="//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 vertexDC;\n\nvarying vec3 vertexVCVSOutput;\nuniform mat4 PCVCMatrix;\n\nuniform float dcxmin;\nuniform float dcxmax;\nuniform float dcymin;\nuniform float dcymax;\n\nvoid main()\n{\n // dcsmall is the device coords reduced to the\n // x y area covered by the volume\n vec4 dcsmall = vec4(\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\n vertexDC.z,\n vertexDC.w);\n vec4 vcpos = PCVCMatrix * dcsmall;\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\n gl_Position = dcsmall;\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkVolumeFS.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 volume mappers fragment shader\n\n// the output of this shader\n//VTK::Output::Dec\n\nvarying vec3 vertexVCVSOutput;\n\n// first declare the settings from the mapper\n// that impact the code paths in here\n\n// always set vtkNumComponents 1,2,3,4\n//VTK::NumComponents\n\n// possibly define vtkTrilinearOn\n//VTK::TrilinearOn\n\n// possibly define vtkIndependentComponents\n//VTK::IndependentComponentsOn\n\n// possibly define any \"proportional\" components\n//VTK::vtkProportionalComponents\n\n// Define the blend mode to use\n#define vtkBlendMode //VTK::BlendMode\n\n// Possibly define vtkImageLabelOutlineOn\n//VTK::ImageLabelOutlineOn\n\n#ifdef vtkImageLabelOutlineOn\nuniform int outlineThickness;\nuniform float vpWidth;\nuniform float vpHeight;\nuniform float vpOffsetX;\nuniform float vpOffsetY;\nuniform mat4 PCWCMatrix;\nuniform mat4 vWCtoIDX;\n#endif\n\n// define vtkLightComplexity\n//VTK::LightComplexity\n#if vtkLightComplexity > 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\nuniform vec4 ipScalarRangeMin;\nuniform vec4 ipScalarRangeMax;\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 trilinear values from multiple z slices\n#ifdef vtkTrilinearOn\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 - vpOffsetX - 0.5) * 2.0,\n (fragCoord.y / vpHeight - vpOffsetY - 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\nbool valueWithinScalarRange(vec4 val, vec4 min, vec4 max) {\n bool withinRange = false;\n #if vtkNumComponents == 1\n if (val.r >= min.r && val.r <= max.r) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents == 2\n if (val.r >= min.r && val.r <= max.r &&\n val.g >= min.g && val.g <= max.g) {\n withinRange = true;\n }\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 3\n if (all(greaterThanEqual(val, ipScalarRangeMin)) &&\n all(lessThanEqual(val, ipScalarRangeMax))) {\n withinRange = true;\n }\n #endif\n return withinRange;\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 || vtkBlendMode == 4 //AVERAGE_INTENSITY_BLEND || ADDITIVE_BLEND\n vec4 sum = vec4(0.);\n\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\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 if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n // Sum the values across each step in the path\n sum += tValue;\n }\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 IPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (valueWithinScalarRange(tValue, ipScalarRangeMin, ipScalarRangeMax)) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n #if vtkBlendMode == 3 // Average\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n #endif\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 (abs(result) < 1e-6)\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(r,n,a){var o=r.Fragment;a.getProperty().getInterpolationType()===Ji.LINEAR&&(o=wl.substitute(o,"//VTK::TrilinearOn","#define vtkTrilinearOn").result),!0===a.getProperty().getUseLabelOutline()&&(o=wl.substitute(o,"//VTK::ImageLabelOutlineOn","#define vtkImageLabelOutlineOn").result);var i=t.scalarTexture.getComponents();o=wl.substitute(o,"//VTK::NumComponents","#define vtkNumComponents ".concat(i)).result;var s=a.getProperty().getIndependentComponents();if(s){o=wl.substitute(o,"//VTK::IndependentComponentsOn","#define vtkIndependentComponentsOn").result;for(var l=[],c=0;c0&&(o=wl.substitute(o,"//VTK::vtkProportionalComponents",l.join("\n")).result)}var u=t.currentInput.getExtent(),d=t.currentInput.getSpacing(),f=new Float64Array(3);In(f,(u[1]-u[0])*d[0],(u[3]-u[2])*d[1],(u[5]-u[4])*d[2]);var p=On(f)/t.renderable.getSampleDistance();o=wl.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(p))).result,o=wl.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var g=1;s&&!t.gopacity&&g0&&(a=wl.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=wl.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)}))}e.Fragment=a},e.replaceShaderClippingPlane=function(e,r,n){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=wl.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=wl.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; 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(r,n,a){var i=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===ms.COMPOSITE_BLEND&&(i=0,t.numberOfLights=0,n.getLights().forEach((function(e){e.getSwitch()>0&&(t.numberOfLights++,0===i&&(i=1)),1===i&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(i=2),i<3&&e.getPositional()&&(i=3)})));var s=!1;t.lastLightComplexity!==i&&(t.lastLightComplexity=i,s=!0);var l=t.scalarTexture.getComponents(),c=a.getProperty().getIndependentComponents(),u=!1,d=[];if(c){for(var f=0;f0&&(u=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);In(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=On(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:u,iComps:c,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;rr.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(r.getVAO().addAttributeArray(o,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("Error setting vertexDC in shader VAO.")),r.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance());for(var i=t.scalarTexture.getVolumeInfo(),s=t.renderable.getIpScalarRange(),l=[],c=[],u=0;u<4;u++)l[u]=s[0]*i.dataComputedScale[u]+i.dataComputedOffset[u],c[u]=s[1]*i.dataComputedScale[u]+i.dataComputedOffset[u],l[u]=(l[u]-i.offset[u])/i.scale[u],c[u]=(c[u]-i.offset[u])/i.scale[u];if(o.setUniform4f("ipScalarRangeMin",l[0],l[1],l[2],l[3]),o.setUniform4f("ipScalarRangeMax",c[0],c[1],c[2],c[3]),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var d=e.getRenderTargetSize();o.setUniformf("vpWidth",d[0]),o.setUniformf("vpHeight",d[1])}},e.setCameraShaderParameters=function(r,n,a){var o=t.openGLCamera.getKeyMatrices(n),i=t.openGLVolume.getKeyMatrices();Ia(t.modelToView,o.wcvc,i.mcwc);var s=r.getProgram(),l=t.openGLCamera.getRenderable(),c=l.getClippingRange();s.setUniformf("camThick",c[1]-c[0]),s.setUniformf("camNear",c[0]),s.setUniformf("camFar",c[1]);for(var u=t.currentInput.getBounds(),d=t.currentInput.getDimensions(),f=new Float64Array(3),p=new Float64Array(3),g=1,m=-1,v=1,h=-1,y=0;y<8;++y)In(f,u[y%2],u[2+Math.floor(y/2)%2],u[4+Math.floor(y/4)]),Jn(f,f,t.modelToView),l.getParallelProjection()||(Kn(p,f),Gn(f,p,-c[0]/f[2])),Jn(f,f,o.vcpc),g=Math.min(f[0],g),m=Math.max(f[0],m),v=Math.min(f[1],v),h=Math.max(f[1],h);s.setUniformf("dcxmin",g),s.setUniformf("dcxmax",m),s.setUniformf("dcymin",v),s.setUniformf("dcymax",h),s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",l.getParallelProjection());var b=t.currentInput.getExtent(),T=t.currentInput.getSpacing(),S=new Float64Array(3);In(S,(b[1]-b[0]+1)*T[0],(b[3]-b[2]+1)*T[1],(b[5]-b[4]+1)*T[2]),s.setUniform3f("vSpacing",T[0],T[1],T[2]),In(f,b[0],b[2],b[4]),t.currentInput.indexToWorldVec3(f,f),Jn(f,f,t.modelToView),s.setUniform3f("vOriginVC",f[0],f[1],f[2]);var C=t.currentInput.getIndexToWorld();Ia(t.idxToView,t.modelToView,C),Mo(t.idxNormalMatrix,o.normalMatrix,i.normalMatrix),Mo(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var x=On(S)/t.renderable.getSampleDistance();x>t.renderable.getMaximumSamplesPerRay()&&Tc("The number of steps required ".concat(Math.ceil(x)," 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=new Float64Array(3);if(In(P,1,1,1),Bn(P,P,S),s.setUniform3f("vVCToIJK",P[0],P[1],P[2]),s.setUniform3i("volumeDimensions",d[0],d[1],d[2]),!t.openGLRenderWindow.getWebgl2()){var w=t.scalarTexture.getVolumeInfo();s.setUniformf("texWidth",t.scalarTexture.getWidth()),s.setUniformf("texHeight",t.scalarTexture.getHeight()),s.setUniformi("xreps",w.xreps),s.setUniformi("xstride",w.xstride),s.setUniformi("ystride",w.ystride)}for(var O=new Float64Array(3),A=new Float64Array(3),M=0;M<6;++M){switch(M){case 1:In(O,-1,0,0),In(A,b[0],b[2],b[4]);break;case 2:In(O,0,1,0),In(A,b[1],b[3],b[5]);break;case 3:In(O,0,-1,0),In(A,b[0],b[2],b[4]);break;case 4:In(O,0,0,1),In(A,b[1],b[3],b[5]);break;case 5:In(O,0,0,-1),In(A,b[0],b[2],b[4]);break;default:In(O,1,0,0),In(A,b[1],b[3],b[5])}ea(O,O,t.idxNormalMatrix),Jn(A,A,t.idxToView);var I=-1*Xn(A,O);if(s.setUniform3f("vPlaneNormal".concat(M),O[0],O[1],O[2]),s.setUniformf("vPlaneDistance".concat(M),I),a.getProperty().getUseLabelOutline()){var R=t.currentInput.getWorldToIndex();s.setUniformMatrix("vWCtoIDX",R),Oa(t.projectionToWorld,o.wcpc),s.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var E=e.getRenderTargetSize();s.setUniformf("vpWidth",E[0]),s.setUniformf("vpHeight",E[1]);var D=e.getRenderTargetOffset();s.setUniformf("vpOffsetX",D[0]/E[0]),s.setUniformf("vpOffsetY",D[1]/E[1])}}switch(Oa(t.projectionToView,o.vcpc),s.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){case 1:case 2:case 3:var B=0,V=[];n.getLights().forEach((function(e){if(e.getSwitch()>0){var t=e.getColor(),r=e.getIntensity();V[0]=t[0]*r,V[1]=t[1]*r,V[2]=t[2]*r,s.setUniform3fArray("lightColor".concat(B),V);var n=e.getDirection();In(O,n[0],n[1],n[2]),ea(O,O,o.normalMatrix),s.setUniform3f("lightDirectionVC".concat(B),O[0],O[1],O[2]);var a=[-.5*O[0],-.5*O[1],-.5*(O[2]-1)];s.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}}))}},e.setPropertyShaderParameters=function(e,r,n){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=n.getProperty(),s=t.scalarTexture.getComponents(),l=n.getProperty().getIndependentComponents();if(l&&s>=2)for(var c=0;c0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,r,n){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(r),o=[],i=[],s=t.renderable.getClippingPlanes(),l=s.length,c=0;c1.5&&(t._useSmallViewport=!0),t._animationRateSubscription||(t._animationRateSubscription=a.onAnimationFrameRateUpdate((function(){if(t.renderable.getAutoAdjustSampleDistances()){var e=a.getRecentAnimationFrameRate(),r=a.getDesiredUpdateRate()/e;(r>1.15||r<.85)&&(t._lastScale*=r),t._lastScale>400&&(t._lastScale=400),t._lastScale<1.5&&(t._lastScale=1.5)}else t._lastScale=t.renderable.getImageSampleDistance()*t.renderable.getImageSampleDistance();var n=t.openGLRenderWindow.getFramebufferSize();t._smallViewportWidth=Math.ceil(n[0]/Math.sqrt(t._lastScale)),t._smallViewportHeight=Math.ceil(n[1]/Math.sqrt(t._lastScale))}))),t._useSmallViewport){var o=t.openGLRenderWindow.getFramebufferSize();if(t._smallViewportHeight>o[1]&&(t._smallViewportHeight=o[1]),t._smallViewportWidth>o[0]&&(t._smallViewportWidth=o[0]),t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer();else{var i=t.framebuffer.getSize();i[0]===o[0]&&i[1]===o[1]||(t.framebuffer.create(o[0],o[1]),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var s=t.context;s.clearColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clear(s.COLOR_BUFFER_BIT),s.viewport(0,0,t._smallViewportWidth,t._smallViewportHeight),t.fvp=[t._smallViewportWidth/o[0],t._smallViewportHeight/o[1]]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(r,n),n.getProperty().getInterpolationType()===Ji.NEAREST?(t.scalarTexture.setMinificationFilter(Ll.NEAREST),t.scalarTexture.setMagnificationFilter(Ll.NEAREST)):(t.scalarTexture.setMinificationFilter(Ll.LINEAR),t.scalarTexture.setMagnificationFilter(Ll.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(r,n){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,r,n),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,r){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t._useSmallViewport){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 n=t.copyShader;t.copyVAO=Il.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(n,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Sc("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 o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.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()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(r,n){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)):Sc("No input!")},e.computeBounds=function(r,n){e.getInput()?t.bounds=e.getInput().getBounds():St(t.Bounds)},e.updateBufferObjects=function(t,r){e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r)},e.getNeedToRebuildBufferObjects=function(r,n){return t.VBOBuildTime.getMTime()1?1:-1,E[3*D+2]=-1;var B=new Uint16Array(8);B[0]=3,B[1]=0,B[2]=1,B[3]=3,B[4]=3,B[5]=0,B[6]=3,B[7]=2;var V=qt.newInstance({numberOfComponents:3,values:E});V.setName("points");var L=qt.newInstance({numberOfComponents:1,values:B});t.tris.getCABO().createVBO(L,"polys",cl.SURFACE,{points:V,cellOffset:0})}t.VBOBuildTime.modified()}}}}var xc={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};var Pc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xc,r),Vs.extend(e,t,r),t.VBOBuildTime={},Z(t.VBOBuildTime,{mtime:0}),t.tris=Bl.newInstance(),t.scalarTexture=$l.newInstance(),t.opacityTexture=$l.newInstance(),t.colorTexture=$l.newInstance(),t.jitterTexture=$l.newInstance(),t.jitterTexture.setWrapS(Vl.REPEAT),t.jitterTexture.setWrapT(Vl.REPEAT),t.framebuffer=yc.newInstance(),t.idxToView=Pa(new Float64Array(16)),t.idxNormalMatrix=xo(new Float64Array(9)),t.modelToView=Pa(new Float64Array(16)),t.projectionToView=Pa(new Float64Array(16)),t.projectionToWorld=Pa(new Float64Array(16)),t._lastScale=1,te(e,t,["context"]),Cc(e,t)}),"vtkOpenGLVolumeMapper");_s("vtkVolumeMapper",Pc);var wc=k;function Oc(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=n.getZBufferTexture(),c=Math.floor(l.getWidth()),u=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():wc("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(c*u*4),d.viewport(0,0,c,u),d.readPixels(0,0,c,u,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,r){e&&t.renderable.getUseZValues()&&r.requestDepth()}}var Ac={};var Mc=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ac,r),Vs.extend(e,t,r),Oc(e,t)}),"vtkOpenGLPixelSpaceCallbackMapper");_s("vtkPixelSpaceCallbackMapper",Mc);var Ic=Object.create(null);function Rc(e,t){Ic[e]=t}function Ec(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}var Dc={};function Bc(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getProjectionMatrix=function(e,r,n,a){if(Pa(e),t.renderable.getParallelProjection()){var o=t.renderable.getParallelScale(),i=o*r,s=o,l=(a[0]-1)*i,c=(a[0]+1)*i,u=(a[1]-1)*s,d=(a[1]+1)*s,f=1/(c-l),p=1/(d-u);e[0]=2*f,e[5]=2*p,e[10]=1/(n[1]-n[0]),e[12]=(c+l)*f,e[13]=(d+u)*p,e[14]=n[1]/(n[1]-n[0])}else{var g,m,v=Math.tan(Math.PI*t.renderable.getViewAngle()/360);!0===t.renderable.getUseHorizontalViewAngle()?(g=n[0]*v,m=n[0]*v/r):(g=n[0]*v*r,m=n[0]*v);var h=(a[0]-1)*g,y=(a[0]+1)*g,b=(a[1]-1)*m,T=(a[1]+1)*m;e[0]=2*n[0]/(y-h),e[5]=2*n[0]/(T-b),e[12]=(h+y)/(y-h),e[13]=(b+T)/(T-b),e[10]=0,e[14]=n[0],e[11]=-1,e[15]=0}},e.convertToOpenGLDepth=function(e){if(t.renderable.getParallelProjection())return 1-e;var r=t.renderable.getClippingRangeByReference(),n=-r[0]/e;return.5*(n=(r[0]+r[1])/(r[1]-r[0])+2*r[0]*r[1]/(n*(r[1]-r[0])))+.5},e.getKeyMatrices=function(r){var n=r.getRenderable(),a=r.getParent();if(Math.max(a.getMTime(),e.getMTime(),n.getMTime(),t.renderable.getMTime(),r.getStabilizedTime())>t.keyMatrixTime.getMTime()){var o=t.renderable.getViewMatrix();Sa(t.keyMatrices.normalMatrix,o),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.wcvc,o);var i=r.getStabilizedCenterByReference();Ra(t.keyMatrices.scvc,t.keyMatrices.wcvc,i);var s=r.getAspectRatio(),l=t.renderable.getClippingRangeByReference();e.getProjectionMatrix(t.keyMatrices.vcpc,s,l,t.renderable.getWindowCenterByReference()),Ia(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),Oa(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dc,r),t.overrides=Ic,Fs.extend(e,t,r),Ec(0,t)}),"vtkWebGPUViewNodeFactory");var Vc={keyMatrixTime:null,keyMatrices:null};var Lc=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,r),Vs.extend(e,t,r),t.keyMatrixTime={},fe.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},fe.setGet(e,t,["keyMatrixTime"]),Bc(e,t)}));function Nc(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=function(r){if(t.bindables.length===r.length){for(var n=!0,a=0;an?o:n}if(n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kc,r),fe.obj(e,t),t.bindables=[],t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),fe.setGet(e,t,["label","device","arrayInformation","sourceTime"]),Nc(e,t)}var Gc={newInstance:fe.newInstance(Fc),extend:Fc};function _c(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,r){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}}var Uc={device:null,handle:null};function Wc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uc,r),fe.obj(e,t),fe.get(e,t,["lastCameraMTime"]),fe.setGet(e,t,["device","handle"]),_c(e,t)}var jc={newInstance:fe.newInstance(Wc,"vtkWebGPUShaderModule"),extend:Wc};function zc(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var r=e.getType(),n=e.getHash(),a=t._shaderModules.keys(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hc,r),t._shaderModules=new Map,fe.obj(e,t),fe.setGet(e,t,["device","window"]),zc(e,t)}fe.newInstance(Kc,"vtkWebGPUShaderCache");var Xc=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(r)?r.join("\n"):r,o=!1;-1!==e.search(t)&&(o=!0);var i="";n&&(i="g");var s=new RegExp(t,i),l=e.replace(s,a);return{replace:o,result:l}};function qc(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e,r){t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;for(var n=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yc,r),Z(e,t),t.layouts=[],t.shaderDescriptions=[],Q(e,t,["handle","pipelineDescription"]),te(e,t,["device","renderEncoder","topology","vertexState"]),qc(e,t)}var Qc={newInstance:ie(Zc,"vtkWebGPUPipeline"),extend:Zc};function $c(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=function(e,r){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=function(e,r){t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=function(e,r){var n=[],a=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=e.getOutputInterpolationsByReference(),c=0;c1&&(o.push("};"),a=o,n[n.length-1]+=",",n.push("input: ".concat(t.type,"Input")))}if(n.length&&(t.code=Xc(t.code,"//VTK::IOStructs::Input",n).result),t.outputNames.length+t.builtinOutputNames.length){for(var d=["struct ".concat(t.type,"Output\n{")],f=0;f ".concat(t.type,"Output")]).result}t.code=Xc(t.code,"//VTK::IOStructs::Dec",a).result}}var Jc={type:null,hash:null,code:null,outputNames:null,outputTypes:null};function eu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jc,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],fe.obj(e,t),fe.setGet(e,t,["type","hash","code"]),fe.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),$c(e,t)}var tu={newInstance:fe.newInstance(eu,"vtkWebGPUShaderDescription"),extend:eu},ru={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"},r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}},nu=function(e){return!e||e.length<6?0:e in ru==1?ru[e]:(F("unknown format ".concat(e)),null)},au=function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var r=1===t?e.length-1:e.length-3,n=Number(e[r]);return Number.isNaN(n)?(F("unknown format ".concat(e)),0):t*(5-n/2)},ou=function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void F("unknown format ".concat(e));t="Uint"}var r=e.split("x")[0],n=Number(r[r.length-1]);if(!Number.isNaN(n))return(t+=8*(5-n/2))+"Array";F("unknown format ".concat(e))},iu=function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void F("unknown format ".concat(e));t="u32"}var r=1;return"x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r?"vec4<".concat(t,">"):3===r?"vec3<".concat(t,">"):2===r?"vec2<".concat(t,">"):t},su=function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},lu=function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void F("unknown format ".concat(e))};function cu(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"vertex",a=r;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0}))},e.removeBufferIfPresent=function(e){for(var r=0;r0&&(e+=",\n"),e="".concat(e," @location(").concat(r,") ").concat(t.inputs[n].names[a]," : ").concat(i),r++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var r=[],n=0,a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,du,r),Z(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],te(e,t,["created","device","handle"]),uu(e,t)}var pu={newInstance:ie(fu,"vtkWebGPUVertexInput"),extend:fu},gu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",mu="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function vu(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(r,n,a){var o=tu.newInstance({type:"vertex",hash:r,code:t.vertexShaderTemplate}),i=tu.newInstance({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),s=n.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,c=new RegExp("//VTK::[^:]*::","g"),u=l.match(c).filter((function(e,t,r){return r.indexOf(e)===t})),d=u.map((function(e){return"replaceShader".concat(e.substring(7,e.length-2))})),f=0;f","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,r){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),r.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(r,n){e.build(r,n),r.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(r),e.renderForPipeline(r)},e.getBindables=function(){var e=f(t.additionalBindables);t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hu,r),fe.obj(e,t),t.textureViews=[],t.vertexInput=pu.newInstance(),t.bindGroup=Gc.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||mu,t.vertexShaderTemplate=t.vertexShaderTemplate||gu,t.shaderReplacements=new Map,fe.get(e,t,["vertexInput"]),fe.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),vu(e,t)}var bu={newInstance:fe.newInstance(yu,"vtkWebGPUMapperHelper"),extend:yu};function Tu(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var r=e.build;e.build=function(e,n){var a=n.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,r(e,n)}}var Su={};function Cu(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Su,r),bu.extend(e,t,r),Tu(e,t)}var xu={newInstance:fe.newInstance(Cu,"vtkWebGPUFullScreenQuad"),extend:Cu},Pu={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,CellIndex:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function wu(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 Ou=["getMappedRange","mapAsync","unmap"];function Au(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=function(e){!function(e,t,r,n){var a=n.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(n)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,0,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,r){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=e.byteLength,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var r=function(r){e[Ou[r]]=function(){var e;return(e=t.handle)[Ou[r]].apply(e,arguments)}},n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mu,r),fe.obj(e,t),fe.get(e,t,["handle","sizeInBytes","usage"]),fe.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),Au(e,t)}var Ru=function(e){for(var t=1;t0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var r=0;r<3;r++)t.color[r]=e*(t.ambient*t.ambientColor[r]+t.diffuse*t.diffuseColor[r]+t.specular*t.specularColor[r]);return[].concat(t.color)},e.addShaderVariable=Vu("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(Bu.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(Bu.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(Bu.PHONG)},e.getInterpolationAsString=function(){return fe.enumToString(Bu,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Du.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Du.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Du.POINTS)},e.getRepresentationAsString=function(){return fe.enumToString(Du,t.representation)}}var Nu={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:Bu.GOURAUD,representation:Du.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null};function ku(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nu,r),fe.obj(e,t),fe.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),fe.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),Lu(e,t)}var Fu=function(e){for(var t=1;t1?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,r){return numPoints>2?3*(e-2):0}};function Ku(e){switch(e){case Wu.Points:return"points";case Wu.Lines:return"lines";case Wu.Triangles:case Wu.TriangleEdges:return"polys";case Wu.TriangleStripEdges:case Wu.TriangleStrips:return"strips";default:return""}}function Xu(e,t,r){var n=null;n=t===ju.POINTS||"points"===r?Hu.anythingToPoints:t===ju.WIREFRAME||"lines"===r?Hu["".concat(r,"ToWireframe")]:Hu["".concat(r,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zu,r),Z(e,t),te(e,t,["device"]),Yu(e,t)}var $u=_u(_u({newInstance:ie(Qu),extend:Qu},{}),Pu),Ju=$u.BufferUsage,ed=fe.vtkErrorMacro;function td(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,r){t._bufferEntryNames.has(e)?ed("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:su(r),offset:-1,nativeType:lu(r),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,r=[],n=4,a=0;a4&&(P.packed=!0,P.offset=e,r.push(P),e+=P.sizeInBytes)}for(var w=0;w ").concat(t.label,": ").concat(t.label,"Struct;")),a.join("\n")}}var rd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function nd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},fe.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,fe.get(e,t,["binding","bindGroupTime"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),td(e,t)}var ad={newInstance:fe.newInstance(nd,"vtkWebGPUUniformBuffer"),extend:nd},od=k;function id(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(r){if(r){if(!t.renderable)return;t.camera=t.renderable.getActiveCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.camera),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),t.webgpuCamera=e.getViewNodeFor(t.camera),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.camera.getClippingRange(),r=t.camera.getPositionByReference(),n=[],a=[];Gn(a,t.camera.getDirectionOfProjectionByReference(),.5*(e[0]+e[1])),Rn(n,r,a),da(a,n,t.stabilizedCenter),va(a)/(e[1]-e[0])>t.recenterThreshold&&(t.stabilizedCenter=n,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,r=t.renderable.getLightsByReference(),n=0;n0&&e++;return e||(od("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,r){for(var n=0;nr||e.getMTime()>r||t.camera.getMTime()>r||t.renderable.getMTime()>r){var n=t.webgpuCamera.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",n.wcvc),t.UBO.setArray("SCPCMatrix",n.scpc),t.UBO.setArray("PCSCMatrix",n.pcsc),t.UBO.setArray("SCVCMatrix",n.scvc),t.UBO.setArray("VCPCMatrix",n.vcpc),t.UBO.setArray("WCVCNormals",n.normalMatrix);var a=e.getYInvertedTiledSizeAndOrigin();t.UBO.setArray("viewportSize",[a.usize,a.vsize]),t.UBO.setValue("cameraParallel",t.camera.getParallelProjection());var o=t.parent.getDevice();t.UBO.sendIfNeeded(o)}},e.scissorAndViewport=function(t){var r=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize,0,1),t.getHandle().setScissorRect(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var n=0;n = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n");var r=ad.newInstance({label:"mapperUBO"});r.addEntry("BackgroundColor","vec4"),t.clearFSQ.setUBO(r)}var n=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",n),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(r){if(r)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sd,r),Vs.extend(e,t,r),t.UBO=ad.newInstance({label:"rendererUBO"}),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("viewportSize","vec2"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=Gc.newInstance({label:"rendererBG"}),t.bindGroup.setBindables([t.UBO]),t.tmpMat4=Pa(new Float64Array(16)),t.stabilizedTime={},Z(t.stabilizedTime,{mtime:0}),Q(e,t,["bindGroup","stabilizedTime"]),re(e,t,["stabilizedCenter"]),te(e,t,["renderEncoder","selector","suppressClear","UBO"]),id(e,t)}),"vtkWebGPURenderer");Rc("vtkRenderer",ld);var cd=$u.BufferUsage,ud=fe.vtkErrorMacro;function dd(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,r){if(t._bufferEntryNames.has(e))ud("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var n=su(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:lu(r)}),t.sizeInBytes+=n}},e.send=function(e){if(!t._buffer){var r={nativeArray:t.Float32Array,time:0,usage:cd.Storage,label:t.label};return t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=fe.newTypedArray(e,t.arrayBuffer))},e.setValue=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else ud("entry named ".concat(r," not found in UBO"))},e.setArray=function(r,n,a){var o=t._bufferEntryNames.get(r);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT,c=0;c;\n};\n@binding(").concat(e,") @group(").concat(r,") var ").concat(t.label,": ").concat(t.label,"Struct;\n")),n.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}var fd={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function pd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fd,r),fe.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},fe.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},fe.get(e,t,["bindGroupTime"]),fe.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),dd(e,t)}var gd={newInstance:fe.newInstance(pd,"vtkWebGPUStorageBuffer"),extend:pd};function md(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=function(e,r){return"@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}var vd={device:null,handle:null,label:null,options:null};function hd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vd,r),fe.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","handle","options"]),fe.setGet(e,t,["bindGroupLayoutEntry","device","label"]),md(e,t)}var yd={newInstance:fe.newInstance(hd),extend:hd},bd=$s,Td="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n\n // var computedColor: vec4 = vec4(1.0,0.7, 0.5, 1.0);\n\n//VTK::RenderEncoder::Impl\n\n return output;\n}\n",Sd=new Float64Array(16),Cd=new Float64Array(16),xd=new Float64Array(16),Pd=new Float64Array(4),wd=new Float64Array(4);function Od(e,t){t.classHierarchy.push("vtkWebGPUImageMapper"),e.buildPass=function(r){if(r){t.WebGPUImageSlice=e.getFirstAncestorOfType("vtkWebGPUImageSlice"),t.WebGPURenderer=t.WebGPUImageSlice.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice();var n=t.WebGPURenderer.getRenderable();t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(n.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.render=function(){t.renderable.update(),t.currentInput=t.renderable.getInputData(),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.build(t.renderEncoder,t.device),e.updateUBO(t.device)},e.computePipelineHash=function(){var e=t.currentInput.getExtent();e[0]===e[1]||e[2]===e[3]||e[4]===e[5]?(t.dimensions=2,t.pipelineHash="img2"):(t.dimensions=3,t.pipelineHash="img3")},e.updateUBO=function(r){var n=t.UBO.getSendTime(),a=t.WebGPUImageSlice.getRenderable(),o=a.getMapper();if(e.getMTime()>n||t.renderable.getMTime()>n||a.getProperty().getMTime()>n){var i=o.getInputData(),s=t.WebGPURenderer.getStabilizedCenterByReference();Pa(Sd),Ra(Sd,Sd,s);var l=a.getMatrix();wa(Cd,l),Oa(Cd,Cd),Ia(Sd,Cd,Sd);var c=i.getWorldToIndex();Ia(Sd,c,Sd),Oa(xd,Sd);var u=i.getDimensions();Pa(Cd),Ea(Cd,Cd,[1/u[0],1/u[1],1/u[2]]),Ia(Sd,Cd,Sd),t.UBO.setArray("SCTCMatrix",Sd);var d=t.currentInput.getExtent(),f=t.renderable.getClosestIJKAxis().ijkMode,p=t.renderable.getSlice();f!==t.renderable.getSlicingMode()&&(p=t.renderable.getSliceAtPosition(p));var g=2,m=0,v=1;f===bd.I?(g=0,m=1,v=2):f===bd.J&&(g=1,m=2,v=0),Pd[g]=p,Pd[m]=d[2*m],Pd[v]=d[2*v],Pd[3]=1,ri(Pd,Pd,xd),t.UBO.setArray("Origin",Pd),wd[g]=p,wd[m]=d[2*m+1],wd[v]=d[2*v],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis1",wd),wd[g]=p,wd[m]=d[2*m],wd[v]=d[2*v+1],wd[3]=1,ri(wd,wd,xd),ti(wd,wd,Pd),wd[3]=1,t.UBO.setArray("Axis2",wd);for(var h=[1,1,1,1],y=[0,0,0,0],b=t.helper.getTextureViews()[0],T=b.getTexture().getScale(),S=b.getTexture().getNumberOfComponents(),C=0;C","@builtin(position) Position");var o=a.getCode(),i=["var pos: vec4 = mapperUBO.Origin +"," (vertexBC.x * 0.5 + 0.5) * mapperUBO.Axis1 + (vertexBC.y * 0.5 + 0.5) * mapperUBO.Axis2;","pos.w = 1.0;"];2===t.dimensions?i.push("var tcoord : vec2 = (mapperUBO.SCTCMatrix * pos).xy;"):i.push("var tcoord : vec3 = (mapperUBO.SCTCMatrix * pos).xyz;"),i.push("output.tcoordVS = tcoord;","output.Position = rendererUBO.SCPCMatrix * pos;"),o=Xc(o,"//VTK::Position::Impl",i).result,a.setCode(o)},r.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,r,n){var a=r.getShaderDescription("vertex");2===t.dimensions?a.addOutput("vec2","tcoordVS"):a.addOutput("vec3","tcoordVS")},r.set("replaceShaderTCoord",e.replaceShaderTCoord),e.replaceShaderImage=function(e,r,n){var a=r.getShaderDescription("fragment"),o=a.getCode();t.dimensions,o=Xc(o,"//VTK::Image::Sample",[" var computedColor: vec4 ="," textureSampleLevel(imgTexture, clampSampler, input.tcoordVS, 0.0);","//VTK::Image::Sample"]).result,o=Xc(o,"//VTK::Image::Sample",[" var coord: vec2 ="," vec2(computedColor.r * mapperUBO.cScale.r + mapperUBO.cShift.r, 0.5);"," computedColor = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);"]).result,a.setCode(o)},r.set("replaceShaderImage",e.replaceShaderImage)}var Ad={rowLength:1024};var Md=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,r),Vs.extend(e,t,r),t.helper=xu.newInstance(),t.helper.setFragmentShaderTemplate(Td),t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("SCTCMatrix","mat4x4"),t.UBO.addEntry("Origin","vec4"),t.UBO.addEntry("Axis2","vec4"),t.UBO.addEntry("Axis1","vec4"),t.UBO.addEntry("cScale","vec4"),t.UBO.addEntry("cShift","vec4"),t.helper.setUBO(t.UBO),t.SSBO=gd.newInstance({label:"volumeSSBO"}),t.componentSSBO=gd.newInstance({label:"componentSSBO"}),t.lutBuildTime={},Z(t.lutBuildTime,{mtime:0}),t.imagemat=Pa(new Float64Array(16)),t.imagematinv=Pa(new Float64Array(16)),t.VBOBuildTime={},Z(t.VBOBuildTime),Od(e,t)}),"vtkWebGPUImageMapper");function Id(e,t){t.classHierarchy.push("vtkWebGPUImageSlice"),e.buildPass=function(r){if(t.renderable&&t.renderable.getVisibility()&&r){if(!t.renderable)return;t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children.forEach((function(e){e.traverse(r)})),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageMapper",Md);var Rd={bufferShift:void 0,keyMatrixTime:null,keyMatrices:null,propID:void 0};var Ed=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rd,r),Vs.extend(e,t,r),t.keyMatricesTime={},Z(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:Pa(new Float64Array(16))},t.bufferShift=[0,0,0,0],Q(e,t,["propID","keyMatricesTime"]),Id(e,t)}),"vtkWebGPUImageSlice");function Dd(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(r){t.renderable&&t.renderable.getVisibility()&&r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),t.renderable.getMapper().update(),e.removeUnusedNodes())},e.queryPass=function(r,n){if(r){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;n.addVolume(e)}};var r=new Float64Array(3),n=new Float64Array(3);e.getBoundingCubePoints=function(e,a){var o=t.renderable.getMapper().getInputData();if(o)for(var i=o.getExtent(),s=t.renderable.getMatrix(),l=0,c=4;c<6;c++){r[2]=i[c];for(var u=2;u<4;u++){r[1]=i[u];for(var d=0;d<2;d++){r[0]=i[d],o.indexToWorld(r,n);var f=a+3*l;e[f++]=s[0]*n[0]+s[1]*n[1]+s[2]*n[2]+s[3],e[f++]=s[4]*n[0]+s[5]*n[1]+s[6]*n[2]+s[7],e[f++]=s[8]*n[0]+s[9]*n[1]+s[10]*n[2]+s[11],l++}}}},e.traverseVolumePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0].traverse(r),e.apply(r,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();wa(t.keyMatrices.bcwc,r),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}Rc("vtkImageSlice",Ed);var Bd={propID:void 0,keyMatricesTime:null};var Vd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bd,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),Dd(e,t)}),"vtkWebGPUVolume");function Ld(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(r,n){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}Rc("vtkVolume",Vd);var Nd={};var kd=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nd,r),Vs.extend(e,t,r),Ld(e,t)}),"vtkWebGPUPixelSpaceCallbackMapper");function Fd(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(r){if(r){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 n=0;nt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),Sa(t.keyMatrices.mcwc,t.renderable.getMatrix()),wa(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?xo(t.keyMatrices.normalMatrix):(yo(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),wo(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),Po(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}Rc("vtkPixelSpaceCallbackMapper",kd);var Gd={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};var _d=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gd,r),Vs.extend(e,t,r),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),Fd(e,t)}));function Ud(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(r){if(r){if(!t.renderable)return;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 n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wd,r),Vs.extend(e,t,r),te(e,t,["context"]),Q(e,t,["activeTextures"]),Ud(e,t)}));_s("vtkActor2D",jd);var zd=Math.sqrt(50),Hd=Math.sqrt(10),Kd=Math.sqrt(2);function Xd(e,t,r){var n=(t-e)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,a);return a>=0?(o>=zd?10:o>=Hd?5:o>=Kd?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=zd?10:o>=Hd?5:o>=Kd?2:1)}function qd(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function Yd(e){let t=e,r=e,n=e;function a(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<0?a=r+1:o=r}while(ae(t)-r,r=qd,n=(t,r)=>qd(e(t),r)),{left:a,center:function(e,r,n=0,o=e.length){const i=a(e,r,n,o-1);return i>n&&t(e[i-1],r)>-t(e[i],r)?i-1:i},right:function(e,t,a=0,o=e.length){if(a>>1;n(e[r],t)<=0?a=r+1:o=r}while(a>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Tf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Tf(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=cf.exec(e))?new xf(t[1],t[2],t[3],1):(t=uf.exec(e))?new xf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=df.exec(e))?Tf(t[1],t[2],t[3],t[4]):(t=ff.exec(e))?Tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pf.exec(e))?Af(t[1],t[2]/100,t[3]/100,1):(t=gf.exec(e))?Af(t[1],t[2]/100,t[3]/100,t[4]):mf.hasOwnProperty(e)?bf(mf[e]):"transparent"===e?new xf(NaN,NaN,NaN,0):null}function bf(e){return new xf(e>>16&255,e>>8&255,255&e,1)}function Tf(e,t,r,n){return n<=0&&(e=t=r=NaN),new xf(e,t,r,n)}function Sf(e){return e instanceof tf||(e=yf(e)),e?new xf((e=e.rgb()).r,e.g,e.b,e.opacity):new xf}function Cf(e,t,r,n){return 1===arguments.length?Sf(e):new xf(e,t,r,null==n?1:n)}function xf(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Pf(){return"#"+Of(this.r)+Of(this.g)+Of(this.b)}function wf(){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 Of(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Af(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new If(e,t,r,n)}function Mf(e){if(e instanceof If)return new If(e.h,e.s,e.l,e.opacity);if(e instanceof tf||(e=yf(e)),!e)return new If;if(e instanceof If)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(i=t===o?(r-n)/s+6*(r0&&l<1?0:i,new If(i,s,l,e.opacity)}function If(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Rf(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function Ef(e,t,r,n,a){var o=e*e,i=o*e;return((1-3*e+3*o-i)*t+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*n+i*a)/6}Jd(tf,yf,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:vf,formatHex:vf,formatHsl:function(){return Mf(this).formatHsl()},formatRgb:hf,toString:hf}),Jd(xf,Cf,ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new xf(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new xf(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:Pf,formatHex:Pf,formatRgb:wf,toString:wf})),Jd(If,(function(e,t,r,n){return 1===arguments.length?Mf(e):new If(e,t,r,null==n?1:n)}),ef(tf,{brighter:function(e){return e=null==e?nf:Math.pow(nf,e),new If(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?rf:Math.pow(rf,e),new If(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new xf(Rf(e>=240?e-240:e+120,a,n),Rf(e,a,n),Rf(e<120?e+240:e-120,a,n),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+")")}}));const Df=e=>()=>e;function Bf(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Df(isNaN(e)?t:e)}const Vf=function e(t){var r=function(e){return 1==(e=+e)?Bf:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Df(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Cf(e)).r,(t=Cf(t)).r),a=r(e.g,t.g),o=r(e.b,t.b),i=Bf(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=a(t),e.b=o(t),e.opacity=i(t),e+""}}return n.gamma=e,n}(1);function Lf(e){return function(t){var r,n,a=t.length,o=new Array(a),i=new Array(a),s=new Array(a);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],i=n>0?e[n-1]:2*a-o,s=no&&(a=t.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(r=r[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,l.push({i,x:Ff(r,n)})),o=Uf.lastIndex;return ot&&(r=e,e=t,t=r),c=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?Qf:Zf,a=o=null,d}function d(t){return null==t||isNaN(t=+t)?r:(a||(a=n(i.map(e),s,l)))(e(c(t)))}return d.invert=function(r){return c(t((o||(o=n(s,i.map(e),Ff)))(r)))},d.domain=function(e){return arguments.length?(i=Array.from(e,Kf),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Hf,u()},d.clamp=function(e){return arguments.length?(c=!!e||qf,u()):c!==qf},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,u()}}()(qf,qf)}function ep(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var tp,rp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=rp.exec(e)))throw new Error("invalid format: "+e);var t;return new ap({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 ap(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 op(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ip(e){return(e=op(Math.abs(e)))?e[1]:NaN}function sp(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}np.prototype=ap.prototype,ap.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};const lp={"%":(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)=>sp(100*e,t),r:sp,s:function(e,t){var r=op(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(tp=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=n.length;return o===i?n:o>i?n+new Array(o-i+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+op(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cp(e){return e}var up,dp,fp,pp=Array.prototype.map,gp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mp(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,a,o,i,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t0){let r=Math.round(e/i),n=Math.round(t/i);for(r*it&&--n,o=new Array(a=n-r+1);++st&&--n,o=new Array(a=n-r+1);++s=zd?a*=10:o>=Hd?a*=5:o>=Kd&&(a*=2),t0;){if((a=Xd(l,c,r))===n)return o[i]=l,o[s]=c,t(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a}n=a}return e},e}function vp(){var e=Jf();return e.copy=function(){return $f(e,vp())},ep.apply(e,arguments),mp(e)}function hp(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}up=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?cp:(t=pp.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var a=e.length,o=[],i=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(a-=s,a+s)),!((l+=s+1)>n));)s=t[i=(i+1)%t.length];return o.reverse().join(r)}),a=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?cp:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(pp.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=np(e)).fill,r=e.align,d=e.sign,f=e.symbol,p=e.zero,g=e.width,m=e.comma,v=e.precision,h=e.trim,y=e.type;"n"===y?(m=!0,y="g"):lp[y]||(void 0===v&&(v=12),h=!0,y="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===f?a:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",T="$"===f?o:/[%p]/.test(y)?l:"",S=lp[y],C=/[defgprs%]/.test(y);function x(e){var a,o,l,f=b,x=T;if("c"===y)x=S(e)+x,e="";else{var P=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),v),h&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),P&&0==+e&&"+"!==d&&(P=!1),f=(P?"("===d?d:c:"-"===d||"("===d?"":d)+f,x=("s"===y?gp[8+tp/3]:"")+x+(P&&"("===d?")":""),C)for(a=-1,o=e.length;++a(l=e.charCodeAt(a))||l>57){x=(46===l?i+e.slice(a+1):e.slice(a))+x,e=e.slice(0,a);break}}m&&!p&&(e=n(e,1/0));var w=f.length+e.length+x.length,O=w>1)+f+e+x+O.slice(w);break;default:e=O+f+e+x}return s(e)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),x.toString=function(){return e+""},x}return{format:d,formatPrefix:function(e,t){var r=d(((e=np(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(ip(t)/3))),a=Math.pow(10,-n),o=gp[8+n/3];return function(e){return r(a*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),dp=up.format,fp=up.formatPrefix;var yp=fe.vtkDebugMacro;function bp(e,t){t.classHierarchy.push("vtkActor");var r=function(e){for(var t=1;t=1;return(r=r&&(!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=Fu.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 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||r[0]!==t.mapperBounds[0]||r[1]!==t.mapperBounds[1]||r[2]!==t.mapperBounds[2]||r[3]!==t.mapperBounds[3]||r[4]!==t.mapperBounds[4]||r[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){yp("Recomputing bounds..."),t.mapperBounds=r.concat();var n=[];Hr.getCorners(r,n),e.computeMatrix();var a=new Float64Array(16);wa(a,t.matrix),n.forEach((function(e){return Jn(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?n.reduce((function(e,r){return e>r[t/2]?r[t/2]:e}),e):n.reduce((function(e,r){return ee?n: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 r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(r=t.mapper.getInput().getMTime())>e?r:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var Tp={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function Sp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tp,r),vi.extend(e,t,r),t.boundsMTime={},fe.obj(t.boundsMTime),fe.set(e,t,["property"]),fe.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),bp(e,t)}var Cp={newInstance:fe.newInstance(Sp,"vtkActor"),extend:Sp};function xp(e,t){e.getBounds=function(){return 0},e.getBounds=function(r){e.getBounds();for(var n=0;n<6;n++)r[n]=t.bounds[n]},e.getCenter=function(){e.getBounds();for(var r=0;r<3;r++)t.center[r]=(t.bounds[2*r+1]+t.bounds[2*r])/2;return t.center.slice()},e.getLength=function(){var r=0,n=0;e.getBounds();for(var a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return Math.sqrt(n)}}var Pp={bounds:[1,-1,1,-1,1,-1],center:[0,0,0]},wp=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,r),ys(e,t,r),t.bounds||St(t.bounds),t.center||(t.center=[0,0,0]),xp(e,t)},Op=fe.vtkErrorMacro;function Ap(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+1+1.5:(r=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(r,n,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var c=e.getAlpha(),u=r.getNumberOfTuples(),d=r.getNumberOfComponents(),f=n.getData(),p=r.getData();if(c>=1){if(a===hi.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}var Mp={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 Ip(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mp,r),Di.extend(e,t,r),t.table||(t.table=[]),t.buildTime={},fe.obj(t.buildTime),t.opaqueFlagBuildTime={},fe.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},fe.obj(t.insertTime,{mtime:0}),fe.get(e,t,["buildTime"]),fe.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),fe.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),fe.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),fe.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),Ap(e,t)}var Rp={newInstance:fe.newInstance(Ip,"vtkLookupTable"),extend:Ip},Ep=1,Dp=0,Bp=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Vp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Dp=e}var Lp={getResolveCoincidentTopologyAsString:function(){return Bp[Dp]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Ep},getResolveCoincidentTopology:function(){return Dp},setResolveCoincidentTopology:Vp,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Ep=e},setResolveCoincidentTopologyToDefault:function(){Vp(0)},setResolveCoincidentTopologyToOff:function(){Vp(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Vp(1)}};function Np(e,t,r){r.forEach((function(r){e["get".concat(r.method)]=function(){return t[r.key]},e["set".concat(r.method)]=function(e,n){t[r.key]={factor:e,offset:n}}}))}var kp=["Polygon","Line","Point"],Fp={};Np(Fp,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},kp.map((function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}})));var Gp={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),fe.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Lp).forEach((function(t){e[t]=Lp[t]})),Object.keys(Fp).forEach((function(t){e[t]=Fp[t]})),Np(e,t.topologyOffset,kp.map((function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}}))),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyPolygonOffsetParameters(),r=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Fp.getResolveCoincidentTopologyLineOffsetParameters(),r=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Fp.getResolveCoincidentTopologyPointOffsetParameters(),r=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}}},staticOffsetAPI:Fp,otherStaticMethods:Lp,CATEGORIES:kp};function _p(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}function Up(e){for(var t=1;t1e3?n=1e3:n<-1e3&&(n=-1e3)),{texCoordS:n,texCoordT:a}},e.createColorTextureCoordinates=function(t,r,n,a,o,i,s,l,c){var u=(i[1]-i[0])/l,d=[];d[0]=i[0]-u,d[1]=i[1]+u;var f=1/(d[1]-d[0]),p=r.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==n){t.lookupTable.setAlpha(n),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),c=new Float64Array(2*s),u=0;ut.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=r.getNumberOfComponents(),g=r.getNumberOfTuples();t.colorCoordinates=qt.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===Xp.MAGNITUDE&&r.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(r,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(r){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var n=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=n.scalars;return!(!a||n.cellFlag||t.colorMode===zp.DEFAULT&&a.getDataType()===qp.UNSIGNED_CHAR||t.colorMode===zp.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 r=t.lookupTable.getMTime();e=r>e?r: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=Yp("AcquireInvertibleLookupTable"),e.valueToColor=Yp("ValueToColor"),e.colorToValue=Yp("ColorToValue"),e.useInvertibleColorFor=Yp("UseInvertibleColorFor"),e.clearInvertibleColor=Yp("ClearInvertibleColor")}var Qp={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 $p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qp,r),wp(e,t,r),fe.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),fe.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Gp.implementCoincidentTopologyMethods(e,t),Zp(e,t)}var Jp=Up(Up(Up({newInstance:fe.newInstance($p,"vtkMapper"),extend:$p},Wp),jp),Ti);function eg(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}function tg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};qt.extend(e,t,og(r)),ag(e,t)}var sg=tg({newInstance:fe.newInstance(ig,"vtkCellArray"),extend:ig},ng),lg=fe.vtkErrorMacro,cg=[1,-1,1,-1,1,-1];function ug(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==r&&(t.size=r*n,t.values=fe.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(n),e.modified())},e.setPoint=function(e){for(var r=e*t.numberOfComponents,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dg,r),qt.extend(e,t,r),ug(e,t)}var pg={newInstance:fe.newInstance(fg,"vtkPoints"),extend:fg};function gg(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){t.pointsIds=r;var n=t.points.getData();n.length!==3*t.pointsIds.length&&(n=fe.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach((function(e,t){var r=3*e,o=3*t;n[o]=a[r],n[++o]=a[++r],n[++o]=a[++r]})),t.points.setData(n)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),r=[];if(e){t.points.getPoint(0,r),t.bounds[0]=r[0],t.bounds[1]=r[0],t.bounds[2]=r[1],t.bounds[3]=r[1],t.bounds[4]=r[2],t.bounds[5]=r[2];for(var n=1;nt.bounds[1]?r[0]:t.bounds[1],t.bounds[2]=r[1]t.bounds[3]?r[1]:t.bounds[3],t.bounds[4]=r[2]t.bounds[5]?r[2]:t.bounds[5]}else St(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var r=0,n=0,a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return r},e.getParametricDistance=function(e){for(var t,r=0,n=0;n<3;n++)(t=e[n]<0?-e[n]:e[n]>1?e[n]-1:0)>r&&(r=t);return r},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,r,n,a,o,i){},e.evaluatePosition=function(e,t,r,n,a,o){}}var mg={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function vg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mg,r),fe.obj(e,t),t.points||(t.points=pg.newInstance()),fe.get(e,t,["points","pointsIds"]),gg(e,t)}var hg={newInstance:fe.newInstance(vg,"vtkCell"),extend:vg};function yg(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(r){var n=r.getPoints().getNumberOfPoints(),a=r.getNumberOfCells(),o=new Uint32Array(n);if(r.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=r,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,r){t.array[e].cells[t.array[e].ncells++]=r},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,r){t.array[r].cells=t.array[r].cells.filter((function(t){return t!==e})),t.array[r].ncells=t.array[r].cells.length},e.addCellReference=function(e,r){t.array[r].cells[t.array[r].ncells++]=e},e.resizeCellList=function(e,r){t.array[e].cells.length=r},e.squeeze=function(){!function(e,t){var r=t;for(t>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=f(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bg,r),fe.obj(e,t),yg(e,t)}var Sg={newInstance:fe.newInstance(Tg,"vtkCellLinks"),extend:Tg},Cg=0,xg=1,Pg=2,wg=3,Og=4,Ag=5,Mg=6,Ig=7,Rg=9,Eg=21,Dg=41,Bg=42,Vg=["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 Lg(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 Ng={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]=Cg},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(t,Fg,r),fe.obj(e,t),fe.get(e,t,["size","maxId","extend"]),fe.getArray(e,t,["typeArray","locationArray"]),kg(e,t)}var _g=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=Ge(i,i),c=1e-5*s;return 0!==l&&(o.t=s/l),c<0&&(c=-c),-c1?n=r:(n=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=n[0],a[1]=n[1],a[2]=n[2]),o.distance=ze(n,e),o}function Kg(e,t,r,n,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=n[0]-r[0],s[1]=n[1]-r[1],s[2]=n[2]-r[2],l[0]=r[0]-e[0],l[1]=r[1]-e[1],l[2]=r[2]-e[2];var c=[];c[0]=[Ge(i,i),-Ge(i,s)],c[1]=[c[0][1],Ge(s,s)];var u=[];if(u[0]=Ge(i,l),u[1]=-Ge(s,l),0===ut(c,u,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,r,n],g=[r,r,e,e],m=[n,n,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Hg(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?zg.YES_INTERSECTION:zg.NO_INTERSECTION}var Xg={distanceToLine:Hg,intersection:Kg};function qg(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,r,n,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],c=[];t.points.getPoint(0,l),t.points.getPoint(1,c);var u,d=[],f=[],p=Kg(e,r,l,c,d,f);if(i.t=d[0],i.betweenPoints=(u=i.t)>=0&&u<=1,o[0]=f[0],p===zg.YES_INTERSECTION){for(var g=0;g<3;g++)a[g]=l[g]+o[0]*(c[g]-l[g]),s[g]=e[g]+i.t*(r[g]-e[g]);if(ze(a,s)<=n*n)return i.intersect=1,i}else{var m;if(i.t<0)return(m=Hg(e,l,c,a)).distance<=n*n?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(m=Hg(r,l,c,a)).distance<=n*n?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,m=Hg(l,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,m=Hg(c,e,r,a),i.t=m.t,m.distance<=n*n?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,r,n,a,o){}}var Yg={};function Zg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,r),hg.extend(e,t,r),qg(e,t)}var Qg=jg(jg({newInstance:fe.newInstance(Zg,"vtkLine"),extend:Zg},Xg),Ug);function $g(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=T(t.points):t.points=pg.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var r=e.shallowCopy;e.shallowCopy=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r(e,n),t.points=pg.newInstance(),t.points.shallowCopy(e.getPoints())}}var Jg={};function em(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,r),pn.extend(e,t,r),fe.setGet(e,t,["points"]),$g(e,t)}var tm={newInstance:fe.newInstance(em,"vtkPointSet"),extend:em};function rm(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}function nm(e,t,r,n){var a=r[0]-t[0],o=r[1]-t[1],i=r[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],c=e[2]-t[2];n[0]=o*c-i*l,n[1]=i*s-a*c,n[2]=a*l-o*s}function am(e,t,r,n){nm(e,t,r,n);var a=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==a&&(n[0]/=a,n[1]/=a,n[2]/=a)}var om={computeNormalDirection:nm,computeNormal:am};function im(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(r,n,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,c=[],u=[],d=[];t.points.getPoint(0,c),t.points.getPoint(1,u),t.points.getPoint(2,d);var f=[];if(am(c,u,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=cr.intersectWithLine(r,n,c,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=ze(c,u),v=ze(u,d),h=ze(d,c);t.line||(t.line=Qg.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,u)):v>h&&v>m?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,c));var y=t.line.intersectWithLine(r,n,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],S=[],C=0;C<3;C++)b[C]=c[C]-d[C],T[C]=u[C]-d[C],S[C]=o[C]-d[C];return i[0]=Ge(S,b)/h,i[1]=Ge(S,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,r,n,a){var o,i,s,l,c,u,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,S=[],C=[],x=[],P=[],w=[];f.subId=0,n[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),nm(p,g,m,v),cr.generalizedProjectPoint(e,p,v,w);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(S[i++]=o);for(o=0;o<2;o++)h[o]=w[S[o]]-m[S[o]],y[o]=p[S[o]]-m[S[o]],b[o]=g[S[o]]-m[S[o]];if(0===(l=qe(y,b)))return n[0]=0,n[1]=0,f.evaluation=-1,f;if(n[0]=qe(h,b)/l,n[1]=qe(y,h)/l,a[0]=1-(n[0]+n[1]),a[1]=n[0],a[2]=n[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)r&&(f.dist2=ze(w,e),r[0]=w[0],r[1]=w[1],r[2]=w[2]),f.evaluation=1;else{var A;if(r)if(a[1]<0&&a[2]<0)for(c=ze(e,m),u=Qg.distanceToLine(e,p,m,A,x),d=Qg.distanceToLine(e,m,g,A,P),c1?n[a]-1:0)>r&&(r=t);return r}}var sm={};function lm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sm,r),hg.extend(e,t,r),im(e,t)}var cm,um=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];r(e,n),dm.forEach((function(r){t[r]=sg.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))}))},e.buildCells=function(){var r=e.getNumberOfVerts(),n=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=r+n+a+o,s=new Uint8Array(i),l=s,c=new Uint32Array(i),u=c;if(r){var d=0;t.verts.getCellSizes().forEach((function(e,t){u[t]=d,l[t]=e>1?Pg:xg,d+=e+1})),u=u.subarray(r),l=l.subarray(r)}if(n){var f=0;t.lines.getCellSizes().forEach((function(e,t){u[t]=f,l[t]=e>2?Og:wg,1===e&&fm("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1})),u=u.subarray(n),l=l.subarray(n)}if(a){var p=0;t.polys.getCellSizes().forEach((function(e,t){switch(u[t]=p,e){case 3:l[t]=Ag;break;case 4:l[t]=Rg;break;default:l[t]=Ig}e<3&&fm("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1})),u+=u.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Mg,0,o),t.strips.getCellSizes().forEach((function(e,t){u[t]=g,g+=e+1}))}t.cells=_g.newInstance(),t.cells.setCellTypes(i,s,c)},e.buildLinks=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Sg.newInstance(),r>0?t.links.allocate(r):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var r=t.cells.getCellType(e),n=null;switch(r){case xg:case Pg:n=t.verts;break;case wg:case Og:n=t.lines;break;case Ag:case Rg:case Ig:n=t.polys;break;case Mg:n=t.strips;break;default:return n=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:r,cellPointIds:n.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,r,n){var a=t.links.getLink(r),o=t.links.getLink(n);return a.cells.filter((function(t){return t!==e&&-1!==o.cells.indexOf(t)}))},e.getCell=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.getCellPoints(t),a=r||pm[n.cellType].newInstance();return a.initialize(e.getPoints(),n.cellPointIds),a}}var mm={};function vm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mm,r),tm.extend(e,t,r),fe.get(e,t,["cells","links"]),fe.setGet(e,t,["verts","lines","polys","strips"]),gm(e,t)}var hm={newInstance:fe.newInstance(vm,"vtkPolyData"),extend:vm};function ym(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setJsImageData=function(r){t.jsImageData!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null),t.jsImageData=r,t.imageLoaded=!0,e.modified())},e.setCanvas=function(r){t.canvas!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.jsImageData=null),t.canvas=r,e.modified())},e.setImage=function(r){t.image!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.canvas=null,t.jsImageData=null),t.image=r,t.imageLoaded=!1,r.complete?e.imageLoaded():r.addEventListener("load",e.imageLoaded),e.modified())}}var bm={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,canvas:null,imageLoaded:!1,jsImageData:null};function Tm(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,r),fe.obj(e,t),fe.algo(e,t,6,0),fe.get(e,t,["canvas","image","jsImageData","imageLoaded"]),fe.setGet(e,t,["repeat","edgeClamp","interpolate"]),ym(e,t)}var Sm={newInstance:fe.newInstance(Tm,"vtkTexture"),extend:Tm};function Cm(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}function xm(e){for(var t=1;t.5?Gn(Em,Bm,o[0]*i):Gn(Em,Bm,o[0]*i-l.width/2),Rn(Im,Im,Em),Gn(Em,Vm,o[1]*i-l.height/2),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[0],s.tcoords[2*f+1]=l.tcoords[1],f++,Gn(Em,Bm,l.width),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[2],s.tcoords[2*f+1]=l.tcoords[3],f++,Gn(Em,Vm,l.height),Rn(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[4],s.tcoords[2*f+1]=l.tcoords[5],f++,Gn(Em,Bm,l.width),En(Im,Im,Em),s.points[3*f]=Im[0],s.points[3*f+1]=Im[1],s.points[3*f+2]=Im[2],s.tcoords[2*f]=l.tcoords[6],s.tcoords[2*f+1]=l.tcoords[7],f++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-3,s.polys[4*p+3]=f-2,p++,s.polys[4*p]=3,s.polys[4*p+1]=f-4,s.polys[4*p+2]=f-2,s.polys[4*p+3]=f-1,s.ptIdx+=4,s.cellIdx+=2}},e.updateTexturePolyData=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r);var n=t.renderable.getTextValues().length,a=4*n,o=2*n,i=new Float64Array(3*a),s=new Uint16Array(4*o),l=new Float32Array(2*a);Oa(Lm,r);for(var c={ptIdx:0,cellIdx:0,polys:s,points:i,tcoords:l},u=0,d=0,f=0,p=t.renderable.getTextPolyData().getPoints().getData(),g=t.renderable.getTextValues();u2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),fe.setGet(e,t,["renderable"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.lastTickBounds=[],km(e,t)}),"vtkCubeAxesActorHelper");function Gm(e,t){t.classHierarchy.push("vtkCubeAxesActor"),e.setCamera=function(r){t.camera!==r&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=r,r&&(t.cameraModifiedSub=r.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=function(){var e=t.camera.getViewMatrix();wa(e,e);for(var r=!1,n=Hr.getDiagonalLength(t.dataBounds),a=Math.sin(t.faceVisibilityAngle*Math.PI/180),o=0;o<6;o++){var i=!1,s=Math.floor(o/2),l=(s+1)%3,c=(s+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*c]!==t.dataBounds[2*c+1]&&(Im[s]=t.dataBounds[o]-.1*n*Pm[o][s],Im[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),Im[c]=.5*(t.dataBounds[2*c]+t.dataBounds[2*c+1]),Jn(Em,Im,e),Im[s]=t.dataBounds[o],Jn(Dm,Im,e),En(Em,Dm,Em),Kn(Em,Em),i=Em[2]>a,t.camera.getParallelProjection()||(Kn(Dm,Dm),i=Xn(Dm,Em)>a)),i!==t.lastFacesToDraw[o]&&(t.lastFacesToDraw[o]=i,r=!0)}return r},e.updatePolyData=function(e,r,n){var a=0,o=0;a+=8;for(var i=0,s=0;s<12;s++)r[s]>0&&i++;if(o+=i,t.gridLines)for(var l=0;l<6;l++)e[l]&&(a+=2*n[Mm[l][0]].length+2*n[Mm[l][1]].length,o+=n[Mm[l][0]].length+n[Mm[l][1]].length);for(var c=new Float64Array(3*a),u=new Uint32Array(3*o),d=0,f=0,p=0;p<2;p++)for(var g=0;g<2;g++)for(var m=0;m<2;m++)c[3*d]=t.dataBounds[m],c[3*d+1]=t.dataBounds[2+g],c[3*d+2]=t.dataBounds[4+p],d++;for(var v=0;v<12;v++)r[v]>0&&(u[3*f]=2,u[3*f+1]=Om[v][0],u[3*f+2]=Om[v][1],f++);if(t.gridLines)for(var h=0;h<6;h++)if(e[h]){for(var y=Math.floor(h/2),b=n[Mm[h][0]],T=0;T2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_m(r)),Cp.extend(e,t,r),t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.gridMapper=Jp.newInstance(),t.polyData=hm.newInstance(),t.gridMapper.setInputData(t.polyData),t.gridActor=Cp.newInstance(),t.gridActor.setMapper(t.gridMapper),t.gridActor.setProperty(e.getProperty()),t.gridActor.setParentProp(e),t.textPolyData=hm.newInstance(),fe.setGet(e,t,["axisTitlePixelOffset","faceVisibilityAngle","gridLines","tickLabelPixelOffset"]),fe.setGetArray(e,t,["dataBounds"],6),fe.setGetArray(e,t,["axisLabels"],3),fe.get(e,t,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","_tmAtlas","tickCounts","gridActor"]),Gm(e,t)}var Wm={newInstance:fe.newInstance(Um,"vtkCubeAxesActor"),extend:Um,newCubeAxesActorHelper:Fm};function jm(e,t){t.classHierarchy.push("vtkOpenGLCubeAxesActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var zm={};var Hm=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zm,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),jm(e,t)}),"vtkOpenGLCubeAxesActor");_s("vtkCubeAxesActor",Hm);var Km={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},Xm=Fu.Representation,qm=Fu.Shading,Ym=Jp.ScalarMode,Zm=$l.Filter,Qm=$l.Wrap,$m=F,Jm={type:"StartEvent"},ev={type:"EndEvent"};function tv(e,r){function n(e,t,r){return t.identity(r),e.reduce((function(e,r,n){return 0===n?r?t.copy(e,r):t.identity(e):r?t.multiply(e,e,r):e}),r)}r.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=function(t){t&&(r.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),r.openGLRenderer=r.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(t){t&&(r.haveSeenDepthRequest=!0,r.renderDepth=!0,e.render(),r.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=Km.Start;n= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=wl.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:$m("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(t,n,a){if(r.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=t.Vertex,i=t.Geometry,s=t.Fragment;r.lastBoundBO.getCABO().getNormalOffset()?(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=wl.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=wl.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=wl.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):r.haveCellNormals?(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=wl.substitute(s,"//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(),r.lastBoundBO.getPrimitiveType())===r.context.LINES?(s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=wl.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=wl.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=wl.substitute(s,"//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),t.Vertex=o,t.Geometry=i,t.Fragment=s}},e.replaceShaderPositionVC=function(e,t,n){var a=e.Vertex,o=e.Geometry,i=e.Fragment;n.getProperty().getRepresentation()!==Xm.POINTS&&r.lastBoundBO.getPrimitiveType()!==Km.Points||(a=wl.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(n.getProperty().getPointSize(),".0;")],!1).result),r.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=wl.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=wl.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=wl.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=wl.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=wl.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,t,n){if(r.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(r.drawingEdges)return;a=wl.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=r.openGLActor.getActiveTextures(),l=2,c=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===r.context.TEXTURE_CUBE_MAP&&(c=3)),r.renderable.getColorTextureMap()&&(l=r.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),c=2),2===c){if(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(a=wl.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=wl.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=wl.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=wl.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:i=wl.substitute(i,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,t,n){var a=e.Vertex,o=e.Fragment;if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes();a=wl.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[".concat(i,"];"),"varying float clipDistancesVSOutput[".concat(i,"];")]).result,a=wl.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=wl.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[".concat(i,"];")]).result,o=wl.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < ".concat(i,"; planeNum++)")," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,t){var n=null,a=t.getProperty();if(r.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===Xm.SURFACE){var o=r.lastBoundBO.getPrimitiveType();o===Km.Points||a.getRepresentation()===Xm.POINTS?n=r.renderable.getCoincidentTopologyPointOffsetParameter():o===Km.Lines||a.getRepresentation()===Xm.WIREFRAME?n=r.renderable.getCoincidentTopologyLineOffsetParameters():o!==Km.Tris&&o!==Km.TriStrips||(n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==Km.TrisEdges&&o!==Km.TriStripsEdges||((n=r.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,n.offset/=2)}return n},e.replaceShaderPicking=function(e,t,r){var n=e.Fragment;n=wl.substitute(n,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,n=wl.substitute(n,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=n},e.replaceShaderValues=function(t,n,a){if(e.replaceShaderColor(t,n,a),e.replaceShaderNormal(t,n,a),e.replaceShaderLight(t,n,a),e.replaceShaderTCoord(t,n,a),e.replaceShaderPicking(t,n,a),e.replaceShaderClip(t,n,a),e.replaceShaderCoincidentOffset(t,n,a),e.replaceShaderPositionVC(t,n,a),r.haveSeenDepthRequest){var o=t.Fragment;o=wl.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=wl.substitute(o,"//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,t.Fragment=o}},e.getNeedToRebuildShaders=function(t,n,a){var o=0,i=0,s=t.getPrimitiveType(),l=r.currentInput,c=!1,u=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===qm.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===r.context.TRIANGLES||d&&!u||!f&&u?c=!0:f||g!==r.context.LINES||(c=!0),a.getProperty().getLighting()&&c){o=0;for(var m=n.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=r.lastBoundBO.getReferenceByName("lastLightComplexity"),T=r.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(r.lastBoundBO.set({lastLightComplexity:o},!0),r.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(r.lastHaveSeenDepthRequest!==r.haveSeenDepthRequest||0===t.getProgram()||t.getShaderSourceTime().getMTime()t.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){var o=r.lastBoundBO.getReferenceByName("lastLightComplexity");t.getProgram().isAttributeUsed("vertexMC")&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"vertexMC",t.getCABO().getVertexOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting vertexMC in shader VAO.")),t.getProgram().isAttributeUsed("normalMC")&&t.getCABO().getNormalOffset()&&o>0?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"normalMC",t.getCABO().getNormalOffset(),t.getCABO().getStride(),r.context.FLOAT,3,!1)||$m("Error setting normalMC in shader VAO."):t.getVAO().removeAttributeArray("normalMC"),r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||$m("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||$m("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),t.getProgram().isAttributeUsed("scalarColor")&&t.getCABO().getColorComponents()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO().getColorBO(),"scalarColor",t.getCABO().getColorOffset(),t.getCABO().getColorBOStride(),r.context.UNSIGNED_BYTE,4,!0)||$m("Error setting scalarColor in shader VAO."):t.getVAO().removeAttributeArray("scalarColor"),t.getAttributeUpdateTime().modified()}if(r.renderable.getNumberOfClippingPlanes()){var i=r.renderable.getNumberOfClippingPlanes(),s=[],l=t.getCABO().getCoordShiftAndScaleEnabled()?t.getCABO().getInverseShiftAndScaleMatrix():null,c=l?Sa(r.tmpMat4,a.getMatrix()):a.getMatrix();l&&(wa(c,c),Ia(c,c,l),wa(c,c));for(var u=0;u0){var u=c.getColorByReference(),d=c.getIntensity();r.lightColor[0]=u[0]*d,r.lightColor[1]=u[1]*d,r.lightColor[2]=u[2]*d;var p=c.getDirection(),g=t.getActiveCamera().getViewMatrix(),m=f(p);c.lightTypeIsSceneLight()&&(m[0]=g[0]*p[0]+g[1]*p[1]+g[2]*p[2],m[1]=g[4]*p[0]+g[5]*p[1]+g[6]*p[2],m[2]=g[8]*p[0]+g[9]*p[1]+g[10]*p[2],We(m)),r.lightDirection[0]=m[0],r.lightDirection[1]=m[1],r.lightDirection[2]=m[2],r.lightHalfAngle[0]=-r.lightDirection[0],r.lightHalfAngle[1]=-r.lightDirection[1],r.lightHalfAngle[2]=1-r.lightDirection[2],We(r.lightDirection),o.setUniform3fArray("lightColor".concat(i),r.lightColor),o.setUniform3fArray("lightDirectionVC".concat(i),r.lightDirection),o.setUniform3fArray("lightHalfAngleVC".concat(i),r.lightHalfAngle),i++}}if(!(a<3)){var v=t.getActiveCamera().getViewMatrix();wa(v,v),i=0;for(var h=0;h0){var b=y.getTransformedPosition(),T=new Float64Array(3);Jn(T,b,v),o.setUniform3fArray("lightAttenuation".concat(i),y.getAttenuationValuesByReference()),o.setUniformi("lightPositional".concat(i),y.getPositional()),o.setUniformf("lightExponent".concat(i),y.getExponent()),o.setUniformf("lightConeAngle".concat(i),y.getConeAngle()),o.setUniform3fArray("lightPositionVC".concat(i),[T[0],T[1],T[2]]),i++}}}}},e.setCameraShaderParameters=function(e,o,i){var s=e.getProgram(),l=r.openGLCamera.getKeyMatrices(o),c=o.getActiveCamera(),u=r.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:r.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],t,r.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,r.tmpMat3)),d!==u&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",c.getParallelProjection()),s.setLastCameraMTime(u)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,t,n){var a=e.getProgram(),o=n.getProperty(),i=o.getOpacity(),s=r.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=r.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),c=r.drawingEdges?1:o.getAmbient(),u=r.drawingEdges?0:o.getDiffuse(),d=r.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",c),a.setUniformf("diffuse",u);var p=r.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.setUniformf("specular",d),a.isUniformUsed("ambientIntensityBF")){if(i=(o=n.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),c=o.getAmbient(),l=o.getDiffuseColor(),u=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",c),a.setUniformf("diffuseIntensityBF",u),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(t,n){r.primitiveIDOffset=0,r.openGLRenderer.getSelector()&&(r.openGLRenderer.getSelector().getCurrentPass(),r.openGLRenderer.getSelector().renderProp(n)),e.updateBufferObjects(t,n),r.renderable.getColorTextureMap()&&r.internalColorTexture.activate(),r.lastBoundBO=null},e.renderPieceDraw=function(t,n){var a=n.getProperty().getRepresentation(),o=r.context,i=n.getProperty().getEdgeVisibility()&&a===Xm.SURFACE;o.lineWidth(n.getProperty().getLineWidth());for(var s=Km.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=Km,t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16));for(var n=Km.Start;ne?r:e}return e},e.mapScalars=function(r,n){var a=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(a){var o="".concat(e.getMTime()).concat(a.getMTime()).concat(n);if(t.colorBuildString!==o){t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]);var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,t.fieldDataTupleId)),t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(n)}}else t.colorMapColors=null}}var uv={static:!1,lookupTable:null,scalarVisibility:!1,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,transformCoordinate:null,viewSpecificProperties:null,customShaderAttributes:[]};function dv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uv,r),ys(e,t,r),fe.get(e,t,["colorMapColors"]),fe.setGet(e,t,["arrayAccessMode","colorByArrayName","colorMode","lookupTable","renderTime","scalarMode","scalarVisibility","static","transformCoordinate","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),fe.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),cv(e,t)}var fv={newInstance:fe.newInstance(dv,"vtkMapper2D"),extend:dv},pv=1,gv=ov.primTypes,mv=fv.ScalarMode,vv=F,hv={type:"StartEvent"},yv={type:"EndEvent"};function bv(e,r){r.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),e.buildPass=function(t){t&&(r.openGLActor2D=e.getFirstAncestorOfType("vtkOpenGLActor2D"),r.openGLRenderer=r.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),r.openGLRenderWindow=r.openGLRenderer.getParent(),r.openGLCamera=r.openGLRenderer.getViewNodeFor(r.openGLRenderer.getRenderable().getActiveCamera()))},e.overlayPass=function(t){t&&e.render()},e.getShaderTemplate=function(e,t,n){var a=r.renderable.getViewSpecificProperties().OpenGL,o="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.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// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n";if(a){var i=a.VertexShaderCode;void 0!==i&&""!==i&&(o=i)}e.Vertex=o;var s="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.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\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n";if(a){var l=a.FragmentShaderCode;void 0!==l&&""!==l&&(s=l)}e.Fragment=s;var c="";if(a){var u=a.GeometryShaderCode;void 0!==u&&(c=u)}e.Geometry=c},e.render=function(){var t=r.openGLRenderWindow.getContext();if(r.context!==t){r.context=t;for(var n=gv.Start;nt.getAttributeUpdateTime().getMTime()||t.getShaderSourceTime().getMTime()>t.getAttributeUpdateTime().getMTime())){r.renderable.getCustomShaderAttributes().forEach((function(e,n){t.getProgram().isAttributeUsed("".concat(e,"MC"))&&(t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"".concat(e,"MC"),t.getCABO().getCustomData()[n].offset,t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getCustomData()[n].components,!1)||vv("Error setting ".concat(e,"MC in shader VAO.")))})),t.getProgram().isAttributeUsed("tcoordMC")&&t.getCABO().getTCoordOffset()?t.getVAO().addAttributeArray(t.getProgram(),t.getCABO(),"tcoordMC",t.getCABO().getTCoordOffset(),t.getCABO().getStride(),r.context.FLOAT,t.getCABO().getTCoordComponents(),!1)||vv("Error setting tcoordMC in shader VAO."):t.getVAO().removeAttributeArray("tcoordMC"),r.internalColorTexture&&t.getProgram().isUniformUsed("texture1")&&t.getProgram().setUniformi("texture1",r.internalColorTexture.getTextureUnit());var o=r.openGLActor2D.getActiveTextures();if(o)for(var i=0;i=u[0]?l[0]:u[0],d[1]=l[1]>=u[1]?l[1]:u[1],d[2]=l[2]>=u[2]?l[2]:u[2],d[3]=l[3]>=u[3]?l[3]:u[3],!(d[0]>=d[2]||d[1]>=d[3])){s.usize=Pe(s.usize*(d[2]-d[0])/(l[2]-l[0])),s.vsize=Pe(s.vsize*(d[3]-d[1])/(l[3]-l[1]));var f=r.openGLRenderer.getParent().getSize(),p=Pe(c[0]-(d[0]-l[0])*f[0]),g=Pe(c[1]-(d[1]-l[1])*f[1]),m=-p,v=-p+s.usize,h=-g,y=-g+s.vsize;m===v&&(v=m+1),h===y&&(y=h+1);var b,T,S,C=Pa(new Float64Array(16));C[0]=2/(v-m),C[5]=2/(y-h),C[3]=-1*(v+m)/(v-m),C[7]=-1*(y+h)/(y-h),C[10]=0,C[11]=a.getProperty().getDisplayLocation()===pv?-1:1,C[15]=1,wa(C,C),o.setUniformMatrix("WCVCMatrix",(b=[C,i],T=t,S=r.tmpMat4,T.identity(S),b.reduce((function(e,t,r){return 0===r?t?T.copy(e,t):T.identity(e):t?T.multiply(e,e,t):e}),S)))}},e.haveWideLines=function(e,t){return r.lastBoundBO===r.lines&&t.getProperty().getLineWidth()>1}}var Tv={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};var Sv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tv,r),Vs.extend(e,t,r),rc(e,t,r),t.primitives=[],t.primTypes=gv,t.tmpMat4=Pa(new Float64Array(16));for(var n=gv.Start;n1?s.fontSize=Math.max(20*o,10):s.fontSize=Math.max(16*o,10);var l=e.updateTextureAtlas();e.setTopTitle(!1);var c=e.getBoxSizeByReference();if(e.getLastAspectRatio()>1){e.setTickLabelPixelOffset(.4*s.fontSize);var u=2*(l.tickWidth+e.getTickLabelPixelOffset())/r[0];e.setAxisTitlePixelOffset(.8*i.fontSize);var d=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[0];u+.4*d>2*l.titleWidth/r[0]?(e.setTopTitle(!0),c[0]=u+.4*d,e.setBoxPosition([.98-c[0],-.92])):(c[0]=u+1.4*d,e.setBoxPosition([.99-c[0],-.92])),c[1]=Math.max(1.2,Math.min(1.84/a,1.84))}else{e.setAxisTitlePixelOffset(2*s.fontSize),e.setTickLabelPixelOffset(.5*s.fontSize);var f=2*(l.tickHeight+e.getTickLabelPixelOffset())/r[1],p=2*(l.titleHeight+e.getAxisTitlePixelOffset())/r[1],g=2*l.tickWidth/r[0];c[0]=Math.min(1.9,Math.max(1.4,1.4*g*(e.getTicks().length+3))),c[1]=f+p,e.setBoxPosition([-.5*c[0],-.97])}e.recomputeBarSegments(l)}}function Vv(e,t){t.classHierarchy.push("vtkScalarBarActorHelper"),e.setRenderable=function(r){t.renderable!==r&&(t.renderable=r,t.barActor.setProperty(r.getProperty()),t.barActor.setParentProp(r),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),t.axisTextStyle=xv({},r.getAxisTextStyle()),t.tickTextStyle=xv({},r.getTickTextStyle()),e.modified())},e.updateAPISpecificData=function(r,n,a){t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0);var o=t.renderable.getScalarsToColors();if(o&&t.renderable.getVisibility()){if(t.barMapper.setLookupTable(o),t.camera=n,t.renderWindow=a,t.forceUpdate||Math.max(o.getMTime(),e.getMTime())>t.lastRebuildTime.getMTime()){var i=o.getMappingRange();t.lastTickBounds=f(i),t.barMapper.setScalarRange(t.lastTickBounds);var s=vp().domain([t.lastTickBounds[0],t.lastTickBounds[1]]);t.ticks=s.ticks(5);var l=s.tickFormat(5);if(t.tickstrings=t.ticks.map(l),t.renderable.getAutomated())t.renderable.getAutoLayout()(e);else{t.axisTextStyle=xv({},t.renderable.getAxisTextStyle()),t.tickTextStyle=xv({},t.renderable.getTickTextStyle()),t.barPosition=f(t.renderable.getBarPosition()),t.barSize=f(t.renderable.getBarSize()),t.boxPosition=f(t.renderable.getBoxPosition()),t.boxSize=f(t.renderable.getBoxSize()),t.axisTitlePixelOffset=t.renderable.getAxisTitlePixelOffset(),t.tickLabelPixelOffset=t.renderable.getTickLabelPixelOffset();var c=e.updateTextureAtlas();e.recomputeBarSegments(c)}t.forceViewUpdate=!0,t.lastRebuildTime.modified(),t.forceUpdate=!1}(t.forceViewUpdate||t.camera.getMTime()>t.lastRedrawTime.getMTime())&&(e.updatePolyDataForLabels(),e.updatePolyDataForBarSegments(),t.lastRedrawTime.modified(),t.forceViewUpdate=!1)}},e.updateTextureAtlas=function(){t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left";var e={},r=new Map,n=0,a=1;Dv(t.tmContext,t.axisTextStyle);var o=t.tmContext.measureText(t.renderable.getAxisLabel()),i={height:o.actualBoundingBoxAscent+2,startingHeight:a,width:o.width+2,textStyle:t.axisTextStyle};r.set(t.renderable.getAxisLabel(),i),a+=i.height,n=i.width,e.titleWidth=i.width,e.titleHeight=i.height,e.tickWidth=0,e.tickHeight=0,Dv(t.tmContext,t.tickTextStyle);for(var s=[].concat(f(t.tickstrings),["NaN","Below","Above"]),l=0;lt.boxSize[0];var r=2*e.tickHeight/t.lastSize[1],n=[1,1];if(t.vertical){var a=2*(e.tickWidth+t.tickLabelPixelOffset)/t.lastSize[0];if(t.topTitle){var o=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0]-a,t.barSize[1]=t.boxSize[1]-o}else{var i=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[0];t.barSize[0]=t.boxSize[0]-i-a,t.barSize[1]=t.boxSize[1]}t.barPosition[0]=t.boxPosition[0]+a,t.barPosition[1]=t.boxPosition[1],n[1]=r}else{var s=(2*e.tickWidth-8)/t.lastSize[0],l=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0],t.barPosition[0]=t.boxPosition[0],t.barSize[1]=t.boxSize[1]-l-r,t.barPosition[1]=t.boxPosition[1],n[0]=s}return n},e.recomputeBarSegments=function(r){var n,a,o,i,s=e.computeBarSize(r);t.barSegments=[];var l=[0,0],c=t.vertical?1:0,u=t.vertical?.01:.02;function d(e,r){t.barSegments.push({corners:[[].concat(l),[l[0]+s[0],l[1]],[l[0]+s[0],l[1]+s[1]],[l[0],l[1]+s[1]]],scalars:r,title:e}),l[c]+=s[c]+u}t.renderable.getDrawNanAnnotation()&&t.renderable.getScalarsToColors().getNanColor()&&d("NaN",[NaN,NaN,NaN,NaN]),t.renderable.getDrawBelowRangeSwatch()&&null!==(n=(a=t.renderable.getScalarsToColors()).getUseBelowRangeColor)&&void 0!==n&&n.call(a)&&d("Below",[-.1,-.1,-.1,-.1]);var f=null===(o=(i=t.renderable.getScalarsToColors()).getUseAboveRangeColor)||void 0===o?void 0:o.call(i);l[c]+=u;var p=s[c];s[c]=f?1-2*u-s[c]-l[c]:1-u-l[c],d("ticks",t.vertical?[0,0,.995,.995]:[0,.995,.995,0]),t.renderable.getDrawAboveRangeSwatch()&&f&&(s[c]=p,l[c]+=u,d("Above",[1.1,1.1,1.1,1.1]))},e.createPolyDataForOneLabel=function(e,r,n,a,o,i,s){var l=t._tmAtlas.get(e);if(l){var c=s.ptIdx,u=s.cellIdx;wv[0]=r[0],wv[1]=r[1],wv[2]=r[2],o[0]<-.5?Gn(Av,n,o[0]*i-l.width):o[0]>.5?Gn(Av,n,o[0]*i):Gn(Av,n,o[0]*i-l.width/2),Rn(wv,wv,Av),Gn(Av,a,o[1]*i-l.height/2),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[0],s.tcoords[2*c+1]=l.tcoords[1],c++,Gn(Av,n,l.width),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[2],s.tcoords[2*c+1]=l.tcoords[3],c++,Gn(Av,a,l.height),Rn(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[4],s.tcoords[2*c+1]=l.tcoords[5],c++,Gn(Av,n,l.width),En(wv,wv,Av),s.points[3*c]=wv[0],s.points[3*c+1]=wv[1],s.points[3*c+2]=wv[2],s.tcoords[2*c]=l.tcoords[6],s.tcoords[2*c+1]=l.tcoords[7],c++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-3,s.polys[4*u+3]=c-2,u++,s.polys[4*u]=3,s.polys[4*u+1]=c-4,s.polys[4*u+2]=c-2,s.polys[4*u+3]=c-1,s.ptIdx+=4,s.cellIdx+=2}},e.updatePolyDataForLabels=function(){var r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);wa(r,r),Oa(Ev,r);var n=t.lastSize;Av[0]=0,Av[1]=0,Av[2]=-.99,Jn(wv,Av,Ev),Av[0]+=.1,Jn(Ov,Av,Ev),En(Iv,Ov,wv),Av[0]-=.1,Av[1]+=.1,Jn(Ov,Av,Ev),En(Rv,Ov,wv);for(var a=0;a<3;a++)Iv[a]/=.05*n[0],Rv[a]/=.05*n[1];var o=t.tickstrings.length+t.barSegments.length,i=4*o,s=2*o,l=new Float64Array(3*i),c=new Uint16Array(4*s),u=new Float32Array(2*i),d={ptIdx:0,cellIdx:0,polys:c,points:l,tcoords:u},f=t.vertical?0:1,p=t.vertical?1:0,g=[0,1];t.vertical?(t.topTitle?(Av[0]=t.boxPosition[0]+.5*t.boxSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,[0,1],t.axisTitlePixelOffset,d)):(Av[0]=t.barPosition[0]+t.barSize[0],Av[1]=t.barPosition[1]+.5*t.barSize[1],Jn(wv,Av,Ev),Gn(Iv,Iv,-1),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Rv,Iv,[0,-1],t.axisTitlePixelOffset,d),Gn(Iv,Iv,-1)),g=[-1,0]):(Av[0]=t.barPosition[0]+.5*t.barSize[0],Av[1]=t.barPosition[1]+t.barSize[1],Jn(wv,Av,Ev),e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),wv,Iv,Rv,g,t.axisTitlePixelOffset,d)),Mv[2]=-.99,Mv[f]=t.barPosition[f]+(.5*g[f]+.5)*t.barSize[f],Mv[p]=t.barPosition[p]+.5*t.barSize[p];for(var m=null,v=0;v2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),fe.obj(e,t),fe.setGet(e,t,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle"]),fe.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","barActor","tmActor","ticks"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),t.forceUpdate=!1,t.lastRedrawTime={},fe.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},fe.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.barMapper=Jp.newInstance(),t.barMapper.setInterpolateScalarsBeforeMapping(!0),t.polyData=hm.newInstance(),t.barMapper.setInputData(t.polyData),t.barActor=Cp.newInstance(),t.barActor.setMapper(t.barMapper),t.tmPolyData=hm.newInstance(),t.tmMapper=Jp.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=Sm.newInstance(),t.tmTexture.setInterpolate(!1),t.tmActor=Cp.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.barPosition=[0,0],t.barSize=[0,0],t.boxPosition=[.88,-.92],t.boxSize=[.1,1.1],t.lastTickBounds=[],Vv(e,t)}),"vtkScalarBarActorHelper");function Nv(e,t){t.classHierarchy.push("vtkScalarBarActor"),e.setTickTextStyle=function(r){t.tickTextStyle=xv(xv({},t.tickTextStyle),r),e.modified()},e.setAxisTextStyle=function(r){t.axisTextStyle=xv(xv({},t.axisTextStyle),r),e.modified()},e.resetAutoLayoutToDefault=function(){t.autoLayout=Bv(0,t)}}function kv(e){return xv({automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif"},drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0},e)}function Fv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv(r)),t.autoLayout||(t.autoLayout=Bv(0,t)),Cp.extend(e,t,r),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),fe.setGet(e,t,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch"]),fe.get(e,t,["axisTextStyle","tickTextStyle"]),fe.getArray(e,t,["boxPosition","boxSize"]),fe.setArray(e,t,["boxPosition","boxSize"],2),Nv(e,t)}var Gv={newInstance:fe.newInstance(Fv,"vtkScalarBarActor"),extend:Fv,newScalarBarActorHelper:Lv};function _v(e,t){t.classHierarchy.push("vtkOpenGLScalarBarActor"),e.buildPass=function(r){r&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,a=t.openGLRenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.openGLRenderWindow.getRenderable())}}}var Uv={};var Wv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),_v(e,t)}),"vtkOpenGLScalarBarActor");_s("vtkScalarBarActor",Wv);var jv=F;function zv(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(r){if(r){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 n=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(n.getActiveCamera())}},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOpaqueActorCount()}},e.opaquePass=function(r,n){if(r&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.context.depthMask(!0),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var o=t.openGLRenderer.getRenderable(),i=t.openGLCamera.getKeyMatrices(o),s=new Float64Array(16);if(Oa(s,i.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),"box"===t.lastFormat){var l=o.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),r=0;r<4;r++)e[3*r]=r%2*2-1,e[3*r+1]=r>1?1:-1,e[3*r+2]=1;var n=qt.newInstance({numberOfComponents:3,values:e});n.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 o=qt.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",cl.SURFACE,{points:n,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)||jv("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||jv("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}var Hv={context:null};var Kv=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hv,r),Vs.extend(e,t,r),t.openGLTexture=$l.newInstance(),t.tris=Bl.newInstance(),t.keyMatrixTime={},Z(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:xo(new Float64Array(9)),mcwc:Pa(new Float64Array(16))},te(e,t,["context"]),Q(e,t,["activeTextures"]),zv(e,t)}));function Xv(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(r){t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=function(r){!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=function(e,r){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=function(r){return e.getKeyMatrices(r),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var r=t.renderable.getMatrix(),n=e.getStabilizedCenterByReference();t.bufferShift[0]=r[3]-n[0],t.bufferShift[1]=r[7]-n[1],t.bufferShift[2]=r[11]-n[2],wa(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?Pa(t.keyMatrices.normalMatrix):(Sa(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,Oa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),wa(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),Ra(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),Ra(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}_s("vtkSkybox",Kv);var qv={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};var Yv=fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,r),Vs.extend(e,t,r),t.keyMatricesTime={},fe.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},fe.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],Xv(e,t)}));function Zv(e,t){t.classHierarchy.push("vtkWebGPUCubeAxesActor"),e.buildPass=function(r){r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=function(e,r){if(e){var n=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,a=t.WebGPURenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([a.usize,a.vsize],n,t.WebGPURenderWindow.getRenderable())}}}Rc("vtkActor",Yv);var Qv={};var $v=ie((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,r),Vs.extend(e,t,r),t.CubeAxesActorHelper=Wm.newCubeAxesActorHelper(),Zv(e,t)}),"vtkWebGPUCubeAxesActor");Rc("vtkCubeAxesActor",$v);var Jv=$u.BufferUsage,eh=$u.PrimitiveTypes,th=Fu.Representation,rh=Jp.ScalarMode,nh={type:"StartEvent"},ah={type:"EndEvent"},oh="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",ih="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::Position::Impl\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";function sh(e){return e.indexOf("edge")>=0}function lh(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(r){r&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var r=t.WebGPUActor.getRenderable().getProperty(),n=t.UBO.getSendTime();if(e.getMTime()>n||r.getMTime()>n||t.renderable.getMTime()>n){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=r.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",r.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",r.getDiffuse()),o=r.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",r.getSpecular()),t.UBO.setValue("SpecularPower",r.getSpecularPower()),o=r.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),o=r.getEdgeColorByReference(),t.UBO.setArray("EdgeColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",r.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(nh),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(ah),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,r){var n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4","@builtin(position) Position");var a=n.getCode();sh(e)?(n.addBuiltinInput("u32","@builtin(instance_index) instanceIndex"),a=Xc(a,"//VTK::Position::Impl",[" var tmpPos: vec4 = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"," var tmpPos2: vec3 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 1.4*(f32(input.instanceIndex % 2u) - 0.5)/rendererUBO.viewportSize.x;"," tmpPos2.y = tmpPos2.y + 1.4*(f32(input.instanceIndex / 2u) - 0.5)/rendererUBO.viewportSize.y;"," tmpPos2.z = tmpPos2.z + 0.00001;"," output.Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"]).result):a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var n=t.getShaderDescription("vertex");n.addOutput("vec3","normalVC");var a=n.getCode();a=Xc(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,r){var n=t.getShaderDescription("fragment"),a=n.getCode();a.includes("var normal")?(a=Xc(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a)):(a=Xc(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,n.setCode(a))},e.replaceShaderColor=function(e,t,r){if(sh(e)){var n=t.getShaderDescription("fragment"),a=n.getCode();return a=Xc(a,"//VTK::Color::Impl",["ambientColor = mapperUBO.EdgeColor;","diffuseColor = mapperUBO.EdgeColor;"]).result,void n.setCode(a)}if(r.hasAttribute("colorVI")){var o=t.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,o.setCode(i);var s=t.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}},e.replaceShaderTCoord=function(e,r,n){if(n.hasAttribute("tcoord")){var a=r.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=Xc(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=r.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=Xc(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("fragment"),a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,n.setCode(a)}},e.getUsage=function(e,t){return e===th.POINTS||t===eh.Points?Jv.Verts:t===eh.Lines?Jv.Lines:e===th.WIREFRAME?t===eh.Triangles?Jv.LinesFromTriangles:Jv.LinesFromStrips:t===eh.Triangles?Jv.Triangles:t===eh.TriangleStrips?Jv.Strips:t===eh.TriangleEdges?Jv.LinesFromTriangles:Jv.LinesFromStrips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case Jv.Triangles:return"triangle-list";case Jv.Verts:return"point-list";case Jv.Lines:default:return"line-list"}},e.buildVertexInput=function(r,n,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=!1;a===eh.TriangleEdges&&(s=!0,o=th.WIREFRAME);var l=t.primitives[a].getVertexInput(),c="R".concat(o,"P").concat(a),u=r.getPoints();if(u){var d=t.WebGPUActor.getBufferShift(t.WebGPURenderer),f={owner:u,usage:Jv.PointArray,format:"float32x4",time:Math.max(u.getMTime(),n.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),hash:c,dataArray:u,cells:n,primitiveType:a,representation:o,shift:d,packExtra:!0},p=i.getBufferManager().getBuffer(f);l.addBuffer(p,["vertexBC"])}else l.removeBufferIfPresent("vertexBC");var g=e.getUsage(o,a);if(g===Jv.Triangles||g===Jv.Strips){var m=r.getPointData().getNormals(),v={format:"snorm8x4",hash:c,cells:n,representation:o,primitiveType:a,packExtra:!0,shift:0,scale:127};if(m){v.owner=m,v.dataArray=m,v.time=Math.max(m.getMTime(),n.getMTime()),v.usage=Jv.PointArray;var h=i.getBufferManager().getBuffer(v);l.addBuffer(h,["normalMC"])}else if(a===eh.Triangles){v.owner=u,v.dataArray=u,v.time=Math.max(u.getMTime(),n.getMTime()),v.usage=Jv.NormalsFromPoints;var y=i.getBufferManager().getBuffer(v);l.addBuffer(y,["normalMC"])}else l.removeBufferIfPresent("normalMC")}else l.removeBufferIfPresent("normalMC");var b=!1;if(t.renderable.getScalarVisibility()){var T=t.renderable.getColorMapColors();if(T&&!s){var S=t.renderable.getScalarMode(),C=!1;S!==rh.USE_CELL_DATA&&S!==rh.USE_CELL_FIELD_DATA&&S!==rh.USE_FIELD_DATA&&r.getPointData().getScalars()||S===rh.USE_POINT_FIELD_DATA||!T||(C=!0);var x={owner:T,usage:Jv.PointArray,format:"unorm8x4",time:Math.max(T.getMTime(),n.getMTime(),u.getMTime()),hash:c+C,dataArray:T,cells:n,primitiveType:a,representation:o,cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(x);l.addBuffer(P,["colorVI"]),b=!0}}b||l.removeBufferIfPresent("colorVI");var w=null;if((w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():r.getPointData().getTCoords())&&!s){var O={owner:w,usage:Jv.PointArray,format:"float32x2",time:Math.max(w.getMTime(),n.getMTime()),hash:c,dataArray:w,cells:n,primitiveType:a,representation:o},A=i.getBufferManager().getBuffer(O);l.addBuffer(A,["tcoord"])}else l.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],r=[],n=t.renderable.getColorTextureMap();n&&(t.colorTexture||(t.colorTexture=Sm.newInstance({label:"polyDataColor"})),t.colorTexture.setInputData(n),r.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(r,n,a){var o="pd";return a?o+="edge":(r.hasAttribute("normalMC")&&(o+="n"),r.hasAttribute("colorVI")&&(o+="c"),r.hasAttribute("tcoord")&&(o+="t"),t.textures.length&&(o+="tx".concat(t.textures.length))),t.SSBO&&(o+="ssbo"),(o+=e.getHashFromUsage(n))+t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var r=t.currentInput,n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(r,1),e.updateTextures();for(var o=t.WebGPUActor.getRenderable(),i=o.getProperty().getRepresentation(),s=o.getProperty().getEdgeVisibility(),l=eh.Points;l<=eh.Triangles;l++)if(n[l].getNumberOfValues()>0){var c=e.getUsage(i,l),u=t.primitives[l];e.buildVertexInput(t.currentInput,n[l],l),u.setPipelineHash(e.computePipelineHash(u.getVertexInput(),c,!1)),u.setTextureViews(t.textureViews),u.setWebGPURenderer(t.WebGPURenderer),u.setNumberOfInstances(1);var d=u.getVertexInput().getBuffer("vertexBC");if(u.setNumberOfVertices(d.getSizeInBytes()/d.getStrideInBytes()),u.setTopology(e.getTopologyFromUsage(c)),u.build(t.renderEncoder,a),u.registerToDraw(),s&&i===th.SURFACE&&l===eh.Triangles){var f=t.primitives[eh.TriangleEdges],p=e.getUsage(i,eh.TriangleEdges);e.buildVertexInput(t.currentInput,n[eh.Triangles],eh.TriangleEdges),f.setPipelineHash(e.computePipelineHash(f.getVertexInput(),p,!0)),f.setWebGPURenderer(t.WebGPURenderer),f.setNumberOfInstances(4);var g=f.getVertexInput().getBuffer("vertexBC");f.setNumberOfVertices(g.getSizeInBytes()/g.getStrideInBytes()),f.setTopology(e.getTopologyFromUsage(p)),f.build(t.renderEncoder,a),f.registerToDraw()}}},e.setShaderReplacement=function(e,r){for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ch,r),Vs.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.tmpMat4=Pa(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||ih,t.vertexShaderTemplate=t.vertexShaderTemplate||oh,t.UBO=ad.newInstance({label:"mapperUBO"}),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("EdgeColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),Q(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),te(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],lh(e,t);for(var n=eh.Start;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gh,r),Vs.extend(e,t,r),t.scalarBarActorHelper=Gv.newScalarBarActorHelper(),ph(e,t)}),"vtkWebGPUScalarBarActor");function vh(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,r){t.texture=e,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;var n=nu(t.texture.getFormat());t.bindGroupLayoutEntry.texture.sampleType=n.sampleType},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,r){var n="f32";"sint"===t.bindGroupLayoutEntry.texture.sampleType?n="i32":"uint"===t.bindGroupLayoutEntry.texture.sampleType&&(n="u32");var a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_").concat(t.options.dimension,"<").concat(n,">;");return"depth"===t.bindGroupLayoutEntry.texture.sampleType&&(a="@binding(".concat(e,") @group(").concat(r,") var ").concat(t.label,": texture_depth_").concat(t.options.dimension,";")),a},e.addSampler=function(r,n){var a=yd.newInstance({label:"".concat(t.label,"Sampler")});a.create(r,n),e.setSampler(a)},e.getBindGroupTime=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.bindGroupTime},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}Rc("vtkScalarBarActor",mh);var hh={texture:null,handle:null,sampler:null,label:null};function yh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hh,r),fe.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},t.bindGroupTime={},fe.obj(t.bindGroupTime,{mtime:0}),fe.get(e,t,["bindGroupTime","texture"]),fe.setGet(e,t,["bindGroupLayoutEntry","label","sampler"]),vh(e,t)}var bh={newInstance:fe.newInstance(yh),extend:yh},Th=$u.BufferUsage;function Sh(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,r){t.device=e,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1;var n=1===t.depth?"2d":"3d";t.format=r.format?r.format:"rgba8unorm",t.usage=r.usage?r.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label,dimension:n})},e.assignFromHandle=function(e,r,n){t.device=e,t.handle=r,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1,t.format=n.format?n.format:"rgba8unorm",t.usage=n.usage?n.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){if(e.canvas)return t.device.getHandle().queue.copyExternalImageToTexture({source:e.canvas,flipY:e.flip},{texture:t.handle,premultipliedAlpha:!0},[t.width,t.height,t.depth]),void(t.ready=!0);e.jsImageData&&!e.nativeArray&&(e.width=e.jsImageData.width,e.height=e.jsImageData.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.nativeArray=e.jsImageData.data);var r=nu(t.format),n=t.width*r.stride;if(e.nativeArray){var a={usage:Th.Texture};e.dataArray&&(a.dataArray=e.dataArray,a.time=e.dataArray.getMTime()),a.nativeArray=e.nativeArray;var o=e.nativeArray.length/(t.height*t.depth)*e.nativeArray.BYTES_PER_ELEMENT,i=2===r.elementSize&&"float"===r.sampleType;if(i||o%256){for(var s=e.nativeArray,l=o/s.BYTES_PER_ELEMENT,c=r.elementSize,u=256*Math.floor((l*c+255)/256),d=u/c,f=fe.newTypedArray(i?"Uint16Array":s.constructor.name,d*t.height*t.depth),p=0;p2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&r===t.height&&n===t.depth||(t.width=e,t.height=r,t.depth=n,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.createView=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.dimension||(n.dimension=1===t.depth?"2d":"3d");var a=bh.newInstance({label:r});return a.create(e,n),a}}var Ch={device:null,handle:null,buffer:null,ready:!1,label:null};function xh(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Ph(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xh(o,n,a,i,s,"next",e)}function s(e){xh(o,n,a,i,s,"throw",e)}i(void 0)}))}}fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ch,r),fe.obj(e,t),fe.get(e,t,["handle","ready","width","height","depth","format","usage"]),fe.setGet(e,t,["device","label"]),Sh(e,t)}));var wh=r(757),Oh=r.n(wh),Ah={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function Mh(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=Ph(Oh().mark((function e(t,r,n,a,o){return Oh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,r,n,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=Ph(Oh().mark((function t(r,n,a,o,i){var s;return Oh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(r,n,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(n,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)})));return function(e,r,n,a,o){return t.apply(this,arguments)}}()}var Ih={fieldAssociation:pn.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function Rh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ih,r),fe.obj(e,t),fe.setGet(e,t,["fieldAssociation","captureZValues"]),Mh(e,t)}var Eh={newInstance:fe.newInstance(Rh,"vtkHardwareSelector"),extend:Rh};function Dh(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}function Bh(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}var Vh={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function Lh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vh,r),fe.obj(e,t),t.properties={},fe.setGet(e,t,["contentType","fieldType","properties","selectionList"]),Bh(e,t)}var Nh=function(e){for(var t=1;te.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=zh(o[0],o[1],e.pixBuffer[Fh.ACTOR_PASS],e.area);if(i<=0||i-1>=e.props.length)return null;var s={valid:!0};s.propID=i-1,s.prop=e.props[s.propID];var l=zh(o[0],o[1],e.pixBuffer[Fh.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-1,e.captureZValues){var c=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[c]+e.zBuffer[c+1])/65535,s.displayPosition=t}return s}var u=[t[0],t[1]],d=[0,0],f=Hh(e,t,0,n);if(f&&f.valid)return f;for(var p=1;pp?u[1]-p:0;g<=u[1]+p;++g){if(d[1]=g,u[0]>=p&&(d[0]=u[0]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[0]=u[0]+p,(f=Hh(e,d,0,n))&&f.valid)return f}for(var m=u[0]>=p?u[0]-(p-1):0;m<=u[0]+(p-1);++m){if(d[0]=m,u[1]>=p&&(d[1]=u[1]-p,(f=Hh(e,d,0,n))&&f.valid))return f;if(d[1]=u[1]+p,(f=Hh(e,d,0,n))&&f.valid)return f}}return n[0]=t[0],n[1]=t[1],null}function Kh(e,t,r,n,a){var o=[],i=0;return t.forEach((function(t,s){var l=Nh.newInstance();switch(l.setContentType(Gh.INDICES),e){case Uh.FIELD_ASSOCIATION_CELLS:l.setFieldType(_h.CELL);break;case Uh.FIELD_ASSOCIATION_POINTS:l.setFieldType(_h.POINT);break;default:Wh("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,r&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,n)),l.setSelectionList(t.attributeIDs),o[i]=l,i++})),o}function Xh(e,t,r,n,a){for(var o=Math.floor(t),i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=new Map,u=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Hh(e,[f,d],0,u);if(p&&p.valid){var g=jh(p);if(c.has(g)){var m=c.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(r){t.currentPass===Fh.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+1),t.props.push(r))},e.renderCompositeIndex=function(r){t.currentPass===Fh.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(r+1)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return fe.enumToString(Fh,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(r,n,a){var o=n<0?0:n;if(0===o){if(a[0]=r[0],a[1]=r[1],r[0]t.area[2]||r[1]t.area[3])return null;var i=[r[0]-t.area[0],r[1]-t.area[1]],s=zh(i[0],i[1],t.pixBuffer[Fh.ACTOR_PASS],t.area);if(s<=0||s-1>=t.props.length)return null;var l={valid:!0};l.propID=s-1,l.prop=t.props[l.propID];var c=zh(i[0],i[1],t.pixBuffer[Fh.COMPOSITE_INDEX_PASS],t.area);if((c<0||c>16777215)&&(c=0),l.compositeID=c-1,t.captureZValues){var u=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[u]+t.zBuffer[u+1])/65535,l.displayPosition=r}return l}var d=[r[0],r[1]],f=[0,0],p=e.getPixelInformation(r,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=r[0],a[1]=r[1],null},e.generateSelection=function(r,n,a,o){for(var i=Math.floor(r),s=Math.floor(n),l=Math.floor(a),c=Math.floor(o),u=new Map,d=[0,0],f=s;f<=c;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=jh(m);if(u.has(v)){var h=u.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yh,r),Eh.extend(e,t,r),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),fe.setGetArray(e,t,["area"],4),fe.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),fe.setGetArray(e,t,["propColorValue"],3),fe.event(e,t,"event"),qh(e,t)}var Qh=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=wl.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=wl.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}r.replaceShaderNormal(e,n,a)},e.replaceShaderColor=function(e,n,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),c=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(c=c.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(c=c.concat(["varying vec4 vertexColorVSOutput;"]),o=wl.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=wl.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=wl.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=wl.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=wl.substitute(s,"//VTK::Color::Impl",u).result,s=wl.substitute(s,"//VTK::Color::Dec",c).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}r.replaceShaderColor(e,n,a)},e.replaceShaderPositionVC=function(e,n,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=wl.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=wl.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}r.replaceShaderPositionVC(e,n,a)},e.replaceShaderPicking=function(e,n,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=wl.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=wl.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=wl.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=wl.substitute(o,"//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=o}else r.replaceShaderPicking(e,n,a)},e.updateGlyphShaderParameters=function(r,n,a,o,i,s,l,c){var u=a.getProgram();if(r){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],S=d[6],C=d[7],x=d[8],P=f[p],w=f[p+1],O=f[p+2],A=f[p+3],M=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=P*m+w*y+O*S,g[1]=P*v+w*b+O*C,g[2]=P*h+w*T+O*x,g[3]=A*m+M*y+I*S,g[4]=A*v+M*b+I*C,g[5]=A*h+M*T+I*x,g[6]=R*m+E*y+D*S,g[7]=R*v+E*b+D*C,g[8]=R*h+E*T+D*x,u.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),u.setUniformMatrix("MCPCMatrix",t.tmpMat4),n&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),u.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var B=o.getData();t.tmpColor[0]=B[4*l]/255,t.tmpColor[1]=B[4*l+1]/255,t.tmpColor[2]=B[4*l+2]/255,u.setUniform3fArray("ambientColorUniform",t.tmpColor),u.setUniform3fArray("diffuseColorUniform",t.tmpColor)}c&&u.setUniform3fArray("mapperIndex",c.getPropColorValue())},e.renderPieceDraw=function(r,n){var a=n.getProperty().getRepresentation(),o=t.context,i=n.getProperty().getEdgeVisibility()&&a===ey.SURFACE,s=t.openGLCamera.getKeyMatrices(r),l=t.openGLActor.getKeyMatrices();Mo(t.normalMatrix,s.normalMatrix,l.normalMatrix),Ia(t.mcpcMatrix,s.wcpc,l.mcwc),Ia(t.mcvcMatrix,s.wcvc,l.mcwc);var c=t.renderable.getMatrixArray(),u=t.renderable.getNormalArray(),d=t.renderable.getColorArray(),f=c.length/16,p=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===ry.COMPOSITE_INDEX_PASS&&(p=!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)||Jh("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)||Jh("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)||Jh("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)||Jh("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),r.setMapperShaderParameters(e,n,a),void e.getAttributeUpdateTime().modified();r.setMapperShaderParameters(e,n,a)},e.getNeedToRebuildBufferObjects=function(e,n){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,ty.ARRAY_BUFFER),t.normalBuffer.upload(o,ty.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),ty.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),c=0;c2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,iy,r),ov.extend(e,t,r),t.tmpMat3=xo(new Float64Array(9)),t.normalMatrix=xo(new Float64Array(9)),t.mcpcMatrix=Pa(new Float64Array(16)),t.mcvcMatrix=Pa(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),oy(e,t)}),"vtkOpenGLGlyph3DMapper");function ly(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}_s("vtkGlyph3DMapper",sy);var cy=$u.PrimitiveTypes;function uy(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var r=function(e){for(var t=1;t","@builtin(position) Position");var a=n.getCode();a=Xc(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,n.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=Xc(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}r.replaceShaderNormal(e,t,n)},e.replaceShaderColor=function(e,n,a){if(t.carray){var o=n.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=Xc(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=n.getShaderDescription("fragment");i=s.getCode(),i=Xc(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else r.replaceShaderColor(e,n,a)},e.replaceShaderSelect=function(e,t,r){if(e.includes("sel")){var n=t.getShaderDescription("vertex");n.addOutput("u32","compositeID","flat");var a=n.getCode();a=Xc(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,n.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=Xc(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),n=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",n),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}r.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dy,r),fh.extend(e,t,r),t.glyphBOBuildTime={},Z(t.glyphBOBuildTime,{mtime:0}),t.SSBO=gd.newInstance({label:"glyphSSBO"}),uy(e,t);for(var n=cy.Start;n1&&void 0!==arguments[1]?arguments[1]:{};return gy[e]&&gy[e](t)}function hy(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(r){e.hasRenderer(r)||(r.setRenderWindow(e),t.renderers.push(r),e.modified())},e.removeRenderer=function(r){t.renderers=t.renderers.filter((function(e){return e!==r})),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vy(e||t.defaultViewAPI,r)},e.addView=function(r){e.hasView(r)||(r.setRenderable(e),t.views.push(r),e.modified())},e.removeView=function(r){t.views=t.views.filter((function(e){return e!==r})),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.preRender=function(){t.renderers.forEach((function(e){e.isActiveCameraCreated()||e.resetCamera()}))},e.render=function(){e.preRender(),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 r=t.getMapper&&t.getMapper();if(r&&r.getPrimitiveCount){var n=r.getPrimitiveCount();Object.keys(n).forEach((function(t){e[t]||(e[t]=0),e[t]+=n[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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fe.setImmediate(e.render),t.views.map((function(e){return e.captureNextImage?e.captureNextImage(r,n):void 0})).filter((function(e){return!!e}))}}var yy={defaultViewAPI:py,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function by(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yy,r),fe.obj(e,t),fe.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),fe.get(e,t,["neverRendered"]),fe.getArray(e,t,["renderers"]),fe.event(e,t,"completion"),hy(e,t)}var Ty={newInstance:fe.newInstance(by,"vtkRenderWindow"),extend:by,registerViewConstructor:my,listViewAPIs:function(){return Object.keys(gy)},newAPISpecificView:vy};function Sy(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(fe.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=n,t.preDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})),t.delegates.forEach((function(t){t.traverse(r,e)})),t.postDelegateOperations.forEach((function(t){e.setCurrentOperation(t),r.traverse(e)})))}}var Cy={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function xy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cy,r),fe.obj(e,t),fe.get(e,t,["currentOperation"]),fe.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),Sy(e,t)}var Py={newInstance:fe.newInstance(xy,"vtkRenderPass"),extend:xy};function wy(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e);for(var a=r.getRenderable().getNumberOfLayers(),o=r.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var u=r.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=yc.newInstance()),t.framebuffer.setOpenGLRenderWindow(r),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===u[0]&&d[1]===u[1]||(t.framebuffer.create(u[0],u[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)),t.overlayActorCount>0&&(e.setCurrentOperation("overlayPass"),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++},e.incrementOverlayActorCount=function(){return t.overlayActorCount++}}var Oy={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function Ay(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Oy,r),Py.extend(e,t,r),fe.get(e,t,["framebuffer"]),wy(e,t)}var My={newInstance:fe.newInstance(Ay,"vtkForwardPass"),extend:Ay},Iy=r(322),Ry=r.n(Iy),Ey=["lastShaderBound","context","openGLRenderWindow"];function Dy(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,r,n){var a=r;n.length>0&&(a=wl.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#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=wl.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#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=wl.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=wl.substitute(l,"varying","out").result,a=wl.substitute(a,"varying","in").result,a=wl.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=wl.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:wl.substitute(n,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,r,n){var a=e.replaceShaderValues(t,r,n),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,r,n){var a="".concat(e).concat(r).concat(n),o=Ry().hash(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=wl.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(r),n&&i.getGeometryShader().setSource(n),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(r){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map((function(e){return t.shaderPrograms[e]})).forEach((function(e){return e.releaseGraphicsResources(r)}))},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 By={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function Vy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,By,r),t.shaderPrograms={},fe.obj(e,t),fe.setGet(e,t,Ey),Dy(e,t)}var Ly={newInstance:fe.newInstance(Vy,"vtkShaderCache"),extend:Vy},Ny=fe.vtkErrorMacro;function ky(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fy,r),fe.obj(e,t),t.textureUnits=[],fe.get(e,t,["numberOfTextureUnits"]),fe.setGet(e,t,["context"]),ky(e,t)}var _y={newInstance:fe.newInstance(Gy,"vtkOpenGLTextureUnitManager"),extend:Gy};function Uy(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var r=e.getViewportByReference();return t.size[0]*(r[2]-r[0])/((r[3]-r[1])*t.size[1])},e.isInViewport=function(t,r,n){var a=n.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=r&&a[3]*o[1]>=r},e.getViewportSize=function(t){var r=t.getViewportByReference(),n=e.getFramebufferSize();return[(r[2]-r[0])*n[0],(r[3]-r[1])*n[1]]},e.getViewportCenter=function(t){var r=e.getViewportSize(t);return[.5*r[0],.5*r[1]]},e.displayToNormalizedDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t/a[0],r/a[1],n]},e.normalizedDisplayToDisplay=function(t,r,n){var a=e.getFramebufferSize();return[t*a[0],r*a[1],n]},e.worldToView=function(e,t,r,n){return n.worldToView(e,t,r)},e.viewToWorld=function(e,t,r,n){return n.viewToWorld(e,t,r)},e.worldToDisplay=function(t,r,n,a){var o=a.worldToView(t,r,n),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,r,n,a){var o=e.displayToNormalizedDisplay(t,r,n),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,r,n,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,r,n);return[i[0]-o[0]-.5,i[1]-o[1]-.5,n]},e.viewportToNormalizedViewport=function(t,r,n,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),r/(o[1]-1),n]:[t,r,n]},e.normalizedViewportToViewport=function(t,r,n,a){var o=e.getViewportSize(a);return[t*(o[0]-1),r*(o[1]-1),n]},e.displayToLocalDisplay=function(t,r,n){return[t,e.getFramebufferSize()[1]-r-1,n]},e.viewportToNormalizedDisplay=function(t,r,n,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=r+o[1]+.5;return e.displayToNormalizedDisplay(i,s,n)},e.getPixelData=function(e,t,r,n){fe.vtkErrorMacro("not implemented")},e.createSelector=function(){fe.vtkErrorMacro("not implemented")}}var Wy={size:void 0,selector:void 0};function jy(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,r),t.size||(t.size=[300,300]),fe.getArray(e,t,["size"],2),fe.get(e,t,["selector"]),Vs.extend(e,t,r),Uy(e,t)}var zy={newInstance:fe.newInstance(jy,"vtkRenderWindowViewNode"),extend:jy},Hy=fe.vtkDebugMacro,Ky=fe.vtkErrorMacro,Xy={position:"absolute",top:0,left:0,width:"100%",height:"100%"},qy=1,Yy=-.7,Zy=.25,Qy=-.5;function $y(e,t,r){var n=e.createFramebuffer(),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,r,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),o===e.FRAMEBUFFER_COMPLETE}var Jy=0,eb=[];function tb(){Jy++,eb.forEach((function(e){return e(Jy)}))}function rb(){Jy--,eb.forEach((function(e){return e(Jy)}))}function nb(e,t){t.classHierarchy.push("vtkOpenGLRenderWindow"),e.getViewNodeFactory=function(){return t.myFactory};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(r){if(r){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=_y.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);var r=t.context;r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),r.depthFunc(r.LEQUAL),r.enable(r.BLEND),t.initialized=!0}},e.makeCurrent=function(){t.context.makeCurrent()},e.setContainer=function(r){t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&Ky("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!==r&&(t.el=r,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(),r=e.width,n=e.height;t.containerSize=[r,n]}return t.containerSize||t.size},e.getFramebufferSize=function(){return t.activeFramebuffer?t.activeFramebuffer.getSize():t.size},e.getPixelData=function(e,r,n,a){var o=new Uint8Array((n-e+1)*(a-r+1)*4);return t.context.readPixels(e,r,n-e+1,a-r+1,t.context.RGBA,t.context.UNSIGNED_BYTE,o),o},e.get3DContext=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},n=null;void 0!==navigator.xr&&navigator.xr.isSessionSupported("immersive-vr")&&e.invokeHaveVRDisplay();var a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(n=t.canvas.getContext("webgl2",r))&&(t.webgl2=!0,Hy("using webgl2")),n||(Hy("using webgl1"),n=t.canvas.getContext("webgl",r)||t.canvas.getContext("experimental-webgl",r)),t.canvas.addEventListener("webglcontextlost",(function(e){e.preventDefault()}),!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),n},e.startXR=function(r){if(void 0===navigator.xr)throw new Error("WebXR is not available");t.xrSessionIsAR=r;var n=r?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(n))throw r?new Error("Device does not support AR session"):new Error("VR display is not available");if(null!==t.xrSession)throw new Error("XR Session already exists!");navigator.xr.requestSession(n).then(e.enterXR,(function(){throw new Error("Failed to create XR session!")}))},e.enterXR=function(){var n=Ph(Oh().mark((function n(a){var o,i;return Oh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.xrSession=a,t.oldCanvasSize=t.size.slice(),null===t.xrSession){n.next=15;break}return o=e.get3DContext(),n.next=6,o.makeXRCompatible();case 6:i=new r.g.XRWebGLLayer(t.xrSession,o),e.setSize(i.framebufferWidth,i.framebufferHeight),t.xrSession.updateRenderState({baseLayer:i}),t.xrSession.requestReferenceSpace("local").then((function(e){t.xrReferenceSpace=e})),e.resetXRScene(),t.renderable.getInteractor().switchToXRAnimation(),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),n.next=16;break;case 15:throw new Error("Failed to enter VR with a null xrSession.");case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),e.resetXRScene=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qy,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yy,n=e,a=r;t.xrSessionIsAR&&n===qy&&(n=Zy),t.xrSessionIsAR&&a===Yy&&(a=Qy);var o=t.renderable.getRenderers()[0];o.resetCamera();var i=o.getActiveCamera(),s=i.getPhysicalScale(),l=i.getPhysicalTranslation();a*=s/=n,l[2]+=a,i.setPhysicalScale(s),i.setPhysicalTranslation(l)},e.stopXR=Ph(Oh().mark((function r(){var n,a;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==navigator.xr){r.next=2;break}return r.abrupt("return");case 2:if(null===t.xrSession){r.next=10;break}return t.xrSession.cancelAnimationFrame(t.xrSceneFrame),t.renderable.getInteractor().returnFromXRAnimation(),(n=e.get3DContext()).bindFramebuffer(n.FRAMEBUFFER,null),r.next=9,t.xrSession.end().catch((function(e){if(!(e instanceof DOMException))throw e}));case 9:t.xrSession=null;case 10:void 0!==t.oldCanvasSize&&e.setSize.apply(e,f(t.oldCanvasSize)),(a=t.renderable.getRenderers()[0]).getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.traverseAllPasses();case 16:case"end":return r.stop()}}),r)}))),e.xrRender=function(){var r=Ph(Oh().mark((function r(n,a){var o,i,s,l,c;return Oh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=a.session,t.renderable.getInteractor().updateXRGamepads(o,a,t.xrReferenceSpace),t.xrSceneFrame=t.xrSession.requestAnimationFrame(e.xrRender),(i=a.getViewerPose(t.xrReferenceSpace))&&(s=e.get3DContext(),t.xrSessionIsAR&&void 0!==t.oldCanvasSize&&(s.canvas.width=t.oldCanvasSize[0],s.canvas.height=t.oldCanvasSize[1]),l=o.renderState.baseLayer,s.bindFramebuffer(s.FRAMEBUFFER,l.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),c=t.renderable.getRenderers()[0],i.views.forEach((function(r){var n=l.getViewport(r);if(s.viewport(n.x,n.y,n.width,n.height),!t.xrSessionIsAR)if("left"===r.eye)c.setViewport(0,0,.5,1);else{if("right"!==r.eye)return;c.setViewport(.5,0,1,1)}c.getActiveCamera().computeViewParametersFromPhysicalMatrix(r.transform.inverse.matrix),c.getActiveCamera().setProjectionMatrix(r.projectionMatrix),e.traverseAllPasses()})));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.restoreContext=function(){var t=Py.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(r){var n=t._textureResourceIds.get(r);if(void 0===n){var a=e.getTextureUnitManager().allocate();a<0?Ky("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(r,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+n)},e.deactivateTexture=function(r){var n=t._textureResourceIds.get(r);void 0!==n&&(e.getTextureUnitManager().free(n),t._textureResourceIds.delete(r))},e.getTextureUnitForTexture=function(e){var r=t._textureResourceIds.get(e);return void 0!==r?r:-1},e.getDefaultTextureInternalFormat=function(e,r,n){if(t.webgl2){if(e===i.UNSIGNED_CHAR)switch(r){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;default:return t.context.RGBA8}switch(r){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;default:return t.context.RGBA16F}}switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.resetCamera,o=void 0!==a&&a,i=n.size,s=void 0===i?null:i,l=n.scale,c=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=r;var u=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==c?s||t.size.map((function(e){return e*c})):null},new Promise((function(r,n){var a=e.onImageReady((function(n){if(null===t._screenshot.size)t.notifyStartCaptureImage=u,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach((function(e){return(0,e.restoreParamsFn)(e.arg)})),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(n);else{var i=document.createElement("img");if(i.style=Xy,i.src=n,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o){var s=!0!==o;t._screenshot.cameras=t.renderable.getRenderers().map((function(e){var t=e.getActiveCamera(),r=t.get("focalPoint","position","parallelScale");return{resetCameraArgs:s?{renderer:e}:void 0,resetCameraFn:s?o:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(r))}})),t._screenshot.cameras.forEach((function(e){return(0,e.resetCameraFn)(e.resetCameraArgs)}))}e.traverseAllPasses()}}))}))},e.getGLInformations=function(){for(var r=e.get3DContext(),n=r.getExtension("OES_texture_float"),a=r.getExtension("OES_texture_half_float"),o=r.getExtension("WEBGL_debug_renderer_info"),i=r.getExtension("WEBGL_draw_buffers"),s=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",r.getParameter(r.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",r.getParameter(r.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",r.getParameter(r.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&r.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",r.getParameter(r.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",r.getParameter(r.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",r.getParameter(r.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",r.getParameter(r.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",r.getParameter(r.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",r.getParameter(r.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",r.getParameter(r.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",r.getParameter(r.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",r.getParameter(r.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",r.getParameter(r.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",r.getParameter(r.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",r.getParameter(r.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",r.getParameter(r.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.UNSIGNED_BYTE)?"RGBA":"",n&&$y(r,r.RGB,r.UNSIGNED_BYTE)?"RGB":"",n&&$y(r,r.LUMINANCE,r.UNSIGNED_BYTE)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.UNSIGNED_BYTE)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&$y(r,r.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&$y(r,r.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&$y(r,r.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&$y(r,r.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&$y(r,r.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[n&&$y(r,r.RGBA,r.FLOAT)?"RGBA":"",n&&$y(r,r.RGB,r.FLOAT)?"RGB":"",n&&$y(r,r.LUMINANCE,r.FLOAT)?"LUMINANCE":"",n&&$y(r,r.ALPHA,r.FLOAT)?"ALPHA":"",n&&$y(r,r.LUMINANCE_ALPHA,r.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?r.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).precision," (-2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMin," - 2",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",r.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",r.getParameter(r.RENDERER)],["WebGL Vendor","VENDOR",r.getParameter(r.VENDOR)],["WebGL Version","VERSION",r.getParameter(r.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",r.getParameter(r.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&r.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],c={};l.length;){var d=u(l.pop(),3),f=d[0],p=d[1],g=d[2];p&&(c[p]={label:f,value:g})}return c},e.traverseAllPasses=function(){if(t.renderPasses)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,n=document.createElement("canvas"),a=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach((function(e){e.getViewProps().forEach((function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,r),zy.extend(e,t,r),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",tb(),t.selector||(t.selector=Qh.newInstance(),t.selector.setOpenGLRenderWindow(e)),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,t.myFactory=zs.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",ib),t.shaderCache=Ly.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=My.newInstance(),fe.event(e,t,"imageReady"),fe.event(e,t,"haveVRDisplay"),fe.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage","xrSupported"]),fe.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen","activeFramebuffer"]),fe.setGetArray(e,t,["size"],2),nb(e,t)}var ib=fe.newInstance(ob,"vtkOpenGLRenderWindow");my("WebGL",ib);var sb={newInstance:ib,extend:ob,pushMonitorGLContextCount:function(e){eb.push(e)},popMonitorGLContextCount:function(e){return eb.pop()}},lb=fe.vtkDebugMacro;function cb(e,t){t.classHierarchy.push("vtkCamera");var r=new Float64Array(3),n=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),o=Pa(new Float64Array(16)),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3),c=Pa(new Float64Array(16)),u=Pa(new Float64Array(16)),d=new Float64Array(3),p=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 r=e.getViewMatrix();t.viewUp[0]=r[4],t.viewUp[1]=r[5],t.viewUp[2]=r[6],e.modified()},e.setPosition=function(r,n,a){r===t.position[0]&&n===t.position[1]&&a===t.position[2]||(t.position[0]=r,t.position[1]=n,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(r,n,a){r===t.focalPoint[0]&&n===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=r,t.focalPoint[1]=n,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(r){if(t.distance!==r){t.distance=r,t.distance<1e-20&&(t.distance=1e-20,lb("Distance is set to minimum."));var n=t.directionOfProjection;t.focalPoint[0]=t.position[0]+n[0]*t.distance,t.focalPoint[1]=t.position[1]+n[1]*t.distance,t.focalPoint[2]=t.position[2]+n[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],r=t.focalPoint[1]-t.position[1],n=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+r*r+n*n),t.distance<1e-20){t.distance=1e-20,lb("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]=r/t.distance,t.directionOfProjection[2]=n/t.distance,g()},e.dolly=function(r){if(!(r<=0)){var n=t.distance/r;e.setPosition(t.focalPoint[0]-n*t.directionOfProjection[0],t.focalPoint[1]-n*t.directionOfProjection[1],t.focalPoint[2]-n*t.directionOfProjection[2])}},e.roll=function(r){var n=t.position,a=t.focalPoint,o=t.viewUp,i=new Float64Array([o[0],o[1],o[2],0]);Pa(c);var s=new Float64Array([a[0]-n[0],a[1]-n[1],a[2]-n[2]]);Da(c,c,Ce(r),s),ri(i,i,c),t.viewUp[0]=i[0],t.viewUp[1]=i[1],t.viewUp[2]=i[2],e.modified()},e.azimuth=function(r){var n=t.focalPoint;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.yaw=function(r){var n=t.position;Pa(u),Ra(u,u,n),Da(u,u,Ce(r),t.viewUp),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint(p[0],p[1],p[2])},e.elevation=function(r){var n=t.focalPoint,a=e.getViewMatrix(),o=[-a[0],-a[1],-a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(d,t.position,u),e.setPosition(d[0],d[1],d[2])},e.pitch=function(r){var n=t.position,a=e.getViewMatrix(),o=[a[0],a[1],a[2]];Pa(u),Ra(u,u,n),Da(u,u,Ce(r),o),Ra(u,u,[-n[0],-n[1],-n[2]]),Jn(p,t.focalPoint,u),e.setFocalPoint.apply(e,f(p))},e.zoom=function(r){r<=0||(t.parallelProjection?t.parallelScale/=r:t.viewAngle/=r,e.modified())},e.translate=function(r,n,a){var o=[r,n,a];Le(t.position,o,t.position),Le(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(r){var n=[].concat(f(t.viewUp),[1]),a=[],o=[],i=[];n[0]+=t.position[0],n[1]+=t.position[1],n[2]+=t.position[2],ri(a,[].concat(f(t.position),[1]),r),ri(o,[].concat(f(t.focalPoint),[1]),r),ri(i,n,r),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,f(a.slice(0,3))),e.setFocalPoint.apply(e,f(o.slice(0,3))),e.setViewUp.apply(e,f(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+n)},e.setThicknessFromFocalPoint=function(r){var n=r;n<1e-20&&(n=1e-20,lb("Thickness is set to minimum.")),e.setClippingRange(t.distance-n/2,t.distance+n/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,r,n=ii(e[0],e[1],e[2],e[3]),a=ni(),o=ii(0,0,1,0);return r=n,(t=a)[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],oi(o,n,o),oi(o,o,a),[o[0],o[1],o[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),Oa(t,t)},e.getWorldToPhysicalMatrix=function(e){Pa(e);var r=[3];_e(t.physicalViewNorth,t.physicalViewUp,r),e[0]=r[0],e[1]=r[1],e[2]=r[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],wa(e,e),In(i,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),Ea(e,e,i),Ra(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(c){Oa(o,c),Jn(i,r,o),e.computeDistance();var u=t.distance;e.setPosition(i[0],i[1],i[2]),Jn(s,n,o),En(s,s,i),Kn(s,s),e.setDirectionOfProjection(s[0],s[1],s[2]),Jn(l,a,o),En(l,l,i),Kn(l,l),e.setViewUp(l[0],l[1],l[2]),e.setDistance(u)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(o),Ia(o,t,o),e.computeViewParametersFromViewMatrix(o)},e.setViewMatrix=function(r){t.viewMatrix=r,t.viewMatrix&&(Sa(o,t.viewMatrix),e.computeViewParametersFromViewMatrix(o),wa(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;ao(o,t.position,t.focalPoint,t.viewUp),wa(o,o);var e=new Float64Array(16);return Sa(e,o),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,r,n){var a=new Float64Array(16);if(Pa(a),t.projectionMatrix){var s=1/t.physicalScale;return In(i,s,s,s),Sa(a,t.projectionMatrix),Ea(a,a,i),wa(a,a),a}Pa(o);var l=t.clippingRange[1]-t.clippingRange[0],c=[t.clippingRange[0]+(r+1)*l/2,t.clippingRange[0]+(n+1)*l/2];if(t.parallelProjection){var u=t.parallelScale*e,d=t.parallelScale,f=(t.windowCenter[0]-1)*u,p=(t.windowCenter[0]+1)*u,g=(t.windowCenter[1]-1)*d,m=(t.windowCenter[1]+1)*d;ro(o,f,p,g,m,c[0],c[1]),wa(o,o)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var v,h,y=Math.tan(Ce(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(v=t.clippingRange[0]*y,h=t.clippingRange[0]*y/e):(v=t.clippingRange[0]*y*e,h=t.clippingRange[0]*y);var b=(t.windowCenter[0]-1)*v,T=(t.windowCenter[0]+1)*v,S=(t.windowCenter[1]-1)*h,C=(t.windowCenter[1]+1)*h,x=c[0],P=c[1];o[0]=2*x/(T-b),o[5]=2*x/(C-S),o[2]=(b+T)/(T-b),o[6]=(S+C)/(C-S),o[10]=-(x+P)/(P-x),o[14]=-1,o[11]=-2*x*P/(P-x),o[15]=0}return Sa(a,o),a},e.getCompositeProjectionMatrix=function(t,r,n){var a=e.getViewMatrix(),o=e.getProjectionMatrix(t,r,n);return Ia(o,a,o),o},e.setDirectionOfProjection=function(e,r,n){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==r||t.directionOfProjection[2]!==n){t.directionOfProjection[0]=e,t.directionOfProjection[1]=r,t.directionOfProjection[2]=n;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(r,n,a,o){var i=[3];_e(t.physicalViewNorth,t.physicalViewUp,i);var s=Pa(new Float64Array(16));Da(s,s,Ce(r),t.physicalViewUp),Da(s,s,Ce(n),i),Da(s,s,Ce(a),t.physicalViewNorth),Da(s,s,Ce(-o),t.physicalViewUp);var l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),c=new Float64Array(t.physicalViewNorth);Jn(l,l,s),Jn(c,c,s),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(c[0],c[1],c[2]),e.modified()},e.setOrientationWXYZ=function(t,r,n,a){var o=Pa(new Float64Array(16));if(0!==t&&(0!==r||0!==n||0!==a)){var i=Ce(t),s=ni();ai(s,[r,n,a],i),Ya(o,s)}var l=new Float64Array(3);Jn(l,[0,0,-1],o);var c=new Float64Array(3);Jn(c,[0,1,0],o),e.setDirectionOfProjection.apply(e,f(l)),e.setViewUp.apply(e,f(c)),e.modified()},e.computeClippingRange=function(e){var r,n;r=t.viewPlaneNormal,n=t.position;for(var a=-r[0],o=-r[1],i=-r[2],s=-(a*n[0]+o*n[1]+i*n[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],c=0;c<2;c++)for(var u=0;u<2;u++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+u]+i*e[4+c]+s;l[0]=fl[1]?f:l[1]}return l}}var ub={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 db(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ub,r),fe.obj(e,t),fe.get(e,t,["distance"]),fe.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),fe.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),fe.setGetArray(e,t,["clippingRange","windowCenter"],2),fe.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),cb(e,t)}var fb={newInstance:fe.newInstance(db,"vtkCamera"),extend:db};function pb(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,gb,r),fe.obj(e,t),fe.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),fe.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),pb(e,t)}var vb={newInstance:fe.newInstance(mb,"vtkLight"),extend:mb,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]},hb=fe.vtkErrorMacro;function yb(e,t){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var n=e.getNestedProps();if(n&&n.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bb,r),fe.obj(e,t),fe.event(e,t,"event"),fe.setGetArray(e,t,["viewport"],4),fe.setGetArray(e,t,["background","background2"],3),yb(e,t)}var Sb={newInstance:fe.newInstance(Tb,"vtkViewport"),extend:Tb},Cb=k,xb=F,Pb=G;function wb(e){return function(){return xb("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}function Ob(e,t){t.classHierarchy.push("vtkRenderer");var r={type:"ComputeVisiblePropBoundsEvent",renderer:e},n={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(Cb("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var r=e.getActiveCameraAndResetIfCreated();t.lights.forEach((function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(r.getPositionByReference()),e.setFocalPointFrom(r.getFocalPointByReference()),e.modified(r.getMTime())):xb("light has unknown light type",e.get()))}))},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=wb("allocateTime"),e.updateGeometry=wb("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(r){Cb(e.getClassName(),e,"setting Layer to ",r),t.layer!==r&&(t.layer=r,e.modified()),e.setPreserveColorBuffer(!!r)},e.setActiveCamera=function(r){return t.activeCamera!==r&&(t.activeCamera=r,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:r}),!0)},e.makeCamera=function(){var t=fb.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(r){t.actors=t.actors.filter((function(e){return e!==r})),e.removeViewProp(r),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(r){t.volumes=t.volumes.filter((function(e){return e!==r})),e.removeViewProp(r),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach((function(t){e.removeViewProp(t)})),t.volumes=[],e.modified()},e.addLight=function(r){t.lights=[].concat(t.lights,r),e.modified()},e.removeLight=function(r){t.lights=t.lights.filter((function(e){return e!==r})),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(r){t.lights=r,e.modified()},e.makeLight=vb.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,r,n,a){var o=e.normalizedDisplayToProjection(t,r,n);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,r,n,a){var o=e.worldToView(t,r,n);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,r,n){if(null===t.activeCamera)return xb("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();Oa(a,a),wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.projectionToView=function(e,r,n,a){if(null===t.activeCamera)return xb("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);Oa(o,o),wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.worldToView=function(e,r,n){if(null===t.activeCamera)return xb("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();wa(a,a);var o=new Float64Array([e,r,n]);return Jn(o,o,a),o},e.viewToProjection=function(e,r,n,a){if(null===t.activeCamera)return xb("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var o=t.activeCamera.getProjectionMatrix(a,-1,1);wa(o,o);var i=new Float64Array([e,r,n]);return Jn(i,i,o),i},e.computeVisiblePropBounds=function(){t.allBounds[0]=Hr.INIT_BOUNDS[0],t.allBounds[1]=Hr.INIT_BOUNDS[1],t.allBounds[2]=Hr.INIT_BOUNDS[2],t.allBounds[3]=Hr.INIT_BOUNDS[3],t.allBounds[4]=Hr.INIT_BOUNDS[4],t.allBounds[5]=Hr.INIT_BOUNDS[5];var n=!0;e.invokeEvent(r);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 n&&(St(t.allBounds),Cb("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=r||e.computeVisiblePropBounds(),o=[0,0,0];if(!Ct(n))return Cb("Cannot reset camera!"),!1;var i=null;if(!e.getActiveCamera())return xb("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),o[0]=(n[0]+n[1])/2,o[1]=(n[2]+n[3])/2,o[2]=(n[4]+n[5])/2;var s=n[1]-n[0],l=n[3]-n[2],c=n[5]-n[4],u=(s*=s)+(l*=l)+(c*=c);u=0===u?1:u,u=.5*Math.sqrt(u);var d=Ce(t.activeCamera.getViewAngle()),f=u,p=u/Math.sin(.5*d),g=t.activeCamera.getViewUp();return Math.abs(Ge(g,i))>.999&&(Pb("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-g[2],g[0],g[1])),t.activeCamera.setFocalPoint(o[0],o[1],o[2]),t.activeCamera.setPosition(o[0]+p*i[0],o[1]+p*i[1],o[2]+p*i[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(f),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-o[0],-o[1],-o[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=r||e.computeVisiblePropBounds();if(!Ct(a))return Cb("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return xb("Trying to reset clipping range of non-existent camera"),!1;var o=t.activeCamera.computeClippingRange(a),i=0;if(t.activeCamera.getParallelProjection())i=.2*t.activeCamera.getParallelScale();else{var s=Ce(t.activeCamera.getViewAngle());i=.2*Math.tan(s/2)*o[1]}return o[1]-o[0]=o[1]?.01*o[1]:o[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),o[0]e&&(e=r);var n=t.createdLight?t.createdLight.getMTime():0;return n>e&&(e=n),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}var Ab={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:Dt(),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 Mb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Object.assign(t,Ab,r),Sb.extend(e,t,r),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1),Q(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),te(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),re(e,t,["actors","volumes","lights"]),ae(e,t,["background"],4,1),Ob(e,t)}var Ib={newInstance:ie(Mb,"vtkRenderer"),extend:Mb},Rb={Unknown:0,LeftController:1,RightController:2},Eb={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},Db={Device:Rb,Input:Eb,Axis:{Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4}};function Bb(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}function Vb(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],o=document,i=r?"addEventListener":"removeEventListener",s=r?"removeEventListener":"addEventListener";!a&&!r&&n>0&&--n,n&&!a||(n=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&r&&++n}function u(){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){Fb("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(r){t.interactorStyle!==r&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=r,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 kb("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer||a(0,0),t.currentRenderer},e.bindEvents=function(r){t.container=r,r.addEventListener("contextmenu",jb),r.addEventListener("wheel",e.handleWheel),r.addEventListener("DOMMouseScroll",e.handleWheel),r.addEventListener("mouseenter",e.handleMouseEnter),r.addEventListener("mouseleave",e.handleMouseLeave),r.addEventListener("mousemove",e.handleMouseMove),r.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),r.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){c(!1,!0),t.container.removeEventListener("contextmenu",jb),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.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var r=l(t);e.keyPressEvent(r)},e.handleKeyDown=function(t){var r=l(t);e.keyDownEvent(r)},e.handleKeyUp=function(t){var r=l(t);e.keyUpEvent(r)},e.handleMouseDown=function(t){if(!(t.button>2)){c(!0),jb(t);var r=Vb(Vb({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(r);break;case 1:e.middleButtonPressEvent(r);break;case 2:e.rightButtonPressEvent(r);break;default:Fb("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(n){void 0!==n?r.has(n)?kb("requester is already registered for animating"):(r.add(n),t.animationRequest||1!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Fb("undefined requester, can not start animating")},e.extendAnimation=function(n){var a=Date.now()+n;t._animationExtendedEnd=Math.max(t._animationExtendedEnd,a),t.animationRequest||0!==r.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())},e.isAnimating=function(){return t.xrAnimation||null!==t.animationRequest},e.cancelAnimation=function(n){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.has(n))r.delete(n),t.animationRequest&&0===r.size&&Date.now()>t._animationExtendedEnd&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=n&&n.getClassName?n.getClassName():n;kb("".concat(o," did not request an animation"))}},e.switchToXRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.xrAnimation=!0},e.returnFromXRAnimation=function(){t.xrAnimation=!1,0!==r.size&&(t.recentAnimationFrameRate=10,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateXRGamepads=function(r,n,a){r.inputSources.forEach((function(r){var o=null==r.gripSpace?null:n.getPose(r.gripSpace,a),i=r.gamepad,s=r.handedness;if(i){i.index in t.lastGamepadValues||(t.lastGamepadValues[i.index]={left:{buttons:{}},right:{buttons:{}}});for(var l=0;l1e3&&t._animationFrameCount>1&&(t.recentAnimationFrameRate=1e3*(t._animationFrameCount-1)/(n-t._animationStartTime),t.lastFrameTime=1/t.recentAnimationFrameRate,e.animationFrameRateUpdateEvent(),t._animationStartTime=n,t._animationFrameCount=1),e.animationEvent(),u(),r.size>0||Date.now()1){var n=i(r.touches);if(2===r.touches.length){var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",n)}else{var s={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(r){if(jb(r),t.recognizeGestures&&r.touches.length>1){var n=i(r.touches);e.recognizeGesture("TouchMove",n)}else{var a={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(r){if(jb(r),t.recognizeGestures)if(0===r.touches.length)if(1===r.changedTouches.length){var n={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(n),c(!1)}else{var a=i(r.changedTouches);e.recognizeGesture("TouchEnd",a),c(!1)}else if(1===r.touches.length){var s=i(r.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(r.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var u=i(r.touches);e.recognizeGesture("TouchMove",u)}else{var d={position:o(r.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),c(!1)}},e.setView=function(r){t.view!==r&&(t.view=r,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){var e,r,n;return null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r||null===(n=r.getRenderersByReference())||void 0===n?void 0:n[0]},e.findPokedRenderer=function(){var e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var o=null===(e=t.view)||void 0===e||null===(r=e.getRenderable())||void 0===r?void 0:r.getRenderers();if(!o)return null;o.sort((function(e,t){return e.getLayer()-t.getLayer()}));for(var i=null,s=null,l=null,c=o.length;c--;){var u=o[c];if(t.view.isInViewport(n,a,u)&&u.getInteractive()){l=u;break}null===i&&u.getInteractive()&&(i=u),null===s&&t.view.isInViewport(n,a,u)&&(s=u)}return null===l&&(l=i),null===l&&(l=s),null==l&&(l=o[0]),l},e.render=function(){e.isAnimating()||t.inRender||u()},Wb.forEach((function(r){var n=r.charAt(0).toLowerCase()+r.slice(1);e["".concat(n,"Event")]=function(n){if(t.enabled)if(e.getCurrentRenderer()){var a=Vb({type:r,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},n);e["invoke".concat(r)](a)}else _b("\n Can not forward events without a current renderer on the interactor.\n ")}})),e.recognizeGesture=function(r,n){if(!(Object.keys(n).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===r)return Object.keys(n).forEach((function(e){t.startingEventPositions[e]=n[e]})),void(t.currentGesture="Start");if("TouchEnd"===r)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,o=[],i=[];Object.keys(n).forEach((function(e){o[a]=n[e],i[a]=t.startingEventPositions[e],a++}));var s=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((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),c=xe(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),u=xe(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=u-c;u=u+180>=360?u-180:u+180,c=c+180>=360?c-180:c+180,Math.abs(u-c)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:n};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:n};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:n};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:n};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var S={scale:l/s,touches:n};e.pinchEvent(S)}if("Pan"===t.currentGesture){var C={translation:f,touches:n};e.panEvent(C)}}}},e.handleVisibilityChange=function(){t._animationStartTime=Date.now(),t._animationFrameCount=0},e.setCurrentRenderer=function(e){t._forcedRenderer=!!e,t.currentRenderer=e};var d=e.delete;e.delete=function(){for(;r.size;)e.cancelAnimation(r.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}var Hb={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,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{}};function Kb(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hb,r),fe.obj(e,t),t._animationExtendedEnd=0,fe.event(e,t,"RenderEvent"),Wb.forEach((function(r){return fe.event(e,t,r)})),fe.get(e,t,["initialized","container","interactorStyle","lastFrameTime","recentAnimationFrameRate","view"]),fe.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),zb(e,t)}var Xb=Vb({newInstance:fe.newInstance(Kb,"vtkRenderWindowInteractor"),extend:Kb,handledEvents:Wb},Db);function qb(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}function Yb(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jb,r),fe.obj(e,t),fe.event(e,t,"InteractionEvent"),fe.event(e,t,"StartInteractionEvent"),fe.event(e,t,"EndInteractionEvent"),fe.get(e,t,["interactor","enabled"]),fe.setGet(e,t,["priority","processEvents"]),$b(e,t)}var tT=Yb({newInstance:fe.newInstance(eT,"vtkInteractorObserver"),extend:eT},{computeWorldToDisplay:function(e,t,r,n){return e.getRenderWindow().getViews()[0].worldToDisplay(t,r,n,e)},computeDisplayToWorld:function(e,t,r,n){return e.getRenderWindow().getViews()[0].displayToWorld(t,r,n,e)}}),rT={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 nT(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 aT=rT.States,oT={Rotate:aT.IS_ROTATE,Pan:aT.IS_PAN,Spin:aT.IS_SPIN,Dolly:aT.IS_DOLLY,CameraPose:aT.IS_CAMERA_POSE,WindowLevel:aT.IS_WINDOW_LEVEL,Slice:aT.IS_SLICE};function iT(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(oT).forEach((function(r){fe.event(e,t,"Start".concat(r,"Event")),e["start".concat(r)]=function(){t.state===aT.IS_NONE&&(t.state=oT[r],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(r,"Event")]({type:"Start".concat(r,"Event")}))},fe.event(e,t,"End".concat(r,"Event")),e["end".concat(r)]=function(){t.state===oT[r]&&(t.state=aT.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(r,"Event")]({type:"End".concat(r,"Event")}),t.interactor.render())}})),e.handleKeyPress=function(e){var r=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),r.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()})),r.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()})),r.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach((function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()})),r.render()}}}var sT={state:aT.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function lT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sT,r),tT.extend(e,t,r),iT(e,t)}var cT=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fT,r),cT.extend(e,t,r),fe.setGet(e,t,["motionFactor","zoomFactor"]),dT(e,t)}var gT={newInstance:fe.newInstance(pT,"vtkInteractorStyleTrackballCamera"),extend:pT};function mT(e,t){var r=e.invokeResize;delete e.invokeResize,t.renderWindow=Ty.newInstance(),t.renderer=Ib.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=sb.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Xb.newInstance(),t.interactor.setInteractorStyle(gT.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,f(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),n=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*n),Math.floor(e.height*n)),r(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=fe.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}var vT={background:[.32,.34,.43],listenWindowResize:!0,container:null};function hT(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vT,r),fe.obj(e,t),fe.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),fe.event(e,t,"resize"),mT(e,t)}var yT={newInstance:fe.newInstance(hT),extend:hT},bT={PICKING_BUFFER:0,FRONT_BUFFER:1},TT={ViewTypes:{DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},RenderingTypes:bT,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}};function ST(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(r){var n=r.selectedState,a=r.representation;t.widgetState.activateOnly(n),t.activeState=n,n&&n.updateManipulator&&n.updateManipulator(),e.invokeActivateHandle({selectedState:n,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CT,r),fi.extend(e,t,r),tT.extend(e,t,r),fe.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),fe.get(e,t,["representations","widgetState"]),fe.event(e,t,"ActivateHandle"),ST(e,t)}var PT={newInstance:fe.newInstance(xT,"vtkAbstractWidget"),extend:xT};function wT(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,r,n,a,o){if(t.callback){var i=r.getCompositeProjectionMatrix(n,-1,1);wa(i,i);for(var s=e.getPoints(),l=new Float64Array(3),c=a.usize,u=a.vsize,d=c/2,f=u/2,p=[],g=0;g2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OT,r),Jp.extend(e,t,r),fe.setGet(e,t,["callback","useZValues"]),wT(e,t)}var MT={newInstance:fe.newInstance(AT,"vtkPixelSpaceCallbackMapper"),extend:AT},IT=0,RT=1,ET=fe.vtkErrorMacro,DT=fe.vtkWarningMacro;function BT(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var r={mtimes:{},states:[]};function n(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),kp.forEach((function(r){if(t[r]){var n="setRelativeCoincidentTopology".concat(r,"OffsetParameters");if(e[n]){var a=t[r],o=a.factor,i=a.offset;e[n](o,i)}}})))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var r=arguments.length,n=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return r.mtimes.representation===e.getMTime()&&r.mtimes.input===n.getMTime()||(r.mtimes.representation=e.getMTime(),r.mtimes.input=n.getMTime(),r.states=[],t.labels.forEach((function(e){r.states=r.states.concat(n.getStatesWithLabel(e)||[])}))),r.states},e.getSelectedState=function(t,r){var n=e.getRepresentationStates();return r0&&void 0!==arguments[0]?arguments[0]:bT.FRONT_BUFFER,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!0;switch(t.behavior){case IT:a=e===bT.PICKING_BUFFER||n;break;case RT:a=r;break;default:a=!0}for(var o=a,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,r),fi.extend(e,t,r),fe.algo(e,t,1,1),fe.get(e,t,["labels","coincidentTopologyParameters"]),fe.set(e,t,["displayScaleParams"]),fe.setGet(e,t,["scaleInPixels"]),BT(e,t)};var NT=function(e){return{name:e,attrs:{},eventListeners:{},textContent:null,children:[],setAttribute:function(e,t){this.attrs[e]=t},removeAttribute:function(e){delete this.attrs[e]},appendChild:function(e){this.children.push(e)},addEventListeners:function(e,t){this.eventListeners[e]=t}}};function kT(e){for(var t=document.createElementNS("http://www.w3.org/2000/svg",e.name),r=Object.keys(e.attrs),n=0;n=s;g--)p(g)}return r}var GT=TT.ViewTypes,_T=TT.RenderingTypes,UT=TT.CaptureOn,WT=fe.vtkErrorMacro,jT=fe.vtkWarningMacro,zT=NT,HT=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},KT=1;function XT(e){var t=e.getActiveCamera(),r=e.getRenderWindow(),n=r.getInteractor(),a=n.getView();return{renderer:e,renderWindow:r,interactor:n,apiSpecificRenderWindow:a,camera:t}}function qT(e,t){t.viewId||(t.viewId="view-".concat(KT++)),t.classHierarchy.push("vtkWidgetManager");var r,n=new WeakMap,a=new WeakMap,o=new WeakMap,i=[];function s(e){return e&&(e.isA("vtkAbstractWidget")?e:e.getWidgetForView({viewId:t.viewId}))}t.svgRoot=(t.viewId,(r=HT("svg")).setAttribute("style","position: absolute; top: 0; left: 0; width: 100%; height: 100%;"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r);var l=new WeakMap;function c(){var e=t.apiSpecificRenderWindow.getReferenceByName("el"),r=t.apiSpecificRenderWindow.getCanvas();e.insertBefore(t.svgRoot,r.nextSibling),"static"===window.getComputedStyle(e).position&&(e.style.position="relative")}function d(){var e=u(t.apiSpecificRenderWindow.getSize(),2),r=e[0],n=e[1],a=window.devicePixelRatio||1,o=String(r/a),i=String(n/a),s="0 0 ".concat(r," ").concat(n),l=t.svgRoot.getAttribute("width"),c=t.svgRoot.getAttribute("height"),d=t.svgRoot.getAttribute("viewBox");l!==o&&t.svgRoot.setAttribute("width",o),c!==i&&t.svgRoot.setAttribute("height",i),d!==s&&t.svgRoot.setAttribute("viewBox",s)}function f(){if(t.useSvgLayer)for(var e=function(e){var r=t.widgets[e],n=r.getRepresentations().filter((function(e){return e.isA("vtkSVGRepresentation")})),i=[];r.getVisibility()&&(i=n.filter((function(e){return e.getVisibility()})).map((function(e){return e.render()})));var s=Promise.all(i),c=l.get(r)||[];c.push(s),l.set(r,c),s.then((function(e){var n=l.get(r)||[],i=n.indexOf(s);if(!t.deleted&&!r.isDeleted()&&-1!==i){n=n.slice(i+1),l.set(r,n);for(var c=o.get(r),u=zT("g"),d=0;dc[2]||ac[3])){r.next=23;break}return r.next=23,h(n,a,n,a);case 23:t.selections=t._capturedBuffers.generateSelection(n,a,n,a);case 24:return r.abrupt("return",e.getSelectedData());case 25:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),e.updateSelectionFromXY=function(e,r){if(jT("updateSelectionFromXY is deprecated, please use getSelectedDataForXY"),t.pickingEnabled){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,YT,r),fe.obj(e,t),fe.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:GT}]),fe.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),qT(e,t)}var QT={newInstance:fe.newInstance(ZT,"vtkWidgetManager"),extend:ZT,Constants:TT};function $T(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}function JT(e){for(var t=1;t1&&(m[e]=fe.chain.apply(fe,f(t)))}))})),m.delete=fe.chain((function(){delete r[a]}),m.delete),m.setInteractor(u);var h=Object.freeze(m);return r[a]=h,h}return r[a]},e.getViewIds=function(){return Object.keys(r)},e.setVisibility=function(e){for(var t=Object.keys(r),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oS,r),fe.obj(e,t),fe.setGetArray(e,t,["normal","origin"],3),aS(e,t)}var sS={intersectDisplayWithPlane:nS,extend:iS,newInstance:fe.newInstance(iS,"vtkPlaneManipulator")};function lS(e,t,r,n,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Ne(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];_e(n,s,l),_e(l,s,l);var c=Ge([i[0]-r[0],i[1]-r[1],i[2]-r[2]],l),u=Ge(l,n),d=n.slice();return ke(d,c/u),Le(r,d,d),d}function cS(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,r){return lS(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,r)}}var uS={origin:[0,0,0],normal:[0,0,1]};function dS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uS,r),fe.obj(e,t),fe.setGetArray(e,t,["origin","normal"],3),cS(e,t)}var fS={projectDisplayToLine:lS,extend:dS,newInstance:fe.newInstance(dS,"vtkLineManipulator")},pS={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function gS(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 mS=pS.OrientationModes,vS=pS.ScaleModes,hS=fe.vtkErrorMacro;function yS(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return fe.enumToString(mS,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode(mS.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode(mS.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode(mS.MATRIX)},e.getOrientationArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.orientationArray?r.getPointData().getArray(t.orientationArray):r.getPointData().getVectors():null},e.getScaleModeAsString=function(){return fe.enumToString(vS,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(vS.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(vS.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(vS.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var r=e.getInputData(0);return r&&r.getPointData()?t.scaleArray?r.getPointData().getArray(t.scaleArray):r.getPointData().getScalars():null},e.getBounds=function(){var r=e.getInputData(0),n=e.getInputData(1);return r&&n?(e.buildArrays(),t.bounds):Dt()},e.buildArrays=function(){var r=e.getInputData(0),n=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=u[0]),u[1]>t.bounds[3]&&(t.bounds[3]=u[1]),u[2]>t.bounds[5]&&(t.bounds[5]=u[2]);var M=new Float32Array(y,36*T,9);yo(M,S),wo(M,M),Po(M,M)}var I=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var R=e.getLookupTable();R&&I&&(R.build(),t.colorArray=R.mapScalars(I,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),r=e.getInputData().getPoints().getNumberOfValues()/3;return{points:r*t.getPoints().getNumberOfValues()/3,verts:r*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:r*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:r*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}var bS={orient:!0,orientationMode:mS.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:vS.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function TS(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bS,r),Jp.extend(e,t,r),fe.algo(e,t,2,0),t.buildTime={},fe.obj(t.buildTime,{mtime:0}),t.boundsTime={},fe.obj(t.boundsTime,{mtime:0}),fe.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),fe.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),yS(e,t)}var SS=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=xS(xS({},wS),r);LT(e,t,n),fe.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),PS(0,t)};function AS(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,r){if(!t.deleted){var n=r[0],a=n?n.getPoints().getDataType():t.pointType;n=hm.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var c=t.startPhit.startPhi?t.endPhi:t.startPhi;u*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=fe.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var S=t.phiResolution-o,C=(u-c)/(t.phiResolution-1),x=0;x=180)for(var E=S-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,MS,r),fe.obj(e,t),fe.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),fe.setGetArray(e,t,["center"],3),fe.algo(e,t,0,1),AS(e,t)}var RS={newInstance:fe.newInstance(IS,"vtkSphereSource"),extend:IS};function ES(e,t){function r(r){if(t.displayCallback){for(var n=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DS,r),OS(e,t,r),fe.get(e,t,["glyph","mapper","actor"]),ES(e,t)}var VS={newInstance:fe.newInstance(BS,"vtkSphereHandleRepresentation"),extend:BS};function LS(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}function NS(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n=NS(NS({},FS),r);LT(e,t,n),kS(0,t)},_S=fe.vtkErrorMacro,US=[2,0,1,2,0,2,2,0,4,2,1,3,2,1,5,2,2,3,2,2,6,2,3,7,2,4,5,2,4,6,2,5,7,2,6,7];function WS(e,t){var r;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=hm.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(US)),t.mapper=Jp.newInstance({scalarVisibility:!1}),t.actor=Cp.newInstance({parentProp:e}),(r=t.actor.getProperty()).setEdgeColor.apply(r,f(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(r,n){var a=e.getRepresentationStates(r[0]).filter((function(e){return e.getOrigin&&e.getOrigin()}));if(8===a.length){for(var o=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jS,r),GS(e,t,r),fe.setGetArray(e,t,["edgeColor"],3),fe.get(e,t,["mapper","actor"]),WS(e,t)}var HS={newInstance:fe.newInstance(zS,"vtkCroppingOutlineRepresentation"),extend:zS},KS=["-","=","+"];function XS(e,t){var r=new Float64Array(3);return Jn(r,e,t),r}function qS(e,t){var r=Pn(),n=ni();return Ka(n,t),ta(r,e,n),r}function YS(e){var t=u(e.split("").map((function(e){return KS.indexOf(e)-1})),3),r=t[0],n=t[1],a=t[2];return r*n*a!=0?"corners":r*n!=0||n*a!=0||a*r!=0?"edges":"faces"}function ZS(e,t){var r=null;e.setDisplayCallback=function(e){return t.representations[0].setDisplayCallback(e)},e.handleLeftButtonPress=function(){return t.activeState&&t.activeState.getActive()&&t.pickable?(r=!0,t.interactor.requestAnimation(e),fe.EVENT_ABORT):fe.VOID},e.handleMouseMove=function(n){return r&&t.pickable&&t.dragable?e.handleEvent(n):fe.VOID},e.handleLeftButtonRelease=function(){r&&t.pickable&&(r=!1,t.interactor.cancelAnimation(e),t.widgetState.deactivate())},e.handleEvent=function(e){if(t.pickable&&t.activeState&&t.activeState.getActive()){var r=t.activeState.getManipulator();if(r){var n=t.activeState.getName(),a=YS(n),o=n.split("").map((function(e){return KS.indexOf(e)})),i=t.widgetState.getCroppingPlanes().getPlanes(),s=t.widgetState.getIndexToWorldT(),l=[];if("corners"===a&&(r.setNormal(t.camera.getDirectionOfProjection()),l=r.handleEvent(e,t.apiSpecificRenderWindow)),"faces"===a){var c=[1-o[0],1-o[1],1-o[2]],u=[(i[0]+i[1])/2,(i[2]+i[3])/2,(i[4]+i[5])/2];r.setOrigin(XS(u,s)),r.setNormal(qS(c,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if("edges"===a){var d=o.map((function(e){return 1===e?e:0}));r.setNormal(qS(d,s)),l=r.handleEvent(e,t.apiSpecificRenderWindow)}if(l.length){for(var p,g,m=XS(l,t.widgetState.getWorldToIndexT()),v=0;v<3;v++)0===o[v]?i[2*v]=m[v]:2===o[v]&&(i[2*v+1]=m[v]);return(p=t.activeState).setOrigin.apply(p,f(l)),(g=t.widgetState.getCroppingPlanes()).setPlanes.apply(g,f(i)),fe.EVENT_ABORT}}}return fe.VOID},t.camera=t.renderer.getActiveCamera(),t.classHierarchy.push("vtkImageCroppingWidgetProp")}var QS="default";function $S(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}function JS(e,t){t.classHierarchy.push("vtkWidgetState");var r=[];t.labels={},t.nestedStates=[],e.bindState=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[QS];if(t.nestedStates.push(n),r.push(n.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,eC,r),fe.obj(e,t),fe.setGet(e,t,["active"]),JS(e,t)};function rC(e,t){var r=[],n=f(Hr.INIT_BOUNDS);e.containsPoint=function(e,t,r){return Array.isArray(e)?Hr.containsPoint(n,e[0],e[1],e[2]):Hr.containsPoint(n,e,t,r)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];r[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(r[0]+r[1])/2,(r[2]+r[3])/2,(r[4]+r[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(r[i]-s)*t.placeFactor+s}Hr.setBounds(n,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}var nC={bounds:[-1,1,-1,1,-1,1],placeFactor:1},aC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nC,r),fe.setGetArray(e,t,["bounds"],6),fe.get(e,t,["placeFactor"]),fe.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),rC(e,t)}},oC={color:.5},iC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oC,r),fe.setGet(e,t,["color"])}};function sC(e,t){e.translate=function(t,r,n){var a=u(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+r,s+n)}}var lC={corner:[0,0,0]},cC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lC,r),fe.setGetArray(e,t,["corner"],3),sC(e)}},uC=function(e){return e},dC=Pa(new Float64Array(16)),fC=1e-6,pC=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];S(this,t),this.matrix=Pa(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?xn:uC}return x(t,[{key:"rotateFromDirections",value:function(e,t){var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(16);In(r,e[0],e[1],e[2]),In(n,t[0],t[1],t[2]),Kn(r,r),Kn(n,n);var o=Xn(r,n);return o>=1||(qn(this.tmp,r,n),On(this.tmp)1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(tt(dC,this.matrix))return this;for(var n=-1===r?e.length:t+3*r,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hC,r),fe.setGetArray(e,t,["direction"],3),vC(e,t)}};function bC(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,r=t.normal,n=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),n&&l?l(n):n&&!r&&s?s(n):r&&l&&l(r)}}}var TC={manipulator:null},SC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,TC,r),fe.setGet(e,t,["manipulator"]),bC(e,t)}},CC={name:""},xC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CC,r),fe.setGet(e,t,["name"])}};function PC(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function wC(e,t){var r={o:[],p1:[],p2:[]};e.normalize=function(){We(t.up),We(t.right),We(t.direction),e.modified()},e.updateFromOriginRightUp=function(n,a,o){(function(e,t,r,n){return PC(e,n.o)&&PC(t,n.p1)&&PC(r,n.p2)})(n,a,o,r)||(r.o=n.slice(),r.p1=a.slice(),r.p2=o.slice(),t.up=[o[0]-n[0],o[1]-n[1],o[2]-n[2]],t.right=[a[0]-n[0],a[1]-n[1],a[2]-n[2]],_e(t.up,t.right,t.direction),_e(t.direction,t.up,t.right),e.normalize(),e.modified())}}var OC={up:[0,1,0],right:[1,0,0],direction:[0,0,1]},AC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,r),fe.setGetArray(e,t,["up","right","direction"],3),wC(e,t)}};function MC(e,t){e.translate=function(t,r,n){var a=u(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+r,s+n)}}var IC={origin:null},RC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,IC,r),fe.setGetArray(e,t,["origin"],3),MC(e)}},EC={scale1:.5},DC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,EC,r),fe.setGet(e,t,["scale1"])}},BC={scale3:[1,1,1]},VC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,BC,r),fe.setGetArray(e,t,["scale3"],3)}},LC={text:"DefaultText"},NC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,r),fe.setGet(e,t,["text"])}},kC={visible:!0},FC={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kC,r),fe.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},GC={shape:""},_C={extend:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,GC,r),fe.setGet(e,t,["shape"])}},UC=fe.vtkErrorMacro,WC={bounds:aC,color:iC,corner:cC,direction:yC,manipulator:SC,name:xC,orientation:AC,origin:RC,scale1:DC,scale3:VC,text:NC,visible:FC,shape:_C};function jC(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];a||tC(r,n,t);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ex,r),rS.extend(e,t,r),JC(e,t)}var rx={newInstance:fe.newInstance(tx,"vtkImageCroppingWidget"),extend:tx},nx=fe.vtkErrorMacro;function ax(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,f(t.getExtent()))},e.requestData=function(e,r){var n=e[0];if(n){var a=n.getPointData().getScalars();if(a){var o=n.getExtent(),i=t.croppingPlanes&&6===t.croppingPlanes.length?o.map((function(e,r){return r%2==0?Math.max(e,Math.round(t.croppingPlanes[r])):Math.min(e,Math.round(t.croppingPlanes[r]))})):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=ei.newInstance();return s.shallowCopy(n),void(r[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var c=[i[2*l+1],i[2*l]];i[2*l]=c[0],i[2*l+1]=c[1]}for(var u=0;u<6;u+=2)i[u]=Math.max(i[u],o[u]),i[u+1]=Math.min(i[u+1],o[u+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=n.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,S=i[4];S<=i[5];++S)for(var C=i[2];C<=i[3];++C){var x=h+(C-o[2])*m+(S-o[4])*v,P=x+y,w=p.subarray(x,P);b.set(w,T),T+=w.length}var O=ei.newInstance({extent:i,origin:n.getOrigin(),direction:n.getDirection(),spacing:n.getSpacing()}),A=qt.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(A),r[0]=O}else nx("No scalars from input")}else nx("Invalid or missing input")},e.isResetAvailable=function(){if(null==t.croppingPlanes||0===t.croppingPlanes.length)return!1;var r=e.getInputData();if(r){var n=r.getExtent().find((function(e,r){return Math.abs(t.croppingPlanes[r]-e)>Number.EPSILON}));return void 0!==n}return!1}}var ox={};fe.newInstance((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ox,r),fe.obj(e,t),fe.algo(e,t,1,1),fe.setGetArray(e,t,["croppingPlanes"],6),ax(e,t)}),"vtkImageCropFilter");var ix=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){ix[e.Name]=e}));var sx=Object.keys(ix);sx.sort();var lx,cx,ux={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(ix[e.Name]||(sx.push(e.Name),sx.sort()),ix[e.Name]=e)},removePresetByName:function(e){var t=sx.indexOf(e);t>-1&&sx.splice(t,1),delete ix[e]},getPresetByName:function(e){return ix[e]},rgbPresetNames:sx},dx=r(146),fx=r.n(dx),px=(lx=function(){!function(){var e={exports:{}},t=function(){function e(e,t){for(var r=0;r1?t-1:0),n=1;n1?t-1:0),a=1;a1?r-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:[];r([0,e,t,n],a)},v=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([1,e,t,n])};return self.addEventListener("message",(function(e){var t=e.data;Array.isArray(t)?p.apply(void 0,s(t)):t&&t.eventName&&n.emitLocally.apply(n,[t.eventName].concat(s(t.args)))})),n},e.exports.TransferableResponse=f;var p=e.exports;p((function(e,t){var r=e.array,n=e.min,a=e.max,o=e.component||0,i=e.numberOfComponents||1,s=e.numberOfBins,l=a-n,c=new Float32Array(s);c.fill(0);for(var u=r.length,d=o;d1&&void 0!==arguments[1]?arguments[1]:256,r=[];r.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=1,h=i*(c<1?c*m+(1-c)*g:(2-c)*m+(c-1)*v);h>r[u]&&(r[u]=h)}}return r}function Sx(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(r.length-1),i=!!n.fillStyle,s=a+t[1];e.lineWidth=n.lineWidth,e.strokeStyle=n.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[n[0]+(e-r[0])/r[2]*(n[1]-n[0]),(t-r[1])/r[3]]}function xx(e,t){var r=t.map((function(t){return Math.abs(t.position-e)})),n=Math.min.apply(Math,f(r));return r.indexOf(n)}function Px(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(r){var n=r.offsetX,a=r.offsetY;t&&r.preventDefault(),e(n,a)}}function wx(){yx.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,f(e.singleTouche))})),e.ts=0,e.count=0,e.touches=0,e.ready=!1}))}function Ox(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,(function(e){return[e.pageX-o.left,e.pageY-o.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(yx[e].timeout),yx[e].ts=a.timeStamp,yx[e].singleTouche=i,yx[e].touches=a.touches.length):"touchmove"===a.type?(yx[e].ts=0,yx[e].count=0,yx[e].ready=!1):"touchend"===a.type&&(a.timeStamp-yx[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=n.numberOfBinToConsiders,o=void 0===a?1:a,i=n.numberOfBinsToSkip,s=void 0===i?1:i,l=n.numberOfComponents,c=void 0===l?1:l,d=n.component,f=void 0===d?0:d;t.histogram=null,t.histogramArray=r,t.dataRange=Ie(r,f,c);var p=u(t.dataRange,2),g=p[0],m=p[1],v=4,h=Math.floor(r.length/v)||1;h+=h%c;for(var y=0,b=[],T=[];yn;)a.shift();for(var l=a.reduce((function(e,t){return e+t}),0)/n,c=0,u=t.histogram.length;c1){for(var s=t.style.iconSize+t.style.padding,l=s,c=0;n>l;)c+=1,l+=s;switch(c){case 0:var d=e.addGaussian(0,1,.1,0,0),f=t.gaussians[d],p=mx({},f),g=bx.adjustPosition;t.activeGaussian=d,t.selectedGaussian=d,fe.setImmediate((function(){e.onDown(r,n),t.dragAction={originalXY:[0,0],action:g,gaussian:f,originalGaussian:p}}));break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var m=xx(o,t.gaussians);m!==t.selectedGaussian&&(t.selectedGaussian=m,e.modified())}return!0},e.onHover=function(r,n){var a=20/t.canvas.height,o=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=u(Cx(r,n,t.graphArea),1)[0],c=i<0?t.selectedGaussian:xx(i,t.gaussians);t.canvas.style.cursor="default";var d=t.gaussians[c];if(t.enableRangeZoom&&l>=0&&nt.rangeZoom[1]-f?t.canvas.style.cursor=hx.adjustZoom:t.canvas.style.cursor=hx.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:bx.adjustZoom}}else if(d&&l>=0){var p,g=1-s;p=g>d.height+a?"adjustPosition":g>d.height-a?Math.abs(i-d.position).5*d.height+a?"adjustPosition":g>.5*d.height-a?Math.abs(i-d.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=hx[p];var m=bx[p],v=mx({},d);t.dragAction={originalXY:[i,s],action:m,gaussian:d,originalGaussian:v}}return c!==t.activeGaussian&&(t.activeGaussian=c,e.modified()),!0},e.onDown=function(r,n){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(r,n){if(t.dragAction){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,mx({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=Tx(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(r,n){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(r,n){return e.onUp(r,n),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(r,n){var a=u(Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(r,n){var a=Cx(r,n,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=xx(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var r=function(){return!!t.mouseIsDown},n=function(){for(var e=yx.length,t=arguments.length,r=new Array(t),n=0;n1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),c=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(c-o/2,c,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c),e.stroke(),e.moveTo(c-o/2,c-l+t.style.strokeWidth+2),e.lineTo(c-o/2,c+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(c-o/2,c+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(c-l+t.style.strokeWidth+2-o/2,c+o/2+t.style.iconSize),e.lineTo(c+l-t.style.strokeWidth-2-o/2,c+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&Sx(e,i,Mx(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),Sx(e,i,Mx(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var d=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,r,n){var a=n||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(r[0],r[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var c=256*t*4,u=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[r[0]+a*n,r[0]+o*n]};var r=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var n=r(e);return n&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),n};var n=e.setRangeZoom;e.setRangeZoom=function(){var e=n.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified((function(){return e.render()})),e.setSize.apply(e,f(t.size))}var Ex={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 Dx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ex,r),fe.obj(e,t),fe.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),fe.setGetArray(e,t,["rangeZoom"],2),fe.get(e,t,["size","canvas","gaussians"]),fe.event(e,t,"opacityChange"),fe.event(e,t,"animation"),fe.event(e,t,"zoomChange"),Rx(e,t)}var Bx=mx({newInstance:fe.newInstance(Dx,"vtkPiecewiseGaussianWidget"),extend:Dx},Ix);function Vx(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,r){var n=e.computeWorldToDisplay(r,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=n[0],t.displayCenter[1]=n[1]}}var Lx={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]},Nx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lx,r),fe.setGet(e,t,["rotationFactor"]),fe.setGetArray(e,t,["displayCenter"],2),fe.setGetArray(e,t,["center"],3),Vx(e,t)};function kx(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,r){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,r){},e.onStartScroll=function(e,t,r){},e.onScroll=function(e,t,r){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}var Fx={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1},Gx=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fx,r),fe.setGet(e,t,["button","shift","control","alt"]),fe.set(e,t,["dragEnabled","scrollEnabled"]),kx(e,t)};function _x(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var r=new Float64Array(3),n=new Float64Array(3),a=new Float64Array(3),o=new Float64Array(16),i=new Float64Array(3),s=new Float64Array(3),l=new Float64Array(3);e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,c,u){if(u){var d=c.getActiveCamera(),f=d.getPosition(),p=d.getFocalPoint();Pa(o);var g=t.center,m=t.rotationFactor;t.useFocalPointAsCenterOfRotation&&(g[0]=p[0],g[1]=p[1],g[2]=p[2]);var v=t.previousPosition.x-u.x,h=t.previousPosition.y-u.y,y=e.getView().getSize(),b=d.getViewUp();if(t.useWorldUpVec){var T=new Float64Array(3);Mn(T,t.worldUpVec),ke(T,Ge(f,t.worldUpVec)/Ge(t.worldUpVec,t.worldUpVec)),Le(g,T,T),Ra(o,o,T),Da(o,o,Ce(360*v/y[0]*m),t.worldUpVec),T[0]=-T[0],T[1]=-T[1],T[2]=-T[2],Ra(o,o,T),Ra(o,o,g)}else Ra(o,o,g),Da(o,o,Ce(360*v/y[0]*m),b);_e(d.getDirectionOfProjection(),b,i),Da(o,o,Ce(-360*h/y[1]*m),i),s[0]=-g[0],s[1]=-g[1],s[2]=-g[2],Ra(o,o,s),Jn(r,f,o),Jn(n,p,o),l[0]=b[0]+f[0],l[1]=b[1]+f[1],l[2]=b[2]+f[2],Jn(a,l,o),d.setPosition(r[0],r[1],r[2]),d.setFocalPoint(n[0],n[1],n[2]),d.setViewUp(a[0]-r[0],a[1]-r[1],a[2]-r[2]),d.orthogonalizeViewUp(),c.resetCameraClippingRange(),e.getLightFollowCamera()&&c.updateLightsGeometryToFollowCamera(),t.previousPosition=u}}}var Ux={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function Wx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ux,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["useWorldUpVec"]),fe.setGetArray(e,t,["worldUpVec"],3),fe.setGet(e,t,["useFocalPointAsCenterOfRotation"]),_x(e,t)}var jx={newInstance:fe.newInstance(Wx,"vtkMouseCameraTrackballRotateManipulator"),extend:Wx};function zx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n},e.onMouseMove=function(e,r,n){if(n){var a=n,o=t.previousPosition;t.previousPosition=n;var i=r.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var c=i.getViewUp(),u=[0,0,0];_e(i.getViewPlaneNormal(),c,u);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=u[0]*(f*=2*g)+c[0]*p;s[0]+=m,l[0]+=m,m=u[1]*f+c[1]*p,s[1]+=m,l[1]+=m,m=u[2]*f+c[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(r,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(r,a.x,a.y,y),T=h.computeDisplayToWorld(r,o.x,o.y,y),S=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],C=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(S[0],S[1],S[2]),i.setFocalPoint(C[0],C[1],C[2])}r.resetCameraClippingRange(),e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}}var Hx={};function Kx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hx,r),fe.obj(e,t),Nx(e,t,r),Gx(e,t,r),zx(e,t)}var Xx={newInstance:fe.newInstance(Kx,"vtkMouseCameraTrackballPanManipulator"),extend:Kx};function qx(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView().getSize(),o=r.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,r,n){if(n){var a=t.previousPosition.y-n.y,o=r.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),c=o.getDirectionOfProjection(),u=a*t.zoomScale,d=u*c[0];s[0]+=d,l[0]+=d,d=u*c[1],s[1]+=d,l[1]+=d,d=u*c[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),r.resetCameraClippingRange()}e.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),t.previousPosition=n}},e.onScroll=function(e,t,r){if(r){var n=t.getActiveCamera(),a=1-r/10;n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}var Yx={zoomScale:0,flipDirection:!1};function Zx(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yx,r),fe.obj(e,t),Gx(e,t,r),Nx(e,t,r),fe.setGet(e,t,["flipDirection"]),qx(e,t)}var Qx={newInstance:fe.newInstance(Zx,"vtkMouseCameraTrackballZoomManipulator"),extend:Zx};function $x(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var r=new Map;function n(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var n=e.getValue(),a=t*e.scale+r.get(e),o=n+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==n?(e.setValue(o),r.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?r.set(e,0):r.set(e,a)}e.setHorizontalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(n,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:n,max:a,step:o,getValue:c,setValue:s,scale:l},r.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(r.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(r.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(r.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,r,n){t.previousPosition=n;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(r);t.containerSize=i.map((function(e){return e*o}))},e.onMouseMove=function(e,r,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=n(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],c=n(t.verticalListener,l);a(t.verticalListener,c)}t.previousPosition=o}},e.onScroll=function(e,r,n){t.scrollListener&&n&&a(t.scrollListener,n*t.scrollListener.step)},e.onStartScroll=e.onScroll}var Jx={horizontalListener:null,verticalListener:null,scrollListener:null};function eP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jx,r),fe.obj(e,t),Gx(e,t,r),$x(e,t)}var tP={newInstance:fe.newInstance(eP,"vtkMouseRangeManipulator"),extend:eP};function rP(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 nP=fe.vtkDebugMacro,aP=cT.States,oP={type:"StartInteractionEvent"},iP={type:"InteractionEvent"},sP={type:"EndInteractionEvent"};function lP(e,t,r,n,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],c=t.getInteractorStyle().computeDisplayToWorld(e,r,n,l),u=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[u[0]-c[0],u[1]-c[1],u[2]-c[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var cP={dollyToPosition:function(e,t,r,n){var a=r.getActiveCamera();if(a.getParallelProjection()){var o=n.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,c=t.y;lP(r,n,i,s,l,c),a.setParallelScale(a.getParallelScale()/e),lP(r,n,l,c,i,s)}else{var u=a.getFocalPoint(),d=a.getViewPlaneNormal();u=n.getInteractorStyle().computeWorldToDisplay(r,u[0],u[1],u[2]);var f=n.getInteractorStyle().computeDisplayToWorld(r,t.x,t.y,u[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),r.resetCameraClippingRange();var p=a.getPosition();u=a.getFocalPoint();var g=[0,0,0],m=d[0]*(u[0]-p[0])+d[1]*(u[1]-p[1])+d[2]*(u[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),r.resetCameraClippingRange()}},translateCamera:lP,dollyByFactor:function(e,t,r){if(!Number.isNaN(r)){var n=t.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/r):(n.dolly(r),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};function uP(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var r=function(t,r){var n=r.indexOf(t);return-1!==n&&(r.splice(n,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return r(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return r(e,t.gestureManipulators)};var n=function(t,r){return-1===r.indexOf(t)&&(r.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return n(e,t.vrManipulators)},e.addGestureManipulator=function(e){return n(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(1,r)},e.handleMiddleButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(2,r)},e.handleRightButtonPress=function(r){t.previousPosition=r.position,e.onButtonDown(3,r)},e.handleButton3D=function(r){r&&(t.currentManipulator=e.findVRManipulator(r.device,r.input,r.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,r.pokedRenderer,t.state,r.device,r.input,r.pressed),r.pressed?e.startCameraPose():e.endCameraPose()):nP("No manipulator found"))},e.handleMove3D=function(r){t.currentManipulator&&t.state===aP.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,r.pokedRenderer,t.state,r)},e.onButtonDown=function(r,n){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(r,n.shiftKey,n.controlKey,n.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,n.pokedRenderer,n.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(oP)):nP("No manipulator found"))},e.findMouseManipulator=function(e,r,n,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===r&&s.getControl()===n&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,r){for(var n=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===r&&(n=o)}return n},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(r){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===r&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(sP))},e.handleStartMouseWheel=function(r){if(!t.currentWheelManipulator){for(var n=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===r.shiftKey&&o.getControl()===r.controlKey&&o.getAlt()===r.altKey&&(n=o)}n?(t.currentWheelManipulator=n,t.currentWheelManipulator.onStartScroll(t.interactor,r.pokedRenderer,r.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(oP)):nP("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(sP))},e.handleMouseWheel=function(r){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,r.pokedRenderer,r.spinY,t.cachedMousePosition),e.invokeInteractionEvent(iP))},e.handleMouseMove=function(r){t.cachedMousePosition=r.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,r.pokedRenderer,r.position),e.invokeInteractionEvent(iP))},e.handleKeyPress=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyPress})).forEach((function(n){n.onKeyPress(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyDown=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyDown})).forEach((function(n){n.onKeyDown(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleKeyUp=function(r){t.keyboardManipulators.filter((function(e){return e.onKeyUp})).forEach((function(n){n.onKeyUp(t.interactor,r.pokedRenderer,r.key),e.invokeInteractionEvent(iP)}))},e.handleStartPinch=function(r){e.startDolly();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,r.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(oP)},e.handleEndPinch=function(){e.endDolly();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPinchEnabled()&&(n.onEndPinch(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(sP)},e.handleStartRotate=function(r){e.startRotate();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,r.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(oP)},e.handleEndRotate=function(){e.endRotate();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isRotateEnabled()&&(n.onEndRotate(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(sP)},e.handleStartPan=function(r){e.startPan();for(var n=t.gestureManipulators.length;n--;){var a=t.gestureManipulators[n];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,r.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(oP)},e.handleEndPan=function(){e.endPan();for(var r=t.gestureManipulators.length;r--;){var n=t.gestureManipulators[r];n&&n.isPanEnabled()&&(n.onEndPan(t.interactor),n.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(sP)},e.handlePinch=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,r.pokedRenderer,r.scale),a++)}a&&e.invokeInteractionEvent(iP)},e.handlePan=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isPanEnabled()&&(o.onPan(t.interactor,r.pokedRenderer,r.translation),a++)}a&&e.invokeInteractionEvent(iP)},e.handleRotate=function(r){for(var n=t.gestureManipulators.length,a=0;n--;){var o=t.gestureManipulators[n];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,r.pokedRenderer,r.rotation),a++)}a&&e.invokeInteractionEvent(iP)}}var dP={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function fP(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dP,r),cT.extend(e,t,r),fe.setGet(e,t,["rotationFactor"]),fe.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),fe.setGetArray(e,t,["centerOfRotation"],3),uP(e,t)}var pP=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mP,r),fe.obj(e,t),fe.get(e,t,["renderer"]),fe.getArray(e,t,["selectionPoint","pickPosition"]),fe.setGet(e,t,["pickFromList","pickList"]),gP(e,t)}var hP={newInstance:fe.newInstance(vP,"vtkAbstractPicker"),extend:vP};function yP(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 bP=fe.vtkErrorMacro,TP=fe.vtkWarningMacro;function SP(e,t){t.classHierarchy.push("vtkPicker");var r=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,CP,r),hP.extend(e,t,r),fe.setGet(e,t,["tolerance"]),fe.setGetArray(e,t,["mapperPosition"],3),fe.get(e,t,["mapper","dataSet","actors","pickedPositions"]),fe.event(e,t,"pickChange"),SP(e,t)}var PP={newInstance:fe.newInstance(xP,"vtkPicker"),extend:xP},wP=fe.vtkErrorMacro;function OP(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(r,n,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(r,n);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(r,n,a,o));return i},e.intersectActorWithLine=function(e,r,n,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],c=0;c<3;c++)l[c]=r[c]-e[c];var u,d=Ge(l,l);if(0===d)return wP("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=o.getPoints();if(t.useCells)for(var y=o.getPolys().getData(),b=y[0],T=o.getPolys().getNumberOfCells(),S=0;S=0&&u<=1&&u<=p+t.tolerance){for(var O=0,A=0;A<3;A++){m[A]=e[A]+u*l[A];var M=Math.abs(v[A]-m[A]);M>O&&(O=M)}O<=n&&O=0&&u<=1&&u<=p+t.tolerance){for(var I=0,R=0;R<3;R++){m[R]=e[R]+u*l[R];var E=Math.abs(v[R]-m[R]);E>I&&(I=E)}I<=n&&I2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,AP,r),PP.extend(e,t,r),fe.getArray(e,t,["pointIJK"]),fe.get(e,t,["pointId"]),fe.setGet(e,t,["useCells"]),OP(e,t)}var IP={newInstance:fe.newInstance(MP,"vtkPointPicker"),extend:MP},RP=fe.vtkWarningMacro;function EP(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(r,n){if(!t.deleted){var a=n[0],o=a?a.getPoints().getDataType():t.pointType,i=hm.newInstance(),s=[],l=[];if(Ne(t.point1,t.origin,s),Ne(t.point2,t.origin,l),e.updatePlane(s,l)){var c=t.xResolution,u=t.yResolution,d=(c+1)*(u+1),f=c*u,p=fe.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=qt.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=qt.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,S=0;S2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,DP,r),t.normal=[0,0,1],t.center=[0,0,0],fe.obj(e,t),fe.setGet(e,t,["xResolution","yResolution"]),fe.setGetArray(e,t,["origin"],3),fe.getArray(e,t,["point1","point2","normal","center"],3),fe.algo(e,t,0,1),EP(e,t),e.setPoint1(t.point1),e.setPoint2(t.point2)}var VP={newInstance:fe.newInstance(BP,"vtkPlaneSource"),extend:BP},LP={Coordinate:{DISPLAY:0,NORMALIZED_DISPLAY:1,VIEWPORT:2,NORMALIZED_VIEWPORT:3,PROJECTION:4,VIEW:5,WORLD:6}};function NP(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 kP=LP.Coordinate,FP=fe.vtkErrorMacro;function GP(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return FP("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_P,r),fe.obj(e,t),fe.set(e,t,["property"]),fe.get(e,t,["value"]),fe.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),fe.getArray(e,t,["value"],3),GP(e,t)}var WP=function(e){for(var t=1;t1?1e3*e:1e3;this.actor.getMapper().setMaximumSamplesPerRay(t),this.renderWindow.render()}get resolution(){return Math.round(1/this._raysDistance)}get presetsList(){return ux.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,r=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(r,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set rangeLUT([e,t]){this._rangeLUT=[e,t],this.actor.getProperty().getRGBTransferFunction(0).setMappingRange(e,t)}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Xi.newInstance();let r;t.applyColorMap(ux.getPresetByName(e)),r=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...r),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const n=$i.newInstance();this.actor.getProperty().setScalarOpacity(0,n),this.ctfun=t,this.ofun=n,this.updateWidget()}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),r=this.actor.getMapper();e?(t.onLeftButtonPress((()=>{r.setSampleDistance(5*this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))):(t.onLeftButtonPress((()=>{r.setSampleDistance(this._raysDistance)})),t.onLeftButtonRelease((()=>{r.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})))}initVR(){const e=yT.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize((()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)})),window.addEventListener("resize",(t=>{e.resize()})),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=Is(e);this.actor=t,this.lut="Grayscale",this.resolution=2,this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setActorProperties(),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return ux.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(.3),this.actor.getProperty().setDiffuse(.7),this.actor.getProperty().setSpecular(.3),this.actor.getProperty().setSpecularPower(.8)}setupCropWidget(){const e=QT.newInstance();e.setRenderer(this.renderer);const t=rx.newInstance(),r=(e.addWidget(t),t.getWidgetState().getCroppingPlanes());r.onModified((()=>{const e=function(e,t){const r=ni();Ka(r,e.getIndexToWorld());const n=e=>{const t=[0,0,0];return ta(t,e,r),t},[a,o,i,s,l,c]=t,u=e.indexToWorld([a,i,l]),d=e.indexToWorld([o,s,c]);return[cr.newInstance({normal:n([1,0,0]),origin:u}),cr.newInstance({normal:n([-1,0,0]),origin:d}),cr.newInstance({normal:n([0,1,0]),origin:u}),cr.newInstance({normal:n([0,-1,0]),origin:d}),cr.newInstance({normal:n([0,0,1]),origin:u}),cr.newInstance({normal:n([0,0,-1]),origin:d})]}(a,r.getPlanes());n.removeAllClippingPlanes(),e.forEach((e=>{n.addClippingPlane(e)})),n.modified()}));let n=this.actor.getMapper(),a=n.getInputData();t.copyImageDataDescription(a),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const r=Bx.newInstance({numberOfBins:256,size:[e,t]});r.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",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:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),r.setContainer(this.PGwidgetElement),window.addEventListener("resize",(e=>{r.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),r.render()})),this.PGwidget=r}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,r=1.8;this.PGwidget.addGaussian(this.wl,e,this.ww,t,r)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified((()=>{this.PGwidget.render(),this.renderWindow.render()})),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation((e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)})),this.PGwidget.onOpacityChange((e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}}))}setupInteractor(){const e=jx.newInstance({button:1}),t=Xx.newInstance({button:3,control:!0}),r=Qx.newInstance({button:3,scrollEnabled:!0}),n=tP.newInstance({button:1,shift:!0});let a=this;n.setVerticalListener(-1,1,.001,(function(){return a.wl}),(function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let r=a.PGwidget.getGaussians().slice();r[0].position=a.wl,a.PGwidget.setGaussians(r)})),n.setHorizontalListener(.1,2.1,.001,(function(){return a.ww}),(function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let r=a.PGwidget.getGaussians().slice();r[0].width=a.ww,a.PGwidget.setGaussians(r)}));const o=pP.newInstance();o.addMouseManipulator(n),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(r),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel((()=>this.resetMeasurementState())),this.renderWindow.getInteractor().onRightButtonPress((()=>this.resetMeasurementState()))}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,r){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(r,e);break;case"Rotation":this.resetMeasurementState(r),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let r=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter((e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName())).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(r);const n=IP.newInstance();if(n.setPickFromList(1),n.initializePickList(),!this._pickingPlane){const e=VP.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const r=Jp.newInstance();r.setInputConnection(e.getOutputPort());const n=Cp.newInstance();n.setMapper(r),n.getProperty().setOpacity(.01),this.renderer.addActor(n),this._pickingPlane=e,this._planeActor=n}n.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress((r=>{if(this.renderer!==r.pokedRenderer)return;const a=r.position,o=[a.x,a.y,0];if(n.pick(o,this.renderer),0===n.getActors().length){const e=n.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const r=n.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${r}`);const a=WP.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...r);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,r,n){jP[n](e,t,r)}(e,o,r,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()}))}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor&&(this.actor.getMapper().delete(),this.actor.delete(),this.actor=null),this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.getCanvas().remove(),this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}const qP=fe;const YP={slabThickness:.1};function ZP(e,t,r={}){Object.assign(t,YP,r),pP.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onScroll"]),qP.get(e,t,["slabThickness","viewUp"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulator=Xx.newInstance({button:1,shift:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function n(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=r=>{if(i(r),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),r){const i=r.getCurrentRenderer().getActiveCamera();a=i.onModified((()=>{n(),e.modified()})),o=r.onAnimation((()=>{const{slabThickness:e}=t,r=i.getDistance(),n=r-e/2,a=r+e/2;i.setClippingRange(n,a)}))}},e.handleMouseMove=qP.chain(e.handleMouseMove,(()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:r}=t,n=e.getActiveCamera(),a=n.getDistance(),o=a-r/2,i=a+r/2;n.setClippingRange(o,i)}));const s=e.setVolumeMapper;e.setVolumeMapper=e=>{if(s(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.getSlice=()=>{const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=e.getSliceNormal(),a=gC().identity().rotateFromDirections(n,[1,0,0]),o=r.getFocalPoint();return a.apply(o),o[0]},e.setSlice=r=>{const n=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,r){return er?r:e}(r,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=n.getDistance(),c=n.getDirectionOfProjection();Lt.normalize(c);const u=(a[1]+a[0])/2,d=[s[0]-c[0]*u,s[1]-c[1]*u,s[2]-c[2]*u],f=[d[0]+c[0]*i,d[1]+c[1]*i,d[2]+c[2]*i],p=[f[0]-c[0]*l,f[1]-c[1]*l,f[2]-c[2]*l];n.setPosition(...p),n.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}},e.getSliceRange=()=>{if(t.volumeMapper){const n=e.getSliceNormal();if(n[0]===r.sliceNormal[0]&&n[1]===r.sliceNormal[1]&&n[2]===r.sliceNormal[2])return r.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=gC().identity().rotateFromDirections(n,[1,0,0]);a.forEach((e=>o.apply(e)));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),tt.volumeMapper&&t.interactor?t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection():[0,0,0],e.setSliceNormal=(r,n=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...r],t.viewUp=[...n];const o=[...r],i=[...n];if(t.volumeMapper){Lt.normalize(o);let r=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(r=t.volumeMapper.getMapper());let n=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(r.getInputData().getDirection());Lt.transpose3x3(n,n),Lt.multiply3x3_vect3(n,o,o);let s=a.getFocalPoint(),l=a.getDistance(),c=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),r=Math.sqrt(Lt.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],c=90,l=r/(2*Math.tan(c/360*Math.PI))}const u=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Lt.multiply3x3_vect3(n,i,i);const{slabThickness:d}=t;a.setPosition(...u),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(c),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}},e.setSlabThickness=e=>{t.slabThickness=e;const r=t.interactor.getCurrentRenderer().getActiveCamera(),n=r.getDistance();r.setClippingRange(n-e/2,n+e/2)},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),n()}(e,t)}const QP=qP.newInstance(ZP,"vtkInteractorStyleMPRSlice"),$P=Object.assign({newInstance:QP,extend:ZP}),{States:JP}=rT;const ew={wlStartPos:[0,0],levelScale:1};function tw(e,t,r={}){Object.assign(t,ew,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=n=>{const a=[n.position.x,n.position.y];t.state===JP.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),r&&r(n)};const n=e.setVolumeMapper;e.setVolumeMapper=e=>{if(n(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.windowLevelFromMouse=([r,n])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(r-t.wlStartPos[0])*o,s=(n-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:c}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),c=Math.round(c+s),e.setWindowLevel(l,c),t.wlStartPos=[r,n];const u=e.getOnLevelsChanged();u&&u({windowCenter:c,windowWidth:l})},e.getWindowLevel=()=>function(e,t){const r=Math.abs(e-t);return{windowWidth:r,windowCenter:e+r/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice()),e.setWindowLevel=(e,r)=>{const n=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,r);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(n.lower,n.upper)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=r=>{t.wlStartPos=[r.position.x,r.position.y],r.shiftKey||r.controlKey?a&&a(r):e.startWindowLevel()},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===JP.IS_WINDOW_LEVEL?e.endWindowLevel():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const rw=qP.newInstance(tw,"vtkInteractorStyleMPRWindowLevel"),nw=Object.assign({newInstance:rw,extend:tw}),{States:aw}=rT;const ow={};function iw(e,t,r={}){Object.assign(t,ow,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onClickCallback"]),function(e,t){function r(t){const r=[t.position.x,t.position.y],n=t.pokedRenderer,a=e.getOnClickCallback(),o=WP.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(r[0],r[1],0);const i=o.getComputedWorldValue(n);i.length&&a({worldPos:i,displayPos:r}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=jx.newInstance({button:1}),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=e=>{t.state===aw.IS_SLICE&&r(e),n&&n(e)};const a=e.handleLeftButtonPress;e.handleLeftButtonPress=n=>{n.shiftKey||n.controlKey?a&&a(n):t.volumeMapper&&(r(n),e.startSlice())};const o=e.setVolumeMapper;e.setVolumeMapper=e=>{if(o(e)){const r=t.interactor.getCurrentRenderer().getActiveCamera();e?r.setFreezeFocalPoint(!0):r.setFreezeFocalPoint(!1)}},e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=()=>{t.state===aw.IS_SLICE?e.endSlice():e.superHandleLeftButtonRelease()},e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}(e,t)}const sw=qP.newInstance(iw,"vtkInteractorStyleMPRCrosshairs"),lw=Object.assign({newInstance:sw,extend:iw}),{States:cw}=rT;const uw={wlStartPos:[0,0],levelScale:1};function dw(e,t,r={}){Object.assign(t,uw,r),$P.extend(e,t,r),qP.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),function(e,t){function r(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const r=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(r[0],r[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=Xx.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=Xx.newInstance({button:3,control:!0}),t.zoomManipulator=Qx.newInstance({button:3}),t.scrollManipulator=tP.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=e=>{"zoom"==e?t.leftManipulator=Qx.newInstance({button:1}):"pan"==e?t.leftManipulator=Xx.newInstance({button:1}):console.error("No tool found for",e),r()},t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),r();const n=e.setInteractor;e.setInteractor=r=>{if(n(r),null===r)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();r.onAnimation(a)}}(e,t)}const fw=qP.newInstance(dw,"vtkInteractorStyleMPRPanZoom"),pw=Object.assign({newInstance:fw,extend:dw}),gw=[[0,0,1],[-1,0,0],[0,1,0]],mw=[[0,-1,0],[0,0,1],[0,0,1]];class vw{constructor(e,t,r){this.VERBOSE=!1,this._key=e,this._element=r,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=gw[t],this.sliceViewUp=mw[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=yT.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(r),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,r,n){this._volume=e;const a=$P.newInstance();a.setOnScroll(r),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),n()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,r=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let n=[];qn(n,e.sliceViewUp,e.slicePlaneNormal),Kn(n,n);let a=e.sliceViewUp;const o=ba();Da(o,o,Ms(e.slicePlaneYRotation),a),Da(o,o,Ms(e.slicePlaneXRotation),n),this.VERBOSE&&console.log(t,e.slicePlaneNormal,o),Jn(t,e.slicePlaneNormal,o);const i=ni();ai(i,t,Ms(-e.viewRotation)),si(i,i);const s=ni();ai(s,n,Ms(e.slicePlaneXRotation)),si(s,s);(function(e,t,r){e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3]})(ni(),s,i),ta(r,e.sliceViewUp,i);const l=this._genericRenderWindow.getRenderWindow(),c=l.getInteractor().getInteractorStyle();c&&c.setSliceNormal&&c.setSliceNormal(t,r),l.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],r=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let n,a;"left"===this._key?(n=t[1],a=t[2]):"front"===this._key?(n=t[0],a=t[2]):"top"===this._key&&(n=t[0],a=t[1]),r>=n/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(n/r+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),r=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&r.getSliceNormal()&&e.setSliceNormal(r.getSliceNormal(),r.getViewUp()),e.setSlabThickness&&r.getSlabThickness()&&e.setSlabThickness(r.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class hw{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const r=t-e/2,n=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(r,n),Object.keys(this.elements).forEach(((r,n)=>{this.mprViews[r].wwwl=[e,t]}))}initMPR(){Object.keys(this.elements).forEach(((e,t)=>{try{this.mprViews[e]=new vw(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}})),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce(((e,t)=>{let{slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:c}=e[t];return e[t]={slicePlaneNormal:r,sliceViewUp:n,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:c},e}),Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce(((e,t)=>({...e,[t]:[0,0]})),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let r=Is(t);this.volume=r,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(r.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach((t=>{this.mprViews[t].initView(r,e,(()=>{this.onScrolled.call(this,e)}),(()=>{this.onScrolled.call(this,e)}))})),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"pan"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnPanChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach((([t])=>{const r=pw.newInstance({leftButtonTool:"zoom"});r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnZoomChanged((()=>{this.updateInteractorCenters(e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach((([t])=>{const r=nw.newInstance();r.setOnScroll((()=>{this.onScrolled(e)})),r.setOnLevelsChanged((r=>{this.updateLevels({...r,srcKey:t},e)})),this.mprViews[t].setInteractor(r)})),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach((([r])=>{const n=lw.newInstance();n.setOnScroll((()=>{t.onScrolled(e)})),n.setOnClickCallback((({worldPos:n})=>{t.onCrosshairPointSelected({worldPos:n,srcKey:r},e)})),this.mprViews[r].setInteractor(n)})),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},r){Object.keys(this.elements).forEach((n=>{if(n!==e){const e=this.mprViews[n]._genericRenderWindow.getRenderWindow(),r=e.getInteractor().getInteractorStyle(),a=r.getSliceNormal(),o=gC().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];r.setSlice(s),e.render()}this.updateInteractorCenters(r)})),this.sliceIntersection=[...t],r.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:r},n){n.views[r].window.center=e,n.views[r].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter((e=>e!==r)).forEach((r=>{this.mprViews[r].wwwl=[t,e]}))}onScrolled(e){let t=[];Object.keys(this.elements).forEach((e=>{const r=this.mprViews[e].camera;t.push({position:r.getFocalPoint(),normal:r.getDirectionOfProjection()})}));const r=((e,t,r)=>{try{let n=cr.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(n.intersection){const{l0:e,l1:t}=n,a=cr.intersectWithLine(e,t,r.position,r.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN})(...t);return Number.isNaN(r)||r.some((e=>Number.isNaN(e)))||(this.sliceIntersection=[...r],e.sliceIntersection=[...r],this.VERBOSE&&console.log("updating slice intersection",r)),this.updateInteractorCenters(e),r}onRotate(e,t,r,n){switch(e){case"top":"x"===t?n.views.front.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneYRotation=r);break;case"left":"x"===t?n.views.top.slicePlaneXRotation=r:"y"===t&&(n.views.front.slicePlaneXRotation=r);break;case"front":"x"===t?n.views.top.slicePlaneYRotation=r:"y"===t&&(n.views.left.slicePlaneXRotation=r)}Object.keys(this.elements).filter((t=>t!==e)).forEach((e=>{this.mprViews[e].updateSlicePlane(n.views[e])})),this.VERBOSE&&console.log("afterOnRotate",n)}onThickness(e,t,r,n){const a=r>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",n.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=r,n.views[o].sliceThickness=r}updateInteractorCenters(e){Object.keys(this.elements).forEach((t=>{const r=this.mprViews[t]._genericRenderWindow.getRenderer(),n=WP.newInstance();n.setCoordinateSystemToWorld(),n.setValue(...this.sliceIntersection);const a=n.getComputedDisplayValue(r);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a}))}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach((e=>{e.onResize()})),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach((e=>{this.mprViews[e].destroy()}))}}console.groupCollapsed("%c** dtk **","background: #0aa658; color: #000000; line-height: 1.6"),console.log("Version 1.0.1"),console.log("Detected graphic card:"),console.log(function(){const e=document.createElement("canvas").getContext("webgl");if(!e)return{error:"no webgl"};const t=e.getExtension("WEBGL_debug_renderer_info");return t?{vendor:e.getParameter(t.UNMASKED_VENDOR_WEBGL),renderer:e.getParameter(t.UNMASKED_RENDERER_WEBGL)}:{error:"no WEBGL_debug_renderer_info"}}()),console.groupEnd("dtk")})(),n})()})); \ No newline at end of file