/*

 Copyright 2016 Google Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Copyright 2018 Google Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Copyright 2017 Google Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Copyright 2015 Mozilla Foundation

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(p,f,m){p!=Array.prototype&&p!=Object.prototype&&(p[f]=m.value)};$jscomp.getGlobal=function(p){return"undefined"!=typeof window&&window===p?p:"undefined"!=typeof global&&null!=global?global:p};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(p){return $jscomp.SYMBOL_PREFIX+(p||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var p=$jscomp.global.Symbol.iterator;p||(p=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[p]&&$jscomp.defineProperty(Array.prototype,p,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(p){var f=0;return $jscomp.iteratorPrototype(function(){return f<p.length?{done:!1,value:p[f++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(p){$jscomp.initSymbolIterator();p={next:p};p[$jscomp.global.Symbol.iterator]=function(){return this};return p};$jscomp.makeIterator=function(p){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var f=p[Symbol.iterator];return f?f.call(p):$jscomp.arrayIterator(p)};$jscomp.arrayFromIterator=function(p){for(var f,m=[];!(f=p.next()).done;)m.push(f.value);return m};$jscomp.arrayFromIterable=function(p){return p instanceof Array?p:$jscomp.arrayFromIterator($jscomp.makeIterator(p))};
$jscomp.owns=function(p,f){return Object.prototype.hasOwnProperty.call(p,f)};$jscomp.polyfill=function(p,f,m,k){if(f){m=$jscomp.global;p=p.split(".");for(k=0;k<p.length-1;k++){var g=p[k];g in m||(m[g]={});m=m[g]}p=p[p.length-1];k=m[p];f=f(k);f!=k&&null!=f&&$jscomp.defineProperty(m,p,{configurable:!0,writable:!0,value:f})}};
$jscomp.polyfill("WeakMap",function(p){function f(a){$jscomp.owns(a,k)||$jscomp.defineProperty(a,k,{value:{}})}function m(a){var b=Object[a];b&&(Object[a]=function(a){f(a);return b(a)})}if(function(){if(!p||!Object.seal)return!1;try{var a=Object.seal({}),b=Object.seal({}),c=new p([[a,2],[b,3]]);if(2!=c.get(a)||3!=c.get(b))return!1;c.delete(a);c.set(b,4);return!c.has(a)&&4==c.get(b)}catch(q){return!1}}())return p;var k="$jscomp_hidden_"+Math.random().toString().substring(2);m("freeze");m("preventExtensions");
m("seal");var g=0,c=function(a){this.id_=(g+=Math.random()+1).toString();if(a){$jscomp.initSymbol();$jscomp.initSymbolIterator();a=$jscomp.makeIterator(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}};c.prototype.set=function(a,b){f(a);if(!$jscomp.owns(a,k))throw Error("WeakMap key fail: "+a);a[k][this.id_]=b;return this};c.prototype.get=function(a){return $jscomp.owns(a,k)?a[k][this.id_]:void 0};c.prototype.has=function(a){return $jscomp.owns(a,k)&&$jscomp.owns(a[k],this.id_)};c.prototype.delete=
function(a){return $jscomp.owns(a,k)&&$jscomp.owns(a[k],this.id_)?delete a[k][this.id_]:!1};return c},"es6","es3");$jscomp.MapEntry=function(){};
$jscomp.polyfill("Map",function(p){if(!$jscomp.ASSUME_NO_NATIVE_MAP&&function(){if(!p||!p.prototype.entries||"function"!=typeof Object.seal)return!1;try{var a=Object.seal({x:4}),c=new p($jscomp.makeIterator([[a,"s"]]));if("s"!=c.get(a)||1!=c.size||c.get({x:4})||c.set({x:4},"t")!=c||2!=c.size)return!1;var q=c.entries(),l=q.next();if(l.done||l.value[0]!=a||"s"!=l.value[1])return!1;l=q.next();return l.done||4!=l.value[0].x||"t"!=l.value[1]||!q.next().done?!1:!0}catch(d){return!1}}())return p;$jscomp.initSymbol();
$jscomp.initSymbolIterator();var f=new WeakMap,m=function(a){this.data_={};this.head_=c();this.size=0;if(a){a=$jscomp.makeIterator(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}};m.prototype.set=function(a,c){var b=k(this,a);b.list||(b.list=this.data_[b.id]=[]);b.entry?b.entry.value=c:(b.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:a,value:c},b.list.push(b.entry),this.head_.previous.next=b.entry,this.head_.previous=b.entry,this.size++);return this};m.prototype.delete=
function(a){a=k(this,a);return a.entry&&a.list?(a.list.splice(a.index,1),a.list.length||delete this.data_[a.id],a.entry.previous.next=a.entry.next,a.entry.next.previous=a.entry.previous,a.entry.head=null,this.size--,!0):!1};m.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=c();this.size=0};m.prototype.has=function(a){return!!k(this,a).entry};m.prototype.get=function(a){return(a=k(this,a).entry)&&a.value};m.prototype.entries=function(){return g(this,function(a){return[a.key,
a.value]})};m.prototype.keys=function(){return g(this,function(a){return a.key})};m.prototype.values=function(){return g(this,function(a){return a.value})};m.prototype.forEach=function(a,c){for(var b=this.entries(),h;!(h=b.next()).done;)h=h.value,a.call(c,h[1],h[0],this)};m.prototype[Symbol.iterator]=m.prototype.entries;var k=function(b,c){var h=c&&typeof c;"object"==h||"function"==h?f.has(c)?h=f.get(c):(h=""+ ++a,f.set(c,h)):h="p_"+c;var l=b.data_[h];if(l&&$jscomp.owns(b.data_,h))for(b=0;b<l.length;b++){var d=
l[b];if(c!==c&&d.key!==d.key||c===d.key)return{id:h,list:l,index:b,entry:d}}return{id:h,list:l,index:-1,entry:void 0}},g=function(a,c){var b=a.head_;return $jscomp.iteratorPrototype(function(){if(b){for(;b.head!=a.head_;)b=b.previous;for(;b.next!=b.head;)return b=b.next,{done:!1,value:c(b)};b=null}return{done:!0,value:void 0}})},c=function(){var a={};return a.previous=a.next=a.head=a},a=0;return m},"es6","es3");
$jscomp.iteratorFromArray=function(p,f){$jscomp.initSymbolIterator();p instanceof String&&(p+="");var m=0,k={next:function(){if(m<p.length){var g=m++;return{value:f(g,p[g]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k};$jscomp.polyfill("Array.prototype.values",function(p){return p?p:function(){return $jscomp.iteratorFromArray(this,function(f,m){return m})}},"es6","es3");
$jscomp.polyfill("Number.isNaN",function(p){return p?p:function(f){return"number"===typeof f&&isNaN(f)}},"es6","es3");$jscomp.polyfill("Number.isFinite",function(p){return p?p:function(f){return"number"!==typeof f?!1:!isNaN(f)&&Infinity!==f&&-Infinity!==f}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(p){return p?p:function(){return $jscomp.iteratorFromArray(this,function(f){return f})}},"es6","es3");
$jscomp.polyfill("Number.isInteger",function(p){return p?p:function(f){return Number.isFinite(f)?f===Math.floor(f):!1}},"es6","es3");$jscomp.polyfill("Array.from",function(p){return p?p:function(f,m,k){$jscomp.initSymbolIterator();m=null!=m?m:function(a){return a};var g=[],c=f[Symbol.iterator];if("function"==typeof c)for(f=c.call(f);!(c=f.next()).done;)g.push(m.call(k,c.value));else{c=f.length;for(var a=0;a<c;a++)g.push(m.call(k,f[a]))}return g}},"es6","es3");
$jscomp.checkStringArgs=function(p,f,m){if(null==p)throw new TypeError("The 'this' value for String.prototype."+m+" must not be null or undefined");if(f instanceof RegExp)throw new TypeError("First argument to String.prototype."+m+" must not be a regular expression");return p+""};
$jscomp.polyfill("String.prototype.startsWith",function(p){return p?p:function(f,m){var k=$jscomp.checkStringArgs(this,f,"startsWith");f+="";var g=k.length,c=f.length;m=Math.max(0,Math.min(m|0,k.length));for(var a=0;a<c&&m<g;)if(k[m++]!=f[a++])return!1;return a>=c}},"es6","es3");$jscomp.polyfill("Math.log2",function(p){return p?p:function(f){return Math.log(f)/Math.LN2}},"es6","es3");
$jscomp.polyfill("String.prototype.repeat",function(p){return p?p:function(f){var m=$jscomp.checkStringArgs(this,null,"repeat");if(0>f||1342177279<f)throw new RangeError("Invalid count value");f|=0;for(var k="";f;)if(f&1&&(k+=m),f>>>=1)m+=m;return k}},"es6","es3");
$jscomp.polyfill("Set",function(p){if(!$jscomp.ASSUME_NO_NATIVE_SET&&function(){if(!p||!p.prototype.entries||"function"!=typeof Object.seal)return!1;try{var m=Object.seal({x:4}),k=new p($jscomp.makeIterator([m]));if(!k.has(m)||1!=k.size||k.add(m)!=k||1!=k.size||k.add({x:4})!=k||2!=k.size)return!1;var g=k.entries(),c=g.next();if(c.done||c.value[0]!=m||c.value[1]!=m)return!1;c=g.next();return c.done||c.value[0]==m||4!=c.value[0].x||c.value[1]!=c.value[0]?!1:g.next().done}catch(a){return!1}}())return p;
$jscomp.initSymbol();$jscomp.initSymbolIterator();var f=function(m){this.map_=new Map;if(m){m=$jscomp.makeIterator(m);for(var k;!(k=m.next()).done;)this.add(k.value)}this.size=this.map_.size};f.prototype.add=function(m){this.map_.set(m,m);this.size=this.map_.size;return this};f.prototype.delete=function(m){m=this.map_.delete(m);this.size=this.map_.size;return m};f.prototype.clear=function(){this.map_.clear();this.size=0};f.prototype.has=function(m){return this.map_.has(m)};f.prototype.entries=function(){return this.map_.entries()};
f.prototype.values=function(){return this.map_.values()};f.prototype.keys=f.prototype.values;f.prototype[Symbol.iterator]=f.prototype.values;f.prototype.forEach=function(m,k){var g=this;this.map_.forEach(function(c){return m.call(k,c,c,g)})};return f},"es6","es3");$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(p){function f(){this.batch_=null}function m(a){return a instanceof g?a:new g(function(b,c){b(a)})}if(p&&!$jscomp.FORCE_POLYFILL_PROMISE)return p;f.prototype.asyncExecute=function(a){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(a);return this};f.prototype.asyncExecuteBatch_=function(){var a=this;this.asyncExecuteFunction(function(){a.executeBatch_()})};var k=$jscomp.global.setTimeout;f.prototype.asyncExecuteFunction=function(a){k(a,
0)};f.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var c=a[b];delete a[b];try{c()}catch(q){this.asyncThrow_(q)}}}this.batch_=null};f.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var g=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(h){b.reject(h)}};g.prototype.createResolveAndReject_=
function(){function a(a){return function(h){c||(c=!0,a.call(b,h))}}var b=this,c=!1;return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};g.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof g)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var b=null!=a;break a;case "function":b=!0;break a;default:b=!1}b?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};g.prototype.resolveToNonPromiseObj_=function(a){var b=
void 0;try{b=a.then}catch(h){this.reject_(h);return}"function"==typeof b?this.settleSameAsThenable_(b,a):this.fulfill_(a)};g.prototype.reject_=function(a){this.settle_(2,a)};g.prototype.fulfill_=function(a){this.settle_(1,a)};g.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b|"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};g.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=
this.onSettledCallbacks_,b=0;b<a.length;++b)a[b].call(),a[b]=null;this.onSettledCallbacks_=null}};var c=new f;g.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};g.prototype.settleSameAsThenable_=function(a,b){var c=this.createResolveAndReject_();try{a.call(b,c.resolve,c.reject)}catch(q){c.reject(q)}};g.prototype.then=function(a,b){function c(a,b){return"function"==typeof a?function(b){try{q(a(b))}catch(e){l(e)}}:b}var q,l,d=new g(function(a,
b){q=a;l=b});this.callWhenSettled_(c(a,q),c(b,l));return d};g.prototype.catch=function(a){return this.then(void 0,a)};g.prototype.callWhenSettled_=function(a,b){function h(){switch(q.state_){case 1:a(q.result_);break;case 2:b(q.result_);break;default:throw Error("Unexpected state: "+q.state_);}}var q=this;null==this.onSettledCallbacks_?c.asyncExecute(h):this.onSettledCallbacks_.push(function(){c.asyncExecute(h)})};g.resolve=m;g.reject=function(a){return new g(function(b,c){c(a)})};g.race=function(a){return new g(function(b,
c){for(var h=$jscomp.makeIterator(a),l=h.next();!l.done;l=h.next())m(l.value).callWhenSettled_(b,c)})};g.all=function(a){var b=$jscomp.makeIterator(a),c=b.next();return c.done?m([]):new g(function(a,h){function d(b){return function(c){n[b]=c;l--;0==l&&a(n)}}var n=[],l=0;do n.push(void 0),l++,m(c.value).callWhenSettled_(d(n.length-1),h),c=b.next();while(!c.done)})};return g},"es6","es3");
$jscomp.polyfill("Object.assign",function(p){return p?p:function(f,m){for(var k=1;k<arguments.length;k++){var g=arguments[k];if(g)for(var c in g)$jscomp.owns(g,c)&&(f[c]=g[c])}return f}},"es6","es3");$jscomp.polyfill("Array.prototype.entries",function(p){return p?p:function(){return $jscomp.iteratorFromArray(this,function(f,m){return[f,m]})}},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(p){return p?p:function(f,m,k){var g=this.length||0;0>m&&(m=Math.max(0,g+m));if(null==k||k>g)k=g;k=Number(k);0>k&&(k=Math.max(0,g+k));for(m=Number(m||0);m<k;m++)this[m]=f;return this}},"es6","es3");
$jscomp.polyfill("Array.prototype.copyWithin",function(p){return p?p:function(f,m,k){var g=this.length;f=Number(f);m=Number(m);k=Number(null!=k?k:g);if(f<m)for(k=Math.min(k,g);m<k;)m in this?this[f++]=this[m++]:(delete this[f++],m++);else for(k=Math.min(k,g+m-f),f+=k-m;k>m;)--k in this?this[--f]=this[k]:delete this[f];return this}},"es6","es3");
(function(p){function f(k){if(m[k])return m[k].exports;var g=m[k]={i:k,l:!1,exports:{}};p[k].call(g.exports,g,g.exports,f);g.l=!0;return g.exports}var m={};f.m=p;f.c=m;f.d=function(k,g,c){f.o(k,g)||Object.defineProperty(k,g,{configurable:!1,enumerable:!0,get:c})};f.n=function(k){var g=k&&k.__esModule?function(){return k["default"]}:function(){return k};f.d(g,"a",g);return g};f.o=function(k,g){return Object.prototype.hasOwnProperty.call(k,g)};f.p="";return f(f.s=55)})([function(p,f,m){function k(a,
b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?
Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){n.set(a,b)}function b(a,b,c){c=void 0===c?{}:c;null!=b&&a.initializeSharedObject(b,c.id)}f.f=a;f.e=function(b,c){a(b,function(a){var b=this,t=a.id,e=new h.b;a=c.call(this,a,e);this.set(t,{promise:a,cancellationToken:e});a.then(function(a){var r=a.value;a=a.transfers;b.delete(t);b.invoke("rpc.promise.response",{id:t,value:r},a)},function(a){b.delete(t);b.invoke("rpc.promise.response",{id:t,error:a.message,errorName:a.name})})})};m.d(f,"a",function(){return e});
m.d(f,"b",function(){return y});f.d=b;m.d(f,"c",function(){return K});f.h=function(a){return function(b){b.prototype.RPC_TYPE_ID=a}};f.g=function(a){return function(b){if(void 0!==a)b.prototype.RPC_TYPE_ID=a;else if(a=b.prototype.RPC_TYPE_ID,void 0===a)throw Error("RPC_TYPE_ID should have already been defined");v.set(a,b)}};var h=m(15);p=m(16);var q=function F(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===e){if(a=Object.getPrototypeOf(a),null!==a)return F(a,
b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},l=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),d=!("undefined"!==typeof Window&&self instanceof Window),n=new Map,J=function(a){function b(a,c){k(this,b);var e=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,c));
e.name=a;e.message=c;return e}c(b,a);return b}(Error);a("rpc.promise.cancel",function(a){this.get(a.id).cancellationToken.cancel()});a("rpc.promise.response",function(a){var b=a.id,c=this.get(b),e=c.resolve;c=c.reject;this.delete(b);a.hasOwnProperty("value")?e(a.value):a.errorName===h.a.name?c(h.a):c(new J(a.errorName,a.error))});var u=d?-1:0,e=function(){function a(b){var c=this;k(this,a);this.target=b;this.objects=new Map;this.nextId=u;b.onmessage=function(a){a=a.data;n.get(a.functionName).call(c,
a)}}l(a,[{key:"set",value:function(a,b){this.objects.set(a,b)}},{key:"delete",value:function(a){this.objects.delete(a)}},{key:"get",value:function(a){return this.objects.get(a)}},{key:"getRef",value:function(a){var b=this.get(a.id);b.referencedGeneration=a.gen;b.addRef();return b}},{key:"invoke",value:function(a,b,c){b.functionName=a;this.target.postMessage(b,c)}},{key:"promiseInvoke",value:function(a,b,c,e){var d=this;c=void 0===c?h.e:c;return Object(h.d)(c,function(c,t,n){var r=b.id=d.newId();d.set(r,
{resolve:c,reject:t});d.invoke(a,b,e);n.add(function(){d.invoke("rpc.promise.cancel",{id:r})})})}},{key:"newId",value:function(){return d?this.nextId--:this.nextId++}},{key:"numObjects",get:function(){return this.objects.size}}]);return a}(),y=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.rpc=null;a.rpcId=null;return a}c(b,a);l(b,[{key:"initializeSharedObject",value:function(a,b){b=void 0===b?a.newId():b;this.rpc=a;this.rpcId=b;this.isOwner=
!1;a.set(b,this)}},{key:"initializeCounterpart",value:function(a,b){b=void 0===b?{}:b;this.initializeSharedObject(a);this.referencedGeneration=this.unreferencedGeneration=0;this.isOwner=!0;b.id=this.rpcId;b.type=this.RPC_TYPE_ID;a.invoke("SharedObject.new",b)}},{key:"dispose",value:function(){q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"dispose",this).call(this)}},{key:"addCounterpartRef",value:function(){return{id:this.rpcId,gen:++this.referencedGeneration}}},{key:"refCountReachedZero",
value:function(){!0===this.isOwner?this.referencedGeneration===this.unreferencedGeneration&&this.ownerDispose():!1===this.isOwner?this.rpc.invoke("SharedObject.refCountReachedZero",{id:this.rpcId,gen:this.referencedGeneration}):q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"refCountReachedZero",this).call(this)}},{key:"ownerDispose",value:function(){var a=this.rpc,c=this.rpcId;q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"refCountReachedZero",this).call(this);a.delete(c);
a.invoke("SharedObject.dispose",{id:c})}},{key:"counterpartRefCountReachedZero",value:function(a){this.unreferencedGeneration=a;0===this.refCount&&a===this.referencedGeneration&&this.ownerDispose()}}]);return b}(p.a),K=function(a){function e(a,c){c=void 0===c?{}:c;k(this,e);var d=g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));b(d,a,c);return d}c(e,a);return e}(y);a("SharedObject.dispose",function(a){a=this.get(a.id);if(0!==a.refCount)throw Error("Attempted to dispose object with non-zero reference count.");
a.disposed();this.delete(a.rpcId);a.rpcId=null;a.rpc=null});a("SharedObject.refCountReachedZero",function(a){this.get(a.id).counterpartRefCountReachedZero(a.gen)});var v=new Map;a("SharedObject.new",function(a){--(new (v.get(a.type))(this,a)).refCount})},function(p,f,m){function k(a,c){var b=Math.abs(a[c]),l=Math.abs(a[c+1]),d=Math.abs(a[c+2]),n=Math.max(b,l,d);1E-4>b/n&&(a[c]=0);1E-4>l/n&&(a[c+1]=0);1E-4>d/n&&(a[c+2]=0)}function g(b){b=b.and(a[0]);for(var c=1;c<a.length;++c)b=b.xor(b.rshift(Math.pow(2,
c))).and(a[c]);return b}f.i=function(a){return a[0]*a[1]*a[2]};f.n=function(a){return a[0]+","+a[1]+","+a[2]};f.k=function(a){k(a,0);k(a,4);k(a,8)};f.l=function(a,c,q){var b=c[0],d=c[1];c=c[2];a[0]=q[0]*b+q[4]*d+q[8]*c;a[1]=q[1]*b+q[5]*d+q[9]*c;a[2]=q[2]*b+q[6]*d+q[10]*c;return a};f.b=function(a,c){var b=c[0],l=c[1],d=c[2],n=c[4],h=c[5],u=c[6],e=c[8],y=c[9];c=c[10];a[0]=Math.sqrt(b*b+l*l+d*d);a[1]=Math.sqrt(n*n+h*h+u*u);a[2]=Math.sqrt(e*e+y*y+c*c);return a};f.a=function(a){if(a.high)throw Error("Fragment ids >= 2^32 not supported yet");
var b=g(a.rshift(0)),q=g(a.rshift(1));a=g(a.rshift(2));return c.c.clone([b.low,q.low,a.low])};var c=m(32);p=m(5);m.d(f,"h",function(){return c.a});m.d(f,"j",function(){return c.b});m.d(f,"m",function(){return c.c});m=c.a.create();f.c=m;m=[c.c.fromValues(1,0,0),c.c.fromValues(0,1,0),c.c.fromValues(0,0,1)];f.d=m;m=c.c.fromValues(0,0,0);f.g=m;m=c.c.fromValues(1,1,1);f.f=m;m=c.c.fromValues(Infinity,Infinity,Infinity);f.e=m;c.b.create();var a=[new p.a(1227133513,306783378),new p.a(3272356035,818089008),
new p.a(251719695,4027515120),new p.a(4278190335,16711680),new p.a(65535,16711680),new p.a(2097151,0)]},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,
writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function a(a){var b=a.downloadCancellationToken=new l.b;a.source.download(a,b).then(function(){a.downloadCancellationToken===b&&(a.downloadCancellationToken=void 0,a.downloadSucceeded())},function(c){a.downloadCancellationToken===b&&(a.downloadCancellationToken=void 0,a.downloadFailed(c),console.log("Error retrieving chunk "+
a+": "+c))})}function b(a){return new t(new e.a(a),n.a)}function h(a,b,c,r,e,d){for(;1>b.availableItems||b.availableSize<a;){var t=e.next().value;if(void 0===t)return!1;var n=t.priorityTier;if(n<c||n===c&&t.priority>=r)return!1;d(t)}return!0}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"Chunk",function(){return F});m.d(f,"ChunkSourceBase",function(){return x});m.d(f,"ChunkSource",function(){return H});m.d(f,"ChunkQueueManager",function(){return I});m.d(f,"ChunkManager",function(){return r});
f.WithParameters=function(a,b){a=function(a){function b(a){for(var r=[],e=0;e<arguments.length;++e)r[e-0]=arguments[e];c(this,b);var d;e=k(this,(d=b.__proto__||Object.getPrototypeOf(b)).call.apply(d,[].concat([this],$jscomp.arrayFromIterable(r))));e.parameters=r[1].parameters;return e}g(b,a);return b}(a);return a=w([Object(K.h)(b.RPC_ID)],a)};f.withChunkManager=function(a){return function(a){function b(a){for(var r=[],e=0;e<arguments.length;++e)r[e-0]=arguments[e];c(this,b);var d;e=k(this,(d=b.__proto__||
Object.getPrototypeOf(b)).call.apply(d,[].concat([this],$jscomp.arrayFromIterable(r))));e.chunkManager=r[0].get(r[1].chunkManager);return e}g(b,a);return b}(a)};var q=m(7),l=m(15);p=m(16);var d=m(57),n=m(58),J=m(31),u=m(64),e=m(65),y=m(8),K=m(0),v=function(){function a(a,b){for(var c=0;c<b.length;c++){var r=b[c];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(a,r.key,r)}}return function(b,c,r){c&&a(b.prototype,c);r&&a(b,r);return b}}(),w=this&&this.__decorate||
function(a,b,c,r){var e=arguments.length,d=3>e?b:null===r?r=Object.getOwnPropertyDescriptor(b,c):r,t;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)d=Reflect.decorate(a,b,c,r);else for(var n=a.length-1;0<=n;n--)if(t=a[n])d=(3>e?t(d):3<e?t(b,c,d):t(b,c))||d;return 3<e&&d&&Object.defineProperty(b,c,d),d},F=function(){function a(){c(this,a);this.key=this.source=this.prev1=this.next1=this.child1=this.prev0=this.next0=this.child0=null;this.state=q.e.NEW;this.error=null;this.newPriority=
this.priority=0;this.newPriorityTier=this.priorityTier=q.d.RECENT;this.backendOnly=!1;this.downloadCancellationToken=void 0}v(a,[{key:"initialize",value:function(a){this.key=a;this.state=q.e.NEW;this.priority=Number.NEGATIVE_INFINITY;this.priorityTier=q.d.RECENT;this.newPriority=Number.NEGATIVE_INFINITY;this.newPriorityTier=q.d.RECENT;this.error=null}},{key:"updatePriorityProperties",value:function(){this.priorityTier=this.newPriorityTier;this.priority=this.newPriority;this.newPriorityTier=q.d.RECENT;
this.newPriority=Number.NEGATIVE_INFINITY}},{key:"dispose",value:function(){this.error=this.source=null}},{key:"downloadFailed",value:function(a){this.error=a;this.queueManager.updateChunkState(this,q.e.FAILED)}},{key:"downloadSucceeded",value:function(){this.queueManager.updateChunkState(this,q.e.SYSTEM_MEMORY_WORKER)}},{key:"freeSystemMemory",value:function(){}},{key:"serialize",value:function(a,b){a.id=this.key;a.source=this.source.rpcId;a["new"]=!0}},{key:"toString",value:function(){return this.key}},
{key:"chunkManager",get:function(){return this.source.chunkManager}},{key:"queueManager",get:function(){return this.source.chunkManager.queueManager}}],[{key:"priorityLess",value:function(a,b){return a.priority<b.priority}},{key:"priorityGreater",value:function(a,b){return a.priority>b.priority}}]);return a}(),x=function(a){function b(a){c(this,b);var r=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));r.chunkManager=a;r.chunks=new Map;r.freeChunks=[];return r}g(b,a);v(b,[{key:"getNewChunk_",
value:function(a){var b=this.freeChunks,c=b.length;if(0<c)return a=b[c-1],b.length=c-1,a.source=this,a;b=new a;b.source=this;return b}},{key:"addChunk",value:function(a){var b=this.chunks;0===b.size&&this.addRef();b.set(a.key,a)}},{key:"removeChunk",value:function(a){var b=this.chunks,c=this.freeChunks;b.delete(a.key);a.dispose();c[c.length]=a;0===b.size&&this.dispose()}}]);return b}(K.b),H=function(a){function b(a,r){c(this,b);var e=a.get(r.chunkManager);e=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,
e));Object(K.d)(e,a,r);return e}g(b,a);return b}(x),t=function(){function a(b,r){c(this,a);this.heapOperations=b;this.linkedListOperations=r;this.heapRoots=[null,null];this.recentHead=new F;r.initializeHead(this.recentHead)}v(a,[{key:"add",value:function(a){var b=a.priorityTier;if(b===q.d.RECENT)this.linkedListOperations.insertAfter(this.recentHead,a);else{var c=this.heapRoots;c[b]=this.heapOperations.meld(c[b],a)}}},{key:"candidates",value:function(){function a(a,f){for(;;)switch(b){case 0:if(m.heapOperations.compare!==
F.priorityLess){b=1;break}K=m;k=K.linkedListOperations;g=K.recentHead;case 3:A=k.back(g);if(null!=A){b=5;break}b=4;break;case 5:return b=7,{value:A,done:!1};case 7:if(void 0===f){b=8;break}b=-1;throw f;case 8:case 6:b=3;break;case 4:y=m,J=y.heapRoots,u=q.d.LAST_ORDERED_TIER;case 9:if(!(u>=q.d.FIRST_ORDERED_TIER)){b=11;break}case 12:h=J[u];if(null!=h){b=14;break}b=13;break;case 14:return b=16,{value:h,done:!1};case 16:if(void 0===f){b=17;break}b=-1;throw f;case 17:case 15:b=12;break;case 13:case 10:--u;
b=9;break;case 11:b=2;break;case 1:l=m.heapRoots,n=q.d.FIRST_ORDERED_TIER;case 18:if(!(n<=q.d.LAST_ORDERED_TIER)){b=20;break}case 21:t=l[n];if(null!=t){b=23;break}b=22;break;case 23:return b=25,{value:t,done:!1};case 25:if(void 0===f){b=26;break}b=-1;throw f;case 26:case 24:b=21;break;case 22:case 19:++n;b=18;break;case 20:d=m,e=d.linkedListOperations,r=d.recentHead;case 27:c=e.front(r);if(null!=c){b=29;break}b=28;break;case 29:return b=31,{value:c,done:!1};case 31:if(void 0===f){b=32;break}b=-1;
throw f;case 32:case 30:b=27;break;case 28:case 2:b=-1;default:return{value:void 0,done:!0}}}var b=0,c,r,e,d,t,n,l,h,u,J,y,A,g,k,K,m=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}},{key:"delete",value:function(a){var b=a.priorityTier;if(b===q.d.RECENT)this.linkedListOperations.pop(a);else{var c=this.heapRoots;c[b]=this.heapOperations.remove(c[b],
a)}}}]);return a}(),A=function(a){function b(a,r){c(this,b);var e=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));e.itemLimit=a;e.sizeLimit=r;e.currentSize=0;e.currentItems=0;e.capacityChanged=new y.a;e.registerDisposer(a.changed.add(e.capacityChanged.dispatch));e.registerDisposer(r.changed.add(e.capacityChanged.dispatch));return e}g(b,a);v(b,[{key:"adjust",value:function(a,b){this.currentItems-=a;this.currentSize-=b}},{key:"availableSize",get:function(){return this.sizeLimit.value-this.currentSize}},
{key:"availableItems",get:function(){return this.itemLimit.value-this.currentItems}}]);return b}(p.a),I=function(r){function e(a,r){c(this,e);var n=k(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a,r));n.queuedPromotionQueue=b(F.priorityGreater);n.downloadEvictionQueue=b(F.priorityLess);n.systemMemoryEvictionQueue=new t(new u.a(F.priorityLess),d.a);n.gpuMemoryPromotionQueue=b(F.priorityGreater);n.gpuMemoryEvictionQueue=b(F.priorityLess);n.updatePending=null;n.numQueued=0;n.numFailed=0;var l=
function(b){b=n.registerDisposer(new A(a.get(b.itemLimit),a.get(b.sizeLimit)));b.capacityChanged.add(function(){return n.scheduleUpdate()});return b};n.gpuMemoryCapacity=l(r.gpuMemoryCapacity);n.systemMemoryCapacity=l(r.systemMemoryCapacity);n.downloadCapacity=l(r.downloadCapacity);return n}g(e,r);v(e,[{key:"scheduleUpdate",value:function(){null===this.updatePending&&(this.updatePending=setTimeout(this.process.bind(this),0))}},{key:"chunkQueuesForChunk",value:function(a){function b(b,n){for(;;)switch(c){case 0:e=
!1;r=a.state;if(!e&&r!==q.e.QUEUED){c=2;break}e=!0;c=3;return{value:d.queuedPromotionQueue,done:!1};case 3:if(void 0===n){c=4;break}c=-1;throw n;case 4:c=1;break;case 2:if(!e&&r!==q.e.DOWNLOADING){c=5;break}e=!0;c=6;return{value:d.downloadEvictionQueue,done:!1};case 6:if(void 0===n){c=7;break}c=-1;throw n;case 7:return c=8,{value:d.systemMemoryEvictionQueue,done:!1};case 8:if(void 0===n){c=9;break}c=-1;throw n;case 9:c=1;break;case 5:if(e||r===q.e.SYSTEM_MEMORY_WORKER)e=!0;if(!e&&r!==q.e.SYSTEM_MEMORY){c=
10;break}e=!0;c=11;return{value:d.systemMemoryEvictionQueue,done:!1};case 11:if(void 0===n){c=12;break}c=-1;throw n;case 12:if(a.priorityTier===q.d.RECENT||a.backendOnly){c=13;break}c=14;return{value:d.gpuMemoryPromotionQueue,done:!1};case 14:if(void 0===n){c=15;break}c=-1;throw n;case 15:case 13:c=1;break;case 10:if(!e&&r!==q.e.GPU_MEMORY){c=16;break}e=!0;c=17;return{value:d.systemMemoryEvictionQueue,done:!1};case 17:if(void 0===n){c=18;break}c=-1;throw n;case 18:return c=19,{value:d.gpuMemoryEvictionQueue,
done:!1};case 19:if(void 0===n){c=20;break}c=-1;throw n;case 20:c=1;break;case 16:case 1:c=-1;default:return{value:void 0,done:!0}}}var c=0,r,e,d=this,n={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();n[Symbol.iterator]=function(){return this};return n}},{key:"adjustCapacitiesForChunk",value:function(a,b){b=b?-1:1;switch(a.state){case q.e.FAILED:this.numFailed-=b;break;case q.e.QUEUED:this.numQueued-=
b;break;case q.e.DOWNLOADING:this.downloadCapacity.adjust(b,0);this.systemMemoryCapacity.adjust(b,0);break;case q.e.SYSTEM_MEMORY:case q.e.SYSTEM_MEMORY_WORKER:this.systemMemoryCapacity.adjust(b,b*a.systemMemoryBytes);break;case q.e.GPU_MEMORY:this.systemMemoryCapacity.adjust(b,b*a.systemMemoryBytes),this.gpuMemoryCapacity.adjust(b,b*a.gpuMemoryBytes)}}},{key:"removeChunkFromQueues_",value:function(a){for(var b=$jscomp.makeIterator(this.chunkQueuesForChunk(a)),c=b.next();!c.done;c=b.next())c.value.delete(a)}},
{key:"addChunkToQueues_",value:function(a){if(a.state===q.e.QUEUED&&a.priorityTier===q.d.RECENT)return a.source.removeChunk(a),this.adjustCapacitiesForChunk(a,!1),!1;for(var b=$jscomp.makeIterator(this.chunkQueuesForChunk(a)),c=b.next();!c.done;c=b.next())c.value.add(a);return!0}},{key:"performChunkPriorityUpdate",value:function(a){a.priorityTier===a.newPriorityTier&&a.priority===a.newPriority?(a.newPriorityTier=q.d.RECENT,a.newPriority=Number.NEGATIVE_INFINITY):(this.removeChunkFromQueues_(a),a.updatePriorityProperties(),
a.state===q.e.NEW&&(a.state=q.e.QUEUED,this.adjustCapacitiesForChunk(a,!0)),this.addChunkToQueues_(a))}},{key:"updateChunkState",value:function(a,b){b!==a.state&&(this.adjustCapacitiesForChunk(a,!1),this.removeChunkFromQueues_(a),a.state=b,this.adjustCapacitiesForChunk(a,!0),this.addChunkToQueues_(a),this.scheduleUpdate())}},{key:"processGPUPromotions_",value:function(){function a(a){b.freeChunkGPUMemory(a);a.source.chunkManager.queueManager.updateChunkState(a,q.e.SYSTEM_MEMORY)}for(var b=this,c=
this.gpuMemoryPromotionQueue.candidates(),r=this.gpuMemoryEvictionQueue.candidates(),e=this.gpuMemoryCapacity;;){var d=c.next().value;if(void 0===d)break;else{if(!h(d.gpuMemoryBytes,e,d.priorityTier,d.priority,r,a))break;this.copyChunkToGPU(d);this.updateChunkState(d,q.e.GPU_MEMORY)}}}},{key:"freeChunkGPUMemory",value:function(a){this.rpc.invoke("Chunk.update",{id:a.key,state:q.e.SYSTEM_MEMORY,source:a.source.rpcId})}},{key:"freeChunkSystemMemory",value:function(a){a.state===q.e.SYSTEM_MEMORY_WORKER?
a.freeSystemMemory():this.rpc.invoke("Chunk.update",{id:a.key,state:q.e.EXPIRED,source:a.source.rpcId})}},{key:"copyChunkToGPU",value:function(a){var b=this.rpc;if(a.state===q.e.SYSTEM_MEMORY)b.invoke("Chunk.update",{id:a.key,source:a.source.rpcId,state:q.e.GPU_MEMORY});else{var c={},r=[];a.serialize(c,r);c.state=q.e.GPU_MEMORY;b.invoke("Chunk.update",c,r)}}},{key:"processQueuePromotions_",value:function(){for(var b=this,c=this,r=function(a){switch(a.state){case q.e.DOWNLOADING:var r=a.downloadCancellationToken;
a.downloadCancellationToken=void 0;r.cancel();break;case q.e.GPU_MEMORY:c.freeChunkGPUMemory(a);case q.e.SYSTEM_MEMORY_WORKER:case q.e.SYSTEM_MEMORY:c.freeChunkSystemMemory(a)}b.updateChunkState(a,q.e.QUEUED)},e=this.queuedPromotionQueue.candidates(),d=this.downloadEvictionQueue.candidates(),n=this.systemMemoryEvictionQueue.candidates(),t=this.downloadCapacity,l=this.systemMemoryCapacity;;){var u=e.next();if(u.done)break;u=u.value;var J=u.priorityTier,y=u.priority;if(!h(0,t,J,y,d,r))break;if(!h(0,
l,J,y,n,r))break;this.updateChunkState(u,q.e.DOWNLOADING);a(u)}}},{key:"process",value:function(){this.updatePending&&(this.updatePending=null,this.processGPUPromotions_(),this.processQueuePromotions_(),this.logStatistics())}},{key:"logStatistics",value:function(){}},{key:"invalidateSourceCache",value:function(a){for(var b=$jscomp.makeIterator(a.chunks.values()),c=b.next();!c.done;c=b.next()){c=c.value;switch(c.state){case q.e.DOWNLOADING:var r=c.downloadCancellationToken;c.downloadCancellationToken=
void 0;r.cancel();break;case q.e.SYSTEM_MEMORY_WORKER:c.freeSystemMemory()}this.updateChunkState(c,q.e.QUEUED)}this.rpc.invoke("Chunk.update",{source:a.rpcId});this.scheduleUpdate()}}]);return e}(K.c);I=w([Object(K.g)(q.b)],I);var r=function(a){function b(a,r){c(this,b);var e=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,r));e.existingTierChunks=[];e.newTierChunks=[];e.updatePending=null;e.recomputeChunkPriorities=new y.a;e.recomputeChunkPrioritiesLate=new y.a;e.memoize=new J.a;e.queueManager=
a.get(r.chunkQueueManager).addRef();for(a=q.d.FIRST_TIER;a<=q.d.LAST_TIER;++a)a!==q.d.RECENT&&(e.existingTierChunks[a]=[]);return e}g(b,a);v(b,[{key:"scheduleUpdateChunkPriorities",value:function(){null===this.updatePending&&(this.updatePending=setTimeout(this.recomputeChunkPriorities_.bind(this),0))}},{key:"recomputeChunkPriorities_",value:function(){this.updatePending=null;this.recomputeChunkPriorities.dispatch();this.recomputeChunkPrioritiesLate.dispatch();this.updateQueueState([q.d.VISIBLE])}},
{key:"requestChunk",value:function(a,b,c){a.newPriorityTier===q.d.RECENT&&this.newTierChunks.push(a);var r=a.newPriorityTier;if(b<r||b===r&&c>a.newPriority)a.newPriorityTier=b,a.newPriority=c}},{key:"updateQueueState",value:function(a){var b=this.existingTierChunks,c=this.queueManager;a=$jscomp.makeIterator(a);for(var r=a.next();!r.done;r=a.next()){var e=b[r.value],d=$jscomp.makeIterator(e);for(r=d.next();!r.done;r=d.next())r=r.value,r.newPriorityTier===q.d.RECENT&&c.performChunkPriorityUpdate(r);
e.length=0}a=this.newTierChunks;e=$jscomp.makeIterator(a);for(r=e.next();!r.done;r=e.next())r=r.value,c.performChunkPriorityUpdate(r),b[r.priorityTier].push(r);a.length=0;this.queueManager.scheduleUpdate()}}]);return b}(K.c);r=w([Object(K.g)(q.a)],r);Object(K.f)(q.c,function(a){a=this.get(a.id);a.chunkManager.queueManager.invalidateSourceCache(a)})},function(p,f,m){function k(a){a:{var b=typeof a;if("number"===b||"string"===b)if(b=parseFloat(""+a),!Number.isNaN(b)){a=b;break a}throw Error("Expected floating-point number, but received: "+
JSON.stringify(a)+".");}if(Number.isFinite(a))return a;throw Error("Expected finite floating-point number, but received: "+a+".");}function g(a){a=k(a);if(0<a)return a;throw Error("Expected positive finite floating-point number, but received: "+a+".");}function c(a){if("object"===typeof a){if(null===a)return"null";if(Array.isArray(a)){var b="[",d=a.length,e=0;if(e<d)for(b+=c(a[e]);++e<d;)b+=",",b+=c(a[e]);return b+"]"}b="{";d=Object.keys(a).sort();e=0;var n=d.length;if(e<n){var l=d[e];b+=JSON.stringify(l);
for(b=b+":"+c(a[l]);++e<n;)b+=",",l=d[e],b+=JSON.stringify(l),b+=":",b+=c(a[l])}return b+"}"}return JSON.stringify(a)}function a(a){for(var b="";0<a.length;){var c=a.match(l);if(null===c){var e=a;c=a=""}else{e=a.substr(0,c.index);a=a.substr(c.index+c[0].length);var n=c[1];if(void 0!==n){if(c=n,2<=c.length&&"'"===c.charAt(0)&&"'"===c.charAt(c.length-1)){c=c.substr(1,c.length-2);for(n='"';0<c.length;){var h=c.match(d);if(null===h){n+=c;break}n+=h[1];'"'===h[2]?(n+="\\",n+='"'):n+="'";c=c.substr(h.index+
h[0].length)}c=n+'"'}}else c=c[2]}b+=e.replace(/\(/g,"[").replace(/\)/g,"]").replace("True","true").replace("False","false").replace(/,\s*([\}\]])/g,"$1");b+=c}return b}function b(a,b,c){var e=a.length;if(!Array.isArray(b)||b.length!==e)throw Error("Expected length "+e+" array, but received: "+JSON.stringify(b)+".");for(var d=0;d<e;++d)a[d]=c(b[d],d);return a}function h(a){if("string"!==typeof a)throw Error("Expected string, but received: "+JSON.stringify(a)+".");return a}f.b=function(a,b){var c=
a.length;if(!Array.isArray(b)||b.length!==c)throw Error("Incompatible sizes");for(var e=0;e<c;++e)if(!Number.isFinite(parseFloat(b[e])))throw Error("Non-finite value.");for(e=0;e<c;++e)a[e]=parseFloat(b[e]);return a};f.e=c;f.d=function(b){return JSON.parse(a(b))};f.a=function(a,b){if(!Array.isArray(a))throw Error("Expected array, but received: "+JSON.stringify(a)+".");return a.map(b)};f.c=b;f.i=function(a){if("object"!==typeof a||null==a||Array.isArray(a))throw Error("Expected JSON object, but received: "+
JSON.stringify(a)+".");return a};f.l=h;f.k=function(a){if(void 0!==a)return h(a)};f.j=function(a,b,c){a=a.hasOwnProperty(b)?a[b]:void 0;try{return c(a)}catch(e){throw Error("Error parsing "+JSON.stringify(b)+" property: "+e.message);}};f.h=function(a,b){if("string"===typeof a&&null!==a.match(/^[a-zA-Z]/)&&(a=a.toUpperCase(),b.hasOwnProperty(a)))return b[a];throw Error("Invalid enum value: "+JSON.stringify(a)+".");};f.g=function(a){return b(q.m.create(),a,k)};f.f=function(a){return b(q.m.create(),
a,g)};f.m=function(a){if(!Array.isArray(a))throw Error("Expected array, received: "+JSON.stringify(a)+".");for(var b=$jscomp.makeIterator(a),c=b.next();!c.done;c=b.next())if(c=c.value,"string"!==typeof c)throw Error("Expected string, received: "+JSON.stringify(c)+".");return a};var q=m(1),l=new RegExp(/('(?:[^'\\]|(?:\\.))*')/.source+"|"+/("(?:[^'\\]|(?:\\.))*")/.source),d=/^((?:[^"'\\]|(?:\\[^']))*)("|\\')/},function(p,f,m){m.d(f,"a",function(){return k});f.b=1E-6;var k="undefined"!==typeof Float32Array?
Float32Array:Array;f.c=Math.random},function(p,f,m){m.d(f,"a",function(){return q});var k=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,l){c&&a(b.prototype,c);l&&a(b,l);return b}}(),g=new Uint32Array(2),c=[];for(p=2;36>=p;++p){f=Math.floor(32/Math.log2(p));m=Math.pow(p,f);var a=Math.floor(f/2),b=Math.pow(p,a);a=Math.pow(p,f-a);var h="^[0-"+String.fromCharCode(48+
Math.min(9,p-1));10<p&&(h+="a-"+String.fromCharCode(97+p-11),h+="A-"+String.fromCharCode(65+p-11));h+="]{1,"+Math.ceil(64/Math.log2(p))+"}$";c[p]={lowDigits:f,lowBase:m,lowBase1:b,lowBase2:a,pattern:new RegExp(h)}}var q=function(){function a(b,c){b=void 0===b?0:b;c=void 0===c?0:c;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.low=b;this.high=c}k(a,[{key:"clone",value:function(){return new a(this.low,this.high)}},{key:"assign",value:function(a){this.low=a.low;
this.high=a.high}},{key:"toString",value:function(a){a=void 0===a?10:a;var b=this.low,d=this.high;if(0===d)return b.toString(a);d*=4294967296;var l=c[a],e=l.lowBase;l=l.lowDigits;var h=d%e;d=Math.floor(d/e);b+=h;d+=Math.floor(b/e);b=(b%e).toString(a);return d.toString(a)+"0".repeat(l-b.length)+b}},{key:"tryParseString",value:function(a,b){b=void 0===b?10:b;var d=c[b],l=d.lowDigits,e=d.lowBase,h=d.lowBase1,n=d.lowBase2;if(!d.pattern.test(a))return!1;if(a.length<=l)return this.low=parseInt(a,b),this.high=
0,!0;l=a.length-l;d=parseInt(a.substr(l),b);a=parseInt(a.substr(0,l),b);e=Math.floor(a*e/4294967296);h=d+a%4294967296*h%4294967296*n%4294967296;4294967296<h&&(++e,h-=4294967296);if(h>>>0!==h||e>>>0!==e)return!1;this.low=h;this.high=e;return!0}},{key:"parseString",value:function(a,b){if(!this.tryParseString(a,void 0===b?10:b))throw Error("Failed to parse string as uint64 value: "+JSON.stringify(a)+".");return this}},{key:"valid",value:function(){var a=this.low,b=this.high;return a>>>0===a&&b>>>0===
b}},{key:"toJSON",value:function(){return this.toString()}},{key:"lshift",value:function(b){b&=63;if(0==b)return this.clone();var c=this.low,d=this.high;return 32>b?new a(c<<b,d<<b|c>>>32-b):new a(0,c<<b-32)}},{key:"rshift",value:function(b){b&=63;if(0==b)return this.clone();var c=this.low,d=this.high;return 32>b?new a(c>>>b|d<<32-b,d>>b):new a(d>>b-32,0<=d?0:-1)}},{key:"or",value:function(b){return new a(this.low|b.low,this.high|b.high)}},{key:"xor",value:function(b){return new a(this.low^b.low,
this.high^b.high)}},{key:"and",value:function(b){return new a(this.low&b.low,this.high&b.high)}}],[{key:"less",value:function(a,b){return a.high<b.high||a.high===b.high&&a.low<b.low}},{key:"compare",value:function(a,b){return a.high-b.high||a.low-b.low}},{key:"equal",value:function(a,b){return a.low===b.low&&a.high===b.high}},{key:"min",value:function(b,c){return a.less(b,c)?b:c}},{key:"random",value:function(){crypto.getRandomValues(g);return new a(g[0],g[1])}},{key:"parseString",value:function(b,
c){c=void 0===c?10:c;return(new a).parseString(b,c)}}]);return a}();q.ZERO=new q(0,0)},function(p,f,m){p="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(c){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var b=a.shift();if(b){if("object"!==typeof b)throw new TypeError(b+"must be non-object");for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(c[h]=b[h])}}return c};f.shrinkBuf=function(c,a){if(c.length===a)return c;
if(c.subarray)return c.subarray(0,a);c.length=a;return c};var k={arraySet:function(c,a,b,h,q){if(a.subarray&&c.subarray)c.set(a.subarray(b,b+h),q);else for(var l=0;l<h;l++)c[q+l]=a[b+l]},flattenChunks:function(c){var a,b;var h=b=0;for(a=c.length;h<a;h++)b+=c[h].length;var q=new Uint8Array(b);h=b=0;for(a=c.length;h<a;h++){var l=c[h];q.set(l,b);b+=l.length}return q}},g={arraySet:function(c,a,b,h,q){for(var l=0;l<h;l++)c[q+l]=a[b+l]},flattenChunks:function(c){return[].concat.apply([],c)}};f.setTyped=
function(c){c?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,k)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,g))};f.setTyped(p)},function(p,f,m){m.d(f,"e",function(){return k});m.d(f,"d",function(){return g});var k;(function(c){c[c.GPU_MEMORY=0]="GPU_MEMORY";c[c.SYSTEM_MEMORY=1]="SYSTEM_MEMORY";c[c.SYSTEM_MEMORY_WORKER=2]="SYSTEM_MEMORY_WORKER";c[c.DOWNLOADING=3]="DOWNLOADING";c[c.QUEUED=4]="QUEUED";c[c.NEW=5]="NEW";c[c.FAILED=6]="FAILED";c[c.EXPIRED=7]="EXPIRED"})(k||
(k={}));var g;(function(c){c[c.FIRST_TIER=0]="FIRST_TIER";c[c.FIRST_ORDERED_TIER=0]="FIRST_ORDERED_TIER";c[c.VISIBLE=0]="VISIBLE";c[c.PREFETCH=1]="PREFETCH";c[c.LAST_ORDERED_TIER=1]="LAST_ORDERED_TIER";c[c.RECENT=2]="RECENT";c[c.LAST_TIER=2]="LAST_TIER"})(g||(g={}));f.f=1E13;f.b="ChunkQueueManager";f.a="ChunkManager";f.c="ChunkSource.invalidate"},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);
a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"b",function(){return a});m.d(f,"a",function(){return b});var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var l=b[c];l.enumerable=l.enumerable||!1;l.configurable=!0;"value"in l&&(l.writable=!0);Object.defineProperty(a,
l.key,l)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),a=function(){function a(){g(this,a);this.handlers=new Set;this.count=0;var b=this;this.dispatch=function(){var a=this,c=arguments;++b.count;b.handlers.forEach(function(b){b.apply(a,c)})}}c(a,[{key:"add",value:function(a){var b=this;this.handlers.add(a);return function(){return b.remove(a)}}},{key:"remove",value:function(a){return this.handlers.delete(a)}},{key:"dispose",value:function(){this.handlers=void 0}}]);return a}(),
b=function(a){function b(){g(this,b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}k(b,a);return b}(a)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b,c){for(var r=0;3>r;++r)a[r]=Number.POSITIVE_INFINITY,b[r]=Number.NEGATIVE_INFINITY;c=$jscomp.makeIterator(c);for(r=c.next();!r.done;r=c.next()){var e=r.value.spec;r=e.lowerChunkBound;e=e.upperChunkBound;for(var d=0;3>d;++d)a[d]=Math.min(a[d],r[d]),b[d]=Math.max(b[d],e[d])}}function a(a,b,c,r){for(var e=
v.FULLY_INSIDE,d=0;3>d;++d){var t=a[d];var l=b[d],h=c[d],n=r[d];t=t>=n||l<=h?v.FULLY_OUTSIDE:t>=h&&l<=n?v.FULLY_INSIDE:v.PARTIALLY_INSIDE;switch(t){case v.FULLY_OUTSIDE:return t;case v.PARTIALLY_INSIDE:e=t}}return e}function b(a){var b=a.transform,c=a.transformedSources,r=b.changed.count;r!==a.transformedSourcesGeneration&&(a.transformedSourcesGeneration=r,c=e.h.equals(b.transform,e.c)?a.sources.map(function(a){return a.map(function(a){return{source:a,chunkLayout:a.spec.chunkLayout}})}):a.sources.map(function(a){return a.map(function(a){var c=
a.spec.chunkLayout;return{chunkLayout:d.a.get(c.size,l(c.transform,b)),source:a}})}),a.transformedSources=c);return c}function h(a,b){var c=b.length,r=0;if(1<c)for(var e=0,d=0;d<c;++d){var t=b[d].chunkLayout;var l=t.size;t=t.globalToLocalSpatialVector(K,a);for(var h=0,n=0,u=1,y=0;3>y;++y){var q=l[y];u*=q;q*=t[y];h=Math.min(h,q);n=Math.max(n,q)}l=u/(n-h);l>e&&(e=l,r=d)}return b[r]}function q(a){var b=a.voxelSize,c=void 0===a.lowerVoxelBound?e.g:a.lowerVoxelBound,r=a.upperVoxelBound,d=void 0===a.maxVoxelsPerChunkLog2?
18:a.maxVoxelsPerChunkLog2;a=void 0===a.transform?e.c:a.transform;a=Object(e.b)(e.m.create(),a);b=e.m.multiply(a,a,b);a=e.m.fromValues(1,1,1);if(void 0===r)var l=e.e;else{l=e.m.create();for(var t=0;3>t;++t)l[t]=Math.pow(2,Math.floor(Math.log2(r[t]-c[t])))}for(c=0;c<d;++c){r=Infinity;t=-1;for(var h=0;3>h;++h)if(!(a[h]>=l[h])){var n=a[h]*b[h];n<r&&(r=n,t=h)}r=t;if(-1===r)break;a[r]*=2}return a}function l(a,b){b=b.transform;return void 0===b?void 0===a?e.c:a:void 0===a?b:e.h.multiply(e.h.create(),b,
a)}m.d(f,"h",function(){return F});f.l=q;f.k=l;f.j=function(a){if(void 0!==a.chunkDataSizes)return a.chunkDataSizes;var b=void 0===a.chunkLayoutPreference?x.ISOTROPIC:a.chunkLayoutPreference;switch(b){case x.ISOTROPIC:return[q(a)];case x.FLAT:b=[];for(var c=0;3>c;++c){var r=c;var d=a.lowerVoxelBound;var l=a.upperVoxelBound,t=c,h=a.voxelSize,n=a.maxVoxelsPerChunkLog2,u=a.transform;e.m.subtract(K,void 0===l?e.e:l,void 0===d?e.g:d);K[t]=1;d=q({voxelSize:h,upperVoxelBound:K,maxVoxelsPerChunkLog2:n,transform:u});
b[r]=d}b.push(q(a));return b}throw Error("Invalid chunk layout preference: "+b+".");};m.d(f,"i",function(){return H});var d=m(67),n=m(21),J=m(68),u=m(10),e=m(1);p=m(0);m.d(f,"a",function(){return u.b});var y=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,r){c&&a(b.prototype,c);r&&a(b,r);return b}}(),K=e.m.create(),v;(function(a){a[a.FULLY_OUTSIDE=0]=
"FULLY_OUTSIDE";a[a.FULLY_INSIDE=1]="FULLY_INSIDE";a[a.PARTIALLY_INSIDE=2]="PARTIALLY_INSIDE"})(v||(v={}));var w=[e.m.create(),e.m.create(),e.m.create(),e.m.create()],F=function(d){function l(){k(this,l);var a=(l.__proto__||Object.getPrototypeOf(l)).call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.width=-1;a.height=-1;a.hasViewportToData=!1;a.hasValidViewport=!1;a.viewportToData=e.h.create();
a.viewportAxes=[e.m.create(),e.m.create(),e.m.create()];a.previousViewportAxes=[e.m.create(),e.m.create()];a.centerDataPosition=e.m.create();a.viewportPlaneDistanceToOrigin=0;a.visibleChunkLayouts=new Map;a.visibleLayers=new Map;a.visibleSourcesStale=!0;a.pixelSize=0;e.h.identity(a.viewportToData);return a}g(l,d);y(l,[{key:"onViewportChanged",value:function(){}},{key:"maybeSetHasValidViewport",value:function(){!this.hasValidViewport&&-1!==this.width&&-1!==this.height&&this.hasViewportToData&&(this.hasValidViewport=
!0,this.onHasValidViewport());if(this.hasValidViewport)this.onViewportChanged()}},{key:"onHasValidViewport",value:function(){}},{key:"setViewportSize",value:function(a,b){return a!==this.width||b!==this.height?(this.width=a,this.height=b,this.maybeSetHasValidViewport(),!0):!1}},{key:"setViewportToDataMatrix",value:function(a){if(this.hasViewportToData&&e.h.equals(this.viewportToData,a))return!1;this.hasViewportToData=!0;var b=this.viewportToData;e.h.copy(b,a);Object(e.k)(b);e.m.transformMat4(this.centerDataPosition,
e.g,a);a=0;for(var c=this.viewportAxes,d=this.previousViewportAxes,l=0;3>l;++l){var h=c[l];Object(e.l)(h,e.d[l],b);0===l&&(a=e.m.length(h));e.m.normalize(h,h)}this.viewportAxes=c;this.previousViewportAxes=d;if(!Object(J.a)(a,this.pixelSize)||.95>e.m.dot(c[0],d[0])||.95>e.m.dot(c[1],d[1]))e.m.copy(d[0],c[0]),e.m.copy(d[1],c[1]),this.visibleSourcesStale=!0,this.pixelSize=a;this.viewportPlaneDistanceToOrigin=e.m.dot(this.centerDataPosition,this.viewportAxes[2]);this.onViewportToDataMatrixChanged();this.maybeSetHasValidViewport();
return!0}},{key:"onViewportToDataMatrixChanged",value:function(){}},{key:"updateVisibleSources",value:function(){if(this.visibleSourcesStale){this.visibleSourcesStale=!1;var a=1.1*this.pixelSize,c=this.visibleChunkLayouts,e=this.viewportAxes[2],d=this.visibleLayers;c.clear();var l={};d=$jscomp.makeIterator(d);for(var t=d.next();!t.done;l={smallestVoxelSize:l.smallestVoxelSize,visibleSources:l.visibleSources},t=d.next()){t=$jscomp.makeIterator(t.value);var n=t.next().value;l.visibleSources=t.next().value;
l.visibleSources.length=0;t=b(n);var u=t.length;n=void 0;l.smallestVoxelSize=t[0][0].source.spec.voxelSize;var y=function(b){return function(c){for(var r=0;3>r;++r){var e=c[r];if(e>a&&e>b.smallestVoxelSize[r])return!0}return!1}}(l),q=function(a){return function(b,r){var e=b.source,d=b.chunkLayout;a.visibleSources[a.visibleSources.length++]=b;b=c.get(d);void 0===b&&(b=new Map,c.set(d,b));b.set(e,r)}}(l);for(n=u-1;;){u=h(e,t[n]);q(u,n);if(0===n||!y(u.source.spec.voxelSize))break;--n}l.visibleSources.reverse()}}}},
{key:"computeVisibleChunks",value:function(b,r){var d=this;this.updateVisibleSources();for(var l=this.width,h=this.height,t=this.viewportToData,u=0;3>u;++u)w[0][u]=-e.d[0][u]*l/2-e.d[1][u]*h/2,w[1][u]=-e.d[0][u]*l/2+e.d[1][u]*h/2,w[2][u]=e.d[0][u]*l/2-e.d[1][u]*h/2,w[3][u]=e.d[0][u]*l/2+e.d[1][u]*h/2;for(l=0;4>l;++l)e.m.transformMat4(w[l],w[l],t);var y=e.m.create(),q=e.m.create(),J=e.m.create(),g=e.m.create(),k=e.m.create(),A=e.m.create(),m=[],f=[];this.visibleChunkLayouts.forEach(function(l,h){function t(){for(var a=
0,b=0,c=0;3>c;++c){var r=A[c],e=y[c],d=q[c]-e,l=k[c]*d;a+=r*(e+l);b+=r*(e+d-l)}return a<G?!1:b<=G}function u(b){function c(){I=Object(n.b)(m,0,k,function(b){var c=b.spec;switch(a(y,q,c.lowerChunkBound,c.upperChunkBound)){case v.PARTIALLY_INSIDE:return!0;case v.FULLY_INSIDE:f.push(b);default:return!1}})}if(0!==f.length||0!==I){for(var e=1,d=0;3>d;++d)e*=Math.max(0,q[d]-y[d]);if(0!==e&&t())if(1===e)r(h,L,y,f);else{for(var l;;)if(e=y[b],d=q[b],l=d-e,1===l)b=(b+1)%3;else break;l=e+Math.floor(.5*l);var J=
(b+1)%3,g=f.length;q[b]=l;var k=I;c();u(J);f.length=g;I=k;q[b]=d;y[b]=l;c();u(J);y[b]=e;f.length=g;I=k}}}var L=b(h);c(J,g,l.keys());e.m.set(y,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);e.m.set(q,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);h.globalToLocalSpatialVector(A,d.viewportAxes[2]);for(var z=0;3>z;++z)k[z]=0<A[z]?1:0;var G=e.m.dot(h.globalToLocalGrid(K,d.centerDataPosition),A);for(z=0;4>z;++z)for(var x=h.globalToLocalGrid(K,w[z]),
H=0;3>H;++H)y[H]=Math.min(y[H],Math.floor(x[H])),q[H]=Math.max(q[H],Math.floor(x[H])+1);e.m.max(y,y,J);e.m.min(q,q,g);f.length=0;m.length=0;l=$jscomp.makeIterator(l.keys());for(z=l.next();!z.done;z=l.next())switch(z=z.value,x=z.spec,a(y,q,x.lowerChunkBound,x.upperChunkBound)){case v.FULLY_INSIDE:f.push(z);break;case v.PARTIALLY_INSIDE:m.push(z)}var I=m.length;u(0)})}}]);return l}(p.b),x;(function(a){a[a.ISOTROPIC=0]="ISOTROPIC";a[a.FLAT=1]="FLAT"})(x||(x={}));var H=function(){function a(b){k(this,
a);var c=b.chunkSize,r=b.transform,l=void 0===b.lowerChunkBound?e.g:b.lowerChunkBound,h=b.upperChunkBound;this.voxelSize=b.voxelSize;this.chunkLayout=d.a.get(c,r);this.lowerChunkBound=l;this.upperChunkBound=h}y(a,[{key:"toObject",value:function(){return{transform:this.chunkLayout.transform,chunkSize:this.chunkLayout.size,voxelSize:this.voxelSize,lowerChunkBound:this.lowerChunkBound,upperChunkBound:this.upperChunkBound}}}]);return a}();f.f="SliceView";f.d="sliceview/RenderLayer";f.b="SliceView.addVisibleLayer";
f.c="SliceView.removeVisibleLayer";f.g="SliceView.updateView";f.e="SliceView.updateTransform"},function(p,f,m){m.d(f,"b",function(){return k});var k;(function(g){g[g.UINT8=0]="UINT8";g[g.UINT16=1]="UINT16";g[g.UINT32=2]="UINT32";g[g.UINT64=3]="UINT64";g[g.FLOAT32=4]="FLOAT32"})(k||(k={}));p=[];f.a=p;p[k.UINT8]=1;p[k.UINT16]=2;p[k.UINT32]=4;p[k.UINT64]=8;p[k.FLOAT32]=4},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||
"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.c=function(a){return function(a){function b(a){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");
var h,q=k(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],$jscomp.arrayFromIterable(c))));q.visibility=c[0].get(c[1].visibility);q.registerDisposer(q.visibility.changed.add(function(){return q.chunkManager.scheduleUpdateChunkPriorities()}));return q}g(b,a);return b}(a)};f.b=function(a){return a===Number.POSITIVE_INFINITY?c.d.VISIBLE:c.d.PREFETCH};f.a=function(a){return a===Number.POSITIVE_INFINITY?0:a*c.f};m(69);var c=m(7)},function(p,f,m){function k(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return q});f.b=function(a,c){c=void 0===c?"GET":c;var d=new XMLHttpRequest;d[h]=c;d[b]=a;d.open(c,a);return d};f.c=function(a,d,n){n=void 0===n?"GET":n;var l=new XMLHttpRequest;if(Array.isArray(a)){var u=
a.length;u=1===u?0:Math.abs(Object(c.a)(d))%u;a=a[u]+d}else a+=d;l[h]=n;l[b]=a;l.open(n,a);return l};f.e=function(a,b,c){c=void 0===c?g.e:c;a.responseType=b;return new Promise(function(b,d){var e=function(){a.abort()};c.add(e);a.onloadend=function(){var l=this.status;c.remove(e);200<=l&&300>l?b(this.response):d(q.fromXhr(a))};a.send()})};f.d=function(a,b,c,h){h=void 0===h?g.e:h;a.responseType=c;a.setRequestHeader("Content-Type","application/json");return new Promise(function(c,e){var d=function(){a.abort()};
h.add(d);a.onloadend=function(){var b=this.status;h.remove(d);200<=b&&300>b?c(this.response):e(q.fromXhr(a))};a.send(JSON.stringify(b))})};var g=m(15),c=m(88),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,l){c&&a(b.prototype,c);l&&a(b,l);return b}}();$jscomp.initSymbol();var b=Symbol("url");$jscomp.initSymbol();var h=Symbol("method"),q=function(c){function d(a,
b,c,e){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");var l=a+" "+JSON.stringify(b)+" resulted in HTTP error "+c;e&&(l+=": "+e);l+=".";var h=(d.__proto__||Object.getPrototypeOf(d)).call(this,l);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");h=!h||"object"!==typeof h&&"function"!==typeof h?this:h;h.name="HttpError";h.message=l;h.method=a;h.url=b;h.code=c;h.statusMessage=e;return h}k(d,c);a(d,null,[{key:"fromXhr",value:function(a){return new d(a[h],
a[b],a.status,a.statusText)}}]);return d}(Error)},function(p,f,m){m.d(f,"b",function(){return k});f.c=function(c,a,b){b=void 0===b?g:b;if(a!==b)for(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength),a=0,b=c.length;a<b;a+=2){var h=c[a];c[a]=c[a+1];c[a+1]=h}};f.d=function(c,a,b){b=void 0===b?g:b;if(a!==b)for(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength),a=0,b=c.length;a<b;a+=4){var h=c[a];c[a]=c[a+3];c[a+3]=h;h=c[a+1];c[a+1]=c[a+2];c[a+2]=h}};var k;(function(c){c[c.LITTLE=0]="LITTLE";c[c.BIG=
1]="BIG"})(k||(k={}));var g=function(){var c=Uint16Array.of(4386);return 17===(new Uint8Array(c.buffer))[0]?k.BIG:k.LITTLE}();f.a=g},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return n});p=m(20);var a=m(44),b=m(1),h=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),q=function u(a,
b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===e){if(a=Object.getPrototypeOf(a),null!==a)return u(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},l=b.m.create(),d=b.m.create();m=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.source=null;return a}c(b,a);h(b,[{key:"initializeVolumeChunk",value:function(a,c){q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"initializeVolumeChunk",this).call(this,a,c);this.chunkDataSize=null;a=this.source;this.gpuMemoryBytes=this.systemMemoryBytes=a.spec.chunkBytes;this.data=null}},{key:"serialize",value:function(a,c){q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var e=this.chunkDataSize;e!==this.source.spec.chunkDataSize&&(a.chunkDataSize=e);a=a.data=this.data;c.push(a.buffer);this.data=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=
this.data.byteLength;q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.data=null}}]);return b}(p.SliceViewChunk);var n=function(n){function e(b,c){k(this,e);b=g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,b,c));b.spec=a.b.fromObject(c.spec);return b}c(e,n);h(e,[{key:"computeChunkBounds",value:function(a){var c=this.spec,e=c.upperVoxelBound;c=c.chunkDataSize;for(var h=b.m.multiply(d,a.chunkGridPosition,
c),n=!1,q=0;3>q;++q)(l[q]=Math.min(e[q],h[q]+c[q])-h[q])!==c[q]&&(n=!0);b.m.add(h,h,this.spec.baseVoxelOffset);a.chunkDataSize=n?b.m.clone(l):c;return h}}]);return e}(p.SliceViewChunkSource);n.prototype.chunkConstructor=m},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?
Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"b",function(){return h});m.d(f,"c",function(){return q});f.d=function(a,c){return new Promise(function(d,l){if(a===b)c(d,l,b);else{var n=new h,e=a.add(function(){n.cancel()});c(function(a){e();d(a)},function(a){e();l(a)},n)}})};var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in
d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,l){c&&a(b.prototype,c);l&&a(b,l);return b}}();p=new (function(){function a(){g(this,a);this.name="CancellationError";this.message="CANCELED"}c(a,[{key:"toString",value:function(){return"CANCELED"}}]);return a}());f.a=p;var a=function(){},b={isCanceled:!1,add:function(){return a},remove:a};f.e=b;var h=function(){function b(){g(this,b)}c(b,[{key:"cancel",value:function(){var a=this.handlers;if(null!==a&&(this.handlers=null,void 0!==
a)){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b()}}},{key:"add",value:function(b){var c=this,d=this.handlers;if(null===d)return b(),a;void 0===d&&(d=this.handlers=new Set);d.add(b);return function(){c.remove(b)}}},{key:"remove",value:function(a){var b=this.handlers;null!=b&&b.delete(a)}},{key:"isCanceled",get:function(){return null===this.handlers}}]);return b}(),q=function(a){function d(){g(this,d);var a=(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments);
if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.consumers=new Set;return a}k(d,a);c(d,[{key:"addConsumer",value:function(a){var c=this;a=void 0===a?b:a;var d=this.consumers;d.has(a)||a.isCanceled||(d.add(a),a.add(function(){d.delete(a);0===d.size&&c.cancel()}))}}]);return d}(h)},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function c(a,b,c,h){a.addEventListener(b,c,h);return function(){return a.removeEventListener(b,c,h)}}m.d(f,"a",function(){return b});m.d(f,"b",function(){return h});var a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=
b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,h){c&&a(b.prototype,c);h&&a(b,h);return b}}(),b=function(){function b(){g(this,b);this.refCount=1}a(b,[{key:"addRef",value:function(){++this.refCount;return this}},{key:"dispose",value:function(){0===--this.refCount&&this.refCountReachedZero()}},{key:"refCountReachedZero",value:function(){this.disposed();var a=this.disposers;if(null!=a){for(var b=a.length;0<b;--b){var c=
a[b-1];"object"===typeof c?c.dispose():c.call(this)}this.disposers=void 0}this.wasDisposed=!0}},{key:"disposed",value:function(){}},{key:"registerDisposer",value:function(a){var b=this.disposers;null==b?this.disposers=[a]:b.push(a);return a}},{key:"unregisterDisposer",value:function(a){var b=this.disposers;if(null!=b){var c=b.indexOf(a);-1!==c&&b.splice(c,1)}return a}},{key:"registerEventListener",value:function(a,b,h,q){this.registerDisposer(c(a,b,h,q))}},{key:"registerCancellable",value:function(a){this.registerDisposer(function(){a.cancel()});
return a}}]);return b}(),h=function(a){function b(a){g(this,b);var c=(b.__proto__||Object.getPrototypeOf(b)).call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");c=!c||"object"!==typeof c&&"function"!==typeof c?this:c;c.value=a;return c}k(b,a);return b}(b)},function(p,f,m){f.a=function(c,a){Object(k.a)(c,Object(g.a)(new Uint8Array(a),c.chunkDataSize,c.source.spec.numChannels))};var k=m(26),g=m(100)},function(p,f,m){function k(a,b){if(!(a instanceof
b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}function a(a,b){for(var c=n.m.create(),e=n.m.create(),r=n.m.create(),d=new Float32Array(a.length),h=b.length,l=0;l<h;l+=3){for(var t=3*b[l],q=3*b[l+1],u=3*b[l+2],y=0;3>y;++y)e[y]=a[q+y]-a[t+y],r[y]=a[u+y]-a[q+y];n.m.cross(c,e,r);n.m.normalize(c,c);for(t=0;3>t;++t)for(q=3*b[l+t],u=0;3>u;++u)d[q+u]+=c[u]}a=d.length;for(b=0;b<a;b+=3)c=d.subarray(b,b+3),n.m.normalize(c,c);return d}function b(a,b,c,e,r,h,l,n){var t=new Float32Array(c,r,3*h);Object(d.d)(t,e);void 0===l&&(l=r+12*h);var q;
void 0!==n&&(q=n*b);c=void 0===q?new Uint32Array(c,l):new Uint32Array(c,l,q);if(0!==c.length%b)throw Error("Number of indices is not a multiple of "+b+": "+c.length+".");Object(d.d)(c,e);a.vertexPositions=t;a.indices=c}f.c=function(a,b,c){Object(J.i)(b);a.fragmentIds=Object(J.j)(b,c,J.m)};f.b=a;f.e=b;f.d=function(c,e,d,h,r,l,n){b(c,3,e,d,h,r,l,n);c.vertexNormals=a(c.vertexPositions,c.indices)};m.d(f,"a",function(){return x});var h=m(2),q=m(7);p=m(90);f=m(42);var l=m(22),d=m(13),n=m(1),J=m(3),u=m(5),
e=m(11);m=m(0);var y=function(){function a(a,b){for(var c=0;c<b.length;c++){var r=b[c];r.enumerable=r.enumerable||!1;r.configurable=!0;"value"in r&&(r.writable=!0);Object.defineProperty(a,r.key,r)}}return function(b,c,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),K=function t(a,b,c){null===a&&(a=Function.prototype);var r=Object.getOwnPropertyDescriptor(a,b);if(void 0===r){if(a=Object.getPrototypeOf(a),null!==a)return t(a,b,c)}else{if("value"in r)return r.value;b=r.get;return void 0===b?void 0:b.call(c)}},
v=this&&this.__decorate||function(a,b,c,r){var e=arguments.length,d=3>e?b:null===r?r=Object.getOwnPropertyDescriptor(b,c):r,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)d=Reflect.decorate(a,b,c,r);else for(var l=a.length-1;0<=l;l--)if(h=a[l])d=(3>e?h(d):3<e?h(b,c,d):h(b,c))||d;return 3<e&&d&&Object.defineProperty(b,c,d),d},w=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.objectId=new u.a;return a}c(b,a);y(b,[{key:"initializeManifestChunk",
value:function(a,c,e){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.objectId.assign(c);e&&(this.clipBounds=e)}},{key:"freeSystemMemory",value:function(){this.fragmentIds=null}},{key:"serialize",value:function(a,c){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);a.fragmentIds=this.fragmentIds}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=100;this.gpuMemoryBytes=0;K(b.prototype.__proto__||
Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this);this.priorityTier<q.d.RECENT&&this.source.chunkManager.scheduleUpdateChunkPriorities()}},{key:"toString",value:function(){return this.objectId.toString()}}]);return b}(h.Chunk),F=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.manifestChunk=null;a.fragmentId=null;a.vertexPositions=null;a.indices=null;a.vertexNormals=null;return a}c(b,a);y(b,[{key:"initializeFragmentChunk",
value:function(a,c,e){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.manifestChunk=c;this.fragmentId=e}},{key:"freeSystemMemory",value:function(){this.fragmentId=this.vertexPositions=this.indices=this.vertexNormals=this.manifestChunk=null}},{key:"serialize",value:function(a,c){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);a.objectKey=this.manifestChunk.key;var e=this.vertexPositions,r=this.indices,d=this.vertexNormals;
a.vertexPositions=e;a.indices=r;a.vertexNormals=d;a=e.buffer;c.push(a);r=r.buffer;r!==a&&c.push(r);d=d.buffer;d!==a&&d!==r&&c.push(d);this.vertexPositions=this.indices=this.vertexNormals=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.vertexPositions.byteLength+this.indices.byteLength+this.vertexNormals.byteLength;K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(h.Chunk),x=function(a){function b(a,
c){k(this,b);var e=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));return(e.fragmentSource=e.registerDisposer(a.getRef(c.fragmentSource))).meshSource=e}c(b,a);y(b,[{key:"getChunk",value:function(a,b){var c=Object(l.b)(a,b),e=this.chunks.get(c);void 0===e&&(e=this.getNewChunk_(w),e.initializeManifestChunk(c,a,b),this.addChunk(e));return e}},{key:"getFragmentChunk",value:function(a,b){var c=a.key+"/"+b,e=this.fragmentSource,r=e.chunks.get(c);void 0===r&&(r=e.getNewChunk_(F),r.initializeFragmentChunk(c,
a,b),e.addChunk(r));return r}}]);return b}(h.ChunkSource);h=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.meshSource=null;return a}c(b,a);y(b,[{key:"download",value:function(a,b){return this.meshSource.downloadFragment(a,b)}}]);return b}(h.ChunkSource);h=v([Object(m.g)(p.a)],h);f=function(a){function b(a,c){k(this,b);var e=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));e.source=e.registerDisposer(a.getRef(c.source));
e.registerDisposer(e.chunkManager.recomputeChunkPriorities.add(function(){e.updateChunkPriorities()}));return e}c(b,a);y(b,[{key:"updateChunkPriorities",value:function(){var a=this,b=this.visibility.value;if(b!==Number.NEGATIVE_INFINITY){var c=Object(e.b)(b),d=Object(e.a)(b),h=this.source,t=this.chunkManager;Object(l.a)(this,function(b){b=h.getChunk(b,a.clipBounds.value);t.requestChunk(b,c,d+100);var e=b.state;if(e===q.e.SYSTEM_MEMORY_WORKER||e===q.e.SYSTEM_MEMORY||e===q.e.GPU_MEMORY){e=$jscomp.makeIterator(b.fragmentIds);
for(var r=e.next();!r.done;r=e.next())r=h.getFragmentChunk(b,r.value),t.requestChunk(r,c,d+50)}})}}}]);return b}(f.a);f=v([Object(m.g)(p.b)],f)},function(p,f,m){f.a=function(b,h,q){q=void 0===q?c.a:q;var l=b.source.spec,d=l.dataType,n=Object(a.i)(b.chunkDataSize),J=g.a[d];l=n*J*l.numChannels;if(l!==h.byteLength)throw Error("Raw-format chunk is "+h.byteLength+" bytes, "+("but "+n+" * "+J+" = "+l+" bytes are expected."));switch(d){case g.b.UINT8:h=new Uint8Array(h);break;case g.b.UINT16:h=new Uint16Array(h);
Object(c.c)(h,q);break;case g.b.UINT32:case g.b.UINT64:h=new Uint32Array(h);Object(c.d)(h,q);break;case g.b.FLOAT32:h=new Float32Array(h);Object(c.d)(h,q);break;default:throw Error("Unexpected data type: "+d+".");}Object(k.a)(b,h)};var k=m(26),g=m(10),c=m(13),a=m(1)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==
typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"SliceView",function(){return y});m.d(f,"SliceViewChunk",function(){return K});m.d(f,"SliceViewChunkSource",
function(){return v});m.d(f,"RenderLayer",function(){return w});p=m(2);var a=m(66);f=m(9);var b=m(1),h=m(8),q=m(11);m=m(0);var l=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),d=function x(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===e){if(a=Object.getPrototypeOf(a),
null!==a)return x(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},n=this&&this.__decorate||function(a,b,c,e){var d=arguments.length,r=3>d?b:null===e?e=Object.getOwnPropertyDescriptor(b,c):e,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(a,b,c,e);else for(var l=a.length-1;0<=l;l--)if(h=a[l])r=(3>d?h(r):3<d?h(b,c,r):h(b,c))||r;return 3<d&&r&&Object.defineProperty(b,c,r),r},J=b.m.create(),u=b.m.create(),e=function(a){function b(a,
c){k(this,b);var e=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));e.initializeSharedObject(a,c.id);return e}c(b,a);return b}(f.h),y=function(a){function e(a,b){k(this,e);var c=g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a,b));c.handleLayerChanged=function(){c.hasValidViewport&&c.chunkManager.scheduleUpdateChunkPriorities()};c.invalidateVisibleSources=function(){c.visibleSourcesStale=!0;c.hasValidViewport&&c.chunkManager.scheduleUpdateChunkPriorities()};c.registerDisposer(c.chunkManager.recomputeChunkPriorities.add(function(){c.updateVisibleChunks()}));
return c}c(e,a);l(e,[{key:"onViewportChanged",value:function(){this.chunkManager.scheduleUpdateChunkPriorities()}},{key:"updateVisibleChunks",value:function(){var a=this,c=this.centerDataPosition,e=this.chunkManager,r=this.visibility.value;if(r!==Number.NEGATIVE_INFINITY){var d=Object(q.b)(r),h=Object(q.a)(r);h+=-1E12;this.computeVisibleChunks(function(b){b.globalToLocalSpatial(u,c);return a.visibleChunkLayouts.get(b)},function(a,c,r,l){b.m.multiply(J,r,a.size);a=-b.m.distance(u,J);l=$jscomp.makeIterator(l);
for(var t=l.next();!t.done;t=l.next()){var n=t.value;t=c.get(n);n=n.getChunk(r);e.requestChunk(n,d,h+a+1E9*t)}})}}},{key:"removeVisibleLayer",value:function(a){this.visibleLayers.delete(a);a.layerChanged.remove(this.handleLayerChanged);a.transform.changed.remove(this.invalidateVisibleSources);this.invalidateVisibleSources()}},{key:"addVisibleLayer",value:function(a){this.visibleLayers.set(a,[]);a.layerChanged.add(this.handleLayerChanged);a.transform.changed.add(this.invalidateVisibleSources);this.invalidateVisibleSources()}},
{key:"disposed",value:function(){for(var a=$jscomp.makeIterator(this.visibleLayers.keys()),b=a.next();!b.done;b=a.next())this.removeVisibleLayer(b.value);d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"disposed",this).call(this)}}]);return e}(Object(q.c)(Object(p.withChunkManager)(e)));y=n([Object(m.g)(f.f)],y);Object(m.f)(f.g,function(a){var b=this.get(a.id);a.width&&b.setViewportSize(a.width,a.height);a.viewportToData&&b.setViewportToDataMatrix(a.viewportToData)});Object(m.f)(f.b,function(a){var b=
this.get(a.id);a=this.get(a.layerId);b.addVisibleLayer(a)});Object(m.f)(f.c,function(a){var b=this.get(a.id);a=this.get(a.layerId);b.removeVisibleLayer(a)});var K=function(a){function e(){k(this,e);var a=g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));a.source=null;a.chunkGridPosition=b.m.create();return a}c(e,a);l(e,[{key:"initializeVolumeChunk",value:function(a,c){d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"initialize",this).call(this,a);b.m.copy(this.chunkGridPosition,
c)}},{key:"serialize",value:function(a,b){d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"serialize",this).call(this,a,b);a.chunkGridPosition=this.chunkGridPosition}},{key:"downloadSucceeded",value:function(){d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){}},{key:"toString",value:function(){return this.source.toString()+":"+Object(b.n)(this.chunkGridPosition)}}]);return e}(p.Chunk),v=function(a){function e(a,
b){k(this,e);return g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a,b))}c(e,a);l(e,[{key:"getChunk",value:function(a){var c=Object(b.n)(a),e=this.chunks.get(c);void 0===e&&(e=this.getNewChunk_(this.chunkConstructor),e.initializeVolumeChunk(c,a),this.addChunk(e));return e}}]);return e}(p.ChunkSource),w=function(e){function d(c,e){k(this,d);var l=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,c,e));l.layerChanged=new h.a;l.transform=new a.a;l.transformedSourcesGeneration=-1;for(var r=
l.sources=[],t=$jscomp.makeIterator(e.sources),n=t.next();!n.done;n=t.next()){var q=n.value;n=[];r.push(n);q=$jscomp.makeIterator(q);for(var u=q.next();!u.done;u=q.next())u=c.get(u.value),l.registerDisposer(u.addRef()),n.push(u)}b.h.copy(l.transform.transform,e.transform);l.transform.changed.add(l.layerChanged.dispatch);return l}c(d,e);return d}(m.c);w=n([Object(m.g)(f.d)],w);Object(m.f)(f.e,function(a){var c=this.get(a.id);a=a.value;var e=c.transform.transform;b.h.equals(a,e)||(b.h.copy(e,a),c.transform.changed.dispatch())})},
function(p,f,m){f.b=function(k,g,c,a){for(;g<c;){var b=k[g];a(b)?++g:(--c,k[g]=k[c],k[c]=b)}return c};f.a=function(k,g){var c=k.length,a=Array(c);g=a[0]=void 0===g?1:g;for(var b=1;b<c;++b)g*=k[b-1],a[b]=g;return a};f.c=function(k,g,c){for(var a=new k.constructor(k.length),b=0;b<g*c;b+=c)for(var h=0;h<c;h++)a[h*g+b/c]=k[b+h];return a}},function(p,f,m){f.b=function(k,g){return k.low+","+k.high+(g?"_"+g.center.toString()+"_"+g.size.toString():"")};f.a=function(k,g){var c=k.segmentEquivalences;k=$jscomp.makeIterator(k.visibleSegments);
for(var a=k.next();!a.done;a=k.next())if(a=a.value,c.disjointSets.isMinElement(a))for(var b=$jscomp.makeIterator(c.setElements(a)),h=b.next();!h.done;h=b.next())g(h.value,a)}},function(p,f,m){function k(g,c,a,b,h,q,l){for(var d=new Map,n=Array(3),J=2,u=0;3>u;++u){var e=n[u]=Math.ceil(b[u]/c[u]);J*=e}u=n[0];e=n[1];n=n[2];var y=b[0],k=b[1];b=b[2];var f=c[0],m=c[1],p=c[2],x=g.length,H=x,t=[0,0,0];g.resize(x+J);J=q[0];for(var A=q[1],I=q[2],r=0;r<n;++r){t[2]=Math.min(p,b-r*p);for(var L=0;L<e;++L){t[1]=
Math.min(m,k-L*m);for(var G=0;G<u;++G){t[0]=Math.min(f,y-G*f);var D=g.length-x,B=$jscomp.makeIterator(l(a,h+(r*p*I+L*m*A+G*f*J),q,c,t,x,d,g)),C=B.next().value;B=B.next().value;var Q=g.data;Q[H++]=B|C<<24;Q[H++]=D}}}}f.c=function(g,c,a,b,h,q,l,d,n){if(1===h)var J=0;else for(J=1;1<<J<h;)J*=2;var u=Math.ceil(J*b/32),e=g.length,y=u,k=!1,f=Array.prototype.join.call(q.subarray(0,h*n),",");b=a.get(f);void 0===b&&(k=!0,y+=h*n,b=e+u-c,a.set(f,b));g.resize(e+y);g=g.data;if(0<J)switch(J){case 1:for(c=a=0;a<
u;++a)y=0,y|=d[l[c+0]]<<0,y|=d[l[c+1]]<<1,y|=d[l[c+2]]<<2,y|=d[l[c+3]]<<3,y|=d[l[c+4]]<<4,y|=d[l[c+5]]<<5,y|=d[l[c+6]]<<6,y|=d[l[c+7]]<<7,y|=d[l[c+8]]<<8,y|=d[l[c+9]]<<9,y|=d[l[c+10]]<<10,y|=d[l[c+11]]<<11,y|=d[l[c+12]]<<12,y|=d[l[c+13]]<<13,y|=d[l[c+14]]<<14,y|=d[l[c+15]]<<15,y|=d[l[c+16]]<<16,y|=d[l[c+17]]<<17,y|=d[l[c+18]]<<18,y|=d[l[c+19]]<<19,y|=d[l[c+20]]<<20,y|=d[l[c+21]]<<21,y|=d[l[c+22]]<<22,y|=d[l[c+23]]<<23,y|=d[l[c+24]]<<24,y|=d[l[c+25]]<<25,y|=d[l[c+26]]<<26,y|=d[l[c+27]]<<27,y|=d[l[c+
28]]<<28,y|=d[l[c+29]]<<29,y|=d[l[c+30]]<<30,y|=d[l[c+31]]<<31,g[e+a]=y,c+=32;break;case 2:for(c=a=0;a<u;++a)y=0,y|=d[l[c+0]]<<0,y|=d[l[c+1]]<<2,y|=d[l[c+2]]<<4,y|=d[l[c+3]]<<6,y|=d[l[c+4]]<<8,y|=d[l[c+5]]<<10,y|=d[l[c+6]]<<12,y|=d[l[c+7]]<<14,y|=d[l[c+8]]<<16,y|=d[l[c+9]]<<18,y|=d[l[c+10]]<<20,y|=d[l[c+11]]<<22,y|=d[l[c+12]]<<24,y|=d[l[c+13]]<<26,y|=d[l[c+14]]<<28,y|=d[l[c+15]]<<30,g[e+a]=y,c+=16;break;case 4:for(c=a=0;a<u;++a)y=0,y|=d[l[c+0]]<<0,y|=d[l[c+1]]<<4,y|=d[l[c+2]]<<8,y|=d[l[c+3]]<<12,
y|=d[l[c+4]]<<16,y|=d[l[c+5]]<<20,y|=d[l[c+6]]<<24,y|=d[l[c+7]]<<28,g[e+a]=y,c+=8;break;case 8:for(c=a=0;a<u;++a)y=0,y|=d[l[c+0]]<<0,y|=d[l[c+1]]<<8,y|=d[l[c+2]]<<16,y|=d[l[c+3]]<<24,g[e+a]=y,c+=4;break;case 16:for(c=a=0;a<u;++a)y=0,y|=d[l[c+0]]<<0,y|=d[l[c+1]]<<16,g[e+a]=y,c+=2;break;case 32:for(c=a=0;a<u;++a)y=0,y|=d[l[c+0]]<<0,g[e+a]=y,c+=1}if(k)for(l=e+u,d=0,h*=n;d<h;++d)g[l++]=q[d];return[J,b]};f.a=k;f.b=function(g,c,a,b,h,q,l){var d=g.length,n=b[3];g.resize(d+n);for(var J=0;J<n;++J)g.data[d+
J]=g.length,k(g,c,a,b,h+q[3]*J,q,l)}},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"b",function(){return d});m.d(f,"a",function(){return n});f.c=function(c,d){function e(){h=c.value;l=new b.a;d(l,h)}var h,l,n=a()(function(){c.value!==h&&(l.dispose(),e())},0),q=c.changed.add(n);e();return function(){n.cancel();q();l.dispose()}};p=m(70);var a=m.n(p),b=m(16),h=m(8),q=function u(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===
e){if(a=Object.getPrototypeOf(a),null!==a)return u(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},l=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),d=function(){function a(b){c(this,a);this.value_=b;this.changed=new h.a}l(a,[{key:"value",get:function(){return this.value_},
set:function(a){a!==this.value_&&(this.value_=a,this.changed.dispatch())}}]);return a}();(function(a){function b(a,e,d){d=void 0===d?a:d;c(this,b);a=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a));a.validator=e;a.defaultValue=d;return a}g(b,a);l(b,[{key:"toJSON",value:function(){if(this.value_!==this.defaultValue)return this.value_}},{key:"reset",value:function(){this.value=this.defaultValue}},{key:"restoreState",value:function(a){if(void 0!==a){var b=this.validator;try{this.value=b(a);
return}catch(v){}}this.value=this.defaultValue}}]);return b})(d);(function(a){function b(a,e){c(this,b);var d=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));d.changed=new h.a;d.f=a;d.ws=e;a=$jscomp.makeIterator(e);for(e=a.next();!e.done;e=a.next())d.registerDisposer(e.value.changed.add(d.changed.dispatch));return d}g(b,a);l(b,[{key:"value",get:function(){return this.f.apply(this,[].concat($jscomp.arrayFromIterable(this.ws.map(function(a){return a.value}))))}}]);return b})(b.a);(function(a){function b(a,
e){for(var d=[],l=1;l<arguments.length;++l)d[l-1]=arguments[l];c(this,b);l=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));l.f=a;l.changed=new h.a;d=$jscomp.makeIterator(d);for(var n=d.next();!n.done;n=d.next())l.registerDisposer(n.value.add(l.changed.dispatch));return l}g(b,a);l(b,[{key:"value",get:function(){return this.f()}}]);return b})(b.a);(function(a){function b(a,e){c(this,b);var d=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));d.validator=a;d.jsonConverter=e;return d}
g(b,a);l(b,[{key:"toJSON",value:function(){var a=this.value;return a&&this.jsonConverter(a)}},{key:"restoreState",value:function(a){this.value=this.validator(a)}}]);return b})(function(a){function b(){c(this,b);var a=k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.changed=new h.a;return a}g(b,a);l(b,[{key:"reset",value:function(){this.value=void 0}},{key:"disposed",value:function(){void 0!==this.value_&&this.value_.dispose();this.value_=void 0;q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"disposed",this).call(this)}},{key:"value",get:function(){return this.value_},set:function(a){var b=this,c=this.value_;this.value_=a;void 0!==c&&(c.dispose(),this.valueHandler=void 0);if(void 0!==a){var e=this.valueHandler=function(){b.value_===a&&(b.value_=void 0,b.changed.dispatch())};a.registerDisposer(e)}a!==c&&this.changed.dispatch()}}]);return b}(b.a));var n=function(){function a(b){c(this,a);this.changed=new h.a;this.values=void 0===b?new Set:new Set(b)}$jscomp.initSymbol();$jscomp.initSymbolIterator();
l(a,[{key:"add",value:function(a){var b=this.values;b.has(a)||(b.add(a),this.changed.dispatch());return this}},{key:"delete",value:function(a){return this.values.delete(a)?(this.changed.dispatch(),!0):!1}},{key:"has",value:function(a){return this.values.has(a)}},{key:Symbol.iterator,value:function(){$jscomp.initSymbol();$jscomp.initSymbolIterator();return this.values[Symbol.iterator]()}},{key:"clear",value:function(){var a=this.values;0<a.size&&(a.clear(),this.changed.dispatch())}},{key:"size",get:function(){return this.values.size}}]);
return a}()},function(p,f,m){f.a=function(k,g){k.data=new Uint32Array(g)}},function(p,f,m){f.a=function(h,q){var l=h.source.spec;if(l.compressedSegmentationBlockSize){var d=l.dataType;a.clear();var n=h.chunkDataSize;b[0]=n[0];b[1]=n[1];b[2]=n[2];b[3]=l.numChannels;switch(d){case k.a.UINT32:Object(g.a)(a,l.compressedSegmentationBlockSize,q,b);break;case k.a.UINT64:Object(c.a)(a,l.compressedSegmentationBlockSize,q,b);break;default:throw Error("Unsupported data type for compressed segmentation: "+k.a[d]);
}h.data=new Uint32Array(a.view)}else h.data=q};var k=m(9),g=m(97),c=m(98),a=new (m(99).a)(2E4),b=Array(4)},function(p,f,m){f=m(6).assign;var k=m(104),g=m(107);m=m(51);var c={};f(c,k,g,m);p.exports=c},function(p,f,m){p.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return J});
p=m(2);var a=m(7),b=m(15),h=m(12),q=m(123),l=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),d=function e(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return e(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===
b?void 0:b.call(c)}},n=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.backendOnly=!0;return a}c(b,a);l(b,[{key:"initialize",value:function(a){d(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.requesters=new Set}},{key:"downloadSucceeded",value:function(){d(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this);var a=this.requesters,c=this.data;this.requesters=
void 0;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next())e.value.resolve(c)}},{key:"downloadFailed",value:function(a){d(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadFailed",this).call(this,a);var c=this.requesters;this.requesters=void 0;c=$jscomp.makeIterator(c);for(var e=c.next();!e.done;e=c.next())e.value.reject(a)}},{key:"freeSystemMemory",value:function(){this.data=void 0}}]);return b}(p.Chunk),J=function(e){function d(a,b){k(this,d);var c=g(this,(d.__proto__||
Object.getPrototypeOf(d)).call(this,a));c.decodeFile=b;c.registerDisposer(a);c.registerDisposer(c.chunkManager.recomputeChunkPrioritiesLate.add(function(){c.updateChunkPriorities()}));return c}c(d,e);l(d,[{key:"updateChunkPriorities",value:function(){for(var a=this.chunkManager,b=$jscomp.makeIterator(this.chunks.values()),c=b.next();!c.done;c=b.next()){c=c.value;var e=c.requesters;if(void 0!==e){e=$jscomp.makeIterator(e);for(var d=e.next();!d.done;d=e.next())d=d.value.getPriority(),a.requestChunk(c,
d.priorityTier,d.priority)}}}},{key:"download",value:function(a,b){var c=this;return Object(h.e)(Object(h.b)(a.key),"arraybuffer",b).then(function(b){a.data=c.decodeFile(b)})}},{key:"getData",value:function(c,e,d){var h=this,l=this.chunks.get(c);void 0===l&&(l=this.getNewChunk_(n),l.initialize(c),this.addChunk(l));return Object(b.d)(d,function(c,d,n){switch(l.state){case a.e.FAILED:d(l.error);return;case a.e.SYSTEM_MEMORY_WORKER:c(l.data);return}var t={resolve:c,reject:d,getPriority:e};l.requesters.add(t);
n.add(function(){var a=l.requesters;void 0!==a&&(a.delete(t),h.chunkManager.scheduleUpdateChunkPriorities());d(b.a)});h.chunkManager.scheduleUpdateChunkPriorities()})}}],[{key:"get",value:function(a,b){return a.memoize.get("getFileSource:"+Object(q.a)(b),function(){return new d(a,b)})}},{key:"getData",value:function(a,b,c,e,h){a=d.get(a,b);c=a.getData(c,e,h);a.dispose();return c}}]);return d}(p.ChunkSourceBase)},function(p,f,m){var k=k||{};k.Utils=k.Utils||{};k.Utils.crcTable=null;k.Utils.GUNZIP_MAGIC_COOKIE1=
31;k.Utils.GUNZIP_MAGIC_COOKIE2=139;k.Utils.getStringAt=function(g,c,a){for(var b="",h;c<a;c+=1)h=g.getUint8(c),0!==h&&(b+=String.fromCharCode(h));return b};k.Utils.getByteAt=function(g,c){return g.getInt8(c)};k.Utils.getShortAt=function(g,c,a){return g.getInt16(c,a)};k.Utils.getIntAt=function(g,c,a){return g.getInt32(c,a)};k.Utils.getFloatAt=function(g,c,a){return g.getFloat32(c,a)};k.Utils.getDoubleAt=function(g,c,a){return g.getFloat64(c,a)};k.Utils.getLongAt=function(g,c,a){var b,h=[],q=0;for(b=
0;8>b;b+=1)h[b]=k.Utils.getByteAt(g,c+b,a);for(b=h.length-1;0<=b;b--)q=256*q+h[b];return q};k.Utils.toArrayBuffer=function(g){var c;var a=new ArrayBuffer(g.length);var b=new Uint8Array(a);for(c=0;c<g.length;c+=1)b[c]=g[c];return a};k.Utils.isString=function(g){return"string"===typeof g||g instanceof String};k.Utils.formatNumber=function(g,c){g=k.Utils.isString(g)?Number(g):g;g=c?g.toPrecision(5):g.toPrecision(7);return parseFloat(g)};k.Utils.makeCRCTable=function(){for(var g,c=[],a=0;256>a;a++){g=
a;for(var b=0;8>b;b++)g=g&1?3988292384^g>>>1:g>>>1;c[a]=g}return c};k.Utils.crc32=function(g){for(var c=k.Utils.crcTable||(k.Utils.crcTable=k.Utils.makeCRCTable()),a=-1,b=0;b<g.byteLength;b++)a=a>>>8^c[(a^g.getUint8(b))&255];return(a^-1)>>>0};"undefined"!==typeof p&&p.exports&&(p.exports=k.Utils)},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,
enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"a",function(){return q});var c=m(16),a=m(3),b=function d(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===e){if(a=Object.getPrototypeOf(a),null!==a)return d(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},
h=function(){function a(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),q=function(d){function n(){g(this,n);var a=(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:
a}k(n,d);h(n,[{key:"get",value:function(c,d){"string"!==typeof c&&(c=Object(a.e)(c));return b(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"get",this).call(this,c,d)}},{key:"getUncounted",value:function(a,b){return this.get(a,function(){return new c.b(b())}).value}}]);return n}(function(){function a(){g(this,a);this.map=new Map}h(a,[{key:"get",value:function(a,b){var c=this.map,e=c.get(a);void 0===e?(e=b(),e.registerDisposer(function(){c.delete(a)}),c.set(a,e)):e.addRef();return e}}]);
return a}())},function(p,f,m){m(4);m(59);m(60);m(33);var k=m(61),g=m(62);m(63);var c=m(34);m(35);m.d(f,"a",function(){return k});m.d(f,"b",function(){return g});m.d(f,"c",function(){return c})},function(p,f,m){f.a=function(){var g=new k.a(9);g[0]=1;g[1]=0;g[2]=0;g[3]=0;g[4]=1;g[5]=0;g[6]=0;g[7]=0;g[8]=1;return g};var k=m(4)},function(p,f,m){function k(){var a=new u.a(3);a[0]=0;a[1]=0;a[2]=0;return a}function g(a){var b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)}function c(a,b,c){var e=new u.a(3);
e[0]=a;e[1]=b;e[2]=c;return e}function a(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];a[2]=b[2]-c[2];return a}function b(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];a[2]=b[2]*c[2];return a}function h(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];a[2]=b[2]/c[2];return a}function q(a,b){var c=b[0]-a[0],e=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(c*c+e*e+a*a)}function l(a,b){var c=b[0]-a[0],e=b[1]-a[1];a=b[2]-a[2];return c*c+e*e+a*a}function d(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a}function n(a,b){var c=b[0],e=b[1],d=
b[2];c=c*c+e*e+d*d;0<c&&(c=1/Math.sqrt(c),a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c);return a}function J(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}Object.defineProperty(f,"__esModule",{value:!0});f.create=k;f.clone=function(a){var b=new u.a(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b};f.length=g;f.fromValues=c;f.copy=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a};f.set=function(a,b,c,d){a[0]=b;a[1]=c;a[2]=d;return a};f.add=function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];return a};f.subtract=
a;f.multiply=b;f.divide=h;f.ceil=function(a,b){a[0]=Math.ceil(b[0]);a[1]=Math.ceil(b[1]);a[2]=Math.ceil(b[2]);return a};f.floor=function(a,b){a[0]=Math.floor(b[0]);a[1]=Math.floor(b[1]);a[2]=Math.floor(b[2]);return a};f.min=function(a,b,c){a[0]=Math.min(b[0],c[0]);a[1]=Math.min(b[1],c[1]);a[2]=Math.min(b[2],c[2]);return a};f.max=function(a,b,c){a[0]=Math.max(b[0],c[0]);a[1]=Math.max(b[1],c[1]);a[2]=Math.max(b[2],c[2]);return a};f.round=function(a,b){a[0]=Math.round(b[0]);a[1]=Math.round(b[1]);a[2]=
Math.round(b[2]);return a};f.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;return a};f.scaleAndAdd=function(a,b,c,d){a[0]=b[0]+c[0]*d;a[1]=b[1]+c[1]*d;a[2]=b[2]+c[2]*d;return a};f.distance=q;f.squaredDistance=l;f.squaredLength=d;f.negate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];return a};f.inverse=function(a,b){a[0]=1/b[0];a[1]=1/b[1];a[2]=1/b[2];return a};f.normalize=n;f.dot=J;f.cross=function(a,b,c){var e=b[0],d=b[1];b=b[2];var h=c[0],l=c[1];c=c[2];a[0]=d*c-b*l;a[1]=b*h-e*c;a[2]=
e*l-d*h;return a};f.lerp=function(a,b,c,d){var e=b[0],h=b[1];b=b[2];a[0]=e+d*(c[0]-e);a[1]=h+d*(c[1]-h);a[2]=b+d*(c[2]-b);return a};f.hermite=function(a,b,c,d,h,l){var e=l*l,n=e*(2*l-3)+1,t=e*(l-2)+l,q=e*(l-1);l=e*(3-2*l);a[0]=b[0]*n+c[0]*t+d[0]*q+h[0]*l;a[1]=b[1]*n+c[1]*t+d[1]*q+h[1]*l;a[2]=b[2]*n+c[2]*t+d[2]*q+h[2]*l;return a};f.bezier=function(a,b,c,d,h,l){var e=1-l,n=e*e,t=l*l,q=n*e;n*=3*l;e*=3*t;l*=t;a[0]=b[0]*q+c[0]*n+d[0]*e+h[0]*l;a[1]=b[1]*q+c[1]*n+d[1]*e+h[1]*l;a[2]=b[2]*q+c[2]*n+d[2]*e+
h[2]*l;return a};f.random=function(a,b){b=b||1;var c=2*u.c()*Math.PI,d=2*u.c()-1,e=Math.sqrt(1-d*d)*b;a[0]=Math.cos(c)*e;a[1]=Math.sin(c)*e;a[2]=d*b;return a};f.transformMat4=function(a,b,c){var d=b[0],e=b[1];b=b[2];var h=c[3]*d+c[7]*e+c[11]*b+c[15];h=h||1;a[0]=(c[0]*d+c[4]*e+c[8]*b+c[12])/h;a[1]=(c[1]*d+c[5]*e+c[9]*b+c[13])/h;a[2]=(c[2]*d+c[6]*e+c[10]*b+c[14])/h;return a};f.transformMat3=function(a,b,c){var d=b[0],e=b[1];b=b[2];a[0]=d*c[0]+e*c[3]+b*c[6];a[1]=d*c[1]+e*c[4]+b*c[7];a[2]=d*c[2]+e*c[5]+
b*c[8];return a};f.transformQuat=function(a,b,c){var d=b[0],e=b[1],h=b[2];b=c[0];var l=c[1],n=c[2];c=c[3];var t=c*d+l*h-n*e,q=c*e+n*d-b*h,g=c*h+b*e-l*d;d=-b*d-l*e-n*h;a[0]=t*c+d*-b+q*-n-g*-l;a[1]=q*c+d*-l+g*-b-t*-n;a[2]=g*c+d*-n+t*-l-q*-b;return a};f.rotateX=function(a,b,c,d){var e=[],h=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];h[0]=e[0];h[1]=e[1]*Math.cos(d)-e[2]*Math.sin(d);h[2]=e[1]*Math.sin(d)+e[2]*Math.cos(d);a[0]=h[0]+c[0];a[1]=h[1]+c[1];a[2]=h[2]+c[2];return a};f.rotateY=function(a,b,
c,d){var e=[],h=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];h[0]=e[2]*Math.sin(d)+e[0]*Math.cos(d);h[1]=e[1];h[2]=e[2]*Math.cos(d)-e[0]*Math.sin(d);a[0]=h[0]+c[0];a[1]=h[1]+c[1];a[2]=h[2]+c[2];return a};f.rotateZ=function(a,b,c,d){var e=[],h=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];h[0]=e[0]*Math.cos(d)-e[1]*Math.sin(d);h[1]=e[0]*Math.sin(d)+e[1]*Math.cos(d);h[2]=e[2];a[0]=h[0]+c[0];a[1]=h[1]+c[1];a[2]=h[2]+c[2];return a};f.angle=function(a,b){a=c(a[0],a[1],a[2]);b=c(b[0],b[1],b[2]);n(a,
a);n(b,b);b=J(a,b);return 1<b?0:-1>b?Math.PI:Math.acos(b)};f.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};f.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]};f.equals=function(a,b){var c=a[0],d=a[1];a=a[2];var e=b[0],h=b[1];b=b[2];return Math.abs(c-e)<=u.b*Math.max(1,Math.abs(c),Math.abs(e))&&Math.abs(d-h)<=u.b*Math.max(1,Math.abs(d),Math.abs(h))&&Math.abs(a-b)<=u.b*Math.max(1,Math.abs(a),Math.abs(b))};var u=m(4);f.sub=a;f.mul=b;f.div=h;f.dist=q;f.sqrDist=l;f.len=
g;f.sqrLen=d;p=function(){var a=k();return function(b,c,d,e,h,l){c||(c=3);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d<e;d+=c)a[0]=b[d],a[1]=b[d+1],a[2]=b[d+2],h(a,a,l),b[d]=a[0],b[d+1]=a[1],b[d+2]=a[2];return b}}();f.forEach=p},function(p,f,m){function k(){var c=new g.a(4);c[0]=0;c[1]=0;c[2]=0;c[3]=0;return c}f.b=function(c){var a=new g.a(4);a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a};f.g=function(c,a,b,h){var q=new g.a(4);q[0]=c;q[1]=a;q[2]=b;q[3]=h;return q};f.c=function(c,a){c[0]=
a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];return c};f.l=function(c,a,b,h,q){c[0]=a;c[1]=b;c[2]=h;c[3]=q;return c};f.a=function(c,a,b){c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c};f.k=function(c,a,b){c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};f.h=function(c){var a=c[0],b=c[1],h=c[2];c=c[3];return Math.sqrt(a*a+b*b+h*h+c*c)};f.m=function(c){var a=c[0],b=c[1],h=c[2];c=c[3];return a*a+b*b+h*h+c*c};f.j=function(c,a){var b=a[0],h=a[1],q=a[2];a=a[3];var l=b*b+h*h+q*q+a*a;
0<l&&(l=1/Math.sqrt(l),c[0]=b*l,c[1]=h*l,c[2]=q*l,c[3]=a*l);return c};f.d=function(c,a){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]};f.i=function(c,a,b,h){var q=a[0],l=a[1],d=a[2];a=a[3];c[0]=q+h*(b[0]-q);c[1]=l+h*(b[1]-l);c[2]=d+h*(b[2]-d);c[3]=a+h*(b[3]-a);return c};f.f=function(c,a){return c[0]===a[0]&&c[1]===a[1]&&c[2]===a[2]&&c[3]===a[3]};f.e=function(c,a){var b=c[0],h=c[1],q=c[2];c=c[3];var l=a[0],d=a[1],n=a[2];a=a[3];return Math.abs(b-l)<=g.b*Math.max(1,Math.abs(b),Math.abs(l))&&Math.abs(h-
d)<=g.b*Math.max(1,Math.abs(h),Math.abs(d))&&Math.abs(q-n)<=g.b*Math.max(1,Math.abs(q),Math.abs(n))&&Math.abs(c-a)<=g.b*Math.max(1,Math.abs(c),Math.abs(a))};var g=m(4);(function(){var c=k();return function(a,b,h,q,l,d){b||(b=4);h||(h=0);for(q=q?Math.min(q*b+h,a.length):a.length;h<q;h+=b)c[0]=a[h],c[1]=a[h+1],c[2]=a[h+2],c[3]=a[h+3],l(c,c,d),a[h]=c[0],a[h+1]=c[1],a[h+2]=c[2],a[h+3]=c[3];return a}})()},function(p,f){p.exports=function(f){var k=typeof f;return null!=f&&("object"==k||"function"==k)}},
function(p,f,m){f=m(72);m="object"==typeof self&&self&&self.Object===Object&&self;f=f||m||Function("return this")();p.exports=f},function(p,f,m){f=m(37).Symbol;p.exports=f},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"PerspectiveViewState",function(){return b});m.d(f,"PerspectiveViewRenderLayer",function(){return h});p=m(80);var a=m(24);m=m(0);f=this&&this.__decorate||function(a,b,c,h){var d=arguments.length,l=3>d?b:null===h?h=Object.getOwnPropertyDescriptor(b,c):h,e;if("object"===
typeof Reflect&&"function"===typeof Reflect.decorate)l=Reflect.decorate(a,b,c,h);else for(var n=a.length-1;0<=n;n--)if(e=a[n])l=(3>d?e(l):3<d?e(b,c,l):e(b,c))||l;return 3<d&&l&&Object.defineProperty(b,c,l),l};var b=function(a){function b(a){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];k(this,b);var h;d=g(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],$jscomp.arrayFromIterable(c))));d.visibility=c[0].get(c[1].visibility);return d}c(b,a);return b}(m.c);b=
f([Object(m.g)(p.c)],b);var h=function(b){function h(){k(this,h);var b=g(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments));b.viewStates=new a.a;return b}c(h,b);return h}(m.c);Object(m.f)(p.a,function(a){var b=this.get(a.view);this.get(a.layer).viewStates.add(b)});Object(m.f)(p.b,function(a){var b=this.get(a.view);this.get(a.layer).viewStates.delete(b)})},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a){return function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}
c(b,a);y(b,[{key:"serialize",value:function(a,c){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);this.data.serialize(a,c);this.data=void 0}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.data.numBytes;K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.data=void 0}}]);return b}(a)}Object.defineProperty(f,"__esModule",
{value:!0});m.d(f,"AnnotationMetadataChunk",function(){return v});m.d(f,"AnnotationGeometryData",function(){return w});m.d(f,"AnnotationGeometryChunk",function(){return F});m.d(f,"AnnotationSubsetGeometryChunk",function(){return x});m.d(f,"AnnotationSource",function(){return t});var b=m(41),h=m(82);p=m(2);var q=m(7),l=m(39),d=m(22),n=m(20),J=m(24),u=m(1),e=m(11);m=m(0);var y=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in
d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),K=function I(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return I(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,d){var r=arguments.length,e=3>r?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,h;if("object"===
typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)if(h=a[l])e=(3>r?h(e):3<r?h(b,c,e):h(b,c))||e;return 3<r&&e&&Object.defineProperty(b,c,e),e};var v=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);y(b,[{key:"freeSystemMemory",value:function(){this.annotation=void 0}},{key:"serialize",value:function(a,c){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"serialize",this).call(this,a,c);a.annotation=this.annotation}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=0;K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(p.Chunk),w=function(){function a(){k(this,a)}y(a,[{key:"serialize",value:function(a,b){a.data=this.data;a.typeToOffset=this.typeToOffset;a.typeToIds=this.typeToIds;a.segmentList=this.segmentList;a.segmentListIndex=this.segmentListIndex;b.push(this.data.buffer,
this.segmentList.buffer,this.segmentListIndex.buffer)}},{key:"numBytes",get:function(){return this.data.byteLength}}]);return a}(),F=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);return b}(a(n.SliceViewChunk)),x=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);return b}(a(p.Chunk)),H=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,
arguments));a.parent=void 0;return a}c(b,a);y(b,[{key:"getChunk",value:function(a){var b=this.chunks.get(a);void 0===b&&(b=this.getNewChunk_(v),b.initialize(a),this.addChunk(b));return b}},{key:"download",value:function(a,b){return this.parent.downloadMetadata(a,b)}}]);return b}(p.ChunkSource);H=f([Object(m.g)(h.d)],H);n=function(a){function b(a,c){k(this,b);a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));a.parent=void 0;a.spec=new h.k(c.spec);return a}c(b,a);y(b,[{key:"download",
value:function(a,b){return this.parent.downloadGeometry(a,b)}}]);return b}(n.SliceViewChunkSource);n=f([Object(m.g)(h.c)],n);n.prototype.chunkConstructor=F;n=function(a){function b(a,c){k(this,b);a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));a.parent=void 0;return a}c(b,a);y(b,[{key:"getChunk",value:function(a){var b=Object(d.b)(a),c=this.chunks.get(b);void 0===c&&(c=this.getNewChunk_(x),c.initialize(b),c.objectId=a.clone(),this.addChunk(c));return c}},{key:"download",value:function(a,
b){return this.parent.downloadSegmentFilteredGeometry(a,b)}}]);return b}(p.ChunkSource);n=f([Object(m.g)(h.j)],n);var t=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));d.references=new Set;var e=d.chunkManager=a.get(c.chunkManager),h=d.metadataChunkSource=d.registerDisposer(a.getRef(c.metadataChunkSource));d.sources=c.sources.map(function(b){return b.map(function(b){b=d.registerDisposer(a.getRef(b));b.parent=d;return b})});d.segmentFilteredSource=
d.registerDisposer(a.getRef(c.segmentFilteredSource));d.segmentFilteredSource.parent=d;h.parent=d;d.registerDisposer(e.recomputeChunkPriorities.add(function(){return d.recomputeChunkPriorities()}));return d}c(b,a);y(b,[{key:"recomputeChunkPriorities",value:function(){for(var a=this.chunkManager,b=this.metadataChunkSource,c=$jscomp.makeIterator(this.references),d=c.next();!d.done;d=c.next())a.requestChunk(b.getChunk(d.value),q.d.VISIBLE,200)}},{key:"add",value:function(a){a;throw Error("Not implemented");
}},{key:"delete",value:function(a){a;throw Error("Not implemented");}},{key:"update",value:function(a,b){a;b;throw Error("Not implemented");}}]);return b}(m.c);Object(m.f)(h.f,function(a){var b=this.get(a.id);b.references.add(a.annotation);b.chunkManager.scheduleUpdateChunkPriorities()});Object(m.f)(h.g,function(a){var b=this.get(a.id);b.references.delete(a.annotation);b.chunkManager.scheduleUpdateChunkPriorities()});Object(m.f)(h.b,function(a){var c=this,d=this.get(a.id),e=a.annotationId,l=Object(b.c)(a.newAnnotation);
(void 0===e?d.add(l).then(function(a){return Object.assign({},l,{id:a})}):null===l?d.delete(e).then(function(){return null}):d.update(e,l).then(function(){return l})).then(function(a){d.wasDisposed||c.invoke(h.a,{id:d.rpcId,annotationId:e||l.id,newAnnotation:a})},function(a){d.wasDisposed||c.invoke(h.a,{id:d.rpcId,annotationId:e,error:a.message})})});l=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));d.source=a.get(c.source);d.filterBySegmentation=
a.get(c.filterBySegmentation);d.viewStates.changed.add(function(){return d.source.chunkManager.scheduleUpdateChunkPriorities()});d.filterBySegmentation.changed.add(function(){return d.source.chunkManager.scheduleUpdateChunkPriorities()});d.registerDisposer(d.source.chunkManager.recomputeChunkPriorities.add(function(){return d.recomputeChunkPriorities()}));return d}c(b,a);y(b,[{key:"recomputeChunkPriorities",value:function(){var a=this.source;if(!this.filterBySegmentation.value)for(var b=$jscomp.makeIterator(this.viewStates),
c=b.next();!c.done;c=b.next()){var d=c.value.visibility.value;if(d!==Number.NEGATIVE_INFINITY){c=Object(e.b)(d);d=Object(e.a)(d);for(var h=$jscomp.makeIterator(a.sources),r=h.next();!r.done;r=h.next()){r=$jscomp.makeIterator(r.value);for(var l=r.next();!l.done;l=r.next())l=l.value.getChunk(u.g),a.chunkManager.requestChunk(l,c,d)}}}}}]);return b}(l.PerspectiveViewRenderLayer);l=f([Object(m.g)(h.e)],l);l;p=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,
a,c));d.segmentationState=new J.b(void 0);d.source=a.get(c.source);d.segmentationState.value=d.getSegmentationState(c.segmentationState);var e=function(){return d.chunkManager.scheduleUpdateChunkPriorities()};d.registerDisposer(Object(J.c)(d.segmentationState,function(a,b){null!=b&&(a.registerDisposer(b.visibleSegments.changed.add(e)),a.registerDisposer(b.segmentEquivalences.changed.add(e)))}));d.registerDisposer(d.chunkManager.recomputeChunkPriorities.add(function(){return d.recomputeChunkPriorities()}));
return d}c(b,a);y(b,[{key:"recomputeChunkPriorities",value:function(){var a=this.segmentationState.value;if(null!=a){var b=this.visibility.value;if(b!==Number.NEGATIVE_INFINITY){var c=Object(e.b)(b),h=Object(e.a)(b),r=this.chunkManager,l=this.source.segmentFilteredSource;Object(d.a)(a,function(a){a=l.getChunk(a);r.requestChunk(a,c,h+60)})}}}},{key:"getSegmentationState",value:function(a){return null==a?a:{visibleSegments:this.rpc.get(a.visibleSegments),segmentEquivalences:this.rpc.get(a.segmentEquivalences)}}}]);
return b}(Object(e.c)(Object(p.withChunkManager)(m.c)));p=f([Object(m.g)(h.h)],p);p;Object(m.f)(h.i,function(a){var b=this.get(a.id);b.segmentationState.value=b.getSegmentationState(a.segmentationState)})},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a){var b=w.get(a.type).toJSON(a);b.type=K[a.type].toLowerCase();b.id=a.id;b.description=a.description||void 0;a=a.segments;void 0!==a&&0<a.length&&(b.segments=a.map(function(a){return a.toString()}));return b}
function b(a,b){b=void 0===b?!1:b;Object(d.i)(a);var c=Object(d.j)(a,"type",function(a){return Object(d.h)(a,K)});b={id:Object(d.j)(a,"id",b?d.k:d.l)||Object(n.a)(160),description:Object(d.j)(a,"description",d.k),segments:Object(d.j)(a,"segments",function(a){return void 0===a?void 0:Object(d.a)(a,function(a){return u.a.parseString(a)})}),type:c};w.get(c).restoreState(b,a);return b}function h(a,b){return a.id<b.id?-1:a.id===b.id?0:1}function q(a){for(var b=0,c=[],d=0,e=0,r=$jscomp.makeIterator(v),
l=r.next();!l.done;l=r.next()){l=l.value;c[l]=b;for(var n=a[l],q=0,g=$jscomp.makeIterator(n),u=g.next();!u.done;u=g.next())u=u.value.segments,void 0!==u&&(q+=u.length);e+=n.length;d+=q;n.sort(h);n=n.length;l=w.get(l);b+=l.serializedBytes*n}var k=new Uint32Array(e+1),f=new Uint32Array(2*d);d=[];b=new ArrayBuffer(b);var m=0,J=0;e={};r=$jscomp.makeIterator(v);for(l=r.next();!l.done;e={serializer:e.serializer},l=r.next())l=l.value,n=a[l],d[l]=n.map(function(a){return a.id}),q=n.length,g=w.get(l),e.serializer=
g.serializer(b,c[l],q),n.forEach(function(a){return function(b,c){a.serializer(b,c);k[J++]=m;b=b.segments;if(void 0!==b)for(b=$jscomp.makeIterator(b),c=b.next();!c.done;c=b.next())c=c.value,f[2*m]=c.low,f[2*m+1]=c.high,++m}}(e));return{data:new Uint8Array(b),typeToIds:d,typeToOffset:c,segmentListIndex:k,segmentList:f}}m.d(f,"b",function(){return K});m.d(f,"a",function(){return F});f.c=function(a){if(null==a)return a;var b=a.segments;void 0!==b&&(a.segments=b.map(function(a){return new u.a(a.low,a.high)}));
return a};p=m(16);var l=m(1),d=m(3),n=m(81),J=m(8),u=m(5),e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),y=function(a){function b(a){k(this,b);var c=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));c.id=a;c.changed=new J.a;return c}c(b,a);return b}(p.a),K;(function(a){a[a.POINT=0]="POINT";a[a.LINE=
1]="LINE";a[a.AXIS_ALIGNED_BOUNDING_BOX=2]="AXIS_ALIGNED_BOUNDING_BOX";a[a.ELLIPSOID=3]="ELLIPSOID"})(K||(K={}));var v=[K.POINT,K.LINE,K.AXIS_ALIGNED_BOUNDING_BOX,K.ELLIPSOID],w=new Map;w.set(K.LINE,{icon:"\ua579",description:"Line",toJSON:function(a){return{pointA:Array.from(a.pointA),pointB:Array.from(a.pointB)}},restoreState:function(a,b){a.pointA=Object(d.j)(b,"pointA",d.g);a.pointB=Object(d.j)(b,"pointB",d.g)},serializedBytes:24,serializer:function(a,b,c){var d=new Float32Array(a,b,6*c);return function(a,
b){var c=a.pointA;a=a.pointB;b*=6;d[b]=c[0];d[b+1]=c[1];d[b+2]=c[2];d[b+3]=a[0];d[b+4]=a[1];d[b+5]=a[2]}}});w.set(K.POINT,{icon:"\u26ac",description:"Point",toJSON:function(a){return{point:Array.from(a.point)}},restoreState:function(a,b){a.point=Object(d.j)(b,"point",d.g)},serializedBytes:12,serializer:function(a,b,c){var d=new Float32Array(a,b,3*c);return function(a,b){a=a.point;b*=3;d[b]=a[0];d[b+1]=a[1];d[b+2]=a[2]}}});w.set(K.AXIS_ALIGNED_BOUNDING_BOX,{icon:"\u2751",description:"Bounding Box",
toJSON:function(a){return{pointA:Array.from(a.pointA),pointB:Array.from(a.pointB)}},restoreState:function(a,b){a.pointA=Object(d.j)(b,"pointA",d.g);a.pointB=Object(d.j)(b,"pointB",d.g)},serializedBytes:24,serializer:function(a,b,c){var d=new Float32Array(a,b,6*c);return function(a,b){var c=a.pointA;a=a.pointB;b*=6;d[b]=Math.min(c[0],a[0]);d[b+1]=Math.min(c[1],a[1]);d[b+2]=Math.min(c[2],a[2]);d[b+3]=Math.max(c[0],a[0]);d[b+4]=Math.max(c[1],a[1]);d[b+5]=Math.max(c[2],a[2])}}});w.set(K.ELLIPSOID,{icon:"\u25ce",
description:"Ellipsoid",toJSON:function(a){return{center:Array.from(a.center),radii:Array.from(a.radii)}},restoreState:function(a,b){a.center=Object(d.j)(b,"center",d.g);a.radii=Object(d.j)(b,"radii",d.f)},serializedBytes:24,serializer:function(a,b,c){var d=new Float32Array(a,b,6*c);return function(a,b){var c=a.radii;b*=6;d.set(a.center,b);d.set(c,b+3)}}});(function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);return b})(function(h){function q(a){a=
void 0===a?l.h.create():a;k(this,q);var b=g(this,(q.__proto__||Object.getPrototypeOf(q)).call(this));b.objectToLocal=a;b.annotationMap=new Map;b.changed=new J.a;b.readonly=!1;b.pending=new Set;b.references=new Map;return b}c(q,h);$jscomp.initSymbol();$jscomp.initSymbolIterator();e(q,[{key:"add",value:function(a,b){b=void 0===b?!0:b;if(!a.id)a.id=Object(n.a)(160);else if(this.annotationMap.has(a.id))throw Error("Annotation id already exists: "+JSON.stringify(a.id)+".");this.annotationMap.set(a.id,
a);this.changed.dispatch();b||this.pending.add(a.id);return this.getReference(a.id)}},{key:"commit",value:function(a){this.pending.delete(a.id)}},{key:"update",value:function(a,b){if(null===a.value)throw Error("Annotation already deleted.");a.value=b;this.annotationMap.set(b.id,b);a.changed.dispatch();this.changed.dispatch()}},{key:Symbol.iterator,value:function(){return this.annotationMap.values()}},{key:"get",value:function(a){return this.annotationMap.get(a)}},{key:"delete",value:function(a){null!==
a.value&&(a.value=null,this.annotationMap.delete(a.id),this.pending.delete(a.id),a.changed.dispatch(),this.changed.dispatch())}},{key:"getReference",value:function(a){var b=this,c=this.references.get(a);if(void 0!==c)return c.addRef();c=new y(a);c.value=this.annotationMap.get(a)||null;this.references.set(a,c);c.registerDisposer(function(){b.references.delete(a)});return c}},{key:"toJSON",value:function(){for(var b=[],c=this.pending,d=$jscomp.makeIterator(this),e=d.next();!e.done;e=d.next())e=e.value,
c.has(e.id)||b.push(a(e));return b}},{key:"clear",value:function(){this.annotationMap.clear();this.pending.clear();this.changed.dispatch()}},{key:"restoreState",value:function(a){var c=this.annotationMap;c.clear();this.pending.clear();void 0!==a&&Object(d.a)(a,function(a){a=b(a);c.set(a.id,a)});a=$jscomp.makeIterator(this.references.values());for(var e=a.next();!e.done;e=a.next()){e=e.value;var h=c.get(e.id);e.value=h||null;e.changed.dispatch()}this.changed.dispatch()}},{key:"reset",value:function(){this.clear()}}]);
return q}(p.a));var F=function(){function a(){k(this,a);this.annotations=[[],[],[],[]]}e(a,[{key:"add",value:function(a){this.annotations[a.type].push(a)}},{key:"serialize",value:function(){return q(this.annotations)}}]);return a}()},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return c});m(91);m(93);p=m(2);f=m(11);m=m(0);var c=function(a){function b(a,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var h=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));h.visibleSegments=a.get(c.visibleSegments);h.clipBounds=a.get(c.clipBounds);
h.segmentEquivalences=a.get(c.segmentEquivalences);a=function(){h.chunkManager.scheduleUpdateChunkPriorities()};h.registerDisposer(h.visibleSegments.changed.add(a));h.registerDisposer(h.segmentEquivalences.changed.add(a));h.registerDisposer(h.clipBounds.changed.add(a));return h}g(b,a);return b}(Object(f.c)(Object(p.withChunkManager)(m.c)))},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return e});f.b=function(b,c,d,e,h,l,n){Object(a.e)(b,2,c,d,e,h,l,n)};f=m(2);var a=m(18),b=m(42),h=m(22);p=m(96);
var q=m(5),l=m(11);m=m(0);var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),n=function K(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return K(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?
void 0:b.call(c)}},J=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,l;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var n=a.length-1;0<=n;n--)if(l=a[n])h=(3>e?l(h):3<e?l(b,c,h):l(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h},u=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.objectId=new q.a;a.vertexPositions=
null;a.vertexAttributes=null;a.indices=null;return a}c(b,a);d(b,[{key:"initializeSkeletonChunk",value:function(a,c){n(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.objectId.assign(c)}},{key:"freeSystemMemory",value:function(){this.vertexPositions=this.indices=null}},{key:"getVertexAttributeBytes",value:function(){var a=this.vertexPositions.byteLength,b=this.vertexAttributes;null!=b&&b.forEach(function(b){a+=b.byteLength});return a}},{key:"serialize",
value:function(a,c){n(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var d=this.vertexPositions,e=this.indices;a.indices=e;c.push(e.buffer);e=this.vertexAttributes;if(null!=e&&0<e.length){var h=new Uint8Array(this.getVertexAttributeBytes());h.set(new Uint8Array(d.buffer,d.byteOffset,d.byteLength));var l=a.vertexAttributeOffsets=new Uint32Array(e.length+1);l[0]=0;var q=d.byteLength;e.forEach(function(a,b){l[b+1]=q;h.set(new Uint8Array(a.buffer,a.byteOffset,
a.byteLength),q);q+=a.byteLength});c.push(h.buffer);a.vertexAttributes=h}else a.vertexAttributes=new Uint8Array(d.buffer,d.byteOffset,d.byteLength),a.vertexAttributeOffsets=Uint32Array.of(0),d.buffer!==c[0]&&c.push(d.buffer);this.vertexPositions=this.indices=this.vertexAttributes=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.indices.byteLength+this.getVertexAttributeBytes();n(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",
this).call(this)}}]);return b}(f.Chunk),e=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);d(b,[{key:"getChunk",value:function(a){var b=Object(h.b)(a),c=this.chunks.get(b);void 0===c&&(c=this.getNewChunk_(u),c.initializeSkeletonChunk(b,a),this.addChunk(c));return c}}]);return b}(f.ChunkSource);f=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));d.source=d.registerDisposer(a.getRef(c.source));
d.registerDisposer(d.chunkManager.recomputeChunkPriorities.add(function(){d.updateChunkPriorities()}));return d}c(b,a);d(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(l.b)(a),c=Object(l.a)(a),d=this.source,e=this.chunkManager;Object(h.a)(this,function(a){a=d.getChunk(a);e.requestChunk(a,b,c+60)})}}}]);return b}(b.a);f=J([Object(m.g)(p.a)],f)},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"c",function(){return q});m.d(f,"b",function(){return l});var g=m(9),c=m(10),a=m(1);m.d(f,"a",function(){return c.b});var b=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,
c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),h=function n(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,b);if(void 0===e){if(a=Object.getPrototypeOf(a),null!==a)return n(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}},q;(function(a){a[a.UNKNOWN=0]="UNKNOWN";a[a.IMAGE=1]="IMAGE";a[a.SEGMENTATION=2]="SEGMENTATION"})(q||(q={}));var l=function(l){function n(b){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");
for(var e=void 0===b.lowerVoxelBound?a.g:b.lowerVoxelBound,h=b.upperVoxelBound,l=b.chunkDataSize,q=b.voxelSize,g=b.transform,k=void 0===b.baseVoxelOffset?a.g:b.baseVoxelOffset,f=void 0===b.lowerClipBound?a.m.multiply(a.m.create(),q,e):b.lowerClipBound,m=void 0===b.upperClipBound?a.m.multiply(a.m.create(),q,h):b.upperClipBound,t=a.m.multiply(a.m.create(),l,q),u=a.m.create(),J=a.m.create(),r=0;3>r;++r)u[r]=Math.floor(e[r]/l[r]),J[r]=Math.floor((h[r]-1)/l[r]+1);q=(n.__proto__||Object.getPrototypeOf(n)).call(this,
{voxelSize:q,transform:g,lowerChunkBound:u,upperChunkBound:J,chunkSize:t});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");q=!q||"object"!==typeof q&&"function"!==typeof q?this:q;q.baseVoxelOffset=k;q.lowerClipBound=f;q.upperClipBound=m;q.lowerVoxelBound=e;q.upperVoxelBound=h;q.chunkDataSize=l;e=q.dataType=b.dataType;h=q.numChannels=b.numChannels;q.chunkBytes=Object(a.i)(l)*c.a[e]*h;q.compressedSegmentationBlockSize=b.compressedSegmentationBlockSize;
return q}k(n,l);b(n,[{key:"toObject",value:function(){return Object.assign({},h(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"toObject",this).call(this),{numChannels:this.numChannels,chunkDataSize:this.chunkDataSize,dataType:this.dataType,lowerVoxelBound:this.lowerVoxelBound,upperVoxelBound:this.upperVoxelBound,lowerClipBound:this.lowerClipBound,upperClipBound:this.upperClipBound,baseVoxelOffset:this.baseVoxelOffset,compressedSegmentationBlockSize:this.compressedSegmentationBlockSize})}}],
[{key:"make",value:function(a){return new n(Object.assign({},a,{transform:Object(g.k)(a.transform,a.volumeSourceOptions)}))}},{key:"fromObject",value:function(a){return new n(a)}},{key:"withDefaultCompression",value:function(a){var b=a.compressedSegmentationBlockSize,h=a.dataType,l=a.voxelSize,k=a.transform,f=a.lowerVoxelBound,m=a.upperVoxelBound;k=Object(g.k)(k,a.volumeSourceOptions);void 0!==b||a.volumeType!==q.SEGMENTATION||h!==c.b.UINT32&&h!==c.b.UINT64||(b=Object(g.l)({voxelSize:l,transform:k,
lowerVoxelBound:f,upperVoxelBound:m,maxVoxelsPerChunkLog2:9}));return new n(Object.assign({},a,{compressedSegmentationBlockSize:b,transform:k}))}},{key:"getDefaults",value:function(a){var b=Object.assign({},a,{transform:Object(g.k)(a.transform,a.volumeSourceOptions)});return(void 0===a.chunkDataSizes?Object(g.j)(b):a.chunkDataSizes).map(function(b){return n.withDefaultCompression(Object.assign({},a,{chunkDataSize:b}))})}}]);return n}(g.i)},function(p,f,m){function k(a,b){if("function"!==typeof b&&
null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"NDStoreVolumeChunkSource",function(){return n});p=m(2);f=m(102);var g=m(17),c=m(46),a=m(19),b=m(14),h=m(12);m=m(0);var q=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=
b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),l=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,l;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var q=a.length-1;0<=q;q--)if(l=a[q])h=(3>e?l(h):3<e?l(b,c,h):l(b,c))||h;return 3<e&&h&&Object.defineProperty(b,
c,h),h},d=new Map;d.set("npz",c.a);d.set("jpeg",g.a);d.set("raw",a.a);var n=function(a){function b(){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.chunkDecoder=d.get(a.parameters.encoding);return a}k(b,a);q(b,[{key:"download",value:function(a,b){for(var c=
this,d=this.parameters,e=d.urlPrefix+"/"+d.key+"/"+d.channel+"/"+(d.encoding+"/"+d.resolution),l=this.computeChunkBounds(a),q=a.chunkDataSize,n=0;3>n;++n)e+="/"+l[n]+","+(l[n]+q[n]);d.neariso&&(e+="/neariso/");return Object(h.e)(Object(h.c)(d.baseUrls,e),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(b.a,f.a));n=l([Object(m.g)()],n)},function(p,f,m){f.a=function(h,q){q=Object(a.a)(Object(b.inflate)(new Uint8Array(q)));var l=h.chunkDataSize,d=
h.source,n=d.spec.numChannels,f=q.shape;if(4!==f.length||f[0]!==n||f[1]!==l[2]||f[2]!==l[1]||f[3]!==l[0])throw Error("Shape "+JSON.stringify(f)+" does not match chunkDataSize "+Object(c.n)(l));l=q.dataType.dataType;d=d.spec;if(l!==d.dataType)throw Error("Data type "+g.a[l]+" does not match "+("expected data type "+g.a[d.dataType]));Object(k.a)(h,q.data)};var k=m(26),g=m(9),c=m(1),a=m(103),b=m(27);m.n(b)},function(p,f,m){p.exports=function(k,g,c,a){var b=k&65535|0;k=k>>>16&65535|0;for(var h;0!==c;){h=
2E3<c?2E3:c;c-=h;do b=b+g[a++]|0,k=k+b|0;while(--h);b%=65521;k%=65521}return b|k<<16|0}},function(p,f,m){var k=function(){for(var g,c=[],a=0;256>a;a++){g=a;for(var b=0;8>b;b++)g=g&1?3988292384^g>>>1:g>>>1;c[a]=g}return c}();p.exports=function(g,c,a,b){a=b+a;for(g^=-1;b<a;b++)g=g>>>8^k[(g^c[b])&255];return g^-1}},function(p,f,m){function k(b,q){if(65537>q&&(b.subarray&&a||!b.subarray&&c))return String.fromCharCode.apply(null,g.shrinkBuf(b,q));for(var h="",d=0;d<q;d++)h+=String.fromCharCode(b[d]);return h}
var g=m(6),c=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(h){c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){a=!1}var b=new g.Buf8(256);for(p=0;256>p;p++)b[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;b[254]=b[254]=1;f.string2buf=function(a){var b,c,d=a.length,h=0;for(b=0;b<d;b++){var k=a.charCodeAt(b);if(55296===(k&64512)&&b+1<d){var f=a.charCodeAt(b+1);56320===(f&64512)&&(k=65536+(k-55296<<10)+(f-56320),b++)}h+=128>k?1:2048>k?2:65536>k?3:4}var e=new g.Buf8(h);for(b=
c=0;c<h;b++)k=a.charCodeAt(b),55296===(k&64512)&&b+1<d&&(f=a.charCodeAt(b+1),56320===(f&64512)&&(k=65536+(k-55296<<10)+(f-56320),b++)),128>k?e[c++]=k:(2048>k?e[c++]=192|k>>>6:(65536>k?e[c++]=224|k>>>12:(e[c++]=240|k>>>18,e[c++]=128|k>>>12&63),e[c++]=128|k>>>6&63),e[c++]=128|k&63);return e};f.buf2binstring=function(a){return k(a,a.length)};f.binstring2buf=function(a){for(var b=new g.Buf8(a.length),c=0,d=b.length;c<d;c++)b[c]=a.charCodeAt(c);return b};f.buf2string=function(a,c){var h,d=c||a.length,
n=Array(2*d);for(c=h=0;c<d;){var q=a[c++];if(128>q)n[h++]=q;else{var g=b[q];if(4<g)n[h++]=65533,c+=g-1;else{for(q&=2===g?31:3===g?15:7;1<g&&c<d;)q=q<<6|a[c++]&63,g--;1<g?n[h++]=65533:65536>q?n[h++]=q:(q-=65536,n[h++]=55296|q>>10&1023,n[h++]=56320|q&1023)}}}return k(n,h)};f.utf8border=function(a,c){var h;c=c||a.length;c>a.length&&(c=a.length);for(h=c-1;0<=h&&128===(a[h]&192);)h--;return 0>h||0===h?c:h+b[a[h]]>c?h:c}},function(p,f,m){p.exports=function(){this.input=null;this.total_in=this.avail_in=
this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},function(p,f,m){p.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,
Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(p,f,m){var k=k||{};k.Utils=k.Utils||m(30);k.NIFTI1=k.NIFTI1||function(){this.littleEndian=!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=this.xyzt_units=this.scl_inter=0;this.intent_name=this.aux_file=
this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.isHDR=!1;this.extensionFlag=[0,0,0,0];this.extensionCode=this.extensionSize=0};k.NIFTI1.TYPE_NONE=0;k.NIFTI1.TYPE_BINARY=1;k.NIFTI1.TYPE_UINT8=2;k.NIFTI1.TYPE_INT16=4;k.NIFTI1.TYPE_INT32=8;k.NIFTI1.TYPE_FLOAT32=16;k.NIFTI1.TYPE_COMPLEX64=32;k.NIFTI1.TYPE_FLOAT64=64;k.NIFTI1.TYPE_RGB24=
128;k.NIFTI1.TYPE_INT8=256;k.NIFTI1.TYPE_UINT16=512;k.NIFTI1.TYPE_UINT32=768;k.NIFTI1.TYPE_INT64=1024;k.NIFTI1.TYPE_UINT64=1280;k.NIFTI1.TYPE_FLOAT128=1536;k.NIFTI1.TYPE_COMPLEX128=1792;k.NIFTI1.TYPE_COMPLEX256=2048;k.NIFTI1.XFORM_UNKNOWN=0;k.NIFTI1.XFORM_SCANNER_ANAT=1;k.NIFTI1.XFORM_ALIGNED_ANAT=2;k.NIFTI1.XFORM_TALAIRACH=3;k.NIFTI1.XFORM_MNI_152=4;k.NIFTI1.SPATIAL_UNITS_MASK=7;k.NIFTI1.TEMPORAL_UNITS_MASK=56;k.NIFTI1.UNITS_UNKNOWN=0;k.NIFTI1.UNITS_METER=1;k.NIFTI1.UNITS_MM=2;k.NIFTI1.UNITS_MICRON=
3;k.NIFTI1.UNITS_SEC=8;k.NIFTI1.UNITS_MSEC=16;k.NIFTI1.UNITS_USEC=24;k.NIFTI1.UNITS_HZ=32;k.NIFTI1.UNITS_PPM=40;k.NIFTI1.UNITS_RADS=48;k.NIFTI1.MAGIC_COOKIE=348;k.NIFTI1.STANDARD_HEADER_SIZE=348;k.NIFTI1.MAGIC_NUMBER_LOCATION=344;k.NIFTI1.MAGIC_NUMBER=[110,43,49];k.NIFTI1.MAGIC_NUMBER2=[110,105,49];k.NIFTI1.EXTENSION_HEADER_SIZE=8;k.NIFTI1.prototype.readHeader=function(g){g=new DataView(g);var c=k.Utils.getIntAt(g,0,this.littleEndian),a,b;c!==k.NIFTI1.MAGIC_COOKIE&&(this.littleEndian=!0,c=k.Utils.getIntAt(g,
0,this.littleEndian));if(c!==k.NIFTI1.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.dim_info=k.Utils.getByteAt(g,39);for(a=0;8>a;a+=1)c=40+2*a,this.dims[a]=k.Utils.getShortAt(g,c,this.littleEndian);this.intent_p1=k.Utils.getFloatAt(g,56,this.littleEndian);this.intent_p2=k.Utils.getFloatAt(g,60,this.littleEndian);this.intent_p3=k.Utils.getFloatAt(g,64,this.littleEndian);this.intent_code=k.Utils.getShortAt(g,68,this.littleEndian);this.datatypeCode=k.Utils.getShortAt(g,70,
this.littleEndian);this.numBitsPerVoxel=k.Utils.getShortAt(g,72,this.littleEndian);this.slice_start=k.Utils.getShortAt(g,74,this.littleEndian);for(a=0;8>a;a+=1)c=76+4*a,this.pixDims[a]=k.Utils.getFloatAt(g,c,this.littleEndian);this.vox_offset=k.Utils.getFloatAt(g,108,this.littleEndian);this.scl_slope=k.Utils.getFloatAt(g,112,this.littleEndian);this.scl_inter=k.Utils.getFloatAt(g,116,this.littleEndian);this.slice_end=k.Utils.getShortAt(g,120,this.littleEndian);this.slice_code=k.Utils.getByteAt(g,122);
this.xyzt_units=k.Utils.getByteAt(g,123);this.cal_max=k.Utils.getFloatAt(g,124,this.littleEndian);this.cal_min=k.Utils.getFloatAt(g,128,this.littleEndian);this.slice_duration=k.Utils.getFloatAt(g,132,this.littleEndian);this.toffset=k.Utils.getFloatAt(g,136,this.littleEndian);this.description=k.Utils.getStringAt(g,148,228);this.aux_file=k.Utils.getStringAt(g,228,252);this.qform_code=k.Utils.getShortAt(g,252,this.littleEndian);this.sform_code=k.Utils.getShortAt(g,254,this.littleEndian);this.quatern_b=
k.Utils.getFloatAt(g,256,this.littleEndian);this.quatern_c=k.Utils.getFloatAt(g,260,this.littleEndian);this.quatern_d=k.Utils.getFloatAt(g,264,this.littleEndian);this.qoffset_x=k.Utils.getFloatAt(g,268,this.littleEndian);this.qoffset_y=k.Utils.getFloatAt(g,272,this.littleEndian);this.qoffset_z=k.Utils.getFloatAt(g,276,this.littleEndian);for(a=0;3>a;a+=1)for(b=0;4>b;b+=1)c=280+4*(4*a+b),this.affine[a][b]=k.Utils.getFloatAt(g,c,this.littleEndian);this.affine[3][0]=0;this.affine[3][1]=0;this.affine[3][2]=
0;this.affine[3][3]=1;this.intent_name=k.Utils.getStringAt(g,328,344);this.magic=k.Utils.getStringAt(g,344,348);this.isHDR=this.magic===k.NIFTI1.MAGIC_NUMBER2;g.byteLength>k.NIFTI1.MAGIC_COOKIE&&(this.extensionFlag[0]=k.Utils.getByteAt(g,348),this.extensionFlag[1]=k.Utils.getByteAt(g,349),this.extensionFlag[2]=k.Utils.getByteAt(g,350),this.extensionFlag[3]=k.Utils.getByteAt(g,351),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(g),this.extensionCode=this.getExtensionCode(g)))};k.NIFTI1.prototype.toFormattedString=
function(){var g=k.Utils.formatNumber;var c=""+("Dim Info = "+this.dim_info+"\n");c+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";c+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";c+="Intent Code = "+this.intent_code+"\n";c+="Datatype = "+this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n";c+="Bits Per Voxel = "+
this.numBitsPerVoxel+"\n";c+="Slice Start = "+this.slice_start+"\n";c+="Voxel Dimensions (1-8): "+g(this.pixDims[0])+", "+g(this.pixDims[1])+", "+g(this.pixDims[2])+", "+g(this.pixDims[3])+", "+g(this.pixDims[4])+", "+g(this.pixDims[5])+", "+g(this.pixDims[6])+", "+g(this.pixDims[7])+"\n";c+="Image Offset = "+this.vox_offset+"\n";c+="Data Scale:  Slope = "+g(this.scl_slope)+"  Intercept = "+g(this.scl_inter)+"\n";c+="Slice End = "+this.slice_end+"\n";c+="Slice Code = "+this.slice_code+"\n";c+="Units Code = "+
this.xyzt_units+" ("+this.getUnitsCodeString(k.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(k.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";c+="Display Range:  Max = "+g(this.cal_max)+"  Min = "+g(this.cal_min)+"\n";c+="Slice Duration = "+this.slice_duration+"\n";c+="Time Axis Shift = "+this.toffset+"\n";c+='Description: "'+this.description+'"\n';c+='Auxiliary File: "'+this.aux_file+'"\n';c+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+
")\n";c+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";c+="Quaternion Parameters:  b = "+g(this.quatern_b)+"  c = "+g(this.quatern_c)+"  d = "+g(this.quatern_d)+"\n";c+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+this.qoffset_z+"\n";c+="S-Form Parameters X: "+g(this.affine[0][0])+", "+g(this.affine[0][1])+", "+g(this.affine[0][2])+", "+g(this.affine[0][3])+"\n";c+="S-Form Parameters Y: "+g(this.affine[1][0])+", "+g(this.affine[1][1])+
", "+g(this.affine[1][2])+", "+g(this.affine[1][3])+"\n";c+="S-Form Parameters Z: "+g(this.affine[2][0])+", "+g(this.affine[2][1])+", "+g(this.affine[2][2])+", "+g(this.affine[2][3])+"\n";c+='Intent Name: "'+this.intent_name+'"\n';this.extensionFlag[0]&&(c+="Extension: Size = "+this.extensionSize+"  Code = "+this.extensionCode+"\n");return c};k.NIFTI1.prototype.getDatatypeCodeString=function(g){return g===k.NIFTI1.TYPE_UINT8?"1-Byte Unsigned Integer":g===k.NIFTI1.TYPE_INT16?"2-Byte Signed Integer":
g===k.NIFTI1.TYPE_INT32?"4-Byte Signed Integer":g===k.NIFTI1.TYPE_FLOAT32?"4-Byte Float":g===k.NIFTI1.TYPE_FLOAT64?"8-Byte Float":g===k.NIFTI1.TYPE_RGB24?"RGB":g===k.NIFTI1.TYPE_INT8?"1-Byte Signed Integer":g===k.NIFTI1.TYPE_UINT16?"2-Byte Unsigned Integer":g===k.NIFTI1.TYPE_UINT32?"4-Byte Unsigned Integer":g===k.NIFTI1.TYPE_INT64?"8-Byte Signed Integer":g===k.NIFTI1.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"};k.NIFTI1.prototype.getTransformCodeString=function(g){return g===k.NIFTI1.XFORM_SCANNER_ANAT?
"Scanner":g===k.NIFTI1.XFORM_ALIGNED_ANAT?"Aligned":g===k.NIFTI1.XFORM_TALAIRACH?"Talairach":g===k.NIFTI1.XFORM_MNI_152?"MNI":"Unknown"};k.NIFTI1.prototype.getUnitsCodeString=function(g){return g===k.NIFTI1.UNITS_METER?"Meters":g===k.NIFTI1.UNITS_MM?"Millimeters":g===k.NIFTI1.UNITS_MICRON?"Microns":g===k.NIFTI1.UNITS_SEC?"Seconds":g===k.NIFTI1.UNITS_MSEC?"Milliseconds":g===k.NIFTI1.UNITS_USEC?"Microseconds":g===k.NIFTI1.UNITS_HZ?"Hz":g===k.NIFTI1.UNITS_PPM?"PPM":g===k.NIFTI1.UNITS_RADS?"Rads":"Unknown"};
k.NIFTI1.prototype.getQformMat=function(){return this.convertNiftiQFormToNiftiSForm(this.quatern_b,this.quatern_c,this.quatern_d,this.qoffset_x,this.qoffset_y,this.qoffset_z,this.pixDims[1],this.pixDims[2],this.pixDims[3],this.pixDims[0])};k.NIFTI1.prototype.convertNiftiQFormToNiftiSForm=function(g,c,a,b,h,q,l,d,n,k){var f=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],e=a;f[3][0]=f[3][1]=f[3][2]=0;f[3][3]=1;a=1-(g*g+c*c+e*e);1E-7>a?(a=1/Math.sqrt(g*g+c*c+e*e),g*=a,c*=a,e*=a,a=0):a=Math.sqrt(a);l=0<l?
l:1;d=0<d?d:1;n=0<n?n:1;0>k&&(n=-n);f[0][0]=(a*a+g*g-c*c-e*e)*l;f[0][1]=2*(g*c-a*e)*d;f[0][2]=2*(g*e+a*c)*n;f[1][0]=2*(g*c+a*e)*l;f[1][1]=(a*a+c*c-g*g-e*e)*d;f[1][2]=2*(c*e-a*g)*n;f[2][0]=2*(g*e-a*c)*l;f[2][1]=2*(c*e+a*g)*d;f[2][2]=(a*a+e*e-c*c-g*g)*n;f[0][3]=b;f[1][3]=h;f[2][3]=q;return f};k.NIFTI1.prototype.convertNiftiSFormToNEMA=function(g){var c,a,b,h;var q=[[0,0,0],[0,0,0],[0,0,0]];var l=[[0,0,0],[0,0,0],[0,0,0]];var d=g[0][0];var n=g[0][1];var k=g[0][2];var f=g[1][0];var e=g[1][1];var m=g[1][2];
var p=g[2][0];var v=g[2][1];var w=g[2][2];g=Math.sqrt(d*d+f*f+p*p);if(0===g)return null;d/=g;f/=g;p/=g;g=Math.sqrt(n*n+e*e+v*v);if(0===g)return null;n/=g;e/=g;v/=g;g=d*n+f*e+p*v;if(1E-4<Math.abs(g)){n-=g*d;e-=g*f;v-=g*p;g=Math.sqrt(n*n+e*e+v*v);if(0===g)return null;n/=g;e/=g;v/=g}g=Math.sqrt(k*k+m*m+w*w);0===g?(k=f*v-p*e,m=p*n-v*d,w=d*e-f*n):(k/=g,m/=g,w/=g);g=d*k+f*m+p*w;if(1E-4<Math.abs(g)){k-=g*d;m-=g*f;w-=g*p;g=Math.sqrt(k*k+m*m+w*w);if(0===g)return null;k/=g;m/=g;w/=g}g=n*k+e*m+v*w;if(1E-4<Math.abs(g)){k-=
g*n;m-=g*e;w-=g*v;g=Math.sqrt(k*k+m*m+w*w);if(0===g)return null;k/=g;m/=g;w/=g}q[0][0]=d;q[0][1]=n;q[0][2]=k;q[1][0]=f;q[1][1]=e;q[1][2]=m;q[2][0]=p;q[2][1]=v;q[2][2]=w;p=this.nifti_mat33_determ(q);if(0===p)return null;var F=-666;d=f=e=m=1;n=2;k=3;for(v=1;3>=v;v+=1)for(w=1;3>=w;w+=1)if(v!==w)for(c=1;3>=c;c+=1)if(v!==c&&w!==c)for(l[0][0]=l[0][1]=l[0][2]=l[1][0]=l[1][1]=l[1][2]=l[2][0]=l[2][1]=l[2][2]=0,a=-1;1>=a;a+=2)for(b=-1;1>=b;b+=2)for(h=-1;1>=h;h+=2)l[0][v-1]=a,l[1][w-1]=b,l[2][c-1]=h,g=this.nifti_mat33_determ(l),
0<g*p&&(g=this.nifti_mat33_mul(l,q),g=g[0][0]+g[1][1]+g[2][2],g>F&&(F=g,d=v,n=w,k=c,f=a,e=b,m=h));q=l=g=p=v=w=0;switch(d*f){case 1:q="X";p="+";break;case -1:q="X";p="-";break;case 2:q="Y";p="+";break;case -2:q="Y";p="-";break;case 3:q="Z";p="+";break;case -3:q="Z",p="-"}switch(n*e){case 1:l="X";v="+";break;case -1:l="X";v="-";break;case 2:l="Y";v="+";break;case -2:l="Y";v="-";break;case 3:l="Z";v="+";break;case -3:l="Z",v="-"}switch(k*m){case 1:g="X";w="+";break;case -1:g="X";w="-";break;case 2:g=
"Y";w="+";break;case -2:g="Y";w="-";break;case 3:g="Z";w="+";break;case -3:g="Z",w="-"}return q+l+g+p+v+w};k.NIFTI1.prototype.nifti_mat33_mul=function(g,c){var a=[[0,0,0],[0,0,0],[0,0,0]],b,h;for(b=0;3>b;b+=1)for(h=0;3>h;h+=1)a[b][h]=g[b][0]*c[0][h]+g[b][1]*c[1][h]+g[b][2]*c[2][h];return a};k.NIFTI1.prototype.nifti_mat33_determ=function(g){var c=g[0][0];var a=g[0][1];var b=g[0][2];var h=g[1][0];var q=g[1][1];var l=g[1][2];var d=g[2][0];var n=g[2][1];g=g[2][2];return c*q*g-c*n*l-h*a*g+h*n*b+d*a*l-
d*q*b};k.NIFTI1.prototype.getExtensionLocation=function(){return k.NIFTI1.MAGIC_COOKIE+4};k.NIFTI1.prototype.getExtensionSize=function(g){return k.Utils.getIntAt(g,this.getExtensionLocation(),this.littleEndian)};k.NIFTI1.prototype.getExtensionCode=function(g){return k.Utils.getIntAt(g,this.getExtensionLocation()+4,this.littleEndian)};"undefined"!==typeof p&&p.exports&&(p.exports=k.NIFTI1)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){b=b.match(x);
if(null===b||void 0===b[1])throw Error('Data source URL must have the form "<protocol>://<path>".');var c=b[1];a=a.get(c);if(void 0===a)throw Error("Unsupported data source: "+JSON.stringify(c)+".");return[a,b[2],c]}function b(b,c,d,e){var h=$jscomp.makeIterator(a(w,c));c=h.next().value;h=h.next().value;return c.getMesh(b,h,d,e)}function h(b,c,d,h){var e=$jscomp.makeIterator(a(F,c));c=e.next().value;e=e.next().value;return c.getMeshVertexAttributes(b,e,d,h)}function q(a){var b=Number.POSITIVE_INFINITY,
c=Number.NEGATIVE_INFINITY;a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())d=d.value,b=Math.min(b,d),c=Math.max(c,d);return[b,c]}function l(a,c,d,e){for(var r=[b(a,c.meshSourceUrl,d,e)],l=$jscomp.makeIterator(c.attributeSourceUrls),n=l.next();!n.done;n=l.next())r.push(h(a,n.value,d,e));return Promise.all(r).then(function(a){function b(a,b,c){for(var d=a.length,h=0;h<d;++h){var r=a[h],l=b[h],n=c,g=$jscomp.makeIterator(q(l)),k=g.next().value;g=g.next().value;e.info.vertexAttributes.push({name:r.name,
source:n,numComponents:r.numComponents,dataType:r.dataType,min:k,max:g});e.vertexAttributes.push(l)}}var d=a[0],e={info:{numVertices:d.info.numVertices,numTriangles:d.info.numTriangles,vertexAttributes:[]},vertexPositions:d.vertexPositions,indices:d.indices,vertexNormals:d.vertexNormals,vertexAttributes:[]};b(d.info.vertexAttributes,d.vertexAttributes);c.attributeSourceUrls.forEach(function(c,e){e=a[e+1];if(e.numVertices!==d.info.numVertices)throw Error("Vertex attribute source "+JSON.stringify(c)+
" specifies attributes for "+(e.numVertices+" vertices, but mesh has "+d.info.numVertices+" vertices."));b(e.attributeInfo,e.attributes,c)});return e})}f.a=function(a,b){w.set(a,b)};f.b=function(a,b){F.set(a,b)};p=m(2);var d=m(7),n=m(18),J=m(129),u=m(3),e=m(11);m=m(0);var y=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,
d);return b}}(),K=function A(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return A(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,l;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var r=a.length-
1;0<=r;r--)if(l=a[r])h=(3>e?l(h):3<e?l(b,c,h):l(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h};var v=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.data=null;return a}c(b,a);y(b,[{key:"freeSystemMemory",value:function(){this.data=null}},{key:"serialize",value:function(a,c){K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var d=this.data,e=d.vertexPositions,h=d.indices,l=d.vertexNormals;d=d.vertexAttributes;
a.vertexPositions=e;a.indices=h;a.vertexNormals=l;a.vertexAttributes=d;a=new Set;a.add(e.buffer);a.add(h.buffer);a.add(l.buffer);e=$jscomp.makeIterator(d);for(h=e.next();!h.done;h=e.next())a.add(h.value.buffer);c.push.apply(c,[].concat($jscomp.arrayFromIterable(a)));this.data=null}},{key:"downloadSucceeded",value:function(){var a=this.data,c=a.vertexAttributes;a=this.gpuMemoryBytes=a.vertexPositions.byteLength+a.indices.byteLength+a.vertexNormals.byteLength;c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=
c.next())a+=d.value.byteLength;this.systemMemoryBytes=this.gpuMemoryBytes=a;K(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(p.Chunk),w=new Map,F=new Map,x=/^(?:([a-zA-Z-+_]+):\/\/)?(.*)$/,H=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);y(b,[{key:"getChunk",value:function(){var a=J.b,b=this.chunks.get(a);void 0===b&&(b=this.getNewChunk_(v),b.initialize(a),this.addChunk(b));
return b}},{key:"download",value:function(a,b){var c=this;return l(this.chunkManager,this.parameters,function(){return{priorityTier:a.priorityTier,priority:a.priority}},b).then(function(b){if(Object(u.e)(b.info)!==Object(u.e)(c.parameters.info))throw Error("Mesh info has changed.");void 0===b.vertexNormals&&(b.vertexNormals=Object(n.b)(b.vertexPositions,b.indices));a.data=b})}}]);return b}(Object(p.WithParameters)(p.ChunkSource,J.d));H=f([Object(m.g)()],H);p=function(a){function b(a,c){k(this,b);
var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));d.source=d.registerDisposer(a.getRef(c.source));d.registerDisposer(d.chunkManager.recomputeChunkPriorities.add(function(){d.updateChunkPriorities()}));return d}c(b,a);y(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(e.b)(a);a=Object(e.a)(a);var c=this.chunkManager,d=this.source.getChunk();c.requestChunk(d,b,a+50)}}}]);return b}(Object(e.c)(Object(p.withChunkManager)(m.c)));
p=f([Object(m.g)(J.c)],p);Object(m.e)(J.a,function(a,b){var c=this.getRef(a.chunkManager);try{return l(c,a.parameters,function(){return{priorityTier:d.d.VISIBLE,priority:1E3}},b).then(function(a){return{value:a.info}})}finally{c.dispose()}})},function(p,f,m){f.a=function(g){g=g instanceof ArrayBuffer?new Uint8Array(g):new Uint8Array(g.buffer,g.byteOffset,g.byteLength);var c=new Uint8Array(g.buffer,g.byteOffset,g.byteLength);return 2<c.length&&31===c[0]&&139===c[1]?Object(k.inflate)(g):g};var k=m(27);
m.n(k)},function(p,f,m){m(56);m(2);m(20);m(39);m(40);m(83);m(45);m(112);m(114);m(119);m(120);m(122);m(127);m(130);p.exports=m(131)},function(p,f,m){Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"rpc",function(){return k});var k=new (m(0).a)(self);self.rpc=k},function(p,f,m){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var h=a[b];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(c,h.key,h)}}return function(c,a,b){a&&g(c.prototype,
a);b&&g(c,b);return c}}();p=function(){function g(){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");}k(g,null,[{key:"insertAfter",value:function(c,a){var b=c.next0;a.next0=b;a.prev0=c;c.next0=a;b.prev0=a}},{key:"insertBefore",value:function(c,a){var b=c.prev0;a.prev0=b;a.next0=c;c.prev0=a;b.next0=a}},{key:"front",value:function(c){var a=c.next0;return a===c?null:a}},{key:"back",value:function(c){var a=c.prev0;return a===c?null:a}},{key:"pop",value:function(c){var a=
c.next0,b=c.prev0;a.prev0=b;b.next0=a;c.next0=null;c.prev0=null;return c}},{key:"iterator",value:function(c){function a(a,d){for(;;)switch(b){case 0:h=c.next0;case 1:if(h===c){b=3;break}b=4;return{value:h,done:!1};case 4:if(void 0===d){b=5;break}b=-1;throw d;case 5:case 2:h=h.next0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,q={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
q[Symbol.iterator]=function(){return this};return q}},{key:"reverseIterator",value:function(c){function a(a,d){for(;;)switch(b){case 0:h=c.prev0;case 1:if(h===c){b=3;break}b=4;return{value:h,done:!1};case 4:if(void 0===d){b=5;break}b=-1;throw d;case 5:case 2:h=h.prev0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,q={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
q[Symbol.iterator]=function(){return this};return q}},{key:"initializeHead",value:function(c){c.next0=c.prev0=c}}]);return g}();f.a=p},function(p,f,m){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var h=a[b];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(c,h.key,h)}}return function(c,a,b){a&&g(c.prototype,a);b&&g(c,b);return c}}();p=function(){function g(){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");
}k(g,null,[{key:"insertAfter",value:function(c,a){var b=c.next1;a.next1=b;a.prev1=c;c.next1=a;b.prev1=a}},{key:"insertBefore",value:function(c,a){var b=c.prev1;a.prev1=b;a.next1=c;c.prev1=a;b.next1=a}},{key:"front",value:function(c){var a=c.next1;return a===c?null:a}},{key:"back",value:function(c){var a=c.prev1;return a===c?null:a}},{key:"pop",value:function(c){var a=c.next1,b=c.prev1;a.prev1=b;b.next1=a;c.next1=null;c.prev1=null;return c}},{key:"iterator",value:function(c){function a(a,d){for(;;)switch(b){case 0:h=
c.next1;case 1:if(h===c){b=3;break}b=4;return{value:h,done:!1};case 4:if(void 0===d){b=5;break}b=-1;throw d;case 5:case 2:h=h.next1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,q={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();q[Symbol.iterator]=function(){return this};return q}},{key:"reverseIterator",value:function(c){function a(a,d){for(;;)switch(b){case 0:h=
c.prev1;case 1:if(h===c){b=3;break}b=4;return{value:h,done:!1};case 4:if(void 0===d){b=5;break}b=-1;throw d;case 5:case 2:h=h.prev1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,q={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();q[Symbol.iterator]=function(){return this};return q}},{key:"initializeHead",value:function(c){c.next1=c.prev1=c}}]);return g}();f.a=p},
function(p,f,m){m(4)},function(p,f,m){m(4)},function(p,f,m){function k(a,b,c){var h=b[0],l=b[1],d=b[2],n=b[3],g=b[4],k=b[5],e=b[6],f=b[7],m=b[8],p=b[9],w=b[10],F=b[11],x=b[12],H=b[13],t=b[14];b=b[15];var A=c[0],I=c[1],r=c[2],L=c[3];a[0]=A*h+I*g+r*m+L*x;a[1]=A*l+I*k+r*p+L*H;a[2]=A*d+I*e+r*w+L*t;a[3]=A*n+I*f+r*F+L*b;A=c[4];I=c[5];r=c[6];L=c[7];a[4]=A*h+I*g+r*m+L*x;a[5]=A*l+I*k+r*p+L*H;a[6]=A*d+I*e+r*w+L*t;a[7]=A*n+I*f+r*F+L*b;A=c[8];I=c[9];r=c[10];L=c[11];a[8]=A*h+I*g+r*m+L*x;a[9]=A*l+I*k+r*p+L*H;a[10]=
A*d+I*e+r*w+L*t;a[11]=A*n+I*f+r*F+L*b;A=c[12];I=c[13];r=c[14];L=c[15];a[12]=A*h+I*g+r*m+L*x;a[13]=A*l+I*k+r*p+L*H;a[14]=A*d+I*e+r*w+L*t;a[15]=A*n+I*f+r*F+L*b;return a}function g(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];a[2]=b[2]-c[2];a[3]=b[3]-c[3];a[4]=b[4]-c[4];a[5]=b[5]-c[5];a[6]=b[6]-c[6];a[7]=b[7]-c[7];a[8]=b[8]-c[8];a[9]=b[9]-c[9];a[10]=b[10]-c[10];a[11]=b[11]-c[11];a[12]=b[12]-c[12];a[13]=b[13]-c[13];a[14]=b[14]-c[14];a[15]=b[15]-c[15];return a}Object.defineProperty(f,"__esModule",{value:!0});
f.create=function(){var a=new c.a(16);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.clone=function(a){var b=new c.a(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b};f.copy=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=
b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a};f.fromValues=function(a,b,h,q,l,d,n,g,k,e,f,m,p,w,F,x){var u=new c.a(16);u[0]=a;u[1]=b;u[2]=h;u[3]=q;u[4]=l;u[5]=d;u[6]=n;u[7]=g;u[8]=k;u[9]=e;u[10]=f;u[11]=m;u[12]=p;u[13]=w;u[14]=F;u[15]=x;return u};f.set=function(a,b,c,q,l,d,n,g,k,e,f,m,p,w,F,x,H){a[0]=b;a[1]=c;a[2]=q;a[3]=l;a[4]=d;a[5]=n;a[6]=g;a[7]=k;a[8]=e;a[9]=f;a[10]=m;a[11]=p;a[12]=w;a[13]=F;a[14]=x;a[15]=H;return a};f.identity=function(a){a[0]=1;a[1]=
0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.transpose=function(a,b){if(a===b){var c=b[1],q=b[2],l=b[3],d=b[6],n=b[7],g=b[11];a[1]=b[4];a[2]=b[8];a[3]=b[12];a[4]=c;a[6]=b[9];a[7]=b[13];a[8]=q;a[9]=d;a[11]=b[14];a[12]=l;a[13]=n;a[14]=g}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a};f.invert=
function(a,b){var c=b[0],q=b[1],l=b[2],d=b[3],n=b[4],g=b[5],k=b[6],e=b[7],f=b[8],m=b[9],p=b[10],w=b[11],F=b[12],x=b[13],H=b[14];b=b[15];var t=c*g-q*n,A=c*k-l*n,I=c*e-d*n,r=q*k-l*g,L=q*e-d*g,G=l*e-d*k,D=f*x-m*F,B=f*H-p*F,C=f*b-w*F,Q=m*H-p*x,N=m*b-w*x,O=p*b-w*H,E=t*O-A*N+I*Q+r*C-L*B+G*D;if(!E)return null;E=1/E;a[0]=(g*O-k*N+e*Q)*E;a[1]=(l*N-q*O-d*Q)*E;a[2]=(x*G-H*L+b*r)*E;a[3]=(p*L-m*G-w*r)*E;a[4]=(k*C-n*O-e*B)*E;a[5]=(c*O-l*C+d*B)*E;a[6]=(H*I-F*G-b*A)*E;a[7]=(f*G-p*I+w*A)*E;a[8]=(n*N-g*C+e*D)*E;a[9]=
(q*C-c*N-d*D)*E;a[10]=(F*L-x*I+b*t)*E;a[11]=(m*I-f*L-w*t)*E;a[12]=(g*B-n*Q-k*D)*E;a[13]=(c*Q-q*B+l*D)*E;a[14]=(x*A-F*r-H*t)*E;a[15]=(f*r-m*A+p*t)*E;return a};f.adjoint=function(a,b){var c=b[0],q=b[1],l=b[2],d=b[3],n=b[4],g=b[5],k=b[6],e=b[7],f=b[8],m=b[9],p=b[10],w=b[11],F=b[12],x=b[13],H=b[14];b=b[15];a[0]=g*(p*b-w*H)-m*(k*b-e*H)+x*(k*w-e*p);a[1]=-(q*(p*b-w*H)-m*(l*b-d*H)+x*(l*w-d*p));a[2]=q*(k*b-e*H)-g*(l*b-d*H)+x*(l*e-d*k);a[3]=-(q*(k*w-e*p)-g*(l*w-d*p)+m*(l*e-d*k));a[4]=-(n*(p*b-w*H)-f*(k*b-e*
H)+F*(k*w-e*p));a[5]=c*(p*b-w*H)-f*(l*b-d*H)+F*(l*w-d*p);a[6]=-(c*(k*b-e*H)-n*(l*b-d*H)+F*(l*e-d*k));a[7]=c*(k*w-e*p)-n*(l*w-d*p)+f*(l*e-d*k);a[8]=n*(m*b-w*x)-f*(g*b-e*x)+F*(g*w-e*m);a[9]=-(c*(m*b-w*x)-f*(q*b-d*x)+F*(q*w-d*m));a[10]=c*(g*b-e*x)-n*(q*b-d*x)+F*(q*e-d*g);a[11]=-(c*(g*w-e*m)-n*(q*w-d*m)+f*(q*e-d*g));a[12]=-(n*(m*H-p*x)-f*(g*H-k*x)+F*(g*p-k*m));a[13]=c*(m*H-p*x)-f*(q*H-l*x)+F*(q*p-l*m);a[14]=-(c*(g*H-k*x)-n*(q*H-l*x)+F*(q*k-l*g));a[15]=c*(g*p-k*m)-n*(q*p-l*m)+f*(q*k-l*g);return a};f.determinant=
function(a){var b=a[0],c=a[1],q=a[2],l=a[3],d=a[4],n=a[5],g=a[6],k=a[7],e=a[8],f=a[9],m=a[10],p=a[11],w=a[12],F=a[13],x=a[14];a=a[15];return(b*n-c*d)*(m*a-p*x)-(b*g-q*d)*(f*a-p*F)+(b*k-l*d)*(f*x-m*F)+(c*g-q*n)*(e*a-p*w)-(c*k-l*n)*(e*x-m*w)+(q*k-l*g)*(e*F-f*w)};f.multiply=k;f.translate=function(a,b,c){var h=c[0],l=c[1];c=c[2];if(b===a)a[12]=b[0]*h+b[4]*l+b[8]*c+b[12],a[13]=b[1]*h+b[5]*l+b[9]*c+b[13],a[14]=b[2]*h+b[6]*l+b[10]*c+b[14],a[15]=b[3]*h+b[7]*l+b[11]*c+b[15];else{var d=b[0];var n=b[1];var g=
b[2];var k=b[3];var e=b[4];var f=b[5];var m=b[6];var p=b[7];var w=b[8];var F=b[9];var x=b[10];var H=b[11];a[0]=d;a[1]=n;a[2]=g;a[3]=k;a[4]=e;a[5]=f;a[6]=m;a[7]=p;a[8]=w;a[9]=F;a[10]=x;a[11]=H;a[12]=d*h+e*l+w*c+b[12];a[13]=n*h+f*l+F*c+b[13];a[14]=g*h+m*l+x*c+b[14];a[15]=k*h+p*l+H*c+b[15]}return a};f.scale=function(a,b,c){var h=c[0],l=c[1];c=c[2];a[0]=b[0]*h;a[1]=b[1]*h;a[2]=b[2]*h;a[3]=b[3]*h;a[4]=b[4]*l;a[5]=b[5]*l;a[6]=b[6]*l;a[7]=b[7]*l;a[8]=b[8]*c;a[9]=b[9]*c;a[10]=b[10]*c;a[11]=b[11]*c;a[12]=
b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a};f.rotate=function(a,b,h,g){var l=g[0],d=g[1];g=g[2];var n=Math.sqrt(l*l+d*d+g*g);if(Math.abs(n)<c.b)return null;n=1/n;l*=n;d*=n;g*=n;var k=Math.sin(h);var q=Math.cos(h);var e=1-q;h=b[0];n=b[1];var f=b[2];var m=b[3];var p=b[4];var w=b[5];var F=b[6];var x=b[7];var H=b[8];var t=b[9];var A=b[10];var I=b[11];var r=l*l*e+q;var L=d*l*e+g*k;var G=g*l*e-d*k;var D=l*d*e-g*k;var B=d*d*e+q;var C=g*d*e+l*k;var Q=l*g*e+d*k;l=d*g*e-l*k;d=g*g*e+q;a[0]=h*r+p*L+H*
G;a[1]=n*r+w*L+t*G;a[2]=f*r+F*L+A*G;a[3]=m*r+x*L+I*G;a[4]=h*D+p*B+H*C;a[5]=n*D+w*B+t*C;a[6]=f*D+F*B+A*C;a[7]=m*D+x*B+I*C;a[8]=h*Q+p*l+H*d;a[9]=n*Q+w*l+t*d;a[10]=f*Q+F*l+A*d;a[11]=m*Q+x*l+I*d;b!==a&&(a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);return a};f.rotateX=function(a,b,c){var h=Math.sin(c);c=Math.cos(c);var l=b[4],d=b[5],n=b[6],g=b[7],k=b[8],e=b[9],f=b[10],m=b[11];b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[4]=l*c+k*h;a[5]=d*c+e*h;
a[6]=n*c+f*h;a[7]=g*c+m*h;a[8]=k*c-l*h;a[9]=e*c-d*h;a[10]=f*c-n*h;a[11]=m*c-g*h;return a};f.rotateY=function(a,b,c){var h=Math.sin(c);c=Math.cos(c);var l=b[0],d=b[1],n=b[2],g=b[3],k=b[8],e=b[9],f=b[10],m=b[11];b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[0]=l*c-k*h;a[1]=d*c-e*h;a[2]=n*c-f*h;a[3]=g*c-m*h;a[8]=l*h+k*c;a[9]=d*h+e*c;a[10]=n*h+f*c;a[11]=g*h+m*c;return a};f.rotateZ=function(a,b,c){var h=Math.sin(c);c=Math.cos(c);var l=b[0],d=b[1],n=
b[2],g=b[3],k=b[4],e=b[5],f=b[6],m=b[7];b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[0]=l*c+k*h;a[1]=d*c+e*h;a[2]=n*c+f*h;a[3]=g*c+m*h;a[4]=k*c-l*h;a[5]=e*c-d*h;a[6]=f*c-n*h;a[7]=m*c-g*h;return a};f.fromTranslation=function(a,b){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=b[0];a[13]=b[1];a[14]=b[2];a[15]=1;return a};f.fromScaling=function(a,b){a[0]=b[0];a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b[1];a[6]=
0;a[7]=0;a[8]=0;a[9]=0;a[10]=b[2];a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromRotation=function(a,b,h){var g=h[0],l=h[1];h=h[2];var d=Math.sqrt(g*g+l*l+h*h);if(Math.abs(d)<c.b)return null;d=1/d;g*=d;l*=d;h*=d;d=Math.sin(b);b=Math.cos(b);var n=1-b;a[0]=g*g*n+b;a[1]=l*g*n+h*d;a[2]=h*g*n-l*d;a[3]=0;a[4]=g*l*n-h*d;a[5]=l*l*n+b;a[6]=h*l*n+g*d;a[7]=0;a[8]=g*h*n+l*d;a[9]=l*h*n-g*d;a[10]=h*h*n+b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromXRotation=function(a,b){var c=Math.sin(b);
b=Math.cos(b);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=c;a[7]=0;a[8]=0;a[9]=-c;a[10]=b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromYRotation=function(a,b){var c=Math.sin(b);b=Math.cos(b);a[0]=b;a[1]=0;a[2]=-c;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=c;a[9]=0;a[10]=b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromZRotation=function(a,b){var c=Math.sin(b);b=Math.cos(b);a[0]=b;a[1]=c;a[2]=0;a[3]=0;a[4]=-c;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=
0;a[15]=1;return a};f.fromRotationTranslation=function(a,b,c){var h=b[0],l=b[1],d=b[2],n=b[3],g=h+h,k=l+l,e=d+d;b=h*g;var f=h*k;h*=e;var m=l*k;l*=e;d*=e;g*=n;k*=n;n*=e;a[0]=1-(m+d);a[1]=f+n;a[2]=h-k;a[3]=0;a[4]=f-n;a[5]=1-(b+d);a[6]=l+g;a[7]=0;a[8]=h+k;a[9]=l-g;a[10]=1-(b+m);a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};f.getTranslation=function(a,b){a[0]=b[12];a[1]=b[13];a[2]=b[14];return a};f.getScaling=function(a,b){var c=b[0],g=b[1],l=b[2],d=b[4],n=b[5],k=b[6],f=b[8],e=b[9];b=b[10];
a[0]=Math.sqrt(c*c+g*g+l*l);a[1]=Math.sqrt(d*d+n*n+k*k);a[2]=Math.sqrt(f*f+e*e+b*b);return a};f.getRotation=function(a,b){var c=b[0]+b[5]+b[10];0<c?(c=2*Math.sqrt(c+1),a[3]=.25*c,a[0]=(b[6]-b[9])/c,a[1]=(b[8]-b[2])/c,a[2]=(b[1]-b[4])/c):b[0]>b[5]&b[0]>b[10]?(c=2*Math.sqrt(1+b[0]-b[5]-b[10]),a[3]=(b[6]-b[9])/c,a[0]=.25*c,a[1]=(b[1]+b[4])/c,a[2]=(b[8]+b[2])/c):b[5]>b[10]?(c=2*Math.sqrt(1+b[5]-b[0]-b[10]),a[3]=(b[8]-b[2])/c,a[0]=(b[1]+b[4])/c,a[1]=.25*c,a[2]=(b[6]+b[9])/c):(c=2*Math.sqrt(1+b[10]-b[0]-
b[5]),a[3]=(b[1]-b[4])/c,a[0]=(b[8]+b[2])/c,a[1]=(b[6]+b[9])/c,a[2]=.25*c);return a};f.fromRotationTranslationScale=function(a,b,c,g){var h=b[0],d=b[1],n=b[2],k=b[3],f=h+h,e=d+d,m=n+n;b=h*f;var q=h*e;h*=m;var p=d*e;d*=m;n*=m;f*=k;e*=k;k*=m;m=g[0];var w=g[1];g=g[2];a[0]=(1-(p+n))*m;a[1]=(q+k)*m;a[2]=(h-e)*m;a[3]=0;a[4]=(q-k)*w;a[5]=(1-(b+n))*w;a[6]=(d+f)*w;a[7]=0;a[8]=(h+e)*g;a[9]=(d-f)*g;a[10]=(1-(b+p))*g;a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};f.fromRotationTranslationScaleOrigin=
function(a,b,c,g,l){var d=b[0],h=b[1],k=b[2],f=b[3],e=d+d,m=h+h,q=k+k;b=d*e;var p=d*m;d*=q;var w=h*m;h*=q;k*=q;e*=f;m*=f;f*=q;q=g[0];var F=g[1];g=g[2];var x=l[0],H=l[1];l=l[2];a[0]=(1-(w+k))*q;a[1]=(p+f)*q;a[2]=(d-m)*q;a[3]=0;a[4]=(p-f)*F;a[5]=(1-(b+k))*F;a[6]=(h+e)*F;a[7]=0;a[8]=(d+m)*g;a[9]=(h-e)*g;a[10]=(1-(b+w))*g;a[11]=0;a[12]=c[0]+x-(a[0]*x+a[4]*H+a[8]*l);a[13]=c[1]+H-(a[1]*x+a[5]*H+a[9]*l);a[14]=c[2]+l-(a[2]*x+a[6]*H+a[10]*l);a[15]=1;return a};f.fromQuat=function(a,b){var c=b[0],g=b[1],l=b[2];
b=b[3];var d=c+c,n=g+g,k=l+l;c*=d;var f=g*d;g*=n;var e=l*d,m=l*n;l*=k;d*=b;n*=b;b*=k;a[0]=1-g-l;a[1]=f+b;a[2]=e-n;a[3]=0;a[4]=f-b;a[5]=1-c-l;a[6]=m+d;a[7]=0;a[8]=e+n;a[9]=m-d;a[10]=1-c-g;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.frustum=function(a,b,c,g,l,d,n){var h=1/(c-b),k=1/(l-g),e=1/(d-n);a[0]=2*d*h;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=2*d*k;a[6]=0;a[7]=0;a[8]=(c+b)*h;a[9]=(l+g)*k;a[10]=(n+d)*e;a[11]=-1;a[12]=0;a[13]=0;a[14]=n*d*2*e;a[15]=0;return a};f.perspective=function(a,b,c,g,l){b=
1/Math.tan(b/2);var d=1/(g-l);a[0]=b/c;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=(l+g)*d;a[11]=-1;a[12]=0;a[13]=0;a[14]=2*l*g*d;a[15]=0;return a};f.perspectiveFromFieldOfView=function(a,b,c,g){var h=Math.tan(b.upDegrees*Math.PI/180),d=Math.tan(b.downDegrees*Math.PI/180),k=Math.tan(b.leftDegrees*Math.PI/180);b=Math.tan(b.rightDegrees*Math.PI/180);var f=2/(k+b),m=2/(h+d);a[0]=f;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=m;a[6]=0;a[7]=0;a[8]=-((k-b)*f*.5);a[9]=(h-d)*m*.5;a[10]=g/(c-
g);a[11]=-1;a[12]=0;a[13]=0;a[14]=g*c/(c-g);a[15]=0;return a};f.ortho=function(a,b,c,g,l,d,k){var h=1/(b-c),n=1/(g-l),e=1/(d-k);a[0]=-2*h;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=-2*n;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2*e;a[11]=0;a[12]=(b+c)*h;a[13]=(l+g)*n;a[14]=(k+d)*e;a[15]=1;return a};f.lookAt=function(a,b,h,g){var l=b[0],d=b[1];b=b[2];var k=g[0];var f=g[1];var m=g[2];var e=h[0];g=h[1];var q=h[2];if(Math.abs(l-e)<c.b&&Math.abs(d-g)<c.b&&Math.abs(b-q)<c.b)return mat4.identity(a);h=l-e;g=d-g;e=b-q;var p=
1/Math.sqrt(h*h+g*g+e*e);h*=p;g*=p;e*=p;q=f*e-m*g;m=m*h-k*e;k=k*g-f*h;(p=Math.sqrt(q*q+m*m+k*k))?(p=1/p,q*=p,m*=p,k*=p):k=m=q=0;f=g*k-e*m;var v=e*q-h*k;var w=h*m-g*q;(p=Math.sqrt(f*f+v*v+w*w))?(p=1/p,f*=p,v*=p,w*=p):w=v=f=0;a[0]=q;a[1]=f;a[2]=h;a[3]=0;a[4]=m;a[5]=v;a[6]=g;a[7]=0;a[8]=k;a[9]=w;a[10]=e;a[11]=0;a[12]=-(q*l+m*d+k*b);a[13]=-(f*l+v*d+w*b);a[14]=-(h*l+g*d+e*b);a[15]=1;return a};f.targetTo=function(a,b,c,g){var h=b[0],d=b[1];b=b[2];var k=g[0],f=g[1],m=g[2];g=h-c[0];var e=d-c[1];c=b-c[2];
var q=g*g+e*e+c*c;0<q&&(q=1/Math.sqrt(q),g*=q,e*=q,c*=q);q=f*c-m*e;m=m*g-k*c;k=k*e-f*g;a[0]=q;a[1]=m;a[2]=k;a[3]=0;a[4]=e*k-c*m;a[5]=c*q-g*k;a[6]=g*m-e*q;a[7]=0;a[8]=g;a[9]=e;a[10]=c;a[11]=0;a[12]=h;a[13]=d;a[14]=b;a[15]=1;return a};f.str=function(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"};f.frob=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+
Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2)+Math.pow(a[9],2)+Math.pow(a[10],2)+Math.pow(a[11],2)+Math.pow(a[12],2)+Math.pow(a[13],2)+Math.pow(a[14],2)+Math.pow(a[15],2))};f.add=function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];a[3]=b[3]+c[3];a[4]=b[4]+c[4];a[5]=b[5]+c[5];a[6]=b[6]+c[6];a[7]=b[7]+c[7];a[8]=b[8]+c[8];a[9]=b[9]+c[9];a[10]=b[10]+c[10];a[11]=b[11]+c[11];a[12]=b[12]+c[12];a[13]=b[13]+c[13];a[14]=b[14]+
c[14];a[15]=b[15]+c[15];return a};f.subtract=g;f.multiplyScalar=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c;a[4]=b[4]*c;a[5]=b[5]*c;a[6]=b[6]*c;a[7]=b[7]*c;a[8]=b[8]*c;a[9]=b[9]*c;a[10]=b[10]*c;a[11]=b[11]*c;a[12]=b[12]*c;a[13]=b[13]*c;a[14]=b[14]*c;a[15]=b[15]*c;return a};f.multiplyScalarAndAdd=function(a,b,c,g){a[0]=b[0]+c[0]*g;a[1]=b[1]+c[1]*g;a[2]=b[2]+c[2]*g;a[3]=b[3]+c[3]*g;a[4]=b[4]+c[4]*g;a[5]=b[5]+c[5]*g;a[6]=b[6]+c[6]*g;a[7]=b[7]+c[7]*g;a[8]=b[8]+c[8]*g;a[9]=b[9]+c[9]*
g;a[10]=b[10]+c[10]*g;a[11]=b[11]+c[11]*g;a[12]=b[12]+c[12]*g;a[13]=b[13]+c[13]*g;a[14]=b[14]+c[14]*g;a[15]=b[15]+c[15]*g;return a};f.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]};f.equals=function(a,b){var h=a[0],g=a[1],l=a[2],d=a[3],k=a[4],f=a[5],m=a[6],e=a[7],p=a[8],K=a[9],v=a[10],w=a[11],F=
a[12],x=a[13],H=a[14];a=a[15];var t=b[0],A=b[1],I=b[2],r=b[3],L=b[4],G=b[5],D=b[6],B=b[7],C=b[8],Q=b[9],N=b[10],O=b[11],E=b[12],z=b[13],M=b[14];b=b[15];return Math.abs(h-t)<=c.b*Math.max(1,Math.abs(h),Math.abs(t))&&Math.abs(g-A)<=c.b*Math.max(1,Math.abs(g),Math.abs(A))&&Math.abs(l-I)<=c.b*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(d-r)<=c.b*Math.max(1,Math.abs(d),Math.abs(r))&&Math.abs(k-L)<=c.b*Math.max(1,Math.abs(k),Math.abs(L))&&Math.abs(f-G)<=c.b*Math.max(1,Math.abs(f),Math.abs(G))&&Math.abs(m-
D)<=c.b*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(e-B)<=c.b*Math.max(1,Math.abs(e),Math.abs(B))&&Math.abs(p-C)<=c.b*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(K-Q)<=c.b*Math.max(1,Math.abs(K),Math.abs(Q))&&Math.abs(v-N)<=c.b*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(w-O)<=c.b*Math.max(1,Math.abs(w),Math.abs(O))&&Math.abs(F-E)<=c.b*Math.max(1,Math.abs(F),Math.abs(E))&&Math.abs(x-z)<=c.b*Math.max(1,Math.abs(x),Math.abs(z))&&Math.abs(H-M)<=c.b*Math.max(1,Math.abs(H),Math.abs(M))&&Math.abs(a-
b)<=c.b*Math.max(1,Math.abs(a),Math.abs(b))};var c=m(4);f.mul=k;f.sub=g},function(p,f,m){function k(){var a=new h.a(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}function g(a,b,c){c*=.5;var d=Math.sin(c);a[0]=d*b[0];a[1]=d*b[1];a[2]=d*b[2];a[3]=Math.cos(c);return a}function c(a,b,c){var d=b[0],h=b[1],l=b[2];b=b[3];var g=c[0],k=c[1],f=c[2];c=c[3];a[0]=d*c+b*g+h*f-l*k;a[1]=h*c+b*k+l*g-d*f;a[2]=l*c+b*f+d*k-h*g;a[3]=b*c-d*g-h*k-l*f;return a}function a(a,b,c,d){var e=b[0],h=b[1],l=b[2];b=b[3];var g=c[0],k=c[1],
f=c[2];c=c[3];var m=e*g+h*k+l*f+b*c;0>m&&(m=-m,g=-g,k=-k,f=-f,c=-c);if(1E-6<1-m){var n=Math.acos(m);var q=Math.sin(n);m=Math.sin((1-d)*n)/q;d=Math.sin(d*n)/q}else m=1-d;a[0]=m*e+d*g;a[1]=m*h+d*k;a[2]=m*l+d*f;a[3]=m*b+d*c;return a}function b(a,b){var c=b[0]+b[4]+b[8];if(0<c)c=Math.sqrt(c+1),a[3]=.5*c,c=.5/c,a[0]=(b[5]-b[7])*c,a[1]=(b[6]-b[2])*c,a[2]=(b[1]-b[3])*c;else{var d=0;b[4]>b[0]&&(d=1);b[8]>b[3*d+d]&&(d=2);var h=(d+1)%3,l=(d+2)%3;c=Math.sqrt(b[3*d+d]-b[3*h+h]-b[3*l+l]+1);a[d]=.5*c;c=.5/c;a[3]=
(b[3*h+l]-b[3*l+h])*c;a[h]=(b[3*h+d]+b[3*d+h])*c;a[l]=(b[3*l+d]+b[3*d+l])*c}return a}Object.defineProperty(f,"__esModule",{value:!0});f.create=k;f.identity=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};f.setAxisAngle=g;f.getAxisAngle=function(a,b){var c=2*Math.acos(b[3]),d=Math.sin(c/2);0!=d?(a[0]=b[0]/d,a[1]=b[1]/d,a[2]=b[2]/d):(a[0]=1,a[1]=0,a[2]=0);return c};f.multiply=c;f.rotateX=function(a,b,c){c*=.5;var d=b[0],h=b[1],l=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c+b*g;a[1]=h*c+l*
g;a[2]=l*c-h*g;a[3]=b*c-d*g;return a};f.rotateY=function(a,b,c){c*=.5;var d=b[0],h=b[1],l=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c-l*g;a[1]=h*c+b*g;a[2]=l*c+d*g;a[3]=b*c-h*g;return a};f.rotateZ=function(a,b,c){c*=.5;var d=b[0],h=b[1],l=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c+h*g;a[1]=h*c-d*g;a[2]=l*c+b*g;a[3]=b*c-l*g;return a};f.calculateW=function(a,b){var c=b[0],d=b[1];b=b[2];a[0]=c;a[1]=d;a[2]=b;a[3]=Math.sqrt(Math.abs(1-c*c-d*d-b*b));return a};f.slerp=a;f.invert=function(a,
b){var c=b[0],d=b[1],h=b[2];b=b[3];var l=c*c+d*d+h*h+b*b;l=l?1/l:0;a[0]=-c*l;a[1]=-d*l;a[2]=-h*l;a[3]=b*l;return a};f.conjugate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=b[3];return a};f.fromMat3=b;f.fromEuler=function(a,b,c,d){var e=.5*Math.PI/180;b*=e;c*=e;d*=e;e=Math.sin(b);b=Math.cos(b);var h=Math.sin(c);c=Math.cos(c);var l=Math.sin(d);d=Math.cos(d);a[0]=e*c*d-b*h*l;a[1]=b*h*d+e*c*l;a[2]=b*c*l-e*h*d;a[3]=b*c*d+e*h*l;return a};f.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+
", "+a[3]+")"};var h=m(4),q=m(33),l=m(34);p=m(35);f.clone=p.b;f.fromValues=p.g;f.copy=p.c;f.set=p.l;f.add=p.a;f.mul=c;f.scale=p.k;f.dot=p.d;f.lerp=p.i;m=p.h;f.length=m;f.len=m;m=p.m;f.squaredLength=m;f.sqrLen=m;var d=p.j;f.normalize=d;f.exactEquals=p.f;f.equals=p.e;p=function(){var a=l.create(),b=l.fromValues(1,0,0),c=l.fromValues(0,1,0);return function(e,h,k){var f=l.dot(h,k);if(-.999999>f)return l.cross(a,b,h),1E-6>l.len(a)&&l.cross(a,c,h),l.normalize(a,a),g(e,a,Math.PI),e;if(.999999<f)return e[0]=
0,e[1]=0,e[2]=0,e[3]=1,e;l.cross(a,h,k);e[0]=a[0];e[1]=a[1];e[2]=a[2];e[3]=1+f;return d(e,e)}}();f.rotationTo=p;p=function(){var b=k(),c=k();return function(d,e,h,l,g,k){a(b,e,g,k);a(c,h,l,k);a(d,b,c,2*k*(1-k));return d}}();f.sqlerp=p;p=function(){var a=q.a();return function(c,h,e,l){a[0]=e[0];a[3]=e[1];a[6]=e[2];a[1]=l[0];a[4]=l[1];a[7]=l[2];a[2]=-h[0];a[5]=-h[1];a[8]=-h[2];return d(c,b(c,a))}}();f.setAxes=p},function(p,f,m){function k(){var c=new g.a(2);c[0]=0;c[1]=0;return c}var g=m(4);(function(){var c=
k();return function(a,b,h,g,l,d){b||(b=2);h||(h=0);for(g=g?Math.min(g*b+h,a.length):a.length;h<g;h+=b)c[0]=a[h],c[1]=a[h+1],l(c,c,d),a[h]=c[0],a[h+1]=c[1];return a}})()},function(p,f,m){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var h=a[b];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(c,h.key,h)}}return function(c,a,b){a&&g(c.prototype,a);b&&g(c,b);return c}}();p=function(){function g(c){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");
this.compare=c}k(g,[{key:"meld",value:function(c,a){if(null===a)return c;if(null===c)return a;var b=this.compare;b(a,c)&&(b=c,c=a,a=b);b=c.child0;a.next0=b;a.prev0=c;null!==b&&(b.prev0=a);c.child0=a;return c}},{key:"combineChildren",value:function(c){var a=c.child0;if(null===a)return null;for(c=null;;){var b=a.next0;if(null===b)var h=null;else h=b.next0,a=this.meld(a,b);a.next0=c;c=a;if(null===h)break;a=h}h=c;for(c=c.next0;null!==c;)a=c.next0,h=this.meld(h,c),c=a;h.prev0=null;h.next0=null;return h}},
{key:"removeMin",value:function(c){var a=this.combineChildren(c);c.next0=null;c.prev0=null;c.child0=null;return a}},{key:"remove",value:function(c,a){if(c===a)return this.removeMin(c);var b=a.prev0,h=a.next0;b.child0===a?b.child0=h:b.next0=h;null!==h&&(h.prev0=b);c=this.meld(c,this.combineChildren(a));a.next0=null;a.prev0=null;a.child0=null;return c}},{key:"entries",value:function(c){function a(a,e){for(;;)switch(b){case 0:if(null===c){b=1;break}d=c.child0;b=2;return{value:c,done:!1};case 2:if(void 0===
e){b=3;break}b=-1;throw e;case 3:case 4:if(null===d){b=5;break}l=d.next0;g=$jscomp.makeIterator(k.entries(d));case 6:if((h=g.next(a)).done){b=7;break}b=8;return{value:h.value,done:!1};case 8:if(void 0===e){b=9;break}b=-1;throw e;case 9:b=6;break;case 7:d=l;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,g,l,d,k=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
f[Symbol.iterator]=function(){return this};return f}},{key:"removedEntries",value:function(c){function a(a,e){for(;;)switch(b){case 0:if(null===c){b=1;break}d=c.child0;c.child0=null;c.next0=null;c.prev0=null;b=2;return{value:c,done:!1};case 2:if(void 0===e){b=3;break}b=-1;throw e;case 3:case 4:if(null===d){b=5;break}l=d.next0;d.child0=null;d.next0=null;d.prev0=null;g=$jscomp.makeIterator(k.entries(d));case 6:if((h=g.next(a)).done){b=7;break}b=8;return{value:h.value,done:!1};case 8:if(void 0===e){b=
9;break}b=-1;throw e;case 9:b=6;break;case 7:d=l;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,g,l,d,k=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}}]);return g}();f.a=p},function(p,f,m){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var h=a[b];h.enumerable=h.enumerable||!1;h.configurable=
!0;"value"in h&&(h.writable=!0);Object.defineProperty(c,h.key,h)}}return function(c,a,b){a&&g(c.prototype,a);b&&g(c,b);return c}}();p=function(){function g(c){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");this.compare=c}k(g,[{key:"meld",value:function(c,a){if(null===a)return c;if(null===c)return a;var b=this.compare;b(a,c)&&(b=c,c=a,a=b);b=c.child1;a.next1=b;a.prev1=c;null!==b&&(b.prev1=a);c.child1=a;return c}},{key:"combineChildren",value:function(c){var a=c.child1;
if(null===a)return null;for(c=null;;){var b=a.next1;if(null===b)var h=null;else h=b.next1,a=this.meld(a,b);a.next1=c;c=a;if(null===h)break;a=h}h=c;for(c=c.next1;null!==c;)a=c.next1,h=this.meld(h,c),c=a;h.prev1=null;h.next1=null;return h}},{key:"removeMin",value:function(c){var a=this.combineChildren(c);c.next1=null;c.prev1=null;c.child1=null;return a}},{key:"remove",value:function(c,a){if(c===a)return this.removeMin(c);var b=a.prev1,h=a.next1;b.child1===a?b.child1=h:b.next1=h;null!==h&&(h.prev1=b);
c=this.meld(c,this.combineChildren(a));a.next1=null;a.prev1=null;a.child1=null;return c}},{key:"entries",value:function(c){function a(a,e){for(;;)switch(b){case 0:if(null===c){b=1;break}d=c.child1;b=2;return{value:c,done:!1};case 2:if(void 0===e){b=3;break}b=-1;throw e;case 3:case 4:if(null===d){b=5;break}l=d.next1;g=$jscomp.makeIterator(k.entries(d));case 6:if((h=g.next(a)).done){b=7;break}b=8;return{value:h.value,done:!1};case 8:if(void 0===e){b=9;break}b=-1;throw e;case 9:b=6;break;case 7:d=l;
b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,g,l,d,k=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}},{key:"removedEntries",value:function(c){function a(a,e){for(;;)switch(b){case 0:if(null===c){b=1;break}d=c.child1;c.child1=null;c.next1=null;c.prev1=null;b=2;return{value:c,done:!1};case 2:if(void 0===
e){b=3;break}b=-1;throw e;case 3:case 4:if(null===d){b=5;break}l=d.next1;d.child1=null;d.next1=null;d.prev1=null;g=$jscomp.makeIterator(k.entries(d));case 6:if((h=g.next(a)).done){b=7;break}b=8;return{value:h.value,done:!1};case 8:if(void 0===e){b=9;break}b=-1;throw e;case 9:b=6;break;case 7:d=l;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,h,g,l,d,k=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");
}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}}]);return g}();f.a=p},function(p,f,m){m.d(f,"a",function(){return b});var k=m(1),g=m(3),c=m(8),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var h=b[c];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(a,h.key,h)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),b=function(){function b(a){a=void 0===a?k.h.create():a;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");
this.transform=a;this.changed=new c.a}a(b,[{key:"reset",value:function(){k.h.copy(this.transform,k.c);this.changed.dispatch()}},{key:"toJSON",value:function(){if(!k.h.equals(k.c,this.transform)){var a=this.transform;return[[a[0],a[4],a[8],a[12]],[a[1],a[5],a[9],a[13]],[a[2],a[6],a[10],a[14]],[a[3],a[7],a[11],a[15]]]}}},{key:"restoreState",value:function(a){if(null==a)this.reset();else if(Array.isArray(a))if(4===a.length)try{for(var b=0;4>b;++b)Object(g.b)(this.transform.subarray(4*b,4*(b+1)),a[b]);
k.h.transpose(this.transform,this.transform)}catch(J){this.reset()}else if(16===a.length)try{Object(g.b)(this.transform,a),k.h.transpose(this.transform,this.transform)}catch(J){this.reset()}else this.reset();else if("object"===typeof a){b=k.j.create();var c=k.m.create(),h=k.m.fromValues(1,1,1);try{Object(g.b)(b,a.rotation),k.j.normalize(b,b)}catch(J){k.j.identity(b)}try{Object(g.b)(c,a.translation)}catch(J){k.m.copy(c,k.g)}try{Object(g.b)(h,a.scale)}catch(J){k.m.copy(h,k.f)}k.h.fromRotationTranslationScale(this.transform,
b,c,h);this.changed.dispatch()}else this.reset()}},{key:"clone",value:function(){return new b(k.h.clone(this.transform))}}]);return b}()},function(p,f,m){m.d(f,"a",function(){return c});var k=m(1),g=function(){function a(a,c){for(var b=0;b<c.length;b++){var h=c[b];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(a,h.key,h)}}return function(b,c,g){c&&a(b.prototype,c);g&&a(b,g);return b}}(),c=function(){function a(b,c){c=void 0===c?k.c:c;if(!(this instanceof
a))throw new TypeError("Cannot call a class as a function");this.size=k.m.clone(b);this.transform=k.h.clone(c);this.invTransform=k.h.invert(k.h.create(),c)}g(a,[{key:"toObject",value:function(a){a.size=this.size;a.transform=this.transform}},{key:"localSpatialToGlobal",value:function(a,c){return k.m.transformMat4(a,c,this.transform)}},{key:"globalToLocalSpatial",value:function(a,c){return k.m.transformMat4(a,c,this.invTransform)}},{key:"globalToLocalGrid",value:function(a,c){this.globalToLocalSpatial(a,
c);k.m.divide(a,a,this.size);return a}},{key:"localSpatialVectorToGlobal",value:function(a,c){return Object(k.l)(a,c,this.transform)}},{key:"globalToLocalSpatialVector",value:function(a,c){return Object(k.l)(a,c,this.invTransform)}},{key:"assignLocalSpatialToGlobalMat4",value:function(a){return k.h.copy(a,this.transform)}}],[{key:"get",value:function(b,c){c=void 0===c?k.c:c;var h=a.cache,l=JSON.stringify([Array.from(b),Array.from(c)]),d=h.get(l);void 0===d&&(d=new a(b,c),h.set(l,d));return d}},{key:"fromObject",
value:function(b){return a.get(b.size,b.transform)}}]);return a}();c.cache=new Map},function(p,f,m){f.a=function(k,g){return k===g?!0:1E-6>Math.abs(k-g)/Math.min(Math.abs(k),Math.abs(g))}},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}var g=m(24);p=m(0);var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var h=b[c];h.enumerable=h.enumerable||!1;h.configurable=!0;"value"in h&&(h.writable=!0);Object.defineProperty(a,h.key,h)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),a=function q(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return q(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===
b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,g){var d=arguments.length,l=3>d?b:null===g?g=Object.getOwnPropertyDescriptor(b,c):g,e;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)l=Reflect.decorate(a,b,c,g);else for(var k=a.length-1;0<=k;k--)if(e=a[k])l=(3>d?e(l):3<d?e(b,c,l):e(b,c))||l;return 3<d&&l&&Object.defineProperty(b,c,l),l};m=b=function(f){function l(a,b){b=void 0===b?{}:b;if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");
var c=(l.__proto__||Object.getPrototypeOf(l)).call(this,a,b);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");c=!c||"object"!==typeof c&&"function"!==typeof c?this:c;c.updatingValue_=!1;void 0!==a&&(c.base=new g.b(b.value),c.setupChangedHandler());return c}k(l,f);c(l,[{key:"initializeCounterpart",value:function(b,c){c=void 0===c?{}:c;c.value=this.value;a(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"initializeCounterpart",this).call(this,
b,c)}},{key:"setupChangedHandler",value:function(){var a=this;this.registerDisposer(this.base.changed.add(function(){if(a.updatingValue_)a.updatingValue_=!1;else{var b=a.rpc;null!==b&&b.invoke("SharedWatchableValue.changed",{id:a.rpcId,value:a.value})}}))}},{key:"value",get:function(){return this.base.value},set:function(a){this.base.value=a}},{key:"changed",get:function(){return this.base.changed}}],[{key:"makeFromExisting",value:function(a,c){var d=new b;d.base=c;d.setupChangedHandler();d.initializeCounterpart(a);
return d}},{key:"make",value:function(a,c){return b.makeFromExisting(a,new g.b(c))}}]);return l}(p.c);m=b=f([Object(p.g)("SharedWatchableValue")],m);Object(p.f)("SharedWatchableValue.changed",function(a){var b=this.get(a.id);b.updatingValue_=!0;b.base.value=a.value;b.updatingValue_=!1});var b},function(p,f,m){var k=m(36),g=m(71),c=m(74),a=Math.max,b=Math.min;p.exports=function(h,f,l){function d(a){var b=y,c=K;y=K=void 0;x=a;return v=h.apply(c,b)}function m(a){var b=a-F;a-=x;return void 0===F||b>=
f||0>b||t&&a>=I}function q(){var a=g();if(m(a))return p(a);var c=setTimeout;var d=a-x;a=f-(a-F);d=t?b(a,I-d):a;w=c(q,d)}function p(a){w=void 0;if(A&&y)return d(a);y=K=void 0;return v}function e(){var a=g(),b=m(a);y=arguments;K=this;F=a;if(b){if(void 0===w)return x=a=F,w=setTimeout(q,f),H?d(a):v;if(t)return w=setTimeout(q,f),d(F)}void 0===w&&(w=setTimeout(q,f));return v}var y,K,v,w,F,x=0,H=!1,t=!1,A=!0;if("function"!=typeof h)throw new TypeError("Expected a function");f=c(f)||0;if(k(l)){H=!!l.leading;
var I=(t="maxWait"in l)?a(c(l.maxWait)||0,f):I;A="trailing"in l?!!l.trailing:A}e.cancel=function(){void 0!==w&&clearTimeout(w);x=0;y=F=K=w=void 0};e.flush=function(){return void 0===w?v:p(g())};return e}},function(p,f,m){var k=m(37);p.exports=function(){return k.Date.now()}},function(p,f,m){f=m(73);p.exports="object"==typeof f&&f&&f.Object===Object&&f},function(p,f){f=function(){return this}();try{f=f||Function("return this")()||(0,eval)("this")}catch(m){"object"===typeof window&&(f=window)}p.exports=
f},function(p,f,m){var k=m(36),g=m(75),c=0/0,a=/^\s+|\s+$/g,b=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,q=/^0o[0-7]+$/i,l=parseInt;p.exports=function(d){if("number"==typeof d)return d;if(g(d))return c;k(d)&&(d="function"==typeof d.valueOf?d.valueOf():d,d=k(d)?d+"":d);if("string"!=typeof d)return 0===d?d:+d;d=d.replace(a,"");var f=h.test(d);return f||q.test(d)?l(d.slice(2),f?2:8):b.test(d)?c:+d}},function(p,f,m){var k=m(76),g=m(79);p.exports=function(c){return"symbol"==typeof c||g(c)&&"[object Symbol]"==
k(c)}},function(p,f,m){f=m(38);var k=m(77),g=m(78),c=f?f.toStringTag:void 0;p.exports=function(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":c&&c in Object(a)?k(a):g(a)}},function(p,f,m){f=m(38);m=Object.prototype;var k=m.hasOwnProperty,g=m.toString,c=f?f.toStringTag:void 0;p.exports=function(a){var b=k.call(a,c),h=a[c];try{a[c]=void 0;var f=!0}catch(d){}var l=g.call(a);f&&(b?a[c]=h:delete a[c]);return l}},function(p,f){var m=Object.prototype.toString;p.exports=function(k){return m.call(k)}},
function(p,f){p.exports=function(f){return null!=f&&"object"==typeof f}},function(p,f,m){f.c="perspective_view/PerspectiveView";f.a="perspective_view/addLayer";f.b="perspective_view/removeLayer"},function(p,f,m){f.a=function(k){k=Math.ceil((void 0===k?128:k)/32);var g=new Uint32Array(k);crypto.getRandomValues(g);for(var c="",a=0;a<k;++a)c+=("00000000"+g[a].toString(16)).slice(-8);return c}},function(p,f,m){function k(c,a){if("function"!==typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+
typeof a);c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}});a&&(Object.setPrototypeOf?Object.setPrototypeOf(c,a):c.__proto__=a)}m.d(f,"k",function(){return g});p=m(9);f.d="annotation.MetadataChunkSource";f.c="annotation.GeometryChunkSource";f.j="annotation.SubsetGeometryChunkSource";f.f="annotation.reference.add";f.g="annotation.reference.delete";f.b="annotation.commit";f.a="annotation.commit";var g=function(c){function a(){if(!(this instanceof
a))throw new TypeError("Cannot call a class as a function");var b=(a.__proto__||Object.getPrototypeOf(a)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?this:b}k(a,c);return a}(p.i);f.e="annotation/PerspectiveRenderLayer";f.h="annotation/RenderLayer";f.i="annotation/RenderLayer.updateSegmentation"},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){a&&
(b.change_spec={change_stack_id:a.changeStackId},a.timeStamp&&(b.change_spec.time_stamp=a.timeStamp),a.skipEquivalences&&(b.change_spec.skip_equivalences=a.skipEquivalences))}function b(a,b){return Object(I.WithParameters)(Object(r.a)()(a),b)}function h(a,b){Object(D.c)(a,b,"fragmentKey");a.clipBounds&&(a.fragmentIds=q(a.fragmentIds,a.clipBounds));a.fragmentIds=n(a.fragmentIds);return a}function q(a,b){b;if(!a)return a;var c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;
var e=O.m.clone([500,500,500]),h=d;var g=e;var r=new z.a;if(!r.tryParseString(h,16))throw Error("Couldn't parse fragmentId "+h+" as hex-encoded Uint64");if(r.high)throw Error("Fragment ids > 2^32 not supported yet");h=Object(O.a)(r);r=O.m.create();g=O.m.mul(r,h,g);h=O.m.create();O.m.scale(h,e,.5);r=O.m.create();O.m.add(r,g,h);l({center:r,size:e},b)&&c.push(d)}return c}function l(a,b){function c(a,b,c){return[].concat($jscomp.arrayFromIterable(a.map(function(a,d){return a+c*b[d]/2}).values()))}function d(a){return{min:O.m.clone(c(a.center,
a.size,-1)),max:O.m.clone(c(a.center,a.size,1))}}a=d(a);b=d(b);return a.min[0]<=b.max[0]&&a.max[0]>=b.min[0]&&a.min[1]<=b.max[1]&&a.max[1]>=b.min[1]&&a.min[2]<=b.max[2]&&a.max[2]>=b.min[2]}function d(a,b){Object(E.i)(b);var c=Object(E.j)(b,"fragmentKey",E.m);b=Object(E.j)(b,"supervoxelId",E.m);if(c.length!==b.length)throw Error("Expected fragmentKey and supervoxelId arrays to have the same length.");b=b.map(function(a,b){return a+"\x00"+c[b]});a.clipBounds&&(b=q(b,a.clipBounds));a.fragmentIds=n(b)}
function n(a){for(var b=[],c=0,d=a.length;c<d;)b.push(JSON.stringify(a.slice(c,c+100))),c+=100;return b}function J(a){var b=a.match(/([0-9]+),([0-9]+),([0-9]+)/);if(null===b)throw Error("Error parsing number triplet: "+JSON.stringify(a)+".");return O.m.fromValues(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3]))}function u(a){return a.volumeId+":"+a.changestack+":"}function e(a,b){if(!b.startsWith(a))throw Error("Received annotation id "+JSON.stringify(b)+" does not have expected prefix of "+JSON.stringify(a)+
".");return b.substring(a.length)}function y(a){if(null!=a)return Object(E.a)(a,function(a){return z.a.parseString(""+a,10)})}function K(a,b,c){var d=Object(E.j)(a,"corner",function(a){return J(Object(E.l)(a))}),h=Object(E.j)(a,"size",function(a){return J(Object(E.l)(a))}),g=Object(E.j)(a,"payload",E.k),l=Object(E.j)(a,"type",E.l),r=Object(E.j)(a,"id",E.l);b=e(b,r);a=Object(E.j)(a,"objectLabels",y);if(void 0!==c&&b!==c)throw Error("Received annotation has unexpected id "+JSON.stringify(r)+".");switch(l){case "LOCATION":if(O.m.equals(h,
O.g))return{type:t.b.POINT,id:b,point:d,description:g,segments:a};c=O.m.scale(O.m.create(),h,.5);d=O.m.add(O.m.create(),d,c);return{type:t.b.ELLIPSOID,id:b,center:d,radii:c,description:g,segments:a};case "LINE":return{type:t.b.LINE,id:b,pointA:d,pointB:O.m.add(O.m.create(),d,h),description:g,segments:a};case "VOLUME":return{type:t.b.AXIS_ALIGNED_BOUNDING_BOX,id:b,pointA:d,pointB:O.m.add(O.m.create(),d,h),description:g,segments:a};default:throw Error("Unknown spatial annotation type: "+JSON.stringify(l)+
".");}}function v(a,b,c){Object(E.i)(a);a=Object(E.j)(a,"annotations",function(a){return Object(E.c)([void 0],a,E.i)})[0];return K(a,b,c)}function w(a,b){var c=new t.a,d=u(a.source.parent.parameters);b.forEach(function(a,b){try{Object(E.i)(a);var e=Object(E.j)(a,"annotations",function(a){return void 0===a?[]:a});if(!Array.isArray(e))throw Error("Expected array, but received "+JSON.stringify(typeof e)+".");for(var h=$jscomp.makeIterator(e),g=h.next();!g.done;g=h.next()){var l=g.value;try{c.add(K(l,
d))}catch(Ia){throw Error("Error parsing annotation: "+Ia.message);}}}catch(Ia){throw Error("Error parsing "+ib[b]+" annotations: "+Ia.message);}});a.data=Object.assign(new A.AnnotationGeometryData,c.serialize())}function F(a){var b=a.indexOf(".");return a.substring(0,b)}function x(a){return Math.round(a[0])+","+Math.round(a[1])+","+Math.round(a[2])}function H(a){var b=a.description||"",c=void 0===a.segments?void 0:a.segments.map(function(a){return a.toString()});switch(a.type){case t.b.LINE:case t.b.AXIS_ALIGNED_BOUNDING_BOX:var d=
a.pointA,e=a.pointB,h=O.m.min(O.m.create(),d,e);d=O.m.max(O.m.create(),d,e);d=O.m.subtract(d,d,h);return{type:a.type===t.b.LINE?"LINE":"VOLUME",corner:x(h),size:x(d),object_labels:c,payload:b};case t.b.POINT:return{type:"LOCATION",corner:x(a.point),size:"0,0,0",object_labels:c,payload:b};case t.b.ELLIPSOID:return h=O.m.subtract(O.m.create(),a.center,a.radii),a=O.m.scale(O.m.create(),a.radii,2),{type:"LOCATION",corner:x(h),size:x(a),object_labels:c,payload:b}}}Object.defineProperty(f,"__esModule",
{value:!0});m.d(f,"BrainmapsVolumeChunkSource",function(){return R});m.d(f,"BrainmapsMeshSource",function(){return kb});m.d(f,"BrainmapsSkeletonSource",function(){return jb});m.d(f,"BrainmapsAnnotationSource",function(){return hb});var t=m(41),A=m(40),I=m(2),r=m(84),L=m(87),G=m(89),D=m(18),B=m(43);p=m(25);f=m(17);var C=m(19),Q=m(14),N=m(13),O=m(1),E=m(3),z=m(5);m=m(0);var M=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&
(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),S=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)if(g=a[l])h=(3>e?g(h):3<e?g(b,c,h):g(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h},pa=new Map([[G.d.RAW,C.a],[G.d.JPEG,
f.a],[G.d.COMPRESSED_SEGMENTATION,p.a]]),R=function(b){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=pa.get(a.parameters.encoding);return a}c(d,b);M(d,[{key:"applyEncodingParams",value:function(a){var b=this.parameters.encoding;switch(b){case G.d.RAW:a.subvolume_format="RAW";break;case G.d.JPEG:a.subvolume_format="SINGLE_IMAGE";a.image_format_options={image_format:"JPEG",jpeg_quality:70};break;case G.d.COMPRESSED_SEGMENTATION:a.subvolume_format=
"RAW";a.image_format_options={compressed_segmentation_block_size:Object(O.n)(this.spec.compressedSegmentationBlockSize)};break;default:throw Error("Invalid encoding: "+b);}}},{key:"download",value:function(b,c){var d=this,e=this.parameters,h=this.computeChunkBounds(b),g=b.chunkDataSize;var l="/v1/volumes/"+e.volumeId+"/subvolume:binary";h={geometry:{corner:Object(O.n)(h),size:Object(O.n)(g),scale:e.scaleIndex}};this.applyEncodingParams(h);a(e.changeSpec,h);return Object(L.a)(e.instance,this.credentialsProvider,
{method:"POST",payload:JSON.stringify(h),path:l,responseType:"arraybuffer"},c).then(function(a){return d.chunkDecoder(b,a)})}}]);return d}(b(Q.a,G.e));R=S([Object(m.g)()],R);var kb=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.manifestDecoder=void 0!==a.parameters.changeSpec?d:h;var c=a.parameters.changeSpec;c=void 0!==c?"&header.changeStackId="+c.changeStackId+"&return_supervoxel_ids=true":"";a.listFragmentsParams=c;return a}c(b,
a);M(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters;return Object(L.a)(d.instance,this.credentialsProvider,{method:"GET",path:"/v1/objects/"+d.volumeId+"/meshes/"+(d.meshName+":listfragments?object_id="+a.objectId)+this.listFragmentsParams,responseType:"json"},b).then(function(b){return c.manifestDecoder(a,b)})}},{key:"downloadFragment",value:function(a,b){function c(b){for(var c=b.byteLength,k=0,f=new DataView(b);k<c;){if(k+32>c)throw Error("Invalid batch mesh fragment response.");
if(void 0!==e.changeSpec){var m=f.getUint32(k,!0);var t=f.getUint32(k+4,!0);t=(new z.a(m,t)).toString()+"\x00"}else t="";k+=8;m=f.getUint32(k,!0);var n=f.getUint32(k+4,!0);k+=8;if(0!==n)throw Error("Invalid batch mesh fragment response.");if(k+m+8+8>c)throw Error("Invalid batch mesh fragment response.");n=(new TextDecoder).decode(new Uint8Array(b,k,m));t+=n;if(!h.delete(t))throw Error("Received unexpected fragment key: "+JSON.stringify(t)+".");k+=m;m=f.getUint32(k,!0);n=f.getUint32(k+4,!0);k+=8;t=
f.getUint32(k,!0);var q=f.getUint32(k+4,!0);k+=8;if(0!==n||0!==q)throw Error("Invalid batch mesh fragment response.");n=k+12*t+12*m;if(n>c)throw Error("Invalid batch mesh fragment response.");g+=m;l+=3*t;r.push({buffer:b,verticesOffset:k,numVertices:m,indicesOffset:k+12*m,numIndices:3*t});k=n}if(0!==h.size)return d();b=new Float32Array(3*g);c=new Uint32Array(l);f=k=0;m=$jscomp.makeIterator(r);for(t=m.next();!t.done;t=m.next()){t=t.value;b.set(new Float32Array(t.buffer,t.verticesOffset,3*t.numVertices),
3*k);n=t.numIndices;q=new Uint32Array(t.buffer,t.indicesOffset,n);Object(N.d)(q,N.b.LITTLE);for(var p=0;p<n;++p)c[f++]=q[p]+k;k+=t.numVertices}Object(N.d)(b,N.b.LITTLE);a.vertexPositions=b;a.indices=c;a.vertexNormals=Object(D.b)(b,c)}function d(){var d=[];if(void 0!==e.changeSpec)for(var g=$jscomp.makeIterator(h),l=g.next();!l.done;l=g.next()){var r=l.value,f=r.indexOf("\x00");l=r.substring(0,f);r=r.substring(f+1);void 0!==l&&d.push({object_id:l,fragment_keys:[]});d[d.length-1].fragment_keys.push(r)}else d.push({object_id:a.manifestChunk.objectId.toString(),
fragment_keys:Array.from(h)});return Object(L.a)(e.instance,k,{method:"POST",path:"/v1/objects/meshes:batch",payload:JSON.stringify({volume_id:e.volumeId,mesh_name:e.meshName,batches:d}),responseType:"arraybuffer"},b).then(c)}var e=this.parameters,h=new Set(JSON.parse(a.fragmentId)),g=0,l=0,r=[],k=this.credentialsProvider;return d()}}]);return b}(b(D.a,G.b));kb=S([Object(m.g)()],kb);var jb=function(b){function d(){k(this,d);return g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}
c(d,b);M(d,[{key:"download",value:function(b,c){var d=this.parameters,e={object_id:""+b.objectId},h="/v1/objects/"+d.volumeId+("/meshes/"+d.meshName)+"/skeleton:binary";a(d.changeSpec,e);return Object(L.a)(d.instance,this.credentialsProvider,{method:"POST",path:h,payload:JSON.stringify(e),responseType:"arraybuffer"},c).then(function(a){var c=new DataView(a),d=c.getUint32(0,!0);if(0!==c.getUint32(4,!0))throw Error("The number of vertices should not exceed 2^32-1.");var e=c.getUint32(8,!0);if(0!==c.getUint32(12,
!0))throw Error("The number of edges should not exceed 2^32-1.");Object(B.b)(b,a,N.b.LITTLE,16,d,void 0,e)})}}]);return d}(b(B.a,G.c));jb=S([Object(m.g)()],jb);var ib=["LOCATION","LINE","VOLUME"],hb=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);M(b,[{key:"downloadGeometry",value:function(a,b){var c=this,d=this.parameters;return Promise.all(ib.map(function(a){return Object(L.a)(d.instance,c.credentialsProvider,{method:"POST",
path:"/v1/changes/"+d.volumeId+"/"+d.changestack+"/spatials:get",payload:JSON.stringify({type:a,ignore_payload:!0}),responseType:"json"},b)})).then(function(b){w(a,b)})}},{key:"downloadSegmentFilteredGeometry",value:function(a,b){var c=this,d=this.parameters;return Promise.all(ib.map(function(e){return Object(L.a)(d.instance,c.credentialsProvider,{method:"POST",path:"/v1/changes/"+d.volumeId+"/"+d.changestack+"/spatials:get",payload:JSON.stringify({type:e,object_labels:[a.objectId.toString()],ignore_payload:!0}),
responseType:"json"},b)})).then(function(b){w(a,b)})}},{key:"downloadMetadata",value:function(a,b){var c=this.parameters,d=a.key;return Object(L.a)(c.instance,this.credentialsProvider,{method:"POST",path:"/v1/changes/"+c.volumeId+"/"+c.changestack+"/spatials:get",payload:JSON.stringify({type:F(d),id:c.volumeId+":"+c.changestack+":"+d}),responseType:"json"},b).then(function(b){a.annotation=v(b,u(c),d)},function(){a.annotation=null})}},{key:"add",value:function(a){var b=this,c=this.parameters;a=H(a);
return Object(L.a)(c.instance,this.credentialsProvider,{method:"POST",path:"/v1/changes/"+c.volumeId+"/"+c.changestack+"/spatials:push",payload:JSON.stringify({annotations:[a]}),responseType:"json"}).then(function(a){Object(E.i)(a);a=Object(E.j)(a,"ids",E.m);if(1!==a.length)throw Error("Expected list of 1 id, but received "+JSON.stringify(a)+".");var c=u(b.parameters);return e(c,a[0])})}},{key:"update",value:function(a,b){var c=this.parameters;b=H(b);b.id=c.volumeId+":"+c.changestack+":"+a;return Object(L.a)(c.instance,
this.credentialsProvider,{method:"POST",path:"/v1/changes/"+c.volumeId+"/"+c.changestack+"/spatials:push",payload:JSON.stringify({annotations:[b]}),responseType:"json"})}},{key:"delete",value:function(a){var b=this.parameters;return Object(L.a)(b.instance,this.credentialsProvider,{method:"POST",path:"/v1/changes/"+b.volumeId+"/"+b.changestack+"/spatials:delete",payload:JSON.stringify({type:F(a),ids:[b.volumeId+":"+b.changestack+":"+a]}),responseType:"json"})}}]);return b}(b(A.AnnotationSource,G.a));
hb=S([Object(m.g)()],hb)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,
enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.a=function(){return function(a){return function(a){function b(a){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];k(this,b);var h;d=g(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],$jscomp.arrayFromIterable(c))));d.credentialsProvider=d.rpc.getRef(c[1].credentialsProvider);return d}c(b,a);return b}(a)}};var a=m(85),b=m(86);p=m(0);f=this&&this.__decorate||
function(a,b,c,d){var h=arguments.length,g=3>h?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,l;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var e=a.length-1;0<=e;e--)if(l=a[e])g=(3>h?l(g):3<h?l(b,c,g):l(b,c))||g;return 3<h&&g&&Object.defineProperty(b,c,g),g};m=function(h){function f(){k(this,f);var c=g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments));c.get=Object(a.a)(function(a,h){return c.rpc.promiseInvoke(b.a,{providerId:c.rpcId,
invalidCredentials:a},h)});return c}c(f,h);return f}(p.c);m=f([Object(p.g)(b.b)],m)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);
a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.a=function(b){var c,h,g;return function(d,e){if(void 0!==h&&(void 0===c||void 0===d||c.generation!==d.generation))return void 0===c&&g.addConsumer(e),h;c=void 0;g=new a.c;return h=b(d,g).then(function(a){c=a;g=void 0;return a},function(a){g.isCanceled&&(h=g=void 0);throw a;})}};var a=m(15);p=m(16);var b=m(31),h=function(){function a(a,
b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,h){c&&a(b.prototype,c);h&&a(b,h);return b}}();(function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);return b})(p.a);var q=function(){function a(){k(this,a);this.providers=new Map}h(a,[{key:"register",value:function(a,b){this.providers.set(a,b)}},{key:"getCredentialsProvider",
value:function(a,b){var c=this.providers.get(a);if(void 0===c)throw Error("No registered credentials provider: "+JSON.stringify(a));return c(b)}}]);return a}();(function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,new q))}c(b,a);h(b,[{key:"register",value:function(a,b){this.base.register(a,b)}}]);return b})(function(a){function d(a){k(this,d);var c=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));c.base=a;c.memoize=new b.a;return c}c(d,a);h(d,
[{key:"getCredentialsProvider",value:function(a,b){var c=this;return this.memoize.get({key:a,parameters:b},function(){return c.registerDisposer(c.base.getCredentialsProvider(a,b).addRef())})}}]);return d}(p.a))},function(p,f,m){f.b="CredentialsProvider";f.a="CredentialsProvider.get"},function(p,f,m){f.a=function(c,a,b,h){h=void 0===h?k.e:h;var f=void 0;return new Promise(function(l,d){function m(k){null!==f&&(f=Object(g.c)(c.serverUrls,b.path,b.method),f.responseType=b.responseType,f.setRequestHeader("Authorization",
k.credentials.tokenType+" "+k.credentials.accessToken),f.onloadend=function(){if(null!==f){var b=this.status;200<=b&&300>b?(h.remove(q),l(this.response)):401===b?a.get(k,h).then(m):504===b||503===b?a.get(void 0,h).then(m):(h.remove(q),d(g.a.fromXhr(this)))}},f.send(b.payload))}var q=function(){var a=f;f=null;null!=a&&a.abort();d(k.a)};h.add(q);a.get(void 0,h).then(m)})};var k=m(15),g=m(12)},function(p,f,m){f.a=function(k){for(var g=0,c=k.length,a=0;a<c;++a)g=31*g+k.charCodeAt(a)|0;return g}},function(p,
f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"d",function(){return c});m.d(f,"e",function(){return a});m.d(f,"b",function(){return b});
m.d(f,"c",function(){return h});m.d(f,"a",function(){return q});var c;(function(a){a[a.RAW=0]="RAW";a[a.JPEG=1]="JPEG";a[a.COMPRESSED_SEGMENTATION=2]="COMPRESSED_SEGMENTATION"})(c||(c={}));var a=function d(){g(this,d)};a.RPC_ID="brainmaps/VolumeChunkSource";var b=function n(){g(this,n)};b.RPC_ID="brainmaps/MeshSource";var h=function(a){function b(){g(this,b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!a||"object"!==typeof a&&"function"!==typeof a?this:a}k(b,a);return b}(b);h.RPC_ID="brainmaps/SkeletonSource";var q=function J(){g(this,J)};q.RPC_ID="brainmaps/Annotation"},function(p,f,m){f.b="mesh/MeshLayer";f.a="mesh/FragmentSource"},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});
b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=m(92),c=m(3),a=m(8),b=m(5);p=m(0);var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),q=function J(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==
a)return J(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)if(g=a[l])h=(3>e?g(h):3<e?g(b,c,h):g(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h};m=function(d){function l(){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");
var b=(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");b=!b||"object"!==typeof b&&"function"!==typeof b?this:b;b.disjointSets=new g.a;b.changed=new a.a;return b}k(l,d);h(l,[{key:"disposed",value:function(){this.changed=this.disjointSets=void 0;q(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"disposed",this).call(this)}},{key:"link",value:function(a,b){if(this.disjointSets.link(a,
b)){var c=this.rpc;c&&c.invoke("DisjointUint64Sets.add",{id:this.rpcId,al:a.low,ah:a.high,bl:b.low,bh:b.high});this.changed.dispatch()}}},{key:"get",value:function(a){return this.disjointSets.get(a)}},{key:"clear",value:function(){if(this.disjointSets.clear()){var a=this.rpc;a&&a.invoke("DisjointUint64Sets.clear",{id:this.rpcId});this.changed.dispatch()}}},{key:"setElements",value:function(a){return this.disjointSets.setElements(a)}},{key:"toJSON",value:function(){return this.disjointSets.toJSON()}},
{key:"restoreState",value:function(a){var d=this;this.clear();if(void 0!==a){var e=[new b.a,new b.a];Object(c.a)(a,function(a){Object(c.a)(a,function(a,b){e[b%2].parseString(String(a),10);0!==b&&d.link(e[0],e[1])})})}}},{key:"size",get:function(){return this.disjointSets.size}}],[{key:"makeWithCounterpart",value:function(a){var b=new this;b.initializeCounterpart(a);return b}}]);return l}(p.c);m=f([Object(p.g)("DisjointUint64Sets")],m);var l=new b.a,d=new b.a;Object(p.f)("DisjointUint64Sets.add",function(a){var b=
this.get(a.id);l.low=a.al;l.high=a.ah;d.low=a.bl;d.high=a.bh;b.disjointSets.link(l,d)&&b.changed.dispatch()});Object(p.f)("DisjointUint64Sets.clear",function(a){a=this.get(a.id);a.disjointSets.clear()&&a.changed.dispatch()})},function(p,f,m){function k(a){for(var b=a,c=a[h];c!==a;)a=c,c=a[h];for(a=b[h];c!==a;)b[h]=c,b=a,a=b[h];return c}function g(a){function b(b,e){for(;;)switch(c){case 0:h=!0,d=a;case 1:if(!h&&d===a){c=3;break}c=4;return{value:d,done:!1};case 4:if(void 0===e){c=5;break}c=-1;throw e;
case 5:d=d[q];case 2:h=!1;c=1;break;case 3:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,h,g={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();g[Symbol.iterator]=function(){return this};return g}m.d(f,"a",function(){return n});var c=m(5),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);
Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}();$jscomp.initSymbol();var b=Symbol("disjoint_sets:rank");$jscomp.initSymbol();var h=Symbol("disjoint_sets:parent");$jscomp.initSymbol();var q=Symbol("disjoint_sets:next");$jscomp.initSymbol();var l=Symbol("disjoint_sets:prev");$jscomp.initSymbol();var d=Symbol("disjoint_sets:min"),n=function(){function f(){if(!(this instanceof f))throw new TypeError("Cannot call a class as a function");this.map=new Map;
this.generation=0}$jscomp.initSymbol();$jscomp.initSymbolIterator();a(f,[{key:"get",value:function(a){var b=this.map.get(a.toString());return void 0===b?a:k(b)[d]}},{key:"isMinElement",value:function(a){var b=this.get(a);return b===a||c.a.equal(b,a)}},{key:"makeSet",value:function(a){var c=a.toString(),g=this.map,f=g.get(c);return void 0===f?(a=f=a.clone(),a[h]=a,a[b]=0,a[q]=a[l]=a,f[d]=f,g.set(c,f),f):k(f)}},{key:"link",value:function(a,e){a=this.makeSet(a);e=this.makeSet(e);if(a===e)return!1;this.generation++;
var g=a;var k=e,f=g[b],m=k[b];f>m?k[h]=g:(g[h]=k,f===m&&(k[b]=m+1),g=k);k=a;f=e;m=k[l];var n=f[l];f[l]=m;m[q]=f;k[l]=n;n[q]=k;a=a[d];e=e[d];g[d]=c.a.less(a,e)?a:e;return!0}},{key:"setElements",value:function(a){function b(b,e){for(;;)switch(c){case 0:k=a.toString();l=f.map.get(k);if(void 0!==l){c=1;break}c=3;return{value:a,done:!1};case 3:if(void 0===e){c=4;break}c=-1;throw e;case 4:c=2;break;case 1:h=$jscomp.makeIterator(g(l));case 5:if((d=h.next(b)).done){c=6;break}c=7;return{value:d.value,done:!1};
case 7:if(void 0===e){c=8;break}c=-1;throw e;case 8:c=5;break;case 6:case 2:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,h,l,k,f=this,m={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();m[Symbol.iterator]=function(){return this};return m}},{key:"clear",value:function(){var a=this.map;if(0===a.size)return!1;++this.generation;a.clear();return!0}},{key:"mappings",value:function(a){function b(b,
e){for(;;)switch(c){case 0:a=void 0===a?Array(2):a,l=$jscomp.makeIterator(f.map.values()),g=l.next();case 1:if(g.done){c=3;break}h=g.value;a[0]=h;a[1]=k(h)[d];c=4;return{value:a,done:!1};case 4:if(void 0===e){c=5;break}c=-1;throw e;case 5:case 2:g=l.next();c=1;break;case 3:c=-1;default:return{value:void 0,done:!0}}}var c=0,h,g,l,f=this,m={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
m[Symbol.iterator]=function(){return this};return m}},{key:Symbol.iterator,value:function(){return this.mappings()}},{key:"toJSON",value:function(){for(var a=[],b=$jscomp.makeIterator(this.map.values()),d=b.next();!d.done;d=b.next()){var l=d.value;if(l[h]===l){d=[];l=$jscomp.makeIterator(g(l));for(var k=l.next();!k.done;k=l.next())d.push(k.value);d.sort(c.a.compare);a.push(d)}}a.sort(function(a,b){return c.a.compare(a[0],b[0])});return a.map(function(a){return a.map(function(a){return a.toString()})})}},
{key:"size",get:function(){return this.map.size}}]);return f}()},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=m(94),c=m(8);p=m(0);var a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=
d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,h){c&&a(b.prototype,c);h&&a(b,h);return b}}(),b=function l(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return l(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,h){var d=arguments.length,e=3>d?b:null===h?h=Object.getOwnPropertyDescriptor(b,
c):h,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,h);else for(var l=a.length-1;0<=l;l--)if(g=a[l])e=(3>d?g(e):3<d?g(b,c,e):g(b,c))||e;return 3<d&&e&&Object.defineProperty(b,c,e),e};m=h=function(l){function d(){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");var a=(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.hashTable=new g.a;a.changed=new c.b;return a}k(d,l);$jscomp.initSymbol();$jscomp.initSymbolIterator();a(d,[{key:"disposed",value:function(){b(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"disposed",this).call(this);this.changed=this.hashTable=void 0}},{key:"add_",value:function(a){return this.hashTable.add(a)}},{key:"add",value:function(a){if(this.add_(a)){var b=this.rpc;b&&b.invoke("Uint64Set.add",{id:this.rpcId,value:a});this.changed.dispatch(a,
!0)}}},{key:"has",value:function(a){return this.hashTable.has(a)}},{key:Symbol.iterator,value:function(){return this.hashTable.keys()}},{key:"delete_",value:function(a){return this.hashTable.delete(a)}},{key:"delete",value:function(a){if(this.delete_(a)){var b=this.rpc;b&&b.invoke("Uint64Set.delete",{id:this.rpcId,value:a});this.changed.dispatch(a,!1)}}},{key:"clear",value:function(){if(this.hashTable.clear()){var a=this.rpc;a&&a.invoke("Uint64Set.clear",{id:this.rpcId});this.changed.dispatch(null,
!1)}}},{key:"toJSON",value:function(){for(var a=[],b=$jscomp.makeIterator(this),c=b.next();!c.done;c=b.next())a.push(c.value.toString());a.sort();return a}},{key:"size",get:function(){return this.hashTable.size}}],[{key:"makeWithCounterpart",value:function(a){var b=new h;b.initializeCounterpart(a);return b}}]);return d}(p.c);m=h=f([Object(p.g)("Uint64Set")],m);Object(p.f)("Uint64Set.add",function(a){var b=this.get(a.id);b.add_(a.value)&&b.changed.dispatch()});Object(p.f)("Uint64Set.delete",function(a){var b=
this.get(a.id);b.delete_(a.value)&&b.changed.dispatch()});Object(p.f)("Uint64Set.clear",function(a){a=this.get(a.id);a.hashTable.clear()&&a.changed.dispatch()});var h},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=
Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"a",function(){return u});var a=m(95),b=m(5),h=function F(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return F(a,b,c)}else{if("value"in d)return d.value;
b=d.get;return void 0===b?void 0:b.call(c)}},q=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),l=0,d=0,n=0,J=0;p=function(){function h(a){a=void 0===a?h.generateHashFunctions(3):a;c(this,h);this.loadFactor=.9;this.size=0;this.growFactor=1.2;this.maxHeight=8192;this.emptyHigh=this.emptyLow=4294967295;this.maxAttempts=
this.maxRehashAttempts=5;this.maxWidth=4096/this.entryStride;this.generation=0;this.mungedEmptyKey=-1;this.hashFunctions=a;this.allocate(4,1)}q(h,[{key:"updateHashFunctions",value:function(a){this.hashFunctions=h.generateHashFunctions(a);this.mungedEmptyKey=-1}},{key:"tableWithMungedEmptyKey",value:function(a){for(var b=this.hashFunctions.length,c=Array(b),d=0;d<b;++d)c[d]=this.getHash(d,this.emptyLow,this.emptyHigh);d=this.mungedEmptyKey;if(-1===d)a:for(;;){d=16777216*Math.random()>>>0;for(var h=
0;h<b;++h)for(var e=this.getHash(h,d,d),g=0;g<b;++g)if(c[g]===e)continue a;this.mungedEmptyKey=d;break}h=this.table;e=this.emptyLow;g=this.emptyHigh;for(var l=0;l<b;++l){var k=c[l];h[k]===e&&h[k+1]===g&&(h[k]=d,h[k+1]=d)}try{a(h)}finally{for(a=0;a<b;++a)l=c[a],h[l]===d&&h[l+1]===d&&(h[l]=e,h[l+1]=g)}}},{key:"getHash",value:function(a,b,c){a=this.hashFunctions[a];var d=this.width,h=this.height;d=a[0].compute(b,c)%d;b=a[1].compute(b,c)%h;return this.entryStride*(b*this.width+d)}},{key:"keys",value:function(a){function c(c,
r){for(;;)switch(d){case 0:a=void 0===a?new b.a:a,p=x,n=p.emptyLow,q=p.emptyHigh,m=p.entryStride,f=x,k=f.table,l=0,g=k.length;case 1:if(!(l<g)){d=3;break}e=k[l];h=k[l+1];if(e===n&&h===q){d=4;break}a.low=e;a.high=h;d=5;return{value:a,done:!1};case 5:if(void 0===r){d=6;break}d=-1;throw r;case 6:case 4:case 2:l+=m;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}var d=0,h,e,g,l,k,f,m,q,n,p,x=this,E={next:function(a){return c(a,void 0)},throw:function(a){return c(void 0,a)},return:function(a){throw Error("Not yet implemented");
}};$jscomp.initSymbolIterator();E[Symbol.iterator]=function(){return this};return E}},{key:"indexOfPair",value:function(a,b){var c=this.table,d=this.emptyHigh;if(a===this.emptyLow&&b===d)return-1;d=0;for(var h=this.hashFunctions.length;d<h;++d){var e=this.getHash(d,a,b);if(c[e]===a&&c[e+1]===b)return e}return-1}},{key:"indexOf",value:function(a){return this.indexOfPair(a.low,a.high)}},{key:"chooseAnotherEmptyKey",value:function(){for(var a=this.emptyLow,b=this.emptyHigh,c=this.table,d=this.entryStride,
h,e;h=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,h===a&&e===b||this.hasPair(h,e););this.emptyLow=h;this.emptyHigh=e;for(var g=0,l=c.length;g<l;g+=d)c[g]===a&&c[g+1]===b&&(c[g]=h,c[g+1]=e)}},{key:"has",value:function(a){return-1!==this.indexOf(a)}},{key:"hasPair",value:function(a,b){return-1!==this.indexOfPair(a,b)}},{key:"delete",value:function(a){a=this.indexOf(a);if(-1!==a){var b=this.table;b[a]=this.emptyLow;b[a+1]=this.emptyHigh;++this.generation;this.size--;return!0}return!1}},
{key:"clearTable",value:function(){for(var a=this.table,b=this.entryStride,c=this.emptyLow,d=this.emptyHigh,h=a.length,e=0;e<h;e+=b)a[e]=c,a[e+1]=d}},{key:"clear",value:function(){if(0===this.size)return!1;this.size=0;++this.generation;this.clearTable();return!0}},{key:"swapPending",value:function(a,b){var c=l,h=d;this.storePending(a,b);a[b]=c;a[b+1]=h}},{key:"storePending",value:function(a,b){l=a[b];d=a[b+1]}},{key:"backupPending",value:function(){n=l;J=d}},{key:"restorePending",value:function(){l=
n;d=J}},{key:"tryToInsert",value:function(){for(var a=0,b=this.emptyLow,c=this.emptyHigh,h=this.maxAttempts,e=this.table,g=this.hashFunctions.length,k=Math.floor(Math.random()*g);;){var f=this.getHash(k,l,d);this.swapPending(e,f);if(l===b&&d===c)return!0;if(++a===h)break;k=(k+Math.floor(Math.random()*(g-1))+1)%g}return!1}},{key:"allocate",value:function(a,b){var c=a*b;this.width=a;this.height=b;this.table=new Uint32Array(c*this.entryStride);this.maxAttempts=c;this.clearTable();this.capacity=c*this.loadFactor;
this.mungedEmptyKey=-1}},{key:"rehash",value:function(a,b,c){this.allocate(b,c);this.updateHashFunctions(this.hashFunctions.length);b=this.emptyLow;c=this.emptyHigh;for(var d=this.entryStride,h=0,e=a.length;h<e;h+=d){var g=a[h+1];if(a[h]!==b||g!==c)if(this.storePending(a,h),!this.tryToInsert())return!1}return!0}},{key:"grow",value:function(a){for(var b=this.table,c=this.width,d=this.height,h=this.maxWidth,e=this.maxHeight;;){var g=c*d;c=Math.min(h,Math.ceil(a/this.height));c*d<a&&(d=Math.min(e,Math.ceil(a/
c)));var l=c*d;if(l<a&&l===g)throw Error("Maximum table size exceeded");for(g=0;g<this.maxRehashAttempts;++g)if(this.rehash(b,c,d))return;a=Math.ceil(this.growFactor*a)}}},{key:"insertInternal",value:function(){++this.generation;l===this.emptyLow&&d===this.emptyHigh&&this.chooseAnotherEmptyKey();++this.size>this.capacity&&(this.backupPending(),this.grow(Math.ceil(this.growFactor*this.width*this.height)),this.restorePending());for(;!this.tryToInsert();)this.backupPending(),this.grow(this.width*this.height),
this.restorePending()}}],[{key:"generateHashFunctions",value:function(b){b=void 0===b?3:b;for(var c=[],d=0;d<b;++d){var h=[a.a.generate(),a.a.generate()];c.push(h)}return c}}]);return h}();var u=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);$jscomp.initSymbol();$jscomp.initSymbolIterator();q(b,[{key:"add",value:function(a){var b=a.low;a=a.high;if(this.hasPair(b,a))return!1;l=b;d=a;this.insertInternal();return!0}},{key:Symbol.iterator,
value:function(){return this.keys()}}]);return b}(p);u.prototype.entryStride=2;var e=0,y=0,K=0,v=0;(function(a){function f(){c(this,f);return k(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}g(f,a);$jscomp.initSymbol();$jscomp.initSymbolIterator();q(f,[{key:"set",value:function(a,b){var c=a.low;a=a.high;if(this.hasPair(c,a))return!1;l=c;d=a;e=b.low;y=b.high;this.insertInternal();return!0}},{key:"get",value:function(a,b){a=this.indexOf(a);if(-1===a)return!1;var c=this.table;b.low=
c[a+2];b.high=c[a+3];return!0}},{key:"swapPending",value:function(a,b){var c=e,d=y;h(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"swapPending",this).call(this,a,b);a[b+2]=c;a[b+3]=d}},{key:"storePending",value:function(a,b){h(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"storePending",this).call(this,a,b);e=a[b+2];y=a[b+3]}},{key:"backupPending",value:function(){h(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"backupPending",this).call(this);K=e;v=y}},{key:"restorePending",
value:function(){h(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"restorePending",this).call(this);e=K;y=v}},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"entries",value:function(a){function c(c,r){for(;;)switch(d){case 0:a=void 0===a?[new b.a,new b.a]:a,M=v,z=M.emptyLow,E=M.emptyHigh,p=M.entryStride,n=v,q=n.table,m=$jscomp.makeIterator(a),f=m.next().value,k=m.next().value,l=0,g=q.length;case 1:if(!(l<g)){d=3;break}e=q[l];h=q[l+1];if(e===z&&h===E){d=4;break}f.low=
e;f.high=h;k.low=q[l+2];k.high=q[l+3];d=5;return{value:a,done:!1};case 5:if(void 0===r){d=6;break}d=-1;throw r;case 6:case 4:case 2:l+=p;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}var d=0,h,e,g,l,k,f,m,q,n,p,E,z,M,v=this,u={next:function(a){return c(a,void 0)},throw:function(a){return c(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();u[Symbol.iterator]=function(){return this};return u}}]);return f})(p).prototype.entryStride=4},function(p,
f,m){m.d(f,"a",function(){return g});var k=function(){function c(a,b){for(var c=0;c<b.length;c++){var g=b[c];g.enumerable=g.enumerable||!1;g.configurable=!0;"value"in g&&(g.writable=!0);Object.defineProperty(a,g.key,g)}}return function(a,b,h){b&&c(a.prototype,b);h&&c(a,h);return a}}(),g=function(){function c(a,b,h,g){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.a0=a;this.a1=b;this.b=h;this.c=g}k(c,[{key:"computeDotProduct",value:function(a,b){var c=this.a0,
g=this.a1;return c[0]*(a&255)+c[1]*(a>>8&255)+c[2]*(a>>16&255)+c[3]*(a>>24&255)+(g[0]*(b&255)+g[1]*(b>>8&255)+g[2]*(b>>16&255)+g[3]*(b>>24&255))}},{key:"compute",value:function(a,b){var c=this.b,g=this.c;a=this.computeDotProduct(a,b);return(a+a*a%4093*g+c)%4093}},{key:"toString",value:function(){return"new HashFunction(Float32Array.of("+this.a0+"), "+("Float32Array.of("+this.a1+"), "+this.b+", "+this.c+")")}}],[{key:"generate",value:function(){function a(){return Math.floor(4093*Math.random())}return new c(Float32Array.of(a(),
a(),a(),a()),Float32Array.of(a(),a(),a(),a()),a(),a())}}]);return c}()},function(p,f,m){f.a="skeleton/SkeletonLayer"},function(p,f,m){function k(c,k,f,m,e,p,K,v){var d=e[0],n=e[1],u=e[2];e=m[0];var y=m[1];m=m[2];var t=f[0],A=f[1],I=f[2];I-=A*n;A-=t*d;if(0===d*n*u)return[0,0];f=e*y*m+31;if(void 0===a||a.length<f)a=new Uint32Array(f),b=new Uint32Array(1*f),h=new Uint32Array(1*f),q=new Uint32Array(f),l=new Uint32Array(f);f=a.subarray(0,f);f.fill(0);for(var r=b,L=h,G=q,D=l,B=0,C=c[k]+1>>>0,J=0,N=e-d,
O=e*y-e*n,E=0;E<u;++E,k+=I,J+=O)for(var z=0;z<n;++z,k+=A,J+=N)for(var M=0;M<d;++M,k+=t){var S=c[k];S!==C&&(C=r[1*B]=S,G[B]=B++);f[J++]=B}G.subarray(0,B).sort(function(a,b){return r[a]-r[b]});c=-1;d=r[1*G[0]]+1>>>0;for(n=0;n<B;++n)u=G[n],t=r[1*u],t!==d&&(++c,d=L[1*c]=t),D[u+1]=c;++c;return Object(g.c)(v,p,K,e*y*m,c,L,f,D,1)}f.a=function(a,b,h,l,e,f){e=void 0===e?0:e;f=void 0===f?Object(c.a)(l,1):f;return Object(g.b)(a,b,h,l,e,f,k)};var g=m(23),c=m(21),a,b,h,q,l},function(p,f,m){function k(c,k,f,m,
e,p,K,v){var d=e[0],n=e[1],u=e[2];e=m[0];var y=m[1];m=m[2];var t=f[0],A=f[1],I=f[2];I-=A*n;A-=t*d;if(0===d*n*u)return[0,0];f=e*y*m+31;if(void 0===a||a.length<f)a=new Uint32Array(f),b=new Uint32Array(2*f),h=new Uint32Array(2*f),q=new Uint32Array(f),l=new Uint32Array(f);f=a.subarray(0,f);f.fill(0);for(var r=b,L=h,G=q,D=l,B=0,C=c[k]+1>>>0,J=0,N=0,O=e-d,E=e*y-e*n,z=0;z<u;++z,k+=I,N+=E)for(var M=0;M<n;++M,k+=A,N+=O)for(var S=0;S<d;++S,k+=t){var pa=c[k],R=c[k+1];if(pa!==C||R!==J)C=r[2*B]=pa,J=r[2*B+1]=
R,G[B]=B++;f[N++]=B}G.subarray(0,B).sort(function(a,b){var c=r[2*a],d=r[2*b];return r[2*a+1]-r[2*b+1]||c-d});c=-1;d=r[2*G[0]]+1>>>0;for(n=A=0;n<B;++n){u=G[n];I=2*u;t=r[I];I=r[I+1];if(t!==d||I!==A)++c,A=2*c,d=L[A]=t,A=L[A+1]=I;D[u+1]=c}++c;return Object(g.c)(v,p,K,e*y*m,c,L,f,D,2)}f.a=function(a,b,h,l,e,f){e=void 0===e?0:e;f=void 0===f?Object(c.a)(l,2):f;return Object(g.b)(a,b,h,l,e,f,k)};var g=m(23),c=m(21),a,b,h,q,l},function(p,f,m){m.d(f,"a",function(){return g});var k=function(){function c(a,b){for(var c=
0;c<b.length;c++){var g=b[c];g.enumerable=g.enumerable||!1;g.configurable=!0;"value"in g&&(g.writable=!0);Object.defineProperty(a,g.key,g)}}return function(a,b,h){b&&c(a.prototype,b);h&&c(a,h);return a}}(),g=function(){function c(a){a=void 0===a?16:a;if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.length=0;this.data=new Uint32Array(a)}k(c,[{key:"resize",value:function(a){var b=this.data;if(a>b.length){var c=new Uint32Array(Math.max(a,2*b.length));c.set(b.subarray(0,
this.length));this.data=c}this.length=a}},{key:"shrinkToFit",value:function(){this.data=new Uint32Array(this.view)}},{key:"clear",value:function(){this.length=0}},{key:"appendArray",value:function(a){var b=this.length;this.resize(b+a.length);this.data.set(a,b)}},{key:"eraseRange",value:function(a,b){this.data.copyWithin(a,b,this.length);this.length-=b-a}},{key:"view",get:function(){var a=this.data;return new Uint32Array(a.buffer,a.byteOffset,this.length)}}]);return c}()},function(p,f,m){f.a=function(a,
b,h){var f=new k.JpegDecoder;f.parse(a);if(f.width*f.height!==b[0]*b[1]*b[2])throw Error("JPEG data does not have the expected dimensions: "+("width="+f.width+", height="+f.height+", ")+("chunkDataSize="+c.m.str(b)));if(f.numComponents!==h)throw Error("JPEG data does not have the expected number of components: "+("components="+f.numComponents+", expected="+h));if(1===f.numComponents)return f.getData(f.width,f.height,!1);if(3===f.numComponents)return a=f.getData(f.width,f.height,!1),Object(g.c)(a,
f.width*f.height,3);throw Error("JPEG data has an unsupported number of components: components="+f.numComponents);};var k=m(101);m.n(k);var g=m(21),c=m(1)},function(p,f,m){function k(c,a){if(0===c.indexOf("data:")){var b=c.indexOf("base64,")+7;c=atob(c.substring(b));b=new Uint8Array(c.length);for(var h=c.length-1;0<=h;h--)b[h]=c.charCodeAt(h);a(b.buffer)}else{var g=new XMLHttpRequest;g.open("GET",c,!0);g.responseType="arraybuffer";g.onload=function(){a(g.response)};g.send(null)}}f=function(){function c(){this._src=
null;this._parser=new g.JpegImage;this.onload=null}c.prototype={get src(){return this._src},set src(a){this.load(a)},get width(){return this._parser.width},get height(){return this._parser.height},load:function(a){this._src=a;k(a,function(a){this.parse(new Uint8Array(a));if(this.onload)this.onload()}.bind(this))},parse:function(a){this._parser.parse(a)},getData:function(a,b){return this._parser.getData(a,b,!1)},copyToImageData:function(a){if(2===this._parser.numComponents||4<this._parser.numComponents)throw Error("Unsupported amount of components");
var b=a.width,c=a.height,g=b*c*4;a=a.data;if(1===this._parser.numComponents){var f=this._parser.getData(b,c,!1);for(c=b=0;b<g;){var d=f[c++];a[b++]=d;a[b++]=d;a[b++]=d;a[b++]=255}}else for(f=this._parser.getData(b,c,!0),c=b=0;b<g;)a[b++]=f[c++],a[b++]=f[c++],a[b++]=f[c++],a[b++]=255}};return c}();var g;(function(c){function a(a){for(var b=1,c=0;a>b;)b<<=1,c++;return c}function b(a,b){return a[b]<<8|a[b+1]}function h(a,b){return(a[b]<<24|a[b+1]<<16|a[b+2]<<8|a[b+3])>>>0}function g(a,b,c){Object.defineProperty(a,
b,{value:c,enumerable:!0,configurable:!0,writable:!1});return c}var f=function(){function a(){}function b(a,b){for(var c=0,d=[],h,g,e=16;0<e&&!a[e-1];)e--;d.push({children:[],index:0});var f=d[0],l;for(h=0;h<e;h++){for(g=0;g<a[h];g++){f=d.pop();for(f.children[f.index]=b[c];0<f.index;)f=d.pop();f.index++;for(d.push(f);d.length<=h;)d.push(l={children:[],index:0}),f.children[f.index]=l.children,f=l;c++}h+1<e&&(d.push(l={children:[],index:0}),f.children[f.index]=l.children,f=l)}return d[0].children}function c(a,
b,c,d,h,e,f,l,k){function r(){if(0<B)return B--,D>>B&1;D=a[b++];if(255===D){var c=a[b++];if(c)throw"unexpected marker: "+(D<<8|c).toString(16);}B=7;return D>>>7}function m(a){for(;;){a=a[r()];if("number"===typeof a)return a;if("object"!==typeof a)throw"invalid huffman sequence";}}function t(a){for(var b=0;0<a;)b=b<<1|r(),a--;return b}function n(a){if(1===a)return 1===r()?1:-1;var b=t(a);return b>=1<<a-1?b:b+(-1<<a)+1}function z(a,b){var c=m(a.huffmanTableDC);c=0===c?0:n(c);a.blockData[b]=a.pred+=
c;for(c=1;64>c;){var d=m(a.huffmanTableAC),h=d&15;d>>=4;if(0===h){if(15>d)break;c+=16}else c+=d,a.blockData[b+g[c]]=n(h),c++}}function q(a,b){var c=m(a.huffmanTableDC);c=0===c?0:n(c)<<k;a.blockData[b]=a.pred+=c}function p(a,b){a.blockData[b]|=r()<<k}function G(a,b){if(0<u)u--;else for(var c=e;c<=f;){var d=m(a.huffmanTableAC),h=d&15;d>>=4;if(0===h){if(15>d){u=t(d)+(1<<d)-1;break}c+=16}else c+=d,a.blockData[b+g[c]]=n(h)*(1<<k),c++}}function L(a,b){for(var c=e,d=0,h;c<=f;){h=g[c];switch(w){case 0:d=
m(a.huffmanTableAC);h=d&15;d>>=4;if(0===h)15>d?(u=t(d)+(1<<d),w=4):(d=16,w=1);else{if(1!==h)throw"invalid ACn encoding";y=n(h);w=d?2:3}continue;case 1:case 2:a.blockData[b+h]?a.blockData[b+h]+=r()<<k:(d--,0===d&&(w=2===w?3:0));break;case 3:a.blockData[b+h]?a.blockData[b+h]+=r()<<k:(a.blockData[b+h]=y<<k,w=0);break;case 4:a.blockData[b+h]&&(a.blockData[b+h]+=r()<<k)}c++}4===w&&(u--,0===u&&(w=0))}var A=c.mcusPerLine,v=b,D=0,B=0,u=0,w=0,y,x=d.length,I,H,C,J;l=c.progressive?0===e?0===l?q:p:0===l?G:L:
z;var F=0;c=1===x?d[0].blocksPerLine*d[0].blocksPerColumn:A*c.mcusPerColumn;h||(h=c);for(var K,Ia;F<c;){for(I=0;I<x;I++)d[I].pred=0;u=0;if(1===x){var Y=d[0];for(J=0;J<h;J++)l(Y,64*((Y.blocksPerLine+1)*(F/Y.blocksPerLine|0)+F%Y.blocksPerLine)),F++}else for(J=0;J<h;J++){for(I=0;I<x;I++)for(Y=d[I],K=Y.h,Ia=Y.v,H=0;H<Ia;H++)for(C=0;C<K;C++)l(Y,64*((Y.blocksPerLine+1)*((F/A|0)*Y.v+H)+(F%A*Y.h+C)));F++}B=0;Y=a[b]<<8|a[b+1];if(65280>=Y)throw"marker was not found";if(65488<=Y&&65495>=Y)b+=2;else break}return b-
v}function d(a,b){a=b.blocksPerLine;for(var c=b.blocksPerColumn,d=new Int16Array(64),h=0;h<c;h++)for(var g=0;g<a;g++){for(var e,f,l,k,m,t,n,z,q,p,A,R,v=64*((b.blocksPerLine+1)*h+g),u=d,w=b.quantizationTable,y=b.blockData,x=0;64>x;x+=8)e=y[v+x],z=y[v+x+1],n=y[v+x+2],t=y[v+x+3],m=y[v+x+4],k=y[v+x+5],l=y[v+x+6],f=y[v+x+7],e*=w[x],0===(z|n|t|m|k|l|f)?(e=5793*e+512>>10,u[x]=e,u[x+1]=e,u[x+2]=e,u[x+3]=e,u[x+4]=e,u[x+5]=e,u[x+6]=e,u[x+7]=e):(z*=w[x+1],n*=w[x+2],t*=w[x+3],m*=w[x+4],k*=w[x+5],l*=w[x+6],f*=
w[x+7],R=5793*e+128>>8,A=5793*m+128>>8,p=n,q=l,m=2896*(z-f)+128>>8,f=2896*(z+f)+128>>8,t<<=4,k<<=4,R=R+A+1>>1,A=R-A,e=3784*p+1567*q+128>>8,p=1567*p-3784*q+128>>8,q=e,m=m+k+1>>1,k=m-k,f=f+t+1>>1,t=f-t,R=R+q+1>>1,q=R-q,A=A+p+1>>1,p=A-p,e=2276*m+3406*f+2048>>12,m=3406*m-2276*f+2048>>12,f=e,e=799*t+4017*k+2048>>12,t=4017*t-799*k+2048>>12,k=e,u[x]=R+f,u[x+7]=R-f,u[x+1]=A+k,u[x+6]=A-k,u[x+2]=p+t,u[x+5]=p-t,u[x+3]=q+m,u[x+4]=q-m);for(w=0;8>w;++w)e=u[w],z=u[w+8],n=u[w+16],t=u[w+24],m=u[w+32],k=u[w+40],l=
u[w+48],f=u[w+56],0===(z|n|t|m|k|l|f)?(e=5793*e+8192>>14,e=-2040>e?0:2024<=e?255:e+2056>>4,y[v+w]=e,y[v+w+8]=e,y[v+w+16]=e,y[v+w+24]=e,y[v+w+32]=e,y[v+w+40]=e,y[v+w+48]=e,y[v+w+56]=e):(R=5793*e+2048>>12,A=5793*m+2048>>12,p=n,q=l,m=2896*(z-f)+2048>>12,f=2896*(z+f)+2048>>12,R=(R+A+1>>1)+4112,A=R-A,e=3784*p+1567*q+2048>>12,p=1567*p-3784*q+2048>>12,q=e,m=m+k+1>>1,k=m-k,f=f+t+1>>1,t=f-t,R=R+q+1>>1,q=R-q,A=A+p+1>>1,p=A-p,e=2276*m+3406*f+2048>>12,m=3406*m-2276*f+2048>>12,f=e,e=799*t+4017*k+2048>>12,t=4017*
t-799*k+2048>>12,k=e,e=R+f,f=R-f,z=A+k,l=A-k,n=p+t,k=p-t,t=q+m,m=q-m,e=16>e?0:4080<=e?255:e>>4,z=16>z?0:4080<=z?255:z>>4,n=16>n?0:4080<=n?255:n>>4,t=16>t?0:4080<=t?255:t>>4,m=16>m?0:4080<=m?255:m>>4,k=16>k?0:4080<=k?255:k>>4,l=16>l?0:4080<=l?255:l>>4,f=16>f?0:4080<=f?255:f>>4,y[v+w]=e,y[v+w+8]=z,y[v+w+16]=n,y[v+w+24]=t,y[v+w+32]=m,y[v+w+40]=k,y[v+w+48]=l,y[v+w+56]=f)}return b.blockData}function h(a){return 0>=a?0:255<=a?255:a}var g=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,
33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);a.prototype={parse:function(a){function h(){var b=a[k]<<8|a[k+1];k+=2;return b}function e(){var b=h();b=a.subarray(k,k+b-2);k+=b.length;return b}function f(a){for(var b=Math.ceil(a.samplesPerLine/8/a.maxH),c=Math.ceil(a.scanLines/8/a.maxV),d=0;d<a.components.length;d++){x=a.components[d];var h=Math.ceil(Math.ceil(a.samplesPerLine/8)*x.h/a.maxH),e=Math.ceil(Math.ceil(a.scanLines/
8)*x.v/a.maxV);x.blockData=new Int16Array(64*c*x.v*(b*x.h+1));x.blocksPerLine=h;x.blocksPerColumn=e}a.mcusPerLine=b;a.mcusPerColumn=c}var k=0,l=null,m=null,t=[],n=[],q=[];var p=h();if(65496!==p)throw"SOI not found";for(p=h();65497!==p;){switch(p){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var v=e();65504===p&&74===v[0]&&70===v[1]&&73===v[2]&&70===v[3]&&0===
v[4]&&(l={version:{major:v[5],minor:v[6]},densityUnits:v[7],xDensity:v[8]<<8|v[9],yDensity:v[10]<<8|v[11],thumbWidth:v[12],thumbHeight:v[13],thumbData:v.subarray(14,14+3*v[12]*v[13])});65518===p&&65===v[0]&&100===v[1]&&111===v[2]&&98===v[3]&&101===v[4]&&0===v[5]&&(m={version:v[6],flags0:v[7]<<8|v[8],flags1:v[9]<<8|v[10],transformCode:v[11]});break;case 65499:p=h()+k-2;for(var E;k<p;){var z=a[k++],M=new Uint16Array(64);if(0===z>>4)for(v=0;64>v;v++)E=g[v],M[E]=a[k++];else if(1===z>>4)for(v=0;64>v;v++)E=
g[v],M[E]=h();else throw"DQT: invalid table spec";t[z&15]=M}break;case 65472:case 65473:case 65474:if(u)throw"Only single frame JPEGs supported";h();var u={};u.extended=65473===p;u.progressive=65474===p;u.precision=a[k++];u.scanLines=h();u.samplesPerLine=h();u.components=[];u.componentIds={};v=a[k++];for(p=M=z=0;p<v;p++){E=a[k];var w=a[k+1]>>4;var R=a[k+1]&15;z<w&&(z=w);M<R&&(M=R);w=u.components.push({h:w,v:R,quantizationTable:t[a[k+2]]});u.componentIds[E]=w-1;k+=3}u.maxH=z;u.maxV=M;f(u);break;case 65476:E=
h();for(p=2;p<E;){z=a[k++];M=new Uint8Array(16);for(v=w=0;16>v;v++,k++)w+=M[v]=a[k];R=new Uint8Array(w);for(v=0;v<w;v++,k++)R[v]=a[k];p+=17+w;(0===z>>4?q:n)[z&15]=b(M,R)}break;case 65501:h();var y=h();break;case 65498:h();E=a[k++];v=[];for(p=0;p<E;p++){z=u.componentIds[a[k++]];var x=u.components[z];z=a[k++];x.huffmanTableDC=q[z>>4];x.huffmanTableAC=n[z&15];v.push(x)}p=a[k++];E=a[k++];z=a[k++];p=c(a,k,u,v,y,p,E,z>>4,z&15);k+=p;break;case 65535:255!==a[k]&&k--;break;default:if(255===a[k-3]&&192<=a[k-
2]&&254>=a[k-2])k-=3;else throw"unknown JPEG marker "+p.toString(16);}p=h()}this.width=u.samplesPerLine;this.height=u.scanLines;this.jfif=l;this.adobe=m;this.components=[];for(p=0;p<u.components.length;p++)x=u.components[p],this.components.push({output:d(u,x),scaleX:x.h/u.maxH,scaleY:x.v/u.maxV,blocksPerLine:x.blocksPerLine,blocksPerColumn:x.blocksPerColumn});this.numComponents=this.components.length},_getLinearizedBlockData:function(a,b){var c=this.width/a,d=this.height/b,h,e,g=this.components.length,
f=a*b*g,k=new Uint8Array(f),l=new Uint32Array(a);for(e=0;e<g;e++){var m=this.components[e];var t=m.scaleX*c;var n=m.scaleY*d;var z=e;var q=m.output;var p=m.blocksPerLine+1<<3;for(h=0;h<a;h++)m=0|h*t,l[h]=(m&4294967288)<<3|m&7;for(t=0;t<b;t++)for(m=0|t*n,m=p*(m&4294967288)|(m&7)<<3,h=0;h<a;h++)k[z]=q[m+l[h]],z+=g}if(b=this.decodeTransform)for(e=0;e<f;)for(a=m=0;m<g;m++,e++,a+=2)k[e]=(k[e]*b[a]>>8)+b[a+1];return k},_isColorConversionNeeded:function(){return this.adobe&&this.adobe.transformCode?!0:3===
this.numComponents?!0:!1},_convertYccToRgb:function(a){for(var b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],a[e]=h(b-179.456+1.402*d),a[e+1]=h(b+135.459-.344*c-.714*d),a[e+2]=h(b-226.816+1.772*c);return a},_convertYcckToRgb:function(a){for(var b,c,d,e,g=0,f=0,k=a.length;f<k;f+=4){b=a[f];c=a[f+1];d=a[f+2];e=a[f+3];var l=-122.67195406894+c*(-6.60635669420364E-5*c+4.37130475926232E-4*d-5.4080610064599E-5*b+4.8449797120281E-4*e-.154362151871126)+d*(-9.57964378445773E-4*d+8.17076911346625E-4*
b-.00477271405408747*e+1.53380253221734)+b*(9.61250184130688E-4*b-.00266257332283933*e+.48357088451265)+e*(-3.36197177618394E-4*e+.484791561490776),m=107.268039397724+c*(2.19927104525741E-5*c-6.40992018297945E-4*d+6.59397001245577E-4*b+4.26105652938837E-4*e-.176491792462875)+d*(-7.78269941513683E-4*d+.00130872261408275*b+7.70482631801132E-4*e-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*e+.25802910206845)+e*(-3.18913117588328E-4*e-.213742400323665);b=-20.810012546947+c*(-5.70115196973677E-4*
c-2.63409051004589E-5*d+.0020741088115012*b-.00288260236853442*e+.814272968359295)+d*(-1.53496057440975E-5*d-1.32689043961446E-4*b+5.60833691242812E-4*e-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*e+.116935020465145)+e*(-3.43531996510555E-4*e+.24165260232407);a[g++]=h(l);a[g++]=h(m);a[g++]=h(b)}return a},_convertYcckToCmyk:function(a){for(var b,c,d,e=0,g=a.length;e<g;e+=4)b=a[e],c=a[e+1],d=a[e+2],a[e]=h(434.456-b-1.402*d),a[e+1]=h(119.541-b+.344*c+.714*d),a[e+2]=h(481.816-b-1.772*
c);return a},_convertCmykToRgb:function(a){for(var b,c,d,e,h=0,g=1/255/255,f=0,k=a.length;f<k;f+=4){b=a[f];c=a[f+1];d=a[f+2];e=a[f+3];var l=b*(-4.387332384609988*b+54.48615194189176*c+18.82290502165302*d+212.25662451639585*e-72734.4411664936)+c*(1.7149763477362134*c-5.6096736904047315*d-17.873870861415444*e-1401.7366389350734)+d*(-2.5217340131683033*d-21.248923337353073*e+4465.541406466231)-e*(21.86122147463605*e+48317.86113160301),m=b*(8.841041422036149*b+60.118027045597366*c+6.871425592049007*d+
31.159100130055922*e-20220.756542821975)+c*(-15.310361306967817*c+17.575251261109482*d+131.35250912493976*e-48691.05921601825)+d*(4.444339102852739*d+9.8632861493405*e-6341.191035517494)-e*(20.737325471181034*e+47890.15695978492);b=b*(.8842522430003296*b+8.078677503112928*c+30.89978309703729*d-.23883238689178934*e-3616.812083916688)+c*(10.49593273432072*c+63.02378494754052*d+50.606957656360734*e-28620.90484698408)+d*(.03296041114873217*d+115.60384449646641*e-49363.43385999684)-e*(22.33816807309886*
e+45932.16563550634);a[h++]=0<=l?255:-16581375>=l?0:255+l*g|0;a[h++]=0<=m?255:-16581375>=m?0:255+m*g|0;a[h++]=0<=b?255:-16581375>=b?0:255+b*g|0}return a},getData:function(a,b,c){if(4<this.numComponents)throw"Unsupported color mode";a=this._getLinearizedBlockData(a,b);if(3===this.numComponents)return this._convertYccToRgb(a);if(4===this.numComponents){if(this._isColorConversionNeeded())return c?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(c)return this._convertCmykToRgb(a)}return a}};return a}();
"use strict";var d=function(){function a(a,b,c){this.data=a;this.bp=b;this.dataEnd=c;this.chigh=a[b];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}var b=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,
nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},
{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},
{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,
nlps:46,switchFlag:0}];a.prototype={byteIn:function(){var a=this.data,b=this.bp;255===a[b]?143<a[b+1]?(this.clow+=65280,this.ct=8):(b++,this.clow+=a[b]<<9,this.ct=7,this.bp=b):(b++,this.clow+=b<this.dataEnd?a[b]<<8:65280,this.ct=8,this.bp=b);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(a,c){var d=a[c]>>1,e=a[c]&1;d=b[d];var h=d.qe,g=this.a-h;if(this.chigh<h)g<h?(g=h,h=e,d=d.nmps):(g=h,h=1^e,1===d.switchFlag&&(e=h),d=d.nlps);else{this.chigh-=h;if(0!==(g&32768))return this.a=
g,e;g<h?(h=1^e,1===d.switchFlag&&(e=h),d=d.nlps):(h=e,d=d.nmps)}do 0===this.ct&&this.byteIn(),g<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(g&32768));this.a=g;a[c]=d<<1|e;return h}};return a}();"use strict";var k=function(){function c(){this.failOnCorruptedImage=!1}function g(a,b,c){a=c.xcb_;c=c.ycb_;var d=1<<a,e=1<<c,h=b.tbx0>>a,g=b.tby0>>c,f=b.tbx1+d-1>>a,k=b.tby1+e-1>>c,l=b.resolution.precinctParameters,m=[],r=[],t,n;for(n=g;n<k;n++)for(t=
h;t<f;t++){var z={cbx:t,cby:n,tbx0:d*t,tby0:e*n,tbx1:d*(t+1),tby1:e*(n+1)};z.tbx0_=Math.max(b.tbx0,z.tbx0);z.tby0_=Math.max(b.tby0,z.tby0);z.tbx1_=Math.min(b.tbx1,z.tbx1);z.tby1_=Math.min(b.tby1,z.tby1);var q=Math.floor((z.tbx0_-b.tbx0)/l.precinctWidthInSubband)+Math.floor((z.tby0_-b.tby0)/l.precinctHeightInSubband)*l.numprecinctswide;z.precinctNumber=q;z.subbandType=b.type;z.Lblock=3;if(!(z.tbx1_<=z.tbx0_||z.tby1_<=z.tby0_)){m.push(z);var p=r[q];void 0!==p?(t<p.cbxMin?p.cbxMin=t:t>p.cbxMax&&(p.cbxMax=
t),n<p.cbyMin?p.cbxMin=n:n>p.cbyMax&&(p.cbyMax=n)):r[q]=p={cbxMin:t,cbyMin:n,cbxMax:t,cbyMax:n};z.precinct=p}}b.codeblockParameters={codeblockWidth:a,codeblockHeight:c,numcodeblockwide:f-h+1,numcodeblockhigh:k-g+1};b.codeblocks=m;b.precincts=r}function f(a,b,c){var d=[];a=a.subbands;for(var e=0,h=a.length;e<h;e++)for(var g=a[e].codeblocks,f=0,k=g.length;f<k;f++){var l=g[f];l.precinctNumber===b&&d.push(l)}return{layerNumber:c,codeblocks:d}}function k(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,
d=a.SIZ.Csiz,e=0;for(a=0;a<d;a++)e=Math.max(e,b.components[a].codingStyleParameters.decompositionLevelsCount);var h=0,g=0,k=0,l=0;this.nextPacket=function(){for(;h<c;h++){for(;g<=e;g++){for(;k<d;k++){var a=b.components[k];if(!(g>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[g];for(var m=a.precinctParameters.numprecincts;l<m;)return a=f(a,l,h),l++,a;l=0}}k=0}g=0}throw Error("JPX Error: Out of packets");}}function l(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,
d=a.SIZ.Csiz,e=0;for(a=0;a<d;a++)e=Math.max(e,b.components[a].codingStyleParameters.decompositionLevelsCount);var h=0,g=0,k=0,l=0;this.nextPacket=function(){for(;h<=e;h++){for(;g<c;g++){for(;k<d;k++){var a=b.components[k];if(!(h>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[h];for(var m=a.precinctParameters.numprecincts;l<m;)return a=f(a,l,g),l++,a;l=0}}k=0}g=0}throw Error("JPX Error: Out of packets");}}function m(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,
d=a.SIZ.Csiz,e,h,g,k=0;for(g=0;g<d;g++)k=Math.max(k,b.components[g].codingStyleParameters.decompositionLevelsCount);var l=new Int32Array(k+1);for(h=0;h<=k;++h){for(g=a=0;g<d;++g){var m=b.components[g].resolutions;h<m.length&&(a=Math.max(a,m[h].precinctParameters.numprecincts))}l[h]=a}var r=g=h=e=0;this.nextPacket=function(){for(;h<=k;h++){for(;r<l[h];r++){for(;g<d;g++){var a=b.components[g];if(!(h>a.codingStyleParameters.decompositionLevelsCount||(a=a.resolutions[h],r>=a.precinctParameters.numprecincts))){for(;e<
c;)return a=f(a,r,e),e++,a;e=0}}g=0}r=0}throw Error("JPX Error: Out of packets");}}function t(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=r(b),h=0,g=0,k=0,l=0,m=0;this.nextPacket=function(){for(;m<e.maxNumHigh;m++){for(;l<e.maxNumWide;l++){for(;k<d;k++){for(var a=b.components[k],r=a.codingStyleParameters.decompositionLevelsCount;g<=r;g++){var t=a.resolutions[g],n=q(l,m,e.components[k].resolutions[g],e,t);if(null!==n){for(;h<c;)return a=f(t,n,h),
h++,a;h=0}}g=0}k=0}l=0}throw Error("JPX Error: Out of packets");}}function n(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=r(b),h=0,g=0,k=0,l=0,m=0;this.nextPacket=function(){for(;k<d;++k){for(var a=b.components[k],r=e.components[k],t=a.codingStyleParameters.decompositionLevelsCount;m<r.maxNumHigh;m++){for(;l<r.maxNumWide;l++){for(;g<=t;g++){var n=a.resolutions[g],z=q(l,m,r.resolutions[g],r,n);if(null!==z){for(;h<c;)return a=f(n,z,h),h++,a;h=0}}g=
0}l=0}m=0}throw Error("JPX Error: Out of packets");}}function q(a,b,c,d,e){a*=d.minWidth;b*=d.minHeight;return 0!==a%c.width||0!==b%c.height?null:a/c.height+b/c.width*e.precinctParameters.numprecinctswide}function r(a){for(var b=a.components.length,c=Number.MAX_VALUE,d=Number.MAX_VALUE,e=0,h=0,g=Array(b),f=0;f<b;f++){for(var k=a.components[f],l=k.codingStyleParameters.decompositionLevelsCount,m=Array(l+1),r=Number.MAX_VALUE,t=Number.MAX_VALUE,n=0,p=0,q=1;0<=l;--l){var G=k.resolutions[l],v=q*G.precinctParameters.precinctWidth,
u=q*G.precinctParameters.precinctHeight;r=Math.min(r,v);t=Math.min(t,u);n=Math.max(n,G.precinctParameters.numprecinctswide);p=Math.max(p,G.precinctParameters.numprecinctshigh);m[l]={width:v,height:u};q<<=1}c=Math.min(c,r);d=Math.min(d,t);e=Math.max(e,n);h=Math.max(h,p);g[f]={resolutions:m,minWidth:r,minHeight:t,maxNumWide:n,maxNumHigh:p}}return{components:g,minWidth:c,minHeight:d,maxNumWide:e,maxNumHigh:h}}function p(b,c,d,e){function h(a){for(;m<a;){var b=c[d+k];k++;r?(l=l<<7|b,m+=7,r=!1):(l=l<<
8|b,m+=8);255===b&&(r=!0)}m-=a;return l>>>m&(1<<a)-1}function g(a){return 255===c[d+k-1]&&c[d+k]===a?(k+=1,!0):255===c[d+k]&&c[d+k+1]===a?(k+=2,!0):!1}function f(){if(0===h(1))return 1;if(0===h(1))return 2;var a=h(2);if(3>a)return a+3;a=h(5);if(31>a)return a+6;a=h(7);return a+37}var k=0,l,m=0,r=!1,t=b.COD.sopMarkerUsed,n=b.COD.ephMarkerUsed;for(b=b.tiles[b.currentTile.index].packetsIterator;k<e;){m=0;r&&(k++,r=!1);t&&g(145)&&(k+=4);var z=b.nextPacket();if(h(1)){for(var p=z.layerNumber,q=[],G,v=0,
M=z.codeblocks.length;v<M;v++){G=z.codeblocks[v];var A=G.precinct,w=G.cbx-A.cbxMin,y=G.cby-A.cbyMin,x=!1,L=!1;if(void 0!==G.included)x=!!h(1);else{A=G.precinct;if(void 0!==A.inclusionTree)var E=A.inclusionTree;else{var D=A.cbxMax-A.cbxMin+1;var S=A.cbyMax-A.cbyMin+1;E=new B(D,S,p);D=new u(D,S);A.inclusionTree=E;A.zeroBitPlanesTree=D}if(E.reset(w,y,p))for(;;)if(h(1)){if(S=!E.nextLevel()){x=L=G.included=!0;break}}else{E.incrementValue(p);break}}if(x){if(L){D=A.zeroBitPlanesTree;for(D.reset(w,y);;)if(h(1)){if(S=
!D.nextLevel())break}else D.incrementValue();G.zeroBitPlanes=D.value}for(A=f();h(1);)G.Lblock++;w=a(A);w=h((A<1<<w?w-1:w)+G.Lblock);q.push({codeblock:G,codingpasses:A,dataLength:w})}}m=0;r&&(k++,r=!1);for(n&&g(146);0<q.length;)z=q.shift(),G=z.codeblock,void 0===G.data&&(G.data=[]),G.data.push({data:c,start:d+k,end:d+k+z.dataLength,codingpasses:z.codingpasses}),k+=z.dataLength}}return k}var G={LL:0,LH:1,HL:1,HH:2};c.prototype={parse:function(a){if(65359===b(a,0))this.parseCodestream(a,0,a.length);
else for(var c=0,d=a.length;c<d;){var g=8,k=h(a,c),f=h(a,c+4);c+=g;1===k&&(k=4294967296*h(a,c)+h(a,c+4),c+=8,g+=8);0===k&&(k=d-c+g);if(k<g)throw Error("JPX Error: Invalid box field size");g=k-g;k=!0;switch(f){case 1785737832:k=!1;break;case 1668246642:f=a[c];if(1===f)switch(f=h(a,c+3),f){case 16:case 17:case 18:break;default:e("Unknown colorspace "+f)}else 2===f&&y("ICC profile not supported");break;case 1785737827:this.parseCodestream(a,c,c+g);break;case 1783636E3:218793738!==h(a,c)&&e("Invalid JP2 signature");
break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var l=String.fromCharCode(f>>24&255,f>>16&255,f>>8&255,f&255);e("Unsupported header type "+f+" ("+l+")")}k&&(c+=g)}},parseImageProperties:function(a){for(var b=a.getByte();0<=b;){var c=b;b=a.getByte();if(65361===(c<<8|b)){a.skip(4);b=a.getInt32()>>>0;c=a.getInt32()>>>0;var d=a.getInt32()>>>0,e=a.getInt32()>>>0;a.skip(16);a=a.getUint16();this.width=b-d;this.height=c-e;this.componentsCount=a;this.bitsPerComponent=
8;return}}throw Error("JPX Error: No size marker found in JPX stream");},parseCodestream:function(a,c,f){var r={};try{var z=!1;for(var q=c;q+1<f;){var v=b(a,q);q+=2;var u=0,A;switch(v){case 65359:r.mainHeader=!0;break;case 65497:break;case 65361:u=b(a,q);var w={};w.Xsiz=h(a,q+4);w.Ysiz=h(a,q+8);w.XOsiz=h(a,q+12);w.YOsiz=h(a,q+16);w.XTsiz=h(a,q+20);w.YTsiz=h(a,q+24);w.XTOsiz=h(a,q+28);w.YTOsiz=h(a,q+32);var M=b(a,q+36);w.Csiz=M;var y=[];var x=q+38;for(var L=0;L<M;L++){var B={precision:(a[x]&127)+1,
isSigned:!!(a[x]&128),XRsiz:a[x+1],YRsiz:a[x+1]},D=B,H=w;D.x0=Math.ceil(H.XOsiz/D.XRsiz);D.x1=Math.ceil(H.Xsiz/D.XRsiz);D.y0=Math.ceil(H.YOsiz/D.YRsiz);D.y1=Math.ceil(H.Ysiz/D.YRsiz);D.width=D.x1-D.x0;D.height=D.y1-D.y0;y.push(B)}r.SIZ=w;r.components=y;for(var E=void 0,I=r,K=y,C=I.SIZ,F=[],Q=Math.ceil((C.Xsiz-C.XTOsiz)/C.XTsiz),pc=Math.ceil((C.Ysiz-C.YTOsiz)/C.YTsiz),Xa=0;Xa<pc;Xa++)for(var Ya=0;Ya<Q;Ya++)E={},E.tx0=Math.max(C.XTOsiz+Ya*C.XTsiz,C.XOsiz),E.ty0=Math.max(C.YTOsiz+Xa*C.YTsiz,C.YOsiz),
E.tx1=Math.min(C.XTOsiz+(Ya+1)*C.XTsiz,C.Xsiz),E.ty1=Math.min(C.YTOsiz+(Xa+1)*C.YTsiz,C.Ysiz),E.width=E.tx1-E.tx0,E.height=E.ty1-E.ty0,E.components=[],F.push(E);I.tiles=F;for(var Za=0,qc=C.Csiz;Za<qc;Za++)for(var $a=K[Za],lb=0,rc=F.length;lb<rc;lb++){var fa={};E=F[lb];fa.tcx0=Math.ceil(E.tx0/$a.XRsiz);fa.tcy0=Math.ceil(E.ty0/$a.YRsiz);fa.tcx1=Math.ceil(E.tx1/$a.XRsiz);fa.tcy1=Math.ceil(E.ty1/$a.YRsiz);fa.width=fa.tcx1-fa.tcx0;fa.height=fa.tcy1-fa.tcy0;E.components[Za]=fa}r.QCC=[];r.COC=[];break;case 65372:u=
b(a,q);var Ja={};x=q+2;var ua=a[x++];switch(ua&31){case 0:var la=8;var va=!0;break;case 1:la=16;va=!1;break;case 2:la=16;va=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+ua);}Ja.noQuantization=8===la;Ja.scalarExpounded=va;Ja.guardBits=ua>>5;for(A=[];x<u+q;){var ha={};8===la?(ha.epsilon=a[x++]>>3,ha.mu=0):(ha.epsilon=a[x]>>3,ha.mu=(a[x]&7)<<8|a[x+1],x+=2);A.push(ha)}Ja.SPqcds=A;r.mainHeader?r.QCD=Ja:(r.currentTile.QCD=Ja,r.currentTile.QCC=[]);break;case 65373:u=b(a,q);var Ka={};x=q+
2;if(257>r.SIZ.Csiz)var mb=a[x++];else mb=b(a,x),x+=2;ua=a[x++];switch(ua&31){case 0:la=8;va=!0;break;case 1:la=16;va=!1;break;case 2:la=16;va=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+ua);}Ka.noQuantization=8===la;Ka.scalarExpounded=va;Ka.guardBits=ua>>5;for(A=[];x<u+q;)ha={},8===la?(ha.epsilon=a[x++]>>3,ha.mu=0):(ha.epsilon=a[x]>>3,ha.mu=(a[x]&7)<<8|a[x+1],x+=2),A.push(ha);Ka.SPqcds=A;r.mainHeader?r.QCC[mb]=Ka:r.currentTile.QCC[mb]=Ka;break;case 65362:u=b(a,q);var T={};x=q+2;
var nb=a[x++];T.entropyCoderWithCustomPrecincts=!!(nb&1);T.sopMarkerUsed=!!(nb&2);T.ephMarkerUsed=!!(nb&4);T.progressionOrder=a[x++];T.layersCount=b(a,x);x+=2;T.multipleComponentTransform=a[x++];T.decompositionLevelsCount=a[x++];T.xcb=(a[x++]&15)+2;T.ycb=(a[x++]&15)+2;var La=a[x++];T.selectiveArithmeticCodingBypass=!!(La&1);T.resetContextProbabilities=!!(La&2);T.terminationOnEachCodingPass=!!(La&4);T.verticalyStripe=!!(La&8);T.predictableTermination=!!(La&16);T.segmentationSymbolUsed=!!(La&32);T.reversibleTransformation=
a[x++];if(T.entropyCoderWithCustomPrecincts){for(var Mb=[];x<u+q;){var Nb=a[x++];Mb.push({PPx:Nb&15,PPy:Nb>>4})}T.precinctsSizes=Mb}var wa=[];T.selectiveArithmeticCodingBypass&&wa.push("selectiveArithmeticCodingBypass");T.resetContextProbabilities&&wa.push("resetContextProbabilities");T.terminationOnEachCodingPass&&wa.push("terminationOnEachCodingPass");T.verticalyStripe&&wa.push("verticalyStripe");T.predictableTermination&&wa.push("predictableTermination");if(0<wa.length)throw z=!0,Error("JPX Error: Unsupported COD options ("+
wa.join(", ")+")");r.mainHeader?r.COD=T:(r.currentTile.COD=T,r.currentTile.COC=[]);break;case 65424:u=b(a,q);var X={};X.index=b(a,q+2);X.length=h(a,q+4);X.dataEnd=X.length+q-2;X.partIndex=a[q+8];X.partsCount=a[q+9];r.mainHeader=!1;0===X.partIndex&&(X.COD=r.COD,X.COC=r.COC.slice(0),X.QCD=r.QCD,X.QCC=r.QCC.slice(0));r.currentTile=X;break;case 65427:X=r.currentTile;if(0===X.partIndex){for(var ma=r,sc=ma.SIZ.Csiz,Ob=ma.tiles[X.index],xa=0;xa<sc;xa++){var Pb=Ob.components[xa];Pb.quantizationParameters=
void 0!==ma.currentTile.QCC[xa]?ma.currentTile.QCC[xa]:ma.currentTile.QCD;Pb.codingStyleParameters=void 0!==ma.currentTile.COC[xa]?ma.currentTile.COC[xa]:ma.currentTile.COD}Ob.codingStyleDefaultParameters=ma.currentTile.COD;for(var ca=r,ya=ca.tiles[ca.currentTile.index],tc=ca.SIZ.Csiz,ob=0;ob<tc;ob++){for(var U=ya.components[ob],pb=U.codingStyleParameters.decompositionLevelsCount,Qb=[],Oa=[],za=0;za<=pb;za++){var ab=za,Aa=U.codingStyleParameters,ia={};Aa.entropyCoderWithCustomPrecincts?(ia.PPx=Aa.precinctsSizes[ab].PPx,
ia.PPy=Aa.precinctsSizes[ab].PPy):(ia.PPx=15,ia.PPy=15);ia.xcb_=0<ab?Math.min(Aa.xcb,ia.PPx-1):Math.min(Aa.xcb,ia.PPx);ia.ycb_=0<ab?Math.min(Aa.ycb,ia.PPy-1):Math.min(Aa.ycb,ia.PPy);var qa=ia;var V={},ra=1<<pb-za;V.trx0=Math.ceil(U.tcx0/ra);V.try0=Math.ceil(U.tcy0/ra);V.trx1=Math.ceil(U.tcx1/ra);V.try1=Math.ceil(U.tcy1/ra);V.resLevel=za;var qb=1<<qa.PPx,rb=1<<qa.PPy,Rb=0===V.resLevel,Sb=V.trx1>V.trx0?Math.ceil(V.trx1/qb)-Math.floor(V.trx0/qb):0,Tb=V.try1>V.try0?Math.ceil(V.try1/rb)-Math.floor(V.try0/
rb):0;V.precinctParameters={precinctWidth:qb,precinctHeight:rb,numprecinctswide:Sb,numprecinctshigh:Tb,numprecincts:Sb*Tb,precinctWidthInSubband:1<<qa.PPx+(Rb?0:-1),precinctHeightInSubband:1<<qa.PPy+(Rb?0:-1)};Qb.push(V);if(0===za){var P={type:"LL"};P.tbx0=Math.ceil(U.tcx0/ra);P.tby0=Math.ceil(U.tcy0/ra);P.tbx1=Math.ceil(U.tcx1/ra);P.tby1=Math.ceil(U.tcy1/ra);P.resolution=V;g(ca,P,qa);Oa.push(P);V.subbands=[P]}else{var da=1<<pb-za+1,bb=[];P={type:"HL"};P.tbx0=Math.ceil(U.tcx0/da-.5);P.tby0=Math.ceil(U.tcy0/
da);P.tbx1=Math.ceil(U.tcx1/da-.5);P.tby1=Math.ceil(U.tcy1/da);P.resolution=V;g(ca,P,qa);Oa.push(P);bb.push(P);P={type:"LH"};P.tbx0=Math.ceil(U.tcx0/da);P.tby0=Math.ceil(U.tcy0/da-.5);P.tbx1=Math.ceil(U.tcx1/da);P.tby1=Math.ceil(U.tcy1/da-.5);P.resolution=V;g(ca,P,qa);Oa.push(P);bb.push(P);P={type:"HH"};P.tbx0=Math.ceil(U.tcx0/da-.5);P.tby0=Math.ceil(U.tcy0/da-.5);P.tbx1=Math.ceil(U.tcx1/da-.5);P.tby1=Math.ceil(U.tcy1/da-.5);P.resolution=V;g(ca,P,qa);Oa.push(P);bb.push(P);V.subbands=bb}}U.resolutions=
Qb;U.subbands=Oa}var Ub=ya.codingStyleDefaultParameters.progressionOrder;switch(Ub){case 0:ya.packetsIterator=new k(ca);break;case 1:ya.packetsIterator=new l(ca);break;case 2:ya.packetsIterator=new m(ca);break;case 3:ya.packetsIterator=new t(ca);break;case 4:ya.packetsIterator=new n(ca);break;default:throw Error("JPX Error: Unsupported progression order "+Ub);}}u=X.dataEnd-q;p(r,a,q,u);break;case 65365:case 65367:case 65368:case 65380:u=b(a,q);break;case 65363:throw Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");
default:throw Error("JPX Error: Unknown codestream code: "+v.toString(16));}q+=u}}catch(Vb){if(z||this.failOnCorruptedImage)throw Vb;e("Trying to recover from "+Vb.message)}for(var Wb=r.components,Ma=r.SIZ.Csiz,Xb=[],sb=0,uc=r.tiles.length;sb<uc;sb++){var tb=r.tiles[sb],Ba=[],ea;for(ea=0;ea<Ma;ea++){for(var vc=Ba,wc=ea,Ca=tb.components[ea],ub=Ca.codingStyleParameters,vb=Ca.quantizationParameters,xc=ub.decompositionLevelsCount,cb=vb.SPqcds,yc=vb.scalarExpounded,zc=vb.guardBits,Ac=ub.segmentationSymbolUsed,
Bc=r.components[ea].precision,wb=ub.reversibleTransformation,Cc=wb?new O:new N,Yb=[],xb=0,Pa=0;Pa<=xc;Pa++){for(var Na=Ca.resolutions[Pa],yb=Na.trx1-Na.trx0,Zb=Na.try1-Na.try0,$b=new Float32Array(yb*Zb),zb=0,Dc=Na.subbands.length;zb<Dc;zb++){if(yc){var ac=cb[xb].mu;var Ab=cb[xb].epsilon;xb++}else ac=cb[0].mu,Ab=cb[0].epsilon+(0<Pa?1-Pa:0);for(var bc=Na.subbands[zb],Ec=G[bc.type],Fc=$b,cc=yb,sa=bc,Gc=wb?1:Math.pow(2,Bc+Ec-Ab)*(1+ac/2048),Bb=zc+Ab-1,dc=wb,Hc=Ac,Ic=sa.tbx0,Jc=sa.tby0,db=sa.tbx1-sa.tbx0,
ec=sa.codeblocks,Kc="H"===sa.type.charAt(0)?1:0,Lc="H"===sa.type.charAt(1)?cc:0,Cb=0,Mc=ec.length;Cb<Mc;++Cb){var ja=ec[Cb],eb=ja.tbx1_-ja.tbx0_,Db=ja.tby1_-ja.tby0_;if(0!==eb&&0!==Db&&void 0!==ja.data){var ta=new J(eb,Db,ja.subbandType,ja.zeroBitPlanes,Bb);var Eb=2;var fb=ja.data,Fb=0,fc=0,gb;var aa=0;for(gb=fb.length;aa<gb;aa++){var Da=fb[aa];Fb+=Da.end-Da.start;fc+=Da.codingpasses}var gc=new Uint8Array(Fb),Ea=0;aa=0;for(gb=fb.length;aa<gb;aa++){Da=fb[aa];var hc=Da.data.subarray(Da.start,Da.end);
gc.set(hc,Ea);Ea+=hc.length}var Nc=new d(gc,0,Fb);ta.setDecoder(Nc);for(aa=0;aa<fc;aa++){switch(Eb){case 0:ta.runSignificancePropogationPass();break;case 1:ta.runMagnitudeRefinementPass();break;case 2:ta.runCleanupPass(),Hc&&ta.checkSegmentationSymbol()}Eb=(Eb+1)%3}var Qa=ja.tbx0_-Ic+(ja.tby0_-Jc)*db,Oc=ta.coefficentsSign,Pc=ta.coefficentsMagnitude,Qc=ta.bitsDecoded,Rc=dc?0:.5,Gb;Ea=0;var Sc="LL"!==sa.type;for(aa=0;aa<Db;aa++){var Tc=2*(Qa/db|0)*(cc-db)+Kc+Lc;for(Gb=0;Gb<eb;Gb++){var Fa=Pc[Ea];if(0!==
Fa){Fa=(Fa+Rc)*Gc;0!==Oc[Ea]&&(Fa=-Fa);var ic=Qc[Ea];Fc[Sc?Tc+(Qa<<1):Qa]=dc&&ic>=Bb?Fa:Fa*(1<<Bb-ic)}Qa++;Ea++}Qa+=db-eb}}}}Yb.push({width:yb,height:Zb,items:$b})}var Hb=Cc.calculate(Yb,Ca.tcx0,Ca.tcy0);vc[wc]={left:Ca.tcx0,top:Ca.tcy0,width:Hb.width,height:Hb.height,items:Hb.items}}var Ra=Ba[0],na=new Uint8Array(Ra.items.length*Ma),Uc={left:Ra.left,top:Ra.top,width:Ra.width,height:Ra.height,items:na},Z=0,W;if(tb.codingStyleDefaultParameters.multipleComponentTransform){var jc=4===Ma,Ib=Ba[0].items,
kc=Ba[1].items,lc=Ba[2].items,Vc=jc?Ba[3].items:null;var ba=Wb[0].precision-8;var Sa=(128<<ba)+.5;var ka=255*(1<<ba);var mc=.5*ka;var Jb=-mc;var Wc=tb.components[0],nc=Ma-3;var Ta=Ib.length;if(Wc.codingStyleParameters.reversibleTransformation)for(W=0;W<Ta;W++,Z+=nc){var Ua=Ib[W]+Sa;var Va=kc[W];var Wa=lc[W];var oa=Ua-(Wa+Va>>2);var Ga=oa+Wa;var Ha=oa+Va;na[Z++]=0>=Ga?0:Ga>=ka?255:Ga>>ba;na[Z++]=0>=oa?0:oa>=ka?255:oa>>ba;na[Z++]=0>=Ha?0:Ha>=ka?255:Ha>>ba}else for(W=0;W<Ta;W++,Z+=nc)Ua=Ib[W]+Sa,Va=
kc[W],Wa=lc[W],Ga=Ua+1.402*Wa,oa=Ua-.34413*Va-.71414*Wa,Ha=Ua+1.772*Va,na[Z++]=0>=Ga?0:Ga>=ka?255:Ga>>ba,na[Z++]=0>=oa?0:oa>=ka?255:oa>>ba,na[Z++]=0>=Ha?0:Ha>=ka?255:Ha>>ba;if(jc)for(W=0,Z=3;W<Ta;W++,Z+=4){var Kb=Vc[W];na[Z]=Kb<=Jb?0:Kb>=mc?255:Kb+Sa>>ba}}else for(ea=0;ea<Ma;ea++){var oc=Ba[ea].items;ba=Wb[ea].precision-8;Sa=(128<<ba)+.5;ka=127.5*(1<<ba);Jb=-ka;Z=ea;W=0;for(Ta=oc.length;W<Ta;W++){var Lb=oc[W];na[Z]=Lb<=Jb?0:Lb>=ka?255:Lb+Sa>>ba;Z+=Ma}}Xb.push(Uc)}this.tiles=Xb;this.width=r.SIZ.Xsiz-
r.SIZ.XOsiz;this.height=r.SIZ.Ysiz-r.SIZ.YOsiz;this.componentsCount=r.SIZ.Csiz}};var u=function(){function b(b,c){var d=a(Math.max(b,c))+1;this.levels=[];for(var e=0;e<d;e++)this.levels.push({width:b,height:c,items:[]}),b=Math.ceil(b/2),c=Math.ceil(c/2)}b.prototype={reset:function(a,b){for(var c=0,d=0,e;c<this.levels.length;){e=this.levels[c];var h=a+b*e.width;if(void 0!==e.items[h]){d=e.items[h];break}e.index=h;a>>=1;b>>=1;c++}c--;e=this.levels[c];e.items[e.index]=d;this.currentLevel=c;delete this.value},
incrementValue:function(){var a=this.levels[this.currentLevel];a.items[a.index]++},nextLevel:function(){var a=this.currentLevel,b=this.levels[a],c=b.items[b.index];a--;if(0>a)return this.value=c,!1;this.currentLevel=a;b=this.levels[a];b.items[b.index]=c;return!0}};return b}(),B=function(){function b(b,c,d){var e=a(Math.max(b,c))+1;this.levels=[];for(var h=0;h<e;h++){for(var g=new Uint8Array(b*c),k=0,f=g.length;k<f;k++)g[k]=d;this.levels.push({width:b,height:c,items:g});b=Math.ceil(b/2);c=Math.ceil(c/
2)}}b.prototype={reset:function(a,b,c){for(var d=0;d<this.levels.length;){var e=this.levels[d],h=a+b*e.width;e.index=h;e=e.items[h];if(255===e)break;if(e>c)return this.currentLevel=d,this.propagateValues(),!1;a>>=1;b>>=1;d++}this.currentLevel=d-1;return!0},incrementValue:function(a){var b=this.levels[this.currentLevel];b.items[b.index]=a+1;this.propagateValues()},propagateValues:function(){for(var a=this.currentLevel,b=this.levels[a],c=b.items[b.index];0<=--a;)b=this.levels[a],b.items[b.index]=c},
nextLevel:function(){var a=this.currentLevel,b=this.levels[a],c=b.items[b.index];b.items[b.index]=255;a--;if(0>a)return!1;this.currentLevel=a;b=this.levels[a];b.items[b.index]=c;return!0}};return b}(),J=function(){function a(a,e,h,g,k){this.width=a;this.height=e;this.contextLabelTable="HH"===h?d:"HL"===h?c:b;a*=e;this.neighborsSignificance=new Uint8Array(a);this.coefficentsSign=new Uint8Array(a);this.coefficentsMagnitude=14<k?new Uint32Array(a):6<k?new Uint16Array(a):new Uint8Array(a);this.processingFlags=
new Uint8Array(a);k=new Uint8Array(a);if(0!==g)for(e=0;e<a;e++)k[e]=g;this.bitsDecoded=k;this.reset()}var b=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),c=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),d=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,
0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);a.prototype={setDecoder:function(a){this.decoder=a},reset:function(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6},setNeighborsSignificance:function(a,b,c){var d=this.neighborsSignificance,e=this.width,h=this.height,g=0<b;b=b+1<e;if(0<a){var k=c-e;g&&(d[k-1]+=16);b&&(d[k+1]+=16);d[k]+=4}a+1<h&&(k=c+e,g&&(d[k-1]+=16),b&&(d[k+1]+=16),d[k]+=
4);g&&(d[c-1]+=1);b&&(d[c+1]+=1);d[c]|=128},runSignificancePropogationPass:function(){for(var a=this.decoder,b=this.width,c=this.height,d=this.coefficentsMagnitude,e=this.coefficentsSign,h=this.neighborsSignificance,g=this.processingFlags,k=this.contexts,f=this.contextLabelTable,l=this.bitsDecoded,m=0;m<c;m+=4)for(var r=0;r<b;r++)for(var t=m*b+r,n=0;4>n;n++,t+=b){var q=m+n;if(q>=c)break;g[t]&=-2;if(!d[t]&&h[t]){if(a.readBit(k,f[h[t]])){var p=this.decodeSignBit(q,r,t);e[t]=p;d[t]=1;this.setNeighborsSignificance(q,
r,t);g[t]|=2}l[t]++;g[t]|=1}}},decodeSignBit:function(a,b,c){var d=this.width,e=this.height,h=this.coefficentsMagnitude,g=this.coefficentsSign;var k=0<b&&0!==h[c-1];b+1<d&&0!==h[c+1]?(b=g[c+1],k?(k=g[c-1],b=1-b-k):b=1-b-b):k?(k=g[c-1],b=1-k-k):b=0;var f=3*b;k=0<a&&0!==h[c-d];a+1<e&&0!==h[c+d]?(b=g[c+d],k?(k=g[c-d],b=1-b-k+f):b=1-b-b+f):k?(k=g[c-d],b=1-k-k+f):b=f;return 0<=b?this.decoder.readBit(this.contexts,9+b):this.decoder.readBit(this.contexts,9-b)^1},runMagnitudeRefinementPass:function(){for(var a=
this.decoder,b=this.width,c=this.coefficentsMagnitude,d=this.neighborsSignificance,e=this.contexts,h=this.bitsDecoded,g=this.processingFlags,k=b*this.height,f=4*b,l=0,m;l<k;l=m){m=Math.min(k,l+f);for(var r=0;r<b;r++)for(var t=l+r;t<m;t+=b)if(c[t]&&0===(g[t]&1)){var n=16;0!==(g[t]&2)&&(g[t]^=2,n=0===(d[t]&127)?15:14);n=a.readBit(e,n);c[t]=c[t]<<1|n;h[t]++;g[t]|=1}}},runCleanupPass:function(){for(var a=this.decoder,b=this.width,c=this.height,d=this.neighborsSignificance,e=this.coefficentsMagnitude,
h=this.coefficentsSign,g=this.contexts,k=this.contextLabelTable,f=this.bitsDecoded,l=this.processingFlags,m=2*b,r=3*b,t,n=0;n<c;n=t){t=Math.min(n+4,c);for(var q=n*b,p=n+3<c,z=0;z<b;z++){var G=q+z,v=0,u=G,A=n;if(p&&0===l[G]&&0===l[G+b]&&0===l[G+m]&&0===l[G+r]&&0===d[G]&&0===d[G+b]&&0===d[G+m]&&0===d[G+r]){if(!a.readBit(g,18)){f[G]++;f[G+b]++;f[G+m]++;f[G+r]++;continue}v=a.readBit(g,17)<<1|a.readBit(g,17);0!==v&&(A=n+v,u+=v*b);var w=this.decodeSignBit(A,z,u);h[u]=w;e[u]=1;this.setNeighborsSignificance(A,
z,u);l[u]|=2;u=G;for(G=n;G<=A;G++,u+=b)f[u]++;v++}for(A=n+v;A<t;A++,u+=b)e[u]||0!==(l[u]&1)||(1===a.readBit(g,k[d[u]])&&(w=this.decodeSignBit(A,z,u),h[u]=w,e[u]=1,this.setNeighborsSignificance(A,z,u),l[u]|=2),f[u]++)}}},checkSegmentationSymbol:function(){var a=this.decoder,b=this.contexts;if(10!==(a.readBit(b,17)<<3|a.readBit(b,17)<<2|a.readBit(b,17)<<1|a.readBit(b,17)))throw Error("JPX Error: Invalid segmentation symbol");}};return a}(),Q=function(){function a(){}a.prototype.calculate=function(a,
b,c){for(var d=a[0],e=1,h=a.length;e<h;e++)d=this.iterate(d,a[e],b,c);return d};a.prototype.extend=function(a,b,c){var d=b-1,e=b+1,h=b+c-2;b+=c;a[d--]=a[e++];a[b++]=a[h--];a[d--]=a[e++];a[b++]=a[h--];a[d--]=a[e++];a[b++]=a[h--];a[d]=a[e];a[b]=a[h]};a.prototype.iterate=function(a,b,c,d){var e=a.width,h=a.height,g=a.items,k=b.width,f=b.height;b=b.items;var l,m,r;for(l=r=0;l<h;l++){var t=2*l*k;for(m=0;m<e;m++,r++,t+=2)b[t]=g[r]}a.items=null;a=new Float32Array(k+8);if(1===k){if(0!==(c&1))for(r=t=0;t<
f;t++,r+=k)b[r]*=.5}else for(r=t=0;t<f;t++,r+=k)a.set(b.subarray(r,r+k),4),this.extend(a,4,k),this.filter(a,4,k),b.set(a.subarray(4,4+k),r);c=16;e=[];for(l=0;l<c;l++)e.push(new Float32Array(f+8));l=0;a=4+f;if(1===f){if(0!==(d&1))for(d=0;d<k;d++)b[d]*=.5}else for(d=0;d<k;d++){if(0===l){c=Math.min(k-d,c);r=d;for(t=4;t<a;r+=k,t++)for(h=0;h<c;h++)e[h][t]=b[r+h];l=c}l--;r=e[l];this.extend(r,4,f);this.filter(r,4,f);if(0===l)for(r=d-c+1,t=4;t<a;r+=k,t++)for(h=0;h<c;h++)b[r+h]=e[h][t]}return{width:k,height:f,
items:b}};return a}(),N=function(){function a(){Q.call(this)}a.prototype=Object.create(Q.prototype);a.prototype.filter=function(a,b,c){c>>=1;b|=0;var d;var e=b-3;for(d=c+4;d--;e+=2)a[e]*=.8128930661159609;e=b-2;var h=.443506852043971*a[e-1];for(d=c+3;d--;e+=2){var g=.443506852043971*a[e+1];a[e]=1.230174104914001*a[e]-h-g;if(d--)e+=2,h=.443506852043971*a[e+1],a[e]=1.230174104914001*a[e]-h-g;else break}e=b-1;h=.882911075530934*a[e-1];for(d=c+2;d--;e+=2)if(g=.882911075530934*a[e+1],a[e]-=h+g,d--)e+=
2,h=.882911075530934*a[e+1],a[e]-=h+g;else break;e=b;h=-.052980118572961*a[e-1];for(d=c+1;d--;e+=2)if(g=-.052980118572961*a[e+1],a[e]-=h+g,d--)e+=2,h=-.052980118572961*a[e+1],a[e]-=h+g;else break;if(0!==c)for(e=b+1,h=-1.586134342059924*a[e-1],d=c;d--;e+=2)if(g=-1.586134342059924*a[e+1],a[e]-=h+g,d--)e+=2,h=-1.586134342059924*a[e+1],a[e]-=h+g;else break};return a}(),O=function(){function a(){Q.call(this)}a.prototype=Object.create(Q.prototype);a.prototype.filter=function(a,b,c){c>>=1;b|=0;var d;var e=
b;for(d=c+1;d--;e+=2)a[e]-=a[e-1]+a[e+1]+2>>2;e=b+1;for(d=c;d--;e+=2)a[e]+=a[e-1]+a[e+1]>>1};return a}();return c}();"use strict";var m=function(){function c(){}function e(a,b,c){this.data=a;this.start=b;this.end=c}function k(a,b,c){function d(a){for(var b=0,d=0;d<a;d++){var g=c.readBit(e,h);h=256>h?h<<1|g:(h<<1|g)&511|256;b=b<<1|g}return b>>>0}var e=a.getContexts(b),h=1;a=d(1);b=d(1)?d(1)?d(1)?d(1)?d(1)?d(32)+4436:d(12)+340:d(8)+84:d(6)+20:d(4)+4:d(2);return 0===a?b:0<b?-b:null}function f(a,b,c){a=
a.getContexts("IAID");for(var d=1,e=0;e<c;e++){var h=b.readBit(a,d);d=d<<1|h}return 31>c?d&(1<<c)-1:d&2147483647}function l(a,b,c){var d=c.decoder;c=c.contextCache.getContexts("GB");var e,h,g,k=[];for(e=0;e<b;e++){var f=k[e]=new Uint8Array(a);var l=1>e?f:k[e-1];var r=2>e?f:k[e-2];var m=r[0]<<13|r[1]<<12|r[2]<<11|l[0]<<7|l[1]<<6|l[2]<<5|l[3]<<4;for(h=0;h<a;h++)f[h]=g=d.readBit(c,m),m=(m&31735)<<1|(h+3<a?r[h+3]<<11:0)|(h+4<a?l[h+4]<<4:0)|g}return k}function m(a,b,c,d,e,h,g,k){a&&p("JBIG2 error: MMR encoding is not supported");
if(0===d&&!h&&!e&&4===g.length&&3===g[0].x&&-1===g[0].y&&-3===g[1].x&&-1===g[1].y&&2===g[2].x&&-2===g[2].y&&-2===g[3].x&&-2===g[3].y)return l(b,c,k);a=!!h;var f=y[d].concat(g);f.sort(function(a,b){return a.y-b.y||a.x-b.x});g=f.length;var r=new Int8Array(g),m=new Int8Array(g),t=[],n=0,q=0,z=0,G=0,v,u;for(u=0;u<g;u++)r[u]=f[u].x,m[u]=f[u].y,q=Math.min(q,f[u].x),z=Math.max(z,f[u].x),G=Math.min(G,f[u].y),u<g-1&&f[u].y===f[u+1].y&&f[u].x===f[u+1].x-1?n|=1<<g-1-u:t.push(u);var A=t.length,x=new Int8Array(A),
w=new Int8Array(A),L=new Uint16Array(A);for(v=0;v<A;v++)u=t[v],x[v]=f[u].x,w[v]=f[u].y,L[v]=1<<g-1-u;f=-q;G=-G;z=b-z;d=J[d];t=new Uint8Array(b);q=[];v=k.decoder;k=k.contextCache.getContexts("GB");for(var D=0,B,M,H,N=0,C,I=0;I<c;I++){if(e&&(u=v.readBit(k,d),D^=u)){q.push(t);continue}t=new Uint8Array(t);q.push(t);for(B=0;B<b;B++)if(a&&h[I][B])t[B]=0;else{if(B>=f&&B<z&&I>=G)for(N=N<<1&n,u=0;u<A;u++){if(M=I+w[u],H=B+x[u],M=q[M][H])M=L[u],N|=M}else for(N=0,C=g-1,u=0;u<g;u++,C--)H=B+r[u],0<=H&&H<b&&(M=
I+m[u],0<=M&&(M=q[M][H])&&(N|=M<<C));u=v.readBit(k,N);t[B]=u}}return q}function t(a,b,c,d,e,h,g,k,f){var l=B[c].coding;0===c&&(l=l.concat([k[0]]));var r=l.length,m=new Int32Array(r),t=new Int32Array(r),n;for(n=0;n<r;n++)m[n]=l[n].x,t[n]=l[n].y;var q=B[c].reference;0===c&&(q=q.concat([k[1]]));k=q.length;l=new Int32Array(k);var z=new Int32Array(k);for(n=0;n<k;n++)l[n]=q[n].x,z[n]=q[n].y;q=d[0].length;var G=d.length;c=Q[c];var u=[],v=f.decoder;f=f.contextCache.getContexts("GR");for(var A=0,x=0;x<b;x++){g&&
(n=v.readBit(f,c),(A^=n)&&p("JBIG2 error: prediction is not supported"));var w=new Uint8Array(a);u.push(w);for(var y=0;y<a;y++){var L=0;for(n=0;n<r;n++){var D=x+t[n];var M=y+m[n];L=0>D||0>M||M>=a?L<<1:L<<1|u[D][M]}for(n=0;n<k;n++)D=x+z[n]+h,M=y+l[n]+e,L=0>D||D>=G||0>M||M>=q?L<<1:L<<1|d[D][M];n=v.readBit(f,L);w[y]=n}}return u}function n(a,b,c,d,e,h,g,l,r,m,n,q,G,u,v,A,x){a&&p("JBIG2 error: huffman is not supported");a=[];for(u=0;u<d;u++){var z=new Uint8Array(c);if(e)for(var w=0;w<c;w++)z[w]=e;a.push(z)}d=
x.decoder;e=x.contextCache;w=-k(e,"IADT",d);var y=0;for(u=0;u<h;){var L=k(e,"IADT",d);w+=L;L=k(e,"IAFS",d);L=y+=L;do{var D=1===g?0:k(e,"IAIT",d);z=g*w+D;D=f(e,d,r);var B=b&&k(e,"IARI",d);D=l[D];var H=D[0].length,M=D.length;if(B){B=k(e,"IARDW",d);var J=k(e,"IARDH",d),C=k(e,"IARDX",d),N=k(e,"IARDY",d);H+=B;M+=J;D=t(H,M,v,D,(B>>1)+C,(J>>1)+N,!1,A,x)}B=z-(q&1?0:M);J=L-(q&2?H:0);if(m){for(C=0;C<M;C++)if(z=a[J+C]){var I=D[C];var K=Math.min(c-B,H);switch(G){case 0:for(N=0;N<K;N++)z[B+N]|=I[N];break;case 2:for(N=
0;N<K;N++)z[B+N]^=I[N];break;default:p("JBIG2 error: operator "+G+" is not supported")}}L+=M-1}else{for(N=0;N<M;N++)if(z=a[B+N])switch(I=D[N],G){case 0:for(C=0;C<H;C++)z[J+C]|=I[C];break;case 2:for(C=0;C<H;C++)z[J+C]^=I[C];break;default:p("JBIG2 error: operator "+G+" is not supported")}L+=H-1}u++;D=k(e,"IADS",d);if(null===D)break;L+=D+n}while(1)}return a}function q(a,b){return{width:h(a,b),height:h(a,b+4),x:h(a,b+8),y:h(a,b+12),combinationOperator:a[b+16]&7}}function r(){}function u(){}c.prototype=
{getContexts:function(a){return a in this?this[a]:this[a]=new Int8Array(65536)}};e.prototype={get decoder(){var a=new d(this.data,this.start,this.end);return g(this,"decoder",a)},get contextCache(){var a=new c;return g(this,"contextCache",a)}};var G=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion",
"ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],y=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},
{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],B=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},
{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],J=[39717,1941,229,405],Q=[32,8];r.prototype={onPageInformation:function(a){this.currentPageInfo=a;var b=new Uint8Array((a.width+7>>3)*a.height);if(a.defaultPixelValue){a=0;for(var c=b.length;a<c;a++)b[a]=255}this.buffer=b},drawBitmap:function(a,b){var c=this.currentPageInfo,d=a.width,e=a.height,
h=c.width+7>>3,g=c.combinationOperatorOverride?a.combinationOperator:c.combinationOperator;c=this.buffer;var k=128>>(a.x&7);a=a.y*h+(a.x>>3);var f;switch(g){case 0:for(g=0;g<e;g++){var l=k;var r=a;for(f=0;f<d;f++)b[g][f]&&(c[r]|=l),l>>=1,l||(l=128,r++);a+=h}break;case 2:for(g=0;g<e;g++){l=k;r=a;for(f=0;f<d;f++)b[g][f]&&(c[r]^=l),l>>=1,l||(l=128,r++);a+=h}break;default:p("JBIG2 error: operator "+g+" is not supported")}},onImmediateGenericRegion:function(a,b,c,d){var h=a.info;b=new e(b,c,d);a=m(a.mmr,
h.width,h.height,a.template,a.prediction,null,a.at,b);this.drawBitmap(h,a)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(b,c,d,h,g,l){b.huffman&&p("JBIG2 error: huffman is not supported");var r=this.symbols;r||(this.symbols=r={});for(var q=[],z=0,G=d.length;z<G;z++)q=q.concat(r[d[z]]);l=new e(h,g,l);z=b.huffman;G=b.refinement;d=q;q=b.numberOfNewSymbols;var u=b.template,v=b.at,A=b.refinementTemplate,x=b.refinementAt;z&&
p("JBIG2 error: huffman is not supported");b=[];var w=0,y=a(d.length+q);h=l.decoder;for(g=l.contextCache;b.length<q;){var L=k(g,"IADH",h);w+=L;for(L=0;;){var D=k(g,"IADW",h);if(null===D)break;L+=D;if(G)if(D=k(g,"IAAI",h),1<D)D=n(z,G,L,w,0,D,1,d.concat(b),y,0,0,1,0,void 0,A,x,l);else{D=f(g,h,y);var B=k(g,"IARDX",h),H=k(g,"IARDY",h);D=t(L,w,A,D<d.length?d[D]:b[D-d.length],B,H,!1,x,l)}else D=m(!1,L,w,u,!1,null,v,l);b.push(D)}}l=[];z=[];G=!1;for(u=d.length+q;z.length<u;){for(v=k(g,"IAEX",h);v--;)z.push(G);
G=!G}h=0;for(g=d.length;h<g;h++)z[h]&&l.push(d[h]);for(d=0;d<q;h++,d++)z[h]&&l.push(b[d]);r[c]=l},onImmediateTextRegion:function(b,c,d,h,g){for(var k=b.info,f=this.symbols,l=[],r=0,m=c.length;r<m;r++)l=l.concat(f[c[r]]);c=a(l.length);d=new e(d,h,g);b=n(b.huffman,b.refinement,k.width,k.height,b.defaultPixelValue,b.numberOfSymbolInstances,b.stripSize,l,c,b.transposed,b.dsOffset,b.referenceCorner,b.combinationOperator,void 0,b.refinementTemplate,b.refinementAt,d);this.drawBitmap(k,b)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,
arguments)}};u.prototype={parseChunks:function(a){for(var c=new r,d=0,e=a.length;d<e;d++){for(var g=a[d],k={},f=g.data,l=g.end,m=[],t=g.start;t<l;){g=f;var n=t;t={};t.number=h(g,n);var u=g[n+4];var v=u&63;G[v]||p("JBIG2 error: invalid segment type: "+v);t.type=v;t.typeName=G[v];t.deferredNonRetain=!!(u&128);u=!!(u&64);var A=g[n+5],x=A>>5&7;var w=[A&31];n+=6;if(7===A)for(x=h(g,n-1)&536870911,n+=3,A=x+7>>3,w[0]=g[n++];0<--A;)w.push(g[n++]);else 5!==A&&6!==A||p("JBIG2 error: invalid referred-to flags");
t.retainBits=w;A=256>=t.number?1:65536>=t.number?2:4;var y=[];for(w=0;w<x;w++){var L=1===A?g[n]:2===A?b(g,n):h(g,n);y.push(L);n+=A}t.referredTo=y;u?(t.pageAssociation=h(g,n),n+=4):t.pageAssociation=g[n++];t.length=h(g,n);n+=4;if(4294967295===t.length)if(38===v){u=q(g,n);x=!!(g[n+17]&1);v=new Uint8Array(6);x||(v[0]=255,v[1]=172);v[2]=u.height>>>24&255;v[3]=u.height>>16&255;v[4]=u.height>>8&255;v[5]=u.height&255;w=n;for(u=g.length;w<u;w++){for(x=0;6>x&&v[x]===g[w+x];)x++;if(6===x){t.length=w+6;break}}4294967295===
t.length&&p("JBIG2 error: segment end was not found")}else p("JBIG2 error: invalid unknown segment length");t.headerEnd=n;g=t;t=g.headerEnd;n={header:g,data:f};k.randomAccess||(n.start=t,t+=g.length,n.end=t);m.push(n);if(51===g.type)break}if(k.randomAccess)for(k=0,f=m.length;k<f;k++)m[k].start=t,t+=m[k].header.length,m[k].end=t;k=c;f=0;for(l=m.length;f<l;f++){x=void 0;u=m[f];g=k;t=u.header;n=u.data;v=u.start;u=u.end;switch(t.type){case 0:y={};x=b(n,v);y.huffman=!!(x&1);y.refinement=!!(x&2);y.huffmanDHSelector=
x>>2&3;y.huffmanDWSelector=x>>4&3;y.bitmapSizeSelector=x>>6&1;y.aggregationInstancesSelector=x>>7&1;y.bitmapCodingContextUsed=!!(x&256);y.bitmapCodingContextRetained=!!(x&512);y.template=x>>10&3;y.refinementTemplate=x>>12&1;v+=2;if(!y.huffman){A=0===y.template?4:1;w=[];for(x=0;x<A;x++)w.push({x:n[v]<<24>>24,y:n[v+1]<<24>>24}),v+=2;y.at=w}if(y.refinement&&!y.refinementTemplate){w=[];for(x=0;2>x;x++)w.push({x:n[v]<<24>>24,y:n[v+1]<<24>>24}),v+=2;y.refinementAt=w}y.numberOfExportedSymbols=h(n,v);v+=
4;y.numberOfNewSymbols=h(n,v);x=[y,t.number,t.referredTo,n,v+4,u];break;case 6:case 7:A={};A.info=q(n,v);v+=17;x=b(n,v);v+=2;A.huffman=!!(x&1);A.refinement=!!(x&2);A.stripSize=1<<(x>>2&3);A.referenceCorner=x>>4&3;A.transposed=!!(x&64);A.combinationOperator=x>>7&3;A.defaultPixelValue=x>>9&1;A.dsOffset=x<<17>>27;A.refinementTemplate=x>>15&1;A.huffman&&(x=b(n,v),v+=2,A.huffmanFS=x&3,A.huffmanDS=x>>2&3,A.huffmanDT=x>>4&3,A.huffmanRefinementDW=x>>6&3,A.huffmanRefinementDH=x>>8&3,A.huffmanRefinementDX=
x>>10&3,A.huffmanRefinementDY=x>>12&3,A.huffmanRefinementSizeSelector=!!(x&14));if(A.refinement&&!A.refinementTemplate){w=[];for(x=0;2>x;x++)w.push({x:n[v]<<24>>24,y:n[v+1]<<24>>24}),v+=2;A.refinementAt=w}A.numberOfSymbolInstances=h(n,v);v+=4;A.huffman&&p("JBIG2 error: huffman is not supported");x=[A,t.referredTo,n,v,u];break;case 38:case 39:y={};y.info=q(n,v);v+=17;x=n[v++];y.mmr=!!(x&1);y.template=x>>1&3;y.prediction=!!(x&8);if(!y.mmr){A=0===y.template?4:1;w=[];for(x=0;x<A;x++)w.push({x:n[v]<<24>>
24,y:n[v+1]<<24>>24}),v+=2;y.at=w}x=[y,n,v,u];break;case 48:u={width:h(n,v),height:h(n,v+4),resolutionX:h(n,v+8),resolutionY:h(n,v+12)};4294967295===u.height&&delete u.height;x=n[v+16];b(n,v+17);u.lossless=!!(x&1);u.refinement=!!(x&2);u.defaultPixelValue=x>>2&1;u.combinationOperator=x>>3&3;u.requiresBuffer=!!(x&32);u.combinationOperatorOverride=!!(x&64);x=[u];break;case 49:break;case 50:break;case 51:break;case 62:break;default:p("JBIG2 error: segment type "+t.typeName+"("+t.type+") is not implemented")}t=
"on"+t.typeName;t in g&&g[t].apply(g,x)}}return c}};return u}(),p=function(){console.error.apply(console,arguments);throw Error("PDFJS error: "+arguments[0]);},e=function(){console.warn.apply(console,arguments)},y=function(){console.info.apply(console,arguments)};m.prototype.parse=function(a){var b=0,c=a.length;151===a[b]&&74===a[b+1]&&66===a[b+2]&&50===a[b+3]&&13===a[b+4]&&10===a[b+5]&&26===a[b+6]&&10===a[b+7]||p("JBIG2 error: invalid header");b+=8;a[b++]&2||(h(a,b),b+=4);a=this.parseChunks([{data:a,
start:b,end:c}]);b=a.currentPageInfo.width;c=a.currentPageInfo.height;var d=a.buffer;a=new Uint8Array(b*c);for(var e=0,g=0,k=0;k<c;k++)for(var f=0,l,r=0;r<b;r++)f||(f=128,l=d[g++]),a[e++]=l&f?0:255,f>>=1;this.width=b;this.height=c;this.data=a};c.JpegImage=f;c.JpxImage=k;c.Jbig2Image=m})(g||(g={}));p.exports={JpegImage:f,JpegDecoder:g.JpegImage,JpxDecoder:g.JpxImage,Jbig2Decoder:g.Jbig2Image}},function(p,f,m){m.d(f,"a",function(){return k});var k=function c(){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");
};k.RPC_ID="ndstore/VolumeChunkSource"},function(p,f,m){f.a=function(a){if(147!==a[0]||78!==a[1]||85!==a[2]||77!==a[3]||80!==a[4]||89!==a[5])throw Error("Data does not match npy format.");var b=a[6],h=a[7];if(1!==b||0!==h)throw Error("Unsupported npy version "+b+"."+h);b=(new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint16(8,!0);h=(new TextDecoder("utf-8")).decode(a.subarray(10,b+10));b+=10;try{var k=Object(g.d)(h)}catch(v){throw Error("Failed to parse npy header: "+v);}var f=k.descr;h=k.shape;
var e=1;if(!Array.isArray(h))throw Error("Invalid shape ${JSON.stringify(shape)}");for(var l=$jscomp.makeIterator(h),m=l.next();!m.done;m=l.next()){m=m.value;if("number"!==typeof m)throw Error("Invalid shape ${JSON.stringify(shape)}");e*=m}l=c.get(f);if(void 0===l)throw Error("Unsupported numpy data type "+JSON.stringify(f));f=l.arrayConstructor;e*=l.javascriptElementsPerArrayElement;if(f.BYTES_PER_ELEMENT*e+b!==a.byteLength)throw Error("Expected length does not match length of data");a=new f(a.buffer,
a.byteOffset+b,e);l.fixEndianness(a);return new q(a,h,l,!0===k.fortran_order)};p=m(10);var k=m(13),g=m(3),c=new Map;c.set("|u1",{arrayConstructor:Uint8Array,fixEndianness:function(){},javascriptElementsPerArrayElement:1,elementBytes:1,dataType:p.b.UINT8});c.set("|i1",{arrayConstructor:Uint8Array,fixEndianness:function(){},javascriptElementsPerArrayElement:1,elementBytes:1,dataType:p.b.UINT8});m={};f=$jscomp.makeIterator([["<",k.b.LITTLE],[">",k.b.BIG]]);for(var a=f.next();!a.done;m={endianness:m.endianness},
a=f.next()){var b=$jscomp.makeIterator(a.value);a=b.next().value;m.endianness=b.next().value;b=$jscomp.makeIterator(["u","i"]);for(var h=b.next();!h.done;h=b.next())h=h.value,c.set(""+a+h+"2",{arrayConstructor:Uint16Array,elementBytes:2,fixEndianness:function(a){return function(b){Object(k.c)(b,a.endianness)}}(m),javascriptElementsPerArrayElement:1,dataType:p.b.UINT16}),c.set(""+a+h+"4",{arrayConstructor:Uint32Array,elementBytes:4,fixEndianness:function(a){return function(b){Object(k.d)(b,a.endianness)}}(m),
javascriptElementsPerArrayElement:1,dataType:p.b.UINT32}),c.set(""+a+h+"8",{arrayConstructor:Uint32Array,elementBytes:8,fixEndianness:function(a){return function(b){Object(k.d)(b,a.endianness)}}(m),javascriptElementsPerArrayElement:2,dataType:p.b.UINT64});c.set(a+"f4",{arrayConstructor:Float32Array,elementBytes:4,fixEndianness:function(a){return function(b){Object(k.d)(b,a.endianness)}}(m),javascriptElementsPerArrayElement:1,dataType:p.b.FLOAT32})}var q=function d(a,b,c,e){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");
this.data=a;this.shape=b;this.dataType=c;this.fortranOrder=e}},function(p,f,m){function k(d){if(!(this instanceof k))return new k(d);d=this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},d||{});d.raw&&0<d.windowBits?d.windowBits=-d.windowBits:d.gzip&&0<d.windowBits&&16>d.windowBits&&(d.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;var g=c.deflateInit2(this.strm,d.level,d.method,d.windowBits,
d.memLevel,d.strategy);if(0!==g)throw Error(h[g]);d.header&&c.deflateSetHeader(this.strm,d.header);if(d.dictionary){d="string"===typeof d.dictionary?b.string2buf(d.dictionary):"[object ArrayBuffer]"===l.call(d.dictionary)?new Uint8Array(d.dictionary):d.dictionary;g=c.deflateSetDictionary(this.strm,d);if(0!==g)throw Error(h[g]);this._dict_set=!0}}function g(a,b){b=new k(b);b.push(a,!0);if(b.err)throw b.msg||h[b.err];return b.result}var c=m(105),a=m(6),b=m(49),h=m(28),q=m(50),l=Object.prototype.toString;
k.prototype.push=function(d,h){var g=this.strm,k=this.options.chunkSize;if(this.ended)return!1;h=h===~~h?h:!0===h?4:0;"string"===typeof d?g.input=b.string2buf(d):"[object ArrayBuffer]"===l.call(d)?g.input=new Uint8Array(d):g.input=d;g.next_in=0;g.avail_in=g.input.length;do{0===g.avail_out&&(g.output=new a.Buf8(k),g.next_out=0,g.avail_out=k);d=c.deflate(g,h);if(1!==d&&0!==d)return this.onEnd(d),this.ended=!0,!1;if(0===g.avail_out||0===g.avail_in&&(4===h||2===h))if("string"===this.options.to)this.onData(b.buf2binstring(a.shrinkBuf(g.output,
g.next_out)));else this.onData(a.shrinkBuf(g.output,g.next_out))}while((0<g.avail_in||0===g.avail_out)&&1!==d);if(4===h)return d=c.deflateEnd(this.strm),this.onEnd(d),this.ended=!0,0===d;2===h&&(this.onEnd(0),g.avail_out=0);return!0};k.prototype.onData=function(a){this.chunks.push(a)};k.prototype.onEnd=function(b){0===b&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};f.Deflate=k;f.deflate=g;f.deflateRaw=
function(a,b){b=b||{};b.raw=!0;return g(a,b)};f.gzip=function(a,b){b=b||{};b.gzip=!0;return g(a,b)}},function(p,f,m){function k(a,b){a.msg=A[b];return b}function g(a){for(var b=a.length;0<=--b;)a[b]=0}function c(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out);0!==c&&(F.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function a(a,b){x._tr_flush_block(a,0<=a.block_start?
a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;c(a.strm)}function b(a,b){a.pending_buf[a.pending++]=b}function h(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function q(a,b){var c=a.max_chain_length,d=a.strstart,e=a.prev_length,h=a.nice_match,g=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,k=a.window,f=a.w_mask,l=a.prev,m=a.strstart+258,r=k[d+e-1],t=k[d+e];a.prev_length>=a.good_match&&(c>>=2);h>a.lookahead&&(h=a.lookahead);do{var n=b;if(k[n+
e]===t&&k[n+e-1]===r&&k[n]===k[d]&&k[++n]===k[d+1]){d+=2;for(n++;k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&k[++d]===k[++n]&&d<m;);n=258-(m-d);d=m-258;if(n>e){a.match_start=b;e=n;if(n>=h)break;r=k[d+e-1];t=k[d+e]}}}while((b=l[b&f])>g&&0!==--c);return e<=a.lookahead?e:a.lookahead}function l(a){var b=a.w_size,c;do{var d=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){F.arraySet(a.window,a.window,b,b,0);a.match_start-=
b;a.strstart-=b;a.block_start-=b;var e=c=a.hash_size;do{var h=a.head[--e];a.head[e]=h>=b?h-b:0}while(--c);e=c=b;do h=a.prev[--e],a.prev[e]=h>=b?h-b:0;while(--c);d+=b}if(0===a.strm.avail_in)break;e=a.strm;c=a.window;h=a.strstart+a.lookahead;var g=e.avail_in;g>d&&(g=d);0===g?c=0:(e.avail_in-=g,F.arraySet(c,e.input,e.next_in,g,h),1===e.state.wrap?e.adler=H(e.adler,c,g,h):2===e.state.wrap&&(e.adler=t(e.adler,c,g,h)),e.next_in+=g,e.total_in+=g,c=g);a.lookahead+=c;if(3<=a.lookahead+a.insert)for(d=a.strstart-
a.insert,a.ins_h=a.window[d],a.ins_h=(a.ins_h<<a.hash_shift^a.window[d+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[d+3-1])&a.hash_mask,a.prev[d&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=d,d++,a.insert--,3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function d(b,c){for(var d;;){if(262>b.lookahead){l(b);if(262>b.lookahead&&0===c)return 1;if(0===b.lookahead)break}d=0;3<=b.lookahead&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,
d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);0!==d&&b.strstart-d<=b.w_size-262&&(b.match_length=q(b,d));if(3<=b.match_length)if(d=x._tr_tally(b,b.strstart-b.match_start,b.match_length-3),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&3<=b.lookahead){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart;while(0!==--b.match_length);b.strstart++}else b.strstart+=
b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else d=x._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(d&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=2>b.strstart?b.strstart:2;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function n(b,c){for(var d,e;;){if(262>b.lookahead){l(b);if(262>b.lookahead&&0===c)return 1;if(0===b.lookahead)break}d=0;3<=b.lookahead&&
(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);b.prev_length=b.match_length;b.prev_match=b.match_start;b.match_length=2;0!==d&&b.prev_length<b.max_lazy_match&&b.strstart-d<=b.w_size-262&&(b.match_length=q(b,d),5>=b.match_length&&(1===b.strategy||3===b.match_length&&4096<b.strstart-b.match_start)&&(b.match_length=2));if(3<=b.prev_length&&b.match_length<=b.prev_length){e=b.strstart+b.lookahead-3;d=x._tr_tally(b,
b.strstart-1-b.prev_match,b.prev_length-3);b.lookahead-=b.prev_length-1;b.prev_length-=2;do++b.strstart<=e&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);while(0!==--b.prev_length);b.match_available=0;b.match_length=2;b.strstart++;if(d&&(a(b,!1),0===b.strm.avail_out))return 1}else if(b.match_available){if((d=x._tr_tally(b,0,b.window[b.strstart-1]))&&a(b,!1),b.strstart++,b.lookahead--,0===b.strm.avail_out)return 1}else b.match_available=
1,b.strstart++,b.lookahead--}b.match_available&&(x._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0);b.insert=2>b.strstart?b.strstart:2;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function J(b,c){for(var d,e,h,g=b.window;;){if(258>=b.lookahead){l(b);if(258>=b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.match_length=0;if(3<=b.lookahead&&0<b.strstart&&(e=b.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){for(h=b.strstart+258;d===
g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&e<h;);b.match_length=258-(h-e);b.match_length>b.lookahead&&(b.match_length=b.lookahead)}3<=b.match_length?(d=x._tr_tally(b,1,b.match_length-3),b.lookahead-=b.match_length,b.strstart+=b.match_length,b.match_length=0):(d=x._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++);if(d&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=0;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),
0===b.strm.avail_out)?1:2}function u(b,c){for(var d;;){if(0===b.lookahead&&(l(b),0===b.lookahead)){if(0===c)return 1;break}b.match_length=0;d=x._tr_tally(b,0,b.window[b.strstart]);b.lookahead--;b.strstart++;if(d&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=0;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function e(a,b,c,d,e){this.good_length=a;this.max_lazy=b;this.nice_length=c;this.max_chain=d;this.func=e}function y(){this.strm=null;this.status=
0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=
this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new F.Buf16(1146);this.dyn_dtree=new F.Buf16(122);this.bl_tree=new F.Buf16(78);g(this.dyn_ltree);g(this.dyn_dtree);g(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new F.Buf16(16);this.heap=new F.Buf16(573);g(this.heap);this.heap_max=this.heap_len=0;this.depth=new F.Buf16(573);g(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=
this.l_buf=0}function K(a){if(!a||!a.state)return k(a,-2);a.total_in=a.total_out=0;a.data_type=2;var b=a.state;b.pending=0;b.pending_out=0;0>b.wrap&&(b.wrap=-b.wrap);b.status=b.wrap?42:113;a.adler=2===b.wrap?0:1;b.last_flush=0;x._tr_init(b);return 0}function v(a){var b=K(a);0===b&&(a=a.state,a.window_size=2*a.w_size,g(a.head),a.max_lazy_match=I[a.level].max_lazy,a.good_match=I[a.level].good_length,a.nice_match=I[a.level].nice_length,a.max_chain_length=I[a.level].max_chain,a.strstart=0,a.block_start=
0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0);return b}function w(a,b,c,d,e,h){if(!a)return-2;var g=1;-1===b&&(b=6);0>d?(g=0,d=-d):15<d&&(g=2,d-=16);if(1>e||9<e||8!==c||8>d||15<d||0>b||9<b||0>h||4<h)return k(a,-2);8===d&&(d=9);var f=new y;a.state=f;f.strm=a;f.wrap=g;f.gzhead=null;f.w_bits=d;f.w_size=1<<f.w_bits;f.w_mask=f.w_size-1;f.hash_bits=e+7;f.hash_size=1<<f.hash_bits;f.hash_mask=f.hash_size-1;f.hash_shift=~~((f.hash_bits+3-1)/3);f.window=new F.Buf8(2*
f.w_size);f.head=new F.Buf16(f.hash_size);f.prev=new F.Buf16(f.w_size);f.lit_bufsize=1<<e+6;f.pending_buf_size=4*f.lit_bufsize;f.pending_buf=new F.Buf8(f.pending_buf_size);f.d_buf=1*f.lit_bufsize;f.l_buf=3*f.lit_bufsize;f.level=b;f.strategy=h;f.method=c;return v(a)}var F=m(6),x=m(106),H=m(47),t=m(48),A=m(28);var I=[new e(0,0,0,0,function(b,c){var d=65535;for(d>b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){l(b);if(0===b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.strstart+=
b.lookahead;b.lookahead=0;var e=b.block_start+d;if(0===b.strstart||b.strstart>=e)if(b.lookahead=b.strstart-e,b.strstart=e,a(b,!1),0===b.strm.avail_out)return 1;if(b.strstart-b.block_start>=b.w_size-262&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=0;if(4===c)return a(b,!0),0===b.strm.avail_out?3:4;b.strstart>b.block_start&&a(b,!1);return 1}),new e(4,4,8,4,d),new e(4,5,16,8,d),new e(4,6,32,32,d),new e(4,4,16,16,n),new e(8,16,32,32,n),new e(8,16,128,128,n),new e(8,32,128,256,n),new e(32,128,258,
1024,n),new e(32,258,258,4096,n)];f.deflateInit=function(a,b){return w(a,b,8,15,8,0)};f.deflateInit2=w;f.deflateReset=v;f.deflateResetKeep=K;f.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;a.state.gzhead=b;return 0};f.deflate=function(a,d){if(!a||!a.state||5<d||0>d)return a?k(a,-2):-2;var e=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===e.status&&4!==d)return k(a,0===a.avail_out?-5:-2);e.strm=a;var f=e.last_flush;e.last_flush=d;if(42===e.status)if(2===e.wrap)a.adler=
0,b(e,31),b(e,139),b(e,8),e.gzhead?(b(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),b(e,e.gzhead.time&255),b(e,e.gzhead.time>>8&255),b(e,e.gzhead.time>>16&255),b(e,e.gzhead.time>>24&255),b(e,9===e.level?2:2<=e.strategy||2>e.level?4:0),b(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(b(e,e.gzhead.extra.length&255),b(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(a.adler=t(a.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=
69):(b(e,0),b(e,0),b(e,0),b(e,0),b(e,0),b(e,9===e.level?2:2<=e.strategy||2>e.level?4:0),b(e,3),e.status=113);else{var l=8+(e.w_bits-8<<4)<<8;l|=(2<=e.strategy||2>e.level?0:6>e.level?1:6===e.level?2:3)<<6;0!==e.strstart&&(l|=32);e.status=113;h(e,l+(31-l%31));0!==e.strstart&&(h(e,a.adler>>>16),h(e,a.adler&65535));a.adler=1}if(69===e.status)if(e.gzhead.extra){for(l=e.pending;e.gzindex<(e.gzhead.extra.length&65535)&&(e.pending!==e.pending_buf_size||(e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,
e.pending-l,l)),c(a),l=e.pending,e.pending!==e.pending_buf_size));)b(e,e.gzhead.extra[e.gzindex]&255),e.gzindex++;e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,e.pending-l,l));e.gzindex===e.gzhead.extra.length&&(e.gzindex=0,e.status=73)}else e.status=73;if(73===e.status)if(e.gzhead.name){l=e.pending;do{if(e.pending===e.pending_buf_size&&(e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,e.pending-l,l)),c(a),l=e.pending,e.pending===e.pending_buf_size)){var m=1;break}m=e.gzindex<
e.gzhead.name.length?e.gzhead.name.charCodeAt(e.gzindex++)&255:0;b(e,m)}while(0!==m);e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,e.pending-l,l));0===m&&(e.gzindex=0,e.status=91)}else e.status=91;if(91===e.status)if(e.gzhead.comment){l=e.pending;do{if(e.pending===e.pending_buf_size&&(e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,e.pending-l,l)),c(a),l=e.pending,e.pending===e.pending_buf_size)){m=1;break}m=e.gzindex<e.gzhead.comment.length?e.gzhead.comment.charCodeAt(e.gzindex++)&
255:0;b(e,m)}while(0!==m);e.gzhead.hcrc&&e.pending>l&&(a.adler=t(a.adler,e.pending_buf,e.pending-l,l));0===m&&(e.status=103)}else e.status=103;103===e.status&&(e.gzhead.hcrc?(e.pending+2>e.pending_buf_size&&c(a),e.pending+2<=e.pending_buf_size&&(b(e,a.adler&255),b(e,a.adler>>8&255),a.adler=0,e.status=113)):e.status=113);if(0!==e.pending){if(c(a),0===a.avail_out)return e.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return k(a,-5);if(666===e.status&&0!==a.avail_in)return k(a,
-5);if(0!==a.avail_in||0!==e.lookahead||0!==d&&666!==e.status){f=2===e.strategy?u(e,d):3===e.strategy?J(e,d):I[e.level].func(e,d);if(3===f||4===f)e.status=666;if(1===f||3===f)return 0===a.avail_out&&(e.last_flush=-1),0;if(2===f&&(1===d?x._tr_align(e):5!==d&&(x._tr_stored_block(e,0,0,!1),3===d&&(g(e.head),0===e.lookahead&&(e.strstart=0,e.block_start=0,e.insert=0))),c(a),0===a.avail_out))return e.last_flush=-1,0}if(4!==d)return 0;if(0>=e.wrap)return 1;2===e.wrap?(b(e,a.adler&255),b(e,a.adler>>8&255),
b(e,a.adler>>16&255),b(e,a.adler>>24&255),b(e,a.total_in&255),b(e,a.total_in>>8&255),b(e,a.total_in>>16&255),b(e,a.total_in>>24&255)):(h(e,a.adler>>>16),h(e,a.adler&65535));c(a);0<e.wrap&&(e.wrap=-e.wrap);return 0!==e.pending?0:1};f.deflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state.status;if(42!==b&&69!==b&&73!==b&&91!==b&&103!==b&&113!==b&&666!==b)return k(a,-2);a.state=null;return 113===b?k(a,-3):0};f.deflateSetDictionary=function(a,b){var c=b.length;if(!a||!a.state)return-2;var d=a.state;
var e=d.wrap;if(2===e||1===e&&42!==d.status||d.lookahead)return-2;1===e&&(a.adler=H(a.adler,b,c,0));d.wrap=0;if(c>=d.w_size){0===e&&(g(d.head),d.strstart=0,d.block_start=0,d.insert=0);var h=new F.Buf8(d.w_size);F.arraySet(h,b,c-d.w_size,d.w_size,0);b=h;c=d.w_size}h=a.avail_in;var k=a.next_in;var f=a.input;a.avail_in=c;a.next_in=0;a.input=b;for(l(d);3<=d.lookahead;){b=d.strstart;c=d.lookahead-2;do d.ins_h=(d.ins_h<<d.hash_shift^d.window[b+3-1])&d.hash_mask,d.prev[b&d.w_mask]=d.head[d.ins_h],d.head[d.ins_h]=
b,b++;while(--c);d.strstart=b;d.lookahead=2;l(d)}d.strstart+=d.lookahead;d.block_start=d.strstart;d.insert=d.lookahead;d.lookahead=0;d.match_length=d.prev_length=2;d.match_available=0;a.next_in=k;a.input=f;a.avail_in=h;d.wrap=e;return 0};f.deflateInfo="pako deflate (from Nodeca project)"},function(p,f,m){function k(a){for(var b=a.length;0<=--b;)a[b]=0}function g(a,b,c,d,e){this.static_tree=a;this.extra_bits=b;this.extra_base=c;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}function c(a,
b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b}function a(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function b(b,c,d){b.bi_valid>16-d?(b.bi_buf|=c<<b.bi_valid&65535,a(b,b.bi_buf),b.bi_buf=c>>16-b.bi_valid,b.bi_valid+=d-16):(b.bi_buf|=c<<b.bi_valid&65535,b.bi_valid+=d)}function h(a,c,d){b(a,d[2*c],d[2*c+1])}function q(a,b){var c=0;do c|=a&1,a>>>=1,c<<=1;while(0<--b);return c>>>1}function l(a,b,c){var d=Array(16),e=0,h;for(h=1;15>=h;h++)d[h]=e=e+c[h-1]<<1;for(c=
0;c<=b;c++)e=a[2*c+1],0!==e&&(a[2*c]=q(d[e]++,e))}function d(a){var b;for(b=0;286>b;b++)a.dyn_ltree[2*b]=0;for(b=0;30>b;b++)a.dyn_dtree[2*b]=0;for(b=0;19>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[512]=1;a.opt_len=a.static_len=0;a.last_lit=a.matches=0}function n(b){8<b.bi_valid?a(b,b.bi_buf):0<b.bi_valid&&(b.pending_buf[b.pending++]=b.bi_buf);b.bi_buf=0;b.bi_valid=0}function J(a,b,c,d){var e=2*b,h=2*c;return a[e]<a[h]||a[e]===a[h]&&d[b]<=d[c]}function u(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len;){e<
a.heap_len&&J(b,a.heap[e+1],a.heap[e],a.depth)&&e++;if(J(b,d,a.heap[e],a.depth))break;a.heap[c]=a.heap[e];c=e;e<<=1}a.heap[c]=d}function e(a,c,d){var e=0;if(0!==a.last_lit){do{var g=a.pending_buf[a.d_buf+2*e]<<8|a.pending_buf[a.d_buf+2*e+1];var k=a.pending_buf[a.l_buf+e];e++;if(0===g)h(a,k,c);else{var f=D[k];h(a,f+256+1,c);var l=H[f];0!==l&&(k-=B[f],b(a,k,l));g--;f=256>g?G[g]:G[256+(g>>>7)];h(a,f,d);l=t[f];0!==l&&(g-=C[f],b(a,g,l))}}while(e<a.last_lit)}h(a,256,c)}function y(a,b){var c=b.dyn_tree,
d=b.stat_desc.static_tree,e=b.stat_desc.has_stree,h=b.stat_desc.elems,g,k=-1;a.heap_len=0;a.heap_max=573;for(g=0;g<h;g++)0!==c[2*g]?(a.heap[++a.heap_len]=k=g,a.depth[g]=0):c[2*g+1]=0;for(;2>a.heap_len;){var f=a.heap[++a.heap_len]=2>k?++k:0;c[2*f]=1;a.depth[f]=0;a.opt_len--;e&&(a.static_len-=d[2*f+1])}b.max_code=k;for(g=a.heap_len>>1;1<=g;g--)u(a,c,g);f=h;do g=a.heap[1],a.heap[1]=a.heap[a.heap_len--],u(a,c,1),d=a.heap[1],a.heap[--a.heap_max]=g,a.heap[--a.heap_max]=d,c[2*f]=c[2*g]+c[2*d],a.depth[f]=
(a.depth[g]>=a.depth[d]?a.depth[g]:a.depth[d])+1,c[2*g+1]=c[2*d+1]=f,a.heap[1]=f++,u(a,c,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];g=b.dyn_tree;f=b.max_code;d=b.stat_desc.static_tree;e=b.stat_desc.has_stree;h=b.stat_desc.extra_bits;var m=b.stat_desc.extra_base,t=b.stat_desc.max_length,n,q=0;for(n=0;15>=n;n++)a.bl_count[n]=0;g[2*a.heap[a.heap_max]+1]=0;for(b=a.heap_max+1;573>b;b++){var p=a.heap[b];n=g[2*g[2*p+1]+1]+1;n>t&&(n=t,q++);g[2*p+1]=n;if(!(p>f)){a.bl_count[n]++;var r=0;p>=m&&(r=
h[p-m]);var v=g[2*p];a.opt_len+=v*(n+r);e&&(a.static_len+=v*(d[2*p+1]+r))}}if(0!==q){do{for(n=t-1;0===a.bl_count[n];)n--;a.bl_count[n]--;a.bl_count[n+1]+=2;a.bl_count[t]--;q-=2}while(0<q);for(n=t;0!==n;n--)for(p=a.bl_count[n];0!==p;)d=a.heap[--b],d>f||(g[2*d+1]!==n&&(a.opt_len+=(n-g[2*d+1])*g[2*d],g[2*d+1]=n),p--)}l(c,k,a.bl_count)}function K(a,b,c){var d,e=-1,g=b[1],h=0,k=7,f=4;0===g&&(k=138,f=3);b[2*(c+1)+1]=65535;for(d=0;d<=c;d++){var l=g;g=b[2*(d+1)+1];++h<k&&l===g||(h<f?a.bl_tree[2*l]+=h:0!==
l?(l!==e&&a.bl_tree[2*l]++,a.bl_tree[32]++):10>=h?a.bl_tree[34]++:a.bl_tree[36]++,h=0,e=l,0===g?(k=138,f=3):l===g?(k=6,f=3):(k=7,f=4))}}function v(a,c,d){var e,g=-1,k=c[1],f=0,l=7,m=4;0===k&&(l=138,m=3);for(e=0;e<=d;e++){var t=k;k=c[2*(e+1)+1];if(!(++f<l&&t===k)){if(f<m){do h(a,t,a.bl_tree);while(0!==--f)}else 0!==t?(t!==g&&(h(a,t,a.bl_tree),f--),h(a,16,a.bl_tree),b(a,f-3,2)):10>=f?(h(a,17,a.bl_tree),b(a,f-3,3)):(h(a,18,a.bl_tree),b(a,f-11,7));f=0;g=t;0===k?(l=138,m=3):t===k?(l=6,m=3):(l=7,m=4)}}}
function w(a){var b=4093624447,c;for(c=0;31>=c;c++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*c])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(c=32;256>c;c++)if(0!==a.dyn_ltree[2*c])return 1;return 0}function F(c,d,e,g){b(c,0+(g?1:0),3);n(c);a(c,e);a(c,~e);x.arraySet(c.pending_buf,c.window,d,e,c.pending);c.pending+=e}var x=m(6),H=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],t=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],A=[0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],r=Array(576);k(r);var L=Array(60);k(L);var G=Array(512);k(G);var D=Array(256);k(D);var B=Array(29);k(B);var C=Array(30);k(C);var Q,N,O,E=!1;f._tr_init=function(a){if(!E){var b,e,h,k=Array(16);for(h=e=0;28>h;h++)for(B[h]=e,b=0;b<1<<H[h];b++)D[e++]=h;D[e-1]=h;for(h=e=0;16>h;h++)for(C[h]=e,b=0;b<1<<t[h];b++)G[e++]=h;for(e>>=7;30>h;h++)for(C[h]=e<<7,b=0;b<1<<t[h]-7;b++)G[256+e++]=h;for(b=0;15>=b;b++)k[b]=0;for(b=0;143>=
b;)r[2*b+1]=8,b++,k[8]++;for(;255>=b;)r[2*b+1]=9,b++,k[9]++;for(;279>=b;)r[2*b+1]=7,b++,k[7]++;for(;287>=b;)r[2*b+1]=8,b++,k[8]++;l(r,287,k);for(b=0;30>b;b++)L[2*b+1]=5,L[2*b]=q(b,5);Q=new g(r,H,257,286,15);N=new g(L,t,0,30,15);O=new g([],A,0,19,7);E=!0}a.l_desc=new c(a.dyn_ltree,Q);a.d_desc=new c(a.dyn_dtree,N);a.bl_desc=new c(a.bl_tree,O);a.bi_buf=0;a.bi_valid=0;d(a)};f._tr_stored_block=F;f._tr_flush_block=function(a,c,h,g){var k=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=w(a));y(a,
a.l_desc);y(a,a.d_desc);K(a,a.dyn_ltree,a.l_desc.max_code);K(a,a.dyn_dtree,a.d_desc.max_code);y(a,a.bl_desc);for(k=18;3<=k&&0===a.bl_tree[2*I[k]+1];k--);a.opt_len+=3*(k+1)+14;var f=a.opt_len+3+7>>>3;var l=a.static_len+3+7>>>3;l<=f&&(f=l)}else f=l=h+5;if(h+4<=f&&-1!==c)F(a,c,h,g);else if(4===a.strategy||l===f)b(a,2+(g?1:0),3),e(a,r,L);else{b(a,4+(g?1:0),3);c=a.l_desc.max_code+1;h=a.d_desc.max_code+1;k+=1;b(a,c-257,5);b(a,h-1,5);b(a,k-4,4);for(f=0;f<k;f++)b(a,a.bl_tree[2*I[f]+1],3);v(a,a.dyn_ltree,
c-1);v(a,a.dyn_dtree,h-1);e(a,a.dyn_ltree,a.dyn_dtree)}d(a);g&&n(a)};f._tr_tally=function(a,b,c){a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255;a.pending_buf[a.d_buf+2*a.last_lit+1]=b&255;a.pending_buf[a.l_buf+a.last_lit]=c&255;a.last_lit++;0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(D[c]+256+1)]++,a.dyn_dtree[2*(256>b?G[b]:G[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(c){b(c,2,3);h(c,256,r);16===c.bi_valid?(a(c,c.bi_buf),c.bi_buf=0,c.bi_valid=0):8<=c.bi_valid&&
(c.pending_buf[c.pending++]=c.bi_buf&255,c.bi_buf>>=8,c.bi_valid-=8)}},function(p,f,m){function k(b){if(!(this instanceof k))return new k(b);var g=this.options=a.assign({chunkSize:16384,windowBits:0,to:""},b||{});g.raw&&0<=g.windowBits&&16>g.windowBits&&(g.windowBits=-g.windowBits,0===g.windowBits&&(g.windowBits=-15));!(0<=g.windowBits&&16>g.windowBits)||b&&b.windowBits||(g.windowBits+=32);15<g.windowBits&&48>g.windowBits&&0===(g.windowBits&15)&&(g.windowBits|=15);this.err=0;this.msg="";this.ended=
!1;this.chunks=[];this.strm=new l;this.strm.avail_out=0;b=c.inflateInit2(this.strm,g.windowBits);if(b!==h.Z_OK)throw Error(q[b]);this.header=new d;c.inflateGetHeader(this.strm,this.header)}function g(a,b){b=new k(b);b.push(a,!0);if(b.err)throw b.msg||q[b.err];return b.result}var c=m(108),a=m(6),b=m(49),h=m(51),q=m(28),l=m(50),d=m(111),n=Object.prototype.toString;k.prototype.push=function(d,g){var e=this.strm,k=this.options.chunkSize,f=this.options.dictionary,l=!1;if(this.ended)return!1;g=g===~~g?
g:!0===g?h.Z_FINISH:h.Z_NO_FLUSH;"string"===typeof d?e.input=b.binstring2buf(d):"[object ArrayBuffer]"===n.call(d)?e.input=new Uint8Array(d):e.input=d;e.next_in=0;e.avail_in=e.input.length;do{0===e.avail_out&&(e.output=new a.Buf8(k),e.next_out=0,e.avail_out=k);d=c.inflate(e,h.Z_NO_FLUSH);d===h.Z_NEED_DICT&&f&&(d="string"===typeof f?b.string2buf(f):"[object ArrayBuffer]"===n.call(f)?new Uint8Array(f):f,d=c.inflateSetDictionary(this.strm,d));d===h.Z_BUF_ERROR&&!0===l&&(d=h.Z_OK,l=!1);if(d!==h.Z_STREAM_END&&
d!==h.Z_OK)return this.onEnd(d),this.ended=!0,!1;if(e.next_out&&(0===e.avail_out||d===h.Z_STREAM_END||0===e.avail_in&&(g===h.Z_FINISH||g===h.Z_SYNC_FLUSH)))if("string"===this.options.to){var m=b.utf8border(e.output,e.next_out);var q=e.next_out-m;var p=b.buf2string(e.output,m);e.next_out=q;e.avail_out=k-q;q&&a.arraySet(e.output,e.output,m,q,0);this.onData(p)}else this.onData(a.shrinkBuf(e.output,e.next_out));0===e.avail_in&&0===e.avail_out&&(l=!0)}while((0<e.avail_in||0===e.avail_out)&&d!==h.Z_STREAM_END);
d===h.Z_STREAM_END&&(g=h.Z_FINISH);if(g===h.Z_FINISH)return d=c.inflateEnd(this.strm),this.onEnd(d),this.ended=!0,d===h.Z_OK;g===h.Z_SYNC_FLUSH&&(this.onEnd(h.Z_OK),e.avail_out=0);return!0};k.prototype.onData=function(a){this.chunks.push(a)};k.prototype.onEnd=function(b){b===h.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};f.Inflate=k;f.inflate=g;f.inflateRaw=function(a,b){b=b||{};b.raw=!0;return g(a,
b)};f.ungzip=g},function(p,f,m){function k(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}function g(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new l.Buf16(320);this.work=
new l.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function c(a){if(!a||!a.state)return-2;var b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new l.Buf32(852);b.distcode=b.distdyn=new l.Buf32(592);b.sane=1;b.back=-1;return 0}function a(a){if(!a||!a.state)return-2;var b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return c(a)}function b(b,c){if(!b||!b.state)return-2;
var d=b.state;if(0>c){var e=0;c=-c}else e=(c>>4)+1,48>c&&(c&=15);if(c&&(8>c||15<c))return-2;null!==d.window&&d.wbits!==c&&(d.window=null);d.wrap=e;d.wbits=c;return a(b)}function h(a,c){if(!a)return-2;var d=new g;a.state=d;d.window=null;c=b(a,c);0!==c&&(a.state=null);return c}function q(a,b,c,d){var e=a.state;null===e.window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new l.Buf8(e.wsize));d>=e.wsize?(l.arraySet(e.window,b,c-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(a=e.wsize-e.wnext,a>d&&
(a=d),l.arraySet(e.window,b,c-d,a,e.wnext),(d-=a)?(l.arraySet(e.window,b,c-d,d,0),e.wnext=d,e.whave=e.wsize):(e.wnext+=a,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=a)));return 0}var l=m(6),d=m(47),n=m(48),J=m(109),u=m(110),e=!0,y,K;f.inflateReset=a;f.inflateReset2=b;f.inflateResetKeep=c;f.inflateInit=function(a){return h(a,15)};f.inflateInit2=h;f.inflate=function(a,b){var c,g=new l.Buf8(4),h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==
a.avail_in)return-2;var f=a.state;12===f.mode&&(f.mode=13);var m=a.next_out;var p=a.output;var r=a.avail_out;var v=a.next_in;var w=a.input;var D=a.avail_in;var B=f.hold;var C=f.bits;var Q=D;var N=r;var O=0;a:for(;;)switch(f.mode){case 1:if(0===f.wrap){f.mode=13;break}for(;16>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if(f.wrap&2&&35615===B){f.check=0;g[0]=B&255;g[1]=B>>>8&255;f.check=n(f.check,g,2,0);C=B=0;f.mode=2;break}f.flags=0;f.head&&(f.head.done=!1);if(!(f.wrap&1)||(((B&255)<<8)+(B>>8))%31){a.msg=
"incorrect header check";f.mode=30;break}if(8!==(B&15)){a.msg="unknown compression method";f.mode=30;break}B>>>=4;C-=4;var E=(B&15)+8;if(0===f.wbits)f.wbits=E;else if(E>f.wbits){a.msg="invalid window size";f.mode=30;break}f.dmax=1<<E;a.adler=f.check=1;f.mode=B&512?10:12;C=B=0;break;case 2:for(;16>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.flags=B;if(8!==(f.flags&255)){a.msg="unknown compression method";f.mode=30;break}if(f.flags&57344){a.msg="unknown header flags set";f.mode=30;break}f.head&&(f.head.text=
B>>8&1);f.flags&512&&(g[0]=B&255,g[1]=B>>>8&255,f.check=n(f.check,g,2,0));C=B=0;f.mode=3;case 3:for(;32>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.head&&(f.head.time=B);f.flags&512&&(g[0]=B&255,g[1]=B>>>8&255,g[2]=B>>>16&255,g[3]=B>>>24&255,f.check=n(f.check,g,4,0));C=B=0;f.mode=4;case 4:for(;16>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.head&&(f.head.xflags=B&255,f.head.os=B>>8);f.flags&512&&(g[0]=B&255,g[1]=B>>>8&255,f.check=n(f.check,g,2,0));C=B=0;f.mode=5;case 5:if(f.flags&1024){for(;16>C;){if(0===
D)break a;D--;B+=w[v++]<<C;C+=8}f.length=B;f.head&&(f.head.extra_len=B);f.flags&512&&(g[0]=B&255,g[1]=B>>>8&255,f.check=n(f.check,g,2,0));C=B=0}else f.head&&(f.head.extra=null);f.mode=6;case 6:if(f.flags&1024){var z=f.length;z>D&&(z=D);z&&(f.head&&(E=f.head.extra_len-f.length,f.head.extra||(f.head.extra=Array(f.head.extra_len)),l.arraySet(f.head.extra,w,v,z,E)),f.flags&512&&(f.check=n(f.check,w,z,v)),D-=z,v+=z,f.length-=z);if(f.length)break a}f.length=0;f.mode=7;case 7:if(f.flags&2048){if(0===D)break a;
z=0;do E=w[v+z++],f.head&&E&&65536>f.length&&(f.head.name+=String.fromCharCode(E));while(E&&z<D);f.flags&512&&(f.check=n(f.check,w,z,v));D-=z;v+=z;if(E)break a}else f.head&&(f.head.name=null);f.length=0;f.mode=8;case 8:if(f.flags&4096){if(0===D)break a;z=0;do E=w[v+z++],f.head&&E&&65536>f.length&&(f.head.comment+=String.fromCharCode(E));while(E&&z<D);f.flags&512&&(f.check=n(f.check,w,z,v));D-=z;v+=z;if(E)break a}else f.head&&(f.head.comment=null);f.mode=9;case 9:if(f.flags&512){for(;16>C;){if(0===
D)break a;D--;B+=w[v++]<<C;C+=8}if(B!==(f.check&65535)){a.msg="header crc mismatch";f.mode=30;break}C=B=0}f.head&&(f.head.hcrc=f.flags>>9&1,f.head.done=!0);a.adler=f.check=0;f.mode=12;break;case 10:for(;32>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}a.adler=f.check=k(B);C=B=0;f.mode=11;case 11:if(0===f.havedict)return a.next_out=m,a.avail_out=r,a.next_in=v,a.avail_in=D,f.hold=B,f.bits=C,2;a.adler=f.check=1;f.mode=12;case 12:if(5===b||6===b)break a;case 13:if(f.last){B>>>=C&7;C-=C&7;f.mode=27;break}for(;3>
C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.last=B&1;B>>>=1;--C;switch(B&3){case 0:f.mode=14;break;case 1:E=f;if(e){y=new l.Buf32(512);K=new l.Buf32(32);for(z=0;144>z;)E.lens[z++]=8;for(;256>z;)E.lens[z++]=9;for(;280>z;)E.lens[z++]=7;for(;288>z;)E.lens[z++]=8;u(1,E.lens,0,288,y,0,E.work,{bits:9});for(z=0;32>z;)E.lens[z++]=5;u(2,E.lens,0,32,K,0,E.work,{bits:5});e=!1}E.lencode=y;E.lenbits=9;E.distcode=K;E.distbits=5;f.mode=20;if(6===b){B>>>=2;C-=2;break a}break;case 2:f.mode=17;break;case 3:a.msg=
"invalid block type",f.mode=30}B>>>=2;C-=2;break;case 14:B>>>=C&7;for(C-=C&7;32>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if((B&65535)!==(B>>>16^65535)){a.msg="invalid stored block lengths";f.mode=30;break}f.length=B&65535;C=B=0;f.mode=15;if(6===b)break a;case 15:f.mode=16;case 16:if(z=f.length){z>D&&(z=D);z>r&&(z=r);if(0===z)break a;l.arraySet(p,w,v,z,m);D-=z;v+=z;r-=z;m+=z;f.length-=z;break}f.mode=12;break;case 17:for(;14>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.nlen=(B&31)+257;B>>>=5;C-=5;
f.ndist=(B&31)+1;B>>>=5;C-=5;f.ncode=(B&15)+4;B>>>=4;C-=4;if(286<f.nlen||30<f.ndist){a.msg="too many length or distance symbols";f.mode=30;break}f.have=0;f.mode=18;case 18:for(;f.have<f.ncode;){for(;3>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.lens[h[f.have++]]=B&7;B>>>=3;C-=3}for(;19>f.have;)f.lens[h[f.have++]]=0;f.lencode=f.lendyn;f.lenbits=7;z={bits:f.lenbits};O=u(0,f.lens,0,19,f.lencode,0,f.work,z);f.lenbits=z.bits;if(O){a.msg="invalid code lengths set";f.mode=30;break}f.have=0;f.mode=19;case 19:for(;f.have<
f.nlen+f.ndist;){for(;;){var M=f.lencode[B&(1<<f.lenbits)-1];z=M>>>24;M&=65535;if(z<=C)break;if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if(16>M)B>>>=z,C-=z,f.lens[f.have++]=M;else{if(16===M){for(E=z+2;C<E;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}B>>>=z;C-=z;if(0===f.have){a.msg="invalid bit length repeat";f.mode=30;break}E=f.lens[f.have-1];z=3+(B&3);B>>>=2;C-=2}else if(17===M){for(E=z+3;C<E;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}B>>>=z;C-=z;E=0;z=3+(B&7);B>>>=3;C-=3}else{for(E=z+7;C<E;){if(0===D)break a;
D--;B+=w[v++]<<C;C+=8}B>>>=z;C-=z;E=0;z=11+(B&127);B>>>=7;C-=7}if(f.have+z>f.nlen+f.ndist){a.msg="invalid bit length repeat";f.mode=30;break}for(;z--;)f.lens[f.have++]=E}}if(30===f.mode)break;if(0===f.lens[256]){a.msg="invalid code -- missing end-of-block";f.mode=30;break}f.lenbits=9;z={bits:f.lenbits};O=u(1,f.lens,0,f.nlen,f.lencode,0,f.work,z);f.lenbits=z.bits;if(O){a.msg="invalid literal/lengths set";f.mode=30;break}f.distbits=6;f.distcode=f.distdyn;z={bits:f.distbits};O=u(2,f.lens,f.nlen,f.ndist,
f.distcode,0,f.work,z);f.distbits=z.bits;if(O){a.msg="invalid distances set";f.mode=30;break}f.mode=20;if(6===b)break a;case 20:f.mode=21;case 21:if(6<=D&&258<=r){a.next_out=m;a.avail_out=r;a.next_in=v;a.avail_in=D;f.hold=B;f.bits=C;J(a,N);m=a.next_out;p=a.output;r=a.avail_out;v=a.next_in;w=a.input;D=a.avail_in;B=f.hold;C=f.bits;12===f.mode&&(f.back=-1);break}for(f.back=0;;){M=f.lencode[B&(1<<f.lenbits)-1];z=M>>>24;E=M>>>16&255;M&=65535;if(z<=C)break;if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if(E&&0===
(E&240)){var S=z;var pa=E;for(c=M;;){M=f.lencode[c+((B&(1<<S+pa)-1)>>S)];z=M>>>24;E=M>>>16&255;M&=65535;if(S+z<=C)break;if(0===D)break a;D--;B+=w[v++]<<C;C+=8}B>>>=S;C-=S;f.back+=S}B>>>=z;C-=z;f.back+=z;f.length=M;if(0===E){f.mode=26;break}if(E&32){f.back=-1;f.mode=12;break}if(E&64){a.msg="invalid literal/length code";f.mode=30;break}f.extra=E&15;f.mode=22;case 22:if(f.extra){for(E=f.extra;C<E;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}f.length+=B&(1<<f.extra)-1;B>>>=f.extra;C-=f.extra;f.back+=f.extra}f.was=
f.length;f.mode=23;case 23:for(;;){M=f.distcode[B&(1<<f.distbits)-1];z=M>>>24;E=M>>>16&255;M&=65535;if(z<=C)break;if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if(0===(E&240)){S=z;pa=E;for(c=M;;){M=f.distcode[c+((B&(1<<S+pa)-1)>>S)];z=M>>>24;E=M>>>16&255;M&=65535;if(S+z<=C)break;if(0===D)break a;D--;B+=w[v++]<<C;C+=8}B>>>=S;C-=S;f.back+=S}B>>>=z;C-=z;f.back+=z;if(E&64){a.msg="invalid distance code";f.mode=30;break}f.offset=M;f.extra=E&15;f.mode=24;case 24:if(f.extra){for(E=f.extra;C<E;){if(0===D)break a;
D--;B+=w[v++]<<C;C+=8}f.offset+=B&(1<<f.extra)-1;B>>>=f.extra;C-=f.extra;f.back+=f.extra}if(f.offset>f.dmax){a.msg="invalid distance too far back";f.mode=30;break}f.mode=25;case 25:if(0===r)break a;z=N-r;if(f.offset>z){z=f.offset-z;if(z>f.whave&&f.sane){a.msg="invalid distance too far back";f.mode=30;break}z>f.wnext?(z-=f.wnext,E=f.wsize-z):E=f.wnext-z;z>f.length&&(z=f.length);S=f.window}else S=p,E=m-f.offset,z=f.length;z>r&&(z=r);r-=z;f.length-=z;do p[m++]=S[E++];while(--z);0===f.length&&(f.mode=
21);break;case 26:if(0===r)break a;p[m++]=f.length;r--;f.mode=21;break;case 27:if(f.wrap){for(;32>C;){if(0===D)break a;D--;B|=w[v++]<<C;C+=8}N-=r;a.total_out+=N;f.total+=N;N&&(a.adler=f.check=f.flags?n(f.check,p,N,m-N):d(f.check,p,N,m-N));N=r;if((f.flags?B:k(B))!==f.check){a.msg="incorrect data check";f.mode=30;break}C=B=0}f.mode=28;case 28:if(f.wrap&&f.flags){for(;32>C;){if(0===D)break a;D--;B+=w[v++]<<C;C+=8}if(B!==(f.total&4294967295)){a.msg="incorrect length check";f.mode=30;break}C=B=0}f.mode=
29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=m;a.avail_out=r;a.next_in=v;a.avail_in=D;f.hold=B;f.bits=C;if((f.wsize||N!==a.avail_out&&30>f.mode&&(27>f.mode||4!==b))&&q(a,a.output,a.next_out,N-a.avail_out))return f.mode=31,-4;Q-=a.avail_in;N-=a.avail_out;a.total_in+=Q;a.total_out+=N;f.total+=N;f.wrap&&N&&(a.adler=f.check=f.flags?n(f.check,p,N,a.next_out-N):d(f.check,p,N,a.next_out-N));a.data_type=f.bits+(f.last?64:0)+(12===f.mode?128:0)+(20===f.mode||15===
f.mode?256:0);(0===Q&&0===N||4===b)&&0===O&&(O=-5);return O};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){if(!a||!a.state)return-2;a=a.state;if(0===(a.wrap&2))return-2;a.head=b;b.done=!1;return 0};f.inflateSetDictionary=function(a,b){var c=b.length;if(!a||!a.state)return-2;var e=a.state;if(0!==e.wrap&&11!==e.mode)return-2;if(11===e.mode){var f=d(1,b,c,0);if(f!==e.check)return-3}if(q(a,b,c,c))return e.mode=
31,-4;e.havedict=1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},function(p,f,m){p.exports=function(f,g){var c=f.state;var a=f.next_in;var b=f.input;var h=a+(f.avail_in-5);var k=f.next_out;var l=f.output;g=k-(g-f.avail_out);var d=k+(f.avail_out-257);var m=c.dmax;var p=c.wsize;var u=c.whave;var e=c.wnext;var y=c.window;var K=c.hold;var v=c.bits;var w=c.lencode;var F=c.distcode;var x=(1<<c.lenbits)-1;var H=(1<<c.distbits)-1;a:do{15>v&&(K+=b[a++]<<v,v+=8,K+=b[a++]<<v,v+=8);var t=w[K&
x];b:for(;;){var A=t>>>24;K>>>=A;v-=A;A=t>>>16&255;if(0===A)l[k++]=t&65535;else if(A&16){var I=t&65535;if(A&=15)v<A&&(K+=b[a++]<<v,v+=8),I+=K&(1<<A)-1,K>>>=A,v-=A;15>v&&(K+=b[a++]<<v,v+=8,K+=b[a++]<<v,v+=8);t=F[K&H];c:for(;;){A=t>>>24;K>>>=A;v-=A;A=t>>>16&255;if(A&16){t&=65535;A&=15;v<A&&(K+=b[a++]<<v,v+=8,v<A&&(K+=b[a++]<<v,v+=8));t+=K&(1<<A)-1;if(t>m){f.msg="invalid distance too far back";c.mode=30;break a}K>>>=A;v-=A;A=k-g;if(t>A){A=t-A;if(A>u&&c.sane){f.msg="invalid distance too far back";c.mode=
30;break a}var r=0;var L=y;if(0===e){if(r+=p-A,A<I){I-=A;do l[k++]=y[r++];while(--A);r=k-t;L=l}}else if(e<A){if(r+=p+e-A,A-=e,A<I){I-=A;do l[k++]=y[r++];while(--A);r=0;if(e<I){A=e;I-=A;do l[k++]=y[r++];while(--A);r=k-t;L=l}}}else if(r+=e-A,A<I){I-=A;do l[k++]=y[r++];while(--A);r=k-t;L=l}for(;2<I;)l[k++]=L[r++],l[k++]=L[r++],l[k++]=L[r++],I-=3;I&&(l[k++]=L[r++],1<I&&(l[k++]=L[r++]))}else{r=k-t;do l[k++]=l[r++],l[k++]=l[r++],l[k++]=l[r++],I-=3;while(2<I);I&&(l[k++]=l[r++],1<I&&(l[k++]=l[r++]))}}else if(0===
(A&64)){t=F[(t&65535)+(K&(1<<A)-1)];continue c}else{f.msg="invalid distance code";c.mode=30;break a}break}}else if(0===(A&64)){t=w[(t&65535)+(K&(1<<A)-1)];continue b}else{A&32?c.mode=12:(f.msg="invalid literal/length code",c.mode=30);break a}break}}while(a<h&&k<d);I=v>>3;a-=I;v-=I<<3;f.next_in=a;f.next_out=k;f.avail_in=a<h?5+(h-a):5-(a-h);f.avail_out=k<d?257+(d-k):257-(k-d);c.hold=K&(1<<v)-1;c.bits=v}},function(p,f,m){var k=m(6),g=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,
131,163,195,227,258,0,0],c=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],b=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];p.exports=function(f,m,l,d,n,p,u,e){var h=e.bits,q,v,w,F,x,H,t=0,A=new k.Buf16(16);var I=new k.Buf16(16);var r,L=0;for(q=0;15>=q;q++)A[q]=0;for(v=0;v<d;v++)A[m[l+
v]]++;var G=h;for(w=15;1<=w&&0===A[w];w--);G>w&&(G=w);if(0===w)return n[p++]=20971520,n[p++]=20971520,e.bits=1,0;for(h=1;h<w&&0===A[h];h++);G<h&&(G=h);for(q=F=1;15>=q;q++)if(F<<=1,F-=A[q],0>F)return-1;if(0<F&&(0===f||1!==w))return-1;I[1]=0;for(q=1;15>q;q++)I[q+1]=I[q]+A[q];for(v=0;v<d;v++)0!==m[l+v]&&(u[I[m[l+v]]++]=v);if(0===f){var D=r=u;var B=19}else 1===f?(D=g,t-=257,r=c,L-=257,B=256):(D=a,r=b,B=-1);v=x=0;q=h;var C=p;d=G;I=0;var J=-1;var N=1<<G;var O=N-1;if(1===f&&852<N||2===f&&592<N)return 1;
for(;;){var E=q-I;if(u[v]<B){var z=0;var M=u[v]}else u[v]>B?(z=r[L+u[v]],M=D[t+u[v]]):(z=96,M=0);F=1<<q-I;h=H=1<<d;do H-=F,n[C+(x>>I)+H]=E<<24|z<<16|M|0;while(0!==H);for(F=1<<q-1;x&F;)F>>=1;0!==F?(x&=F-1,x+=F):x=0;v++;if(0===--A[q]){if(q===w)break;q=m[l+u[v]]}if(q>G&&(x&O)!==J){0===I&&(I=G);C+=h;d=q-I;for(F=1<<d;d+I<w;){F-=A[d+I];if(0>=F)break;d++;F<<=1}N+=1<<d;if(1===f&&852<N||2===f&&592<N)return 1;J=x&O;n[J]=G<<24|d<<16|C-p|0}}0!==x&&(n[C+x]=q-I<<24|4194304);e.bits=G;return 0}},function(p,f,m){p.exports=
function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"DVIDVolumeChunkSource",function(){return J});m.d(f,"TileChunkSource",function(){return u});p=m(2);var a=m(113),b=m(25),h=m(17);f=m(14);var q=m(12);m=m(0);var l=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=
!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),d=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},n=new Map([[a.b.JPEG,
h.a]]),J=function(d){function e(){k(this,e);return g(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}c(e,d);l(e,[{key:"download",value:function(a,b){var c=this.parameters;var d=this.computeChunkBounds(a);d=this.getPath(d,a.chunkDataSize);var e=this.getDecoder(c);return Object(q.e)(Object(q.c)(c.baseUrls,d),"arraybuffer",b).then(function(b){return e(a,b)})}},{key:"getPath",value:function(b,c){var d=this.parameters;return d.encoding===a.c.JPEG?"/api/node/"+d.nodeKey+"/"+d.dataInstanceKey+
"/raw/0_1_2/"+(c[0]+"_"+c[1]+"_"+c[2]+"/")+(b[0]+"_"+b[1]+"_"+b[2]+"/jpeg"):"/api/node/"+d.nodeKey+"/"+d.dataInstanceKey+"/raw/0_1_2/"+(c[0]+"_"+c[1]+"_"+c[2]+"/")+(b[0]+"_"+b[1]+"_"+b[2]+"?compression=googlegzip")}},{key:"getDecoder",value:function(c){return c.encoding===a.c.JPEG?h.a:b.a}}]);return e}(Object(p.WithParameters)(f.a,a.d));J=d([Object(m.g)()],J);var u=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=n.get(a.parameters.encoding);
return a}c(b,a);l(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=a.chunkGridPosition;a.chunkDataSize=this.spec.chunkDataSize;return Object(q.e)(Object(q.c)(d.baseUrls,"/api/node/"+d.nodeKey+"/"+d.dataInstanceKey+"/tile/"+(d.dims+"/"+d.level+"/")+(e[0]+"_"+e[1]+"_"+e[2])),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(f.a,a.a));u=d([Object(m.g)()],u)},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"c",function(){return a});m.d(f,
"d",function(){return b});m.d(f,"b",function(){return h});m.d(f,"a",function(){return q});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.COMPRESSED_SEGMENTATION=1]="COMPRESSED_SEGMENTATION"})(a||(a={}));p=function d(){c(this,d)};var b=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);b.RPC_ID="dvid/VolumeChunkSource";var h;(function(a){a[a.JPEG=0]="JPEG"})(h||(h={}));var q=function(a){function b(){c(this,b);return k(this,
(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);q.RPC_ID="dvid/TileChunkSource"},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a){var b=[];Object(K.a)(a,function(a){Object(K.i)(a);b.push(Object(K.l)(a.sectionId))});return b}function b(a,b,c){return Object(y.d)(Object(y.c)(b.baseUrls,"/render-ws/v1/owner/"+b.owner+"/project/"+b.project+"/"+("stack/"+b.stack+"/local-to-world-coordinates"),"PUT"),a,"json",c)}function h(a,c,d,e){var f=
[];Object(K.a)(c,function(a){var b=Object(K.l)(a.pId),c=Object(K.l)(a.qId),d=Object(K.i)(a.matches);a=d.p;d=d.q;for(var e=0;e<a[0].length;e++)f.push({tileId:b,local:[a[0][e],a[1][e]]}),f.push({tileId:c,local:[d[0][e],d[1][e]]})});return b(f,d,e).then(function(b){for(var c=new u.a,d=0;d<b.length;d++){var e=Object(K.i)(b[d]);e=Object(K.g)(e.world);c.appendArray(e)}a.vertexPositions=c.view})}function q(a,b,c,d){if(1===b.length)b="/render-ws/v1/owner/"+c.owner+"/matchCollection/"+(c.matchCollection+"/group/"+
b[0]+"/matchesWith/"+b[0]);else if(2===b.length)b="/render-ws/v1/owner/"+c.owner+"/matchCollection/"+(c.matchCollection+"/group/"+b[0]+"/matchesWith/"+b[1]);else throw Error("Invalid section Id vector of length: "+JSON.stringify(b.length));return Object(y.e)(Object(y.c)(c.baseUrls,b),"json",d).then(function(b){return h(a,b,c,d)})}function l(b,c,d,e){return Object(y.e)(Object(y.c)(d.baseUrls,c),"json",e).then(function(c){return q(b,a(c),d,e)})}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,
"TileChunkSource",function(){return x});m.d(f,"PointMatchSource",function(){return H});p=m(2);f=m(115);var d=m(17),n=m(116),J=m(14),u=m(118),e=m(1),y=m(12),K=m(3);m=m(0);var v=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),w=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?
d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},F=new Map;F.set("jpg",d.a);var x=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=F.get(a.parameters.encoding);var c=a.parameters;var d=[];void 0!==c.channel&&
d.push("channels="+c.channel);void 0!==c.minIntensity&&d.push("minIntensity="+JSON.stringify(c.minIntensity));void 0!==c.maxIntensity&&d.push("maxIntensity="+JSON.stringify(c.maxIntensity));void 0!==c.maxTileSpecsToRender&&d.push("maxTileSpecsToRender="+JSON.stringify(c.maxTileSpecsToRender));void 0!==c.filter&&d.push("filter="+JSON.stringify(c.filter));c=d.join("&");a.queryString=c;return a}c(b,a);v(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,f=a.chunkGridPosition,g=1/Math.pow(2,
d.level);a.chunkDataSize=this.spec.chunkDataSize;var h=a.chunkDataSize[0]*Math.pow(2,d.level),k=a.chunkDataSize[1]*Math.pow(2,d.level),l=e.m.create();l[0]=f[0]*h;l[1]=f[1]*k;l[2]=f[2];return Object(y.e)(Object(y.c)(d.baseUrls,"/render-ws/v1/owner/"+d.owner+"/project/"+d.project+"/stack/"+d.stack+"/z/"+l[2]+"/box/"+l[0]+","+l[1]+","+h+","+k+","+g+"/jpeg-image?"+this.queryString),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(J.a,f.b));x=w([Object(m.g)()],
x);var H=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);v(b,[{key:"download",value:function(a,b){var c=this.parameters,d=a.chunkGridPosition;return l(a,"/render-ws/v1/owner/"+c.owner+"/project/"+c.project+"/"+("stack/"+c.stack+"/sectionData?minZ="+d[2]+"&")+("maxZ="+(d[2]+c.zoffset)),c,b)}}]);return b}(Object(p.WithParameters)(n.a,f.a));H=w([Object(m.g)()],H)},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"b",function(){return a});m.d(f,
"a",function(){return b});p=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(function q(){c(this,q)});var a=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);a.RPC_ID="render/TileChunkSource";var b=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);b.RPC_ID=
"render/PointMatchSource"},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,
enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return q});p=m(20);var a=m(117),b=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,f){c&&a(b.prototype,c);f&&a(b,f);return b}}(),h=function d(a,b,c){null===a&&(a=Function.prototype);var e=Object.getOwnPropertyDescriptor(a,
b);if(void 0===e){if(a=Object.getPrototypeOf(a),null!==a)return d(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}};m=function(a){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));a.source=null;a.vertexPositions=null;a.vertexNormals=null;return a}c(d,a);b(d,[{key:"initializeVolumeChunk",value:function(a,b){h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"initializeVolumeChunk",this).call(this,a,b);a=0;this.vertexPositions&&
(a+=this.vertexPositions.buffer.byteLength);this.vertexNormals&&(a+=this.vertexNormals.buffer.byteLength);this.gpuMemoryBytes=this.systemMemoryBytes=a;this.vertexPositions=null}},{key:"serialize",value:function(a,b){h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"serialize",this).call(this,a,b);var c=this.vertexPositions,f=this.vertexNormals;a.vertexPositions=c;b.push(c.buffer);f&&(a.vertexNormals=f,b.push(f.buffer));this.vertexNormals=this.vertexPositions=null}},{key:"downloadSucceeded",
value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.vertexPositions.byteLength;h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.vertexNormals=this.vertexPositions=null}}]);return d}(p.SliceViewChunk);var q=function(b){function d(b,c){k(this,d);b=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,b,c));b.spec=a.a.fromObject(c.spec);return b}c(d,b);return d}(p.SliceViewChunkSource);q.prototype.chunkConstructor=
m},function(p,f,m){function k(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}m.d(f,"a",function(){return h});var g=m(9),c=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in
d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,f){c&&a(b.prototype,c);f&&a(b,f);return b}}(),a=function l(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return l(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}},b;(function(a){a[a.LINE=0]="LINE";a[a.POINT=1]="POINT"})(b||(b={}));var h=function(b){function d(a){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");
a=(d.__proto__||Object.getPrototypeOf(d)).call(this,a);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}k(d,b);c(d,[{key:"toObject",value:function(){return a(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"toObject",this).call(this)}}],[{key:"make",value:function(a){return new d(Object.assign({},a,{transform:Object(g.k)(a.transform,a.vectorGraphicsSourceOptions)}))}},{key:"fromObject",
value:function(a){return new d(a)}}]);return d}(g.i)},function(p,f,m){m.d(f,"a",function(){return g});var k=function(){function c(a,b){for(var c=0;c<b.length;c++){var f=b[c];f.enumerable=f.enumerable||!1;f.configurable=!0;"value"in f&&(f.writable=!0);Object.defineProperty(a,f.key,f)}}return function(a,b,f){b&&c(a.prototype,b);f&&c(a,f);return a}}(),g=function(){function c(a){a=void 0===a?16:a;if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.length=0;this.data=
new Float32Array(a)}k(c,[{key:"resize",value:function(a){var b=this.data;if(a>b.length){var c=new Float32Array(Math.max(a,2*b.length));c.set(b.subarray(0,this.length));this.data=c}this.length=a}},{key:"shrinkToFit",value:function(){this.data=new Float32Array(this.view)}},{key:"clear",value:function(){this.length=0}},{key:"appendArray",value:function(a){var b=this.length;this.resize(b+a.length);this.data.set(a,b)}},{key:"eraseRange",value:function(a,b){this.data.copyWithin(a,b,this.length);this.length-=
b-a}},{key:"view",get:function(){var a=this.data;return new Float32Array(a.buffer,a.byteOffset,this.length)}}]);return c}()},function(p,f,m){Object.defineProperty(f,"__esModule",{value:!0});m(45)},function(p,f,m){function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){return Object(h.c)(a,b,"fragments")}function b(a,b){var c=(new DataView(b)).getUint32(0,!0);Object(h.d)(a,b,J.b.LITTLE,4,c)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"PrecomputedVolumeChunkSource",
function(){return v});f.decodeManifestChunk=a;f.decodeFragmentChunk=b;m.d(f,"PrecomputedMeshSource",function(){return w});p=m(2);f=m(121);var h=m(18),q=m(25),l=m(17),d=m(19),n=m(14),J=m(13),u=m(12);m=m(0);var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),y=this&&this.__decorate||function(a,b,c,d){var e=
arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},K=new Map;K.set(f.b.RAW,d.a);K.set(f.b.JPEG,l.a);K.set(f.b.COMPRESSED_SEGMENTATION,q.a);var v=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));
a.chunkDecoder=K.get(a.parameters.encoding);return a}c(b,a);e(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=this.computeChunkBounds(a),f=a.chunkDataSize;return Object(u.e)(Object(u.c)(d.baseUrls,d.path+"/"+e[0]+"-"+(e[0]+f[0])+"_"+(e[1]+"-"+(e[1]+f[1])+"_")+(e[2]+"-"+(e[2]+f[2]))),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(n.a,f.c));v=y([Object(m.g)()],v);var w=function(d){function f(){k(this,f);return g(this,(f.__proto__||
Object.getPrototypeOf(f)).apply(this,arguments))}c(f,d);e(f,[{key:"download",value:function(b,c){var d=this.parameters;return Object(u.e)(Object(u.c)(d.baseUrls,d.path+"/"+b.objectId+":"+d.lod),"json",c).then(function(c){return a(b,c)})}},{key:"downloadFragment",value:function(a,c){var d=this.parameters;return Object(u.e)(Object(u.c)(d.baseUrls,d.path+"/"+a.fragmentId),"arraybuffer",c).then(function(c){return b(a,c)})}}]);return f}(Object(p.WithParameters)(h.a,f.a));w=y([Object(m.g)()],w)},function(p,
f,m){function k(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}m.d(f,"b",function(){return g});m.d(f,"c",function(){return c});m.d(f,"a",function(){return a});var g;(function(a){a[a.RAW=0]="RAW";a[a.JPEG=1]="JPEG";a[a.COMPRESSED_SEGMENTATION=2]="COMPRESSED_SEGMENTATION"})(g||(g={}));var c=function h(){k(this,h)};c.RPC_ID="precomputed/VolumeChunkSource";var a=function q(){k(this,q)};a.RPC_ID="precomputed/MeshSource"},function(p,f,m){function k(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function c(a){Object(y.isCompressed)(a)&&(a=Object(y.decompress)(a));var b=new v;b.uncompressedData=a;a=Object(y.readHeader)(a);
if(null===a)throw Error("Failed to parse NIFTI header.");b.header=a;return b}function a(a,b,d,e){return q.a.getData(a,c,b,d,e)}function b(b,c,d){return a(b,c,function(){return{priorityTier:h.d.VISIBLE,priority:1E3}},d).then(function(a){return a.header})}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"NiftiFileData",function(){return v});m.d(f,"NiftiVolumeChunkSource",function(){return F});p=m(2);var h=m(7),q=m(29),l=m(124),d=m(19);f=m(14);var n=m(44),J=m(13),u=m(1),e=m(0),y=m(125);m.n(y);
var K=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}();m=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=
a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f};var v=function H(){g(this,H)},w=new Map([[l.b.INT8,{dataType:n.a.UINT8,volumeType:n.c.IMAGE}],[l.b.UINT8,{dataType:n.a.UINT8,volumeType:n.c.IMAGE}],[l.b.INT16,{dataType:n.a.UINT16,volumeType:n.c.IMAGE}],[l.b.UINT16,{dataType:n.a.UINT16,volumeType:n.c.IMAGE}],[l.b.INT32,{dataType:n.a.UINT32,volumeType:n.c.SEGMENTATION}],[l.b.UINT32,{dataType:n.a.UINT32,volumeType:n.c.SEGMENTATION}],[l.b.INT64,{dataType:n.a.UINT64,
volumeType:n.c.SEGMENTATION}],[l.b.UINT64,{dataType:n.a.UINT64,volumeType:n.c.SEGMENTATION}],[l.b.FLOAT32,{dataType:n.a.FLOAT32,volumeType:n.c.IMAGE}]]);Object(e.e)(l.a,function(a,c){return b(this.getRef(a.chunkManager),a.url,c).then(function(a){var b=w.get(a.datatypeCode);if(void 0===b)throw Error("Unsupported data type: "+((l.b[a.datatypeCode]||a.datatypeCode)+"."));if(1!==a.dims[4])throw Error("Time series data not supported.");var c=1;switch(a.xyzt_units&y.NIFTI1.SPATIAL_UNITS_MASK){case y.NIFTI1.UNITS_METER:c=
1E9;break;case y.NIFTI1.UNITS_MM:c=1E6;break;case y.NIFTI1.UNITS_MICRON:c=1E3}var d=a.quatern_b,e=a.quatern_c,f=a.quatern_d,g=Math.sqrt(1-d*d-e*e-f*f),h=-1===a.pixDims[0]?-1:1,k=a.description;var m=a.affine;m=u.h.fromValues(m[0][0],m[1][0],m[2][0],m[3][0],m[0][1],m[1][1],m[2][1],m[3][1],m[0][2],m[1][2],m[2][2],m[3][2],m[0][3],m[1][3],m[2][3],m[3][3]);return{value:{description:k,affine:m,dataType:b.dataType,numChannels:a.dims[5],volumeType:b.volumeType,voxelSize:u.m.fromValues(c*a.pixDims[1],c*a.pixDims[2],
c*a.pixDims[3]),volumeSize:u.m.fromValues(a.dims[1],a.dims[2],a.dims[3]),qoffset:u.m.fromValues(c*a.qoffset_x,c*a.qoffset_y,c*a.qoffset_z),qform_code:a.qform_code,sform_code:a.sform_code,qfac:h,quatern:u.j.fromValues(d,e,f,g)}}})});var F=function(b){function c(){g(this,c);var a=(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}k(c,b);
K(c,[{key:"download",value:function(b,c){b.chunkDataSize=this.spec.chunkDataSize;return a(this.chunkManager.addRef(),this.parameters.url,function(){return{priorityTier:b.priorityTier,priority:b.priority}},c).then(function(a){var c=Object(y.readImage)(a.header,a.uncompressedData);Object(d.a)(b,c,a.header.littleEndian?J.b.LITTLE:J.b.BIG)})}}]);return c}(Object(p.WithParameters)(f.a,l.c));F=m([Object(e.g)()],F)},function(p,f,m){f.a=function(c){if(c instanceof Object){var a=c[k];void 0===a&&(a=c[k]=g++);
return"o"+a}return""+JSON.stringify(c)};$jscomp.initSymbol();var k=Symbol("objectId"),g=0},function(p,f,m){m.d(f,"b",function(){return k});m.d(f,"c",function(){return g});f.a="nifti/getNiftiVolumeInfo";var k;(function(c){c[c.NONE=0]="NONE";c[c.BINARY=1]="BINARY";c[c.UINT8=2]="UINT8";c[c.INT16=4]="INT16";c[c.INT32=8]="INT32";c[c.FLOAT32=16]="FLOAT32";c[c.COMPLEX64=32]="COMPLEX64";c[c.FLOAT64=64]="FLOAT64";c[c.RGB24=128]="RGB24";c[c.INT8=256]="INT8";c[c.UINT16=512]="UINT16";c[c.UINT32=768]="UINT32";
c[c.INT64=1024]="INT64";c[c.UINT64=1280]="UINT64";c[c.FLOAT128=1536]="FLOAT128";c[c.COMPLEX128=1792]="COMPLEX128";c[c.COMPLEX256=2048]="COMPLEX256"})(k||(k={}));var g=function a(){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");};g.RPC_ID="nifti/VolumeChunkSource"},function(p,f,m){var k=k||{};k.NIFTI1=k.NIFTI1||m(52);k.NIFTI2=k.NIFTI2||m(126);k.Utils=k.Utils||m(30);var g=g||m(27);k.isNIFTI1=function(c){if(c.byteLength<k.NIFTI1.STANDARD_HEADER_SIZE)return!1;var a=new DataView(c);
c=a.getUint8(k.NIFTI1.MAGIC_NUMBER_LOCATION);var b=a.getUint8(k.NIFTI1.MAGIC_NUMBER_LOCATION+1);a=a.getUint8(k.NIFTI1.MAGIC_NUMBER_LOCATION+2);return!(c!==k.NIFTI1.MAGIC_NUMBER[0]||b!==k.NIFTI1.MAGIC_NUMBER[1]||a!==k.NIFTI1.MAGIC_NUMBER[2])};k.isNIFTI2=function(c){if(c.byteLength<k.NIFTI1.STANDARD_HEADER_SIZE)return!1;var a=new DataView(c);c=a.getUint8(k.NIFTI2.MAGIC_NUMBER_LOCATION);var b=a.getUint8(k.NIFTI2.MAGIC_NUMBER_LOCATION+1);a=a.getUint8(k.NIFTI2.MAGIC_NUMBER_LOCATION+2);return!(c!==k.NIFTI2.MAGIC_NUMBER[0]||
b!==k.NIFTI2.MAGIC_NUMBER[1]||a!==k.NIFTI2.MAGIC_NUMBER[2])};k.isNIFTI=function(c){return k.isNIFTI1(c)||k.isNIFTI2(c)};k.isCompressed=function(c){if(c){var a=new DataView(c);c=a.getUint8(0);a=a.getUint8(1);if(c===k.Utils.GUNZIP_MAGIC_COOKIE1||a===k.Utils.GUNZIP_MAGIC_COOKIE2)return!0}return!1};k.decompress=function(c){return g.inflate(c).buffer};k.readHeader=function(c){var a=null;k.isCompressed(c)&&(c=k.decompress(c));k.isNIFTI1(c)?a=new k.NIFTI1:k.isNIFTI2(c)&&(a=new k.NIFTI2);a?a.readHeader(c):
console.error("That file does not appear to be NIFTI!");return a};k.hasExtension=function(c){return 0!=c.extensionFlag[0]};k.readImage=function(c,a){var b=c.vox_offset,f=1,g=1;c.dims[4]&&(f=c.dims[4]);c.dims[5]&&(g=c.dims[5]);return a.slice(b,b+c.numBitsPerVoxel/8*c.dims[2]*c.dims[3]*f*g*c.dims[1])};k.readExtension=function(c,a){var b=c.getExtensionLocation();return a.slice(b,b+c.extensionSize)};k.readExtensionData=function(c,a){var b=c.getExtensionLocation();return a.slice(b+8,b+c.extensionSize-
8)};"undefined"!==typeof p&&p.exports&&(p.exports=k)},function(p,f,m){var k=k||{};k.Utils=k.Utils||m(30);k.NIFTI1=k.NIFTI1||m(52);k.NIFTI2=k.NIFTI2||function(){this.littleEndian=!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=this.xyzt_units=this.scl_inter=
0;this.intent_name=this.aux_file=this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.extensionFlag=[0,0,0,0]};k.NIFTI2.MAGIC_COOKIE=540;k.NIFTI2.MAGIC_NUMBER_LOCATION=4;k.NIFTI2.MAGIC_NUMBER=[110,43,50,0,13,10,26,10];k.NIFTI2.prototype.readHeader=function(f){f=new DataView(f);var c=k.Utils.getIntAt(f,0,this.littleEndian),a,b;c!==k.NIFTI2.MAGIC_COOKIE&&
(this.littleEndian=!0,c=k.Utils.getIntAt(f,0,this.littleEndian));if(c!==k.NIFTI2.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.datatypeCode=k.Utils.getShortAt(f,12,this.littleEndian);this.numBitsPerVoxel=k.Utils.getShortAt(f,14,this.littleEndian);for(a=0;8>a;a+=1)c=16+8*a,this.dims[a]=k.Utils.getLongAt(f,c,this.littleEndian);this.intent_p1=k.Utils.getDoubleAt(f,80,this.littleEndian);this.intent_p2=k.Utils.getDoubleAt(f,88,this.littleEndian);this.intent_p3=k.Utils.getDoubleAt(f,
96,this.littleEndian);for(a=0;8>a;a+=1)c=104+8*a,this.pixDims[a]=k.Utils.getDoubleAt(f,c,this.littleEndian);this.vox_offset=k.Utils.getLongAt(f,168,this.littleEndian);this.scl_slope=k.Utils.getDoubleAt(f,176,this.littleEndian);this.scl_inter=k.Utils.getDoubleAt(f,184,this.littleEndian);this.cal_max=k.Utils.getDoubleAt(f,192,this.littleEndian);this.cal_min=k.Utils.getDoubleAt(f,200,this.littleEndian);this.slice_duration=k.Utils.getDoubleAt(f,208,this.littleEndian);this.toffset=k.Utils.getDoubleAt(f,
216,this.littleEndian);this.slice_start=k.Utils.getLongAt(f,224,this.littleEndian);this.slice_end=k.Utils.getLongAt(f,232,this.littleEndian);this.description=k.Utils.getStringAt(f,240,320);this.aux_file=k.Utils.getStringAt(f,320,344);this.qform_code=k.Utils.getIntAt(f,344,this.littleEndian);this.sform_code=k.Utils.getIntAt(f,348,this.littleEndian);this.quatern_b=k.Utils.getDoubleAt(f,352,this.littleEndian);this.quatern_c=k.Utils.getDoubleAt(f,360,this.littleEndian);this.quatern_d=k.Utils.getDoubleAt(f,
368,this.littleEndian);this.qoffset_x=k.Utils.getDoubleAt(f,376,this.littleEndian);this.qoffset_y=k.Utils.getDoubleAt(f,384,this.littleEndian);this.qoffset_z=k.Utils.getDoubleAt(f,392,this.littleEndian);for(a=0;3>a;a+=1)for(b=0;4>b;b+=1)c=400+8*(4*a+b),this.affine[a][b]=k.Utils.getDoubleAt(f,c,this.littleEndian);this.affine[3][0]=0;this.affine[3][1]=0;this.affine[3][2]=0;this.affine[3][3]=1;this.slice_code=k.Utils.getIntAt(f,496,this.littleEndian);this.xyzt_units=k.Utils.getIntAt(f,500,this.littleEndian);
this.intent_code=k.Utils.getIntAt(f,504,this.littleEndian);this.intent_name=k.Utils.getStringAt(f,508,524);this.dim_info=k.Utils.getByteAt(f,524);f.byteLength>k.NIFTI2.MAGIC_COOKIE&&(this.extensionFlag[0]=k.Utils.getByteAt(f,540),this.extensionFlag[1]=k.Utils.getByteAt(f,541),this.extensionFlag[2]=k.Utils.getByteAt(f,542),this.extensionFlag[3]=k.Utils.getByteAt(f,543),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(f),this.extensionCode=this.getExtensionCode(f)))};k.NIFTI2.prototype.toFormattedString=
function(){var f=k.Utils.formatNumber;var c=""+("Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n");c+="Bits Per Voxel =  = "+this.numBitsPerVoxel+"\n";c+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";c+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";c+="Voxel Dimensions (1-8): "+f(this.pixDims[0])+
", "+f(this.pixDims[1])+", "+f(this.pixDims[2])+", "+f(this.pixDims[3])+", "+f(this.pixDims[4])+", "+f(this.pixDims[5])+", "+f(this.pixDims[6])+", "+f(this.pixDims[7])+"\n";c+="Image Offset = "+this.vox_offset+"\n";c+="Data Scale:  Slope = "+f(this.scl_slope)+"  Intercept = "+f(this.scl_inter)+"\n";c+="Display Range:  Max = "+f(this.cal_max)+"  Min = "+f(this.cal_min)+"\n";c+="Slice Duration = "+this.slice_duration+"\n";c+="Time Axis Shift = "+this.toffset+"\n";c+="Slice Start = "+this.slice_start+
"\n";c+="Slice End = "+this.slice_end+"\n";c+='Description: "'+this.description+'"\n';c+='Auxiliary File: "'+this.aux_file+'"\n';c+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";c+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";c+="Quaternion Parameters:  b = "+f(this.quatern_b)+"  c = "+f(this.quatern_c)+"  d = "+f(this.quatern_d)+"\n";c+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+
this.qoffset_z+"\n";c+="S-Form Parameters X: "+f(this.affine[0][0])+", "+f(this.affine[0][1])+", "+f(this.affine[0][2])+", "+f(this.affine[0][3])+"\n";c+="S-Form Parameters Y: "+f(this.affine[1][0])+", "+f(this.affine[1][1])+", "+f(this.affine[1][2])+", "+f(this.affine[1][3])+"\n";c+="S-Form Parameters Z: "+f(this.affine[2][0])+", "+f(this.affine[2][1])+", "+f(this.affine[2][2])+", "+f(this.affine[2][3])+"\n";c+="Slice Code = "+this.slice_code+"\n";c+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(k.NIFTI1.SPATIAL_UNITS_MASK&
this.xyzt_units)+", "+this.getUnitsCodeString(k.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";c+="Intent Code = "+this.intent_code+"\n";c+='Intent Name: "'+this.intent_name+'"\n';return c+="Dim Info = "+this.dim_info+"\n"};k.NIFTI2.prototype.getExtensionLocation=function(){return k.NIFTI2.MAGIC_COOKIE+4};k.NIFTI2.prototype.getExtensionSize=k.NIFTI1.prototype.getExtensionSize;k.NIFTI2.prototype.getExtensionCode=k.NIFTI1.prototype.getExtensionCode;k.NIFTI2.prototype.getDatatypeCodeString=k.NIFTI1.prototype.getDatatypeCodeString;
k.NIFTI2.prototype.getTransformCodeString=k.NIFTI1.prototype.getTransformCodeString;k.NIFTI2.prototype.getUnitsCodeString=k.NIFTI1.prototype.getUnitsCodeString;k.NIFTI2.prototype.getQformMat=k.NIFTI1.prototype.getQformMat;k.NIFTI2.prototype.convertNiftiQFormToNiftiSForm=k.NIFTI1.prototype.convertNiftiQFormToNiftiSForm;k.NIFTI2.prototype.convertNiftiSFormToNEMA=k.NIFTI1.prototype.convertNiftiSFormToNEMA;k.NIFTI2.prototype.nifti_mat33_mul=k.NIFTI1.prototype.nifti_mat33_mul;k.NIFTI2.prototype.nifti_mat33_determ=
k.NIFTI1.prototype.nifti_mat33_determ;"undefined"!==typeof p&&p.exports&&(p.exports=k.NIFTI2)},function(p,f,m){function k(a){return Object(c.a)(Object(b.a)(a))}Object.defineProperty(f,"__esModule",{value:!0});var g=m(29),c=m(128);p=m(53);var a=m(10),b=m(54);Object(p.a)("vtk",{description:"VTK",getMesh:function(b,c,f,d){return g.a.getData(b.addRef(),k,c,f,d).then(function(b){var c={info:{numTriangles:b.numTriangles,numVertices:b.numVertices,vertexAttributes:[]},indices:b.indices,vertexPositions:b.vertexPositions,
vertexAttributes:[]};b=$jscomp.makeIterator(b.vertexAttributes);for(var d=b.next();!d.done;d=b.next())d=d.value,c.info.vertexAttributes.push({name:d.name,dataType:a.b.FLOAT32,numComponents:d.numComponents}),c.vertexAttributes.push(d.data);return c})}})},function(p,f,m){f.a=function(a){var b=(new TextDecoder).decode(new Uint8Array(a.buffer,a.byteOffset,Math.min(a.byteLength,1E3))).match(k);if(null===b)throw Error("Failed to parse VTK file header.");var c=b[0].length,d=b[4],f=b[3];b={version:b[1],comment:b[2],
datasetType:d,dataFormat:f};a=new Uint8Array(a.buffer,a.byteOffset+c,a.byteLength-c);if("ASCII"===f){f=n.get(d);if(void 0===f)throw Error("VTK dataset type "+JSON.stringify(d)+" is not supported.");return f(b,a)}throw Error("VTK data format "+JSON.stringify(f)+" is not supported.");};var k=/^[ \t]*#[ \t]+vtk[ \t]+DataFile[ \t]+Version[ \t]+([^\s]+)[ \t]*\n(.*)\n[ \t]*(ASCII|BINARY)[ \t]*\n[ \t]*DATASET[ \t]+([^ ]+)[ \t]*\n/,g=/^[ \t]*POINT_DATA[ \t]+([0-9]+)[ \t]*$/,c=/^[ \t]*POINTS[ \t]+([0-9]+)[ \t]+([^\s]+)[ \t]*$/,
a=/^[ \t]*SCALARS[ \t]+([^\s]+)[ \t]+([^\s]+)(?:[ \t]+([0-9]+))?[ \t]*$/,b=/^[ \t]*LOOKUP_TABLE[ \t]+([^\s]+)[ \t]*$/,h=/^[ \t]*POLYGONS[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,q=/^[ \t]*3[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,l=/^[ \t]*$/,d=function u(a,b,c,d,f,h){if(!(this instanceof u))throw new TypeError("Cannot call a class as a function");this.header=a;this.numVertices=b;this.vertexPositions=c;this.numTriangles=d;this.indices=f;this.vertexAttributes=h},n=new Map([["POLYDATA",function(f,
e){function k(a,b,c,d){d=RegExp("^[ \t]*"+"([^s]+)[ \t]+".repeat(c-1)+"([^s]+)[ \t]*$");if(x-H<b)throw Error("VTK data ended unexpectedly while parsing "+a+".");for(var e=new Float32Array(b*c),f=0,h=0;h<b;++h){var g=u[H++],k=g.match(d);if(null===k)throw Error("Failed to parse "+a+" line "+h+": "+JSON.stringify(g)+".");for(g=0;g<c;++g)e[f++]=parseFloat(k[g+1])}return e}function m(a,b){if(void 0!==r)throw Error("POINTS specified more than once.");t=a;A=k("POINTS",a,3,b)}function n(a,b){if(void 0!==
r)throw Error("VERTICES specified more than once.");if(x-H<a)throw Error("VTK data ended unexpectedly");if(b!==4*a)throw Error("Only triangular faces are supported.");I=a;r=new Uint32Array(3*a);for(var c=b=0;c<a;++c){var d=u[H++].match(q);if(null===d)throw Error("Failed to parse indices for face "+c);r[b++]=parseInt(d[1],10);r[b++]=parseInt(d[2],10);r[b++]=parseInt(d[3],10)}}function p(c){if(t!==c)throw Error("Number of vertices specified in POINT_DATA section ("+c+") "+("must match number of points ("+
t+")."));for(;H<x;)if(c=u[H],c.match(l))++H;else{var d=c.match(a);if(null!==d){var e=void 0===d[3]?1:parseInt(d[3],10);++H;c=d[1];d=d[2];if(H===x)throw Error("Expected LOOKUP_TABLE directive.");var f=u[H++],h=f.match(b);if(null===h)throw Error("Expected LOOKUP_TABLE directive in "+JSON.stringify(f)+".");f=h[1];h=k("SCALARS("+c+")",t,e,d);L.push({name:c,data:h,numComponents:e,dataType:d,tableName:f})}}}for(var u=(new TextDecoder).decode(e).split("\n"),x=u.length,H=0,t=-1,A=void 0,I=-1,r=void 0,L=[];H<
x;)if(e=u[H],e.match(l))++H;else{var G=void 0;G=e.match(c);if(null!==G)++H,m(parseInt(G[1],10),G[2]);else if(G=e.match(h),null!==G)++H,n(parseInt(G[1],10),parseInt(G[2],10));else{G=e.match(g);if(null!==G){++H;p(parseInt(G[1],10));break}throw Error("Failed to parse VTK line "+JSON.stringify(e)+".");}}if(void 0===A)throw Error("Vertex positions not specified.");if(void 0===r)throw Error("Indices not specified.");return new d(f,t,A,I,r,L)}]])},function(p,f,m){function k(a,b){if("function"!==typeof b&&
null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"d",function(){return c});f.c="single_mesh/SingleMeshLayer";f.a="single_mesh/getSingleMeshInfo";f.b="";var c=function(a){function b(){g(this,
b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}k(b,a);return b}(function b(){g(this,b)});c.RPC_ID="single_mesh/SingleMeshSource"},function(p,f,m){function k(b){b=(new TextDecoder).decode(Object(a.a)(b)).trim().split(/\n+/);if(!b)throw Error("CSV file is empty.");var f=b[0].split(","),g=f.map(function(a){return{name:a.trim(),
dataType:c.b.FLOAT32,numComponents:1}}),k=b.length-1,d=f.length;f=f.map(function(){return new Float32Array(k)});for(var m=0;m<k;++m)for(var p=b[m+1].split(","),u=0;u<d;++u)f[u][m]=parseFloat(p[u]);return{numVertices:k,attributeInfo:g,attributes:f}}Object.defineProperty(f,"__esModule",{value:!0});var g=m(29);p=m(53);var c=m(10),a=m(54);Object(p.b)("csv",{description:"Comma separated value text file",getMeshVertexAttributes:function(a,c,f,l){return g.a.getData(a.addRef(),k,c,f,l)}})},function(p,f,m){function k(a,
b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?
Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){var c=(new DataView(b)).getUint32(0,!0);Object(h.d)(a,b,u.b.LITTLE,4,c)}Object.defineProperty(f,"__esModule",{value:!0});m.d(f,"PythonVolumeChunkSource",function(){return w});f.decodeFragmentChunk=a;m.d(f,"PythonMeshSource",function(){return F});m.d(f,"PythonSkeletonSource",function(){return x});p=m(2);var b=m(132),h=m(18),q=m(43);f=m(17);var l=m(46),d=m(19),n=m(14),J=m(10),u=m(13),e=m(12);m=m(0);var y=function(){function a(a,b){for(var c=
0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),K=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,
c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},v=new Map;v.set(b.c.NPZ,l.a);v.set(b.c.JPEG,f.a);v.set(b.c.RAW,d.a);var w=function(a){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=v.get(a.parameters.encoding);a.encoding=b.c[a.parameters.encoding].toLowerCase();return a}c(d,a);y(d,[{key:"download",value:function(a,b){var c=this,d=this.parameters;d="/neuroglancer/"+this.encoding+"/"+d.key+"/"+d.scaleKey;for(var f=this.computeChunkBounds(a),
g=a.chunkDataSize,h=0;3>h;++h)d+="/"+f[h]+","+(f[h]+g[h]);return Object(e.e)(Object(e.b)(d),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return d}(Object(p.WithParameters)(n.a,b.d));w=K([Object(m.g)()],w);var F=function(b){function d(){k(this,d);return g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}c(d,b);y(d,[{key:"download",value:function(a){a.fragmentIds=[""];return Promise.resolve(void 0)}},{key:"downloadFragment",value:function(b,c){return Object(e.e)(Object(e.b)("/neuroglancer/mesh/"+
this.parameters.key+"/"+b.manifestChunk.objectId),"arraybuffer",c).then(function(c){return a(b,c)})}}]);return d}(Object(p.WithParameters)(h.a,b.a));F=K([Object(m.g)()],F);var x=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);y(b,[{key:"download",value:function(a,b){var c=this.parameters;return Object(e.e)(Object(e.b)("/neuroglancer/skeleton/"+c.key+"/"+a.objectId),"arraybuffer",b).then(function(b){var d=c.vertexAttributes,e=new DataView(b),
f=e.getUint32(0,!0);e=e.getUint32(4,!0);var g=8+12*f,h=[];d=$jscomp.makeIterator(d.values());for(var k=d.next();!k.done;k=d.next()){k=k.value;k=J.a[k.dataType]*k.numComponents;var l=k*f,m=new Uint8Array(b,g,l);switch(k){case 2:Object(u.c)(m,u.b.LITTLE);break;case 4:case 8:Object(u.d)(m,u.b.LITTLE)}h.push(m);g+=l}a.vertexAttributes=h;Object(q.b)(a,b,u.b.LITTLE,8,f,g,e)})}}]);return b}(Object(p.WithParameters)(q.a,b.b));x=K([Object(m.g)()],x)},function(p,f,m){function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function g(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}m.d(f,"c",function(){return a});m.d(f,
"d",function(){return b});m.d(f,"a",function(){return h});m.d(f,"b",function(){return q});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.NPZ=1]="NPZ";a[a.RAW=2]="RAW"})(a||(a={}));p=function d(){c(this,d)};var b=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);b.RPC_ID="python/VolumeChunkSource";var h=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);
h.RPC_ID="python/MeshSource";var q=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);q.RPC_ID="python/SkeletonSource"}]);
