/*

 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,l,f){p!=Array.prototype&&p!=Object.prototype&&(p[l]=f.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 l=0;return $jscomp.iteratorPrototype(function(){return l<p.length?{done:!1,value:p[l++]}:{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 l=p[Symbol.iterator];return l?l.call(p):$jscomp.arrayIterator(p)};$jscomp.arrayFromIterator=function(p){for(var l,f=[];!(l=p.next()).done;)f.push(l.value);return f};$jscomp.arrayFromIterable=function(p){return p instanceof Array?p:$jscomp.arrayFromIterator($jscomp.makeIterator(p))};
$jscomp.owns=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)};$jscomp.polyfill=function(p,l,f,k){if(l){f=$jscomp.global;p=p.split(".");for(k=0;k<p.length-1;k++){var g=p[k];g in f||(f[g]={});f=f[g]}p=p[p.length-1];k=f[p];l=l(k);l!=k&&null!=l&&$jscomp.defineProperty(f,p,{configurable:!0,writable:!0,value:l})}};
$jscomp.polyfill("WeakMap",function(p){function l(a){$jscomp.owns(a,k)||$jscomp.defineProperty(a,k,{value:{}})}function f(a){var b=Object[a];b&&(Object[a]=function(a){l(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(n){return!1}}())return p;var k="$jscomp_hidden_"+Math.random().toString().substring(2);f("freeze");f("preventExtensions");
f("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){l(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 n=c.entries(),m=n.next();if(m.done||m.value[0]!=a||"s"!=m.value[1])return!1;m=n.next();return m.done||4!=m.value[0].x||"t"!=m.value[1]||!n.next().done?!1:!0}catch(h){return!1}}())return p;$jscomp.initSymbol();
$jscomp.initSymbolIterator();var l=new WeakMap,f=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])}};f.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};f.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};f.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=c();this.size=0};f.prototype.has=function(a){return!!k(this,a).entry};f.prototype.get=function(a){return(a=k(this,a).entry)&&a.value};f.prototype.entries=function(){return g(this,function(a){return[a.key,
a.value]})};f.prototype.keys=function(){return g(this,function(a){return a.key})};f.prototype.values=function(){return g(this,function(a){return a.value})};f.prototype.forEach=function(a,c){for(var b=this.entries(),e;!(e=b.next()).done;)e=e.value,a.call(c,e[1],e[0],this)};f.prototype[Symbol.iterator]=f.prototype.entries;var k=function(b,c){var e=c&&typeof c;"object"==e||"function"==e?l.has(c)?e=l.get(c):(e=""+ ++a,l.set(c,e)):e="p_"+c;var m=b.data_[e];if(m&&$jscomp.owns(b.data_,e))for(b=0;b<m.length;b++){var h=
m[b];if(c!==c&&h.key!==h.key||c===h.key)return{id:e,list:m,index:b,entry:h}}return{id:e,list:m,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 f},"es6","es3");
$jscomp.iteratorFromArray=function(p,l){$jscomp.initSymbolIterator();p instanceof String&&(p+="");var f=0,k={next:function(){if(f<p.length){var g=f++;return{value:l(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(l,f){return f})}},"es6","es3");
$jscomp.polyfill("Number.isNaN",function(p){return p?p:function(l){return"number"===typeof l&&isNaN(l)}},"es6","es3");$jscomp.polyfill("Number.isFinite",function(p){return p?p:function(l){return"number"!==typeof l?!1:!isNaN(l)&&Infinity!==l&&-Infinity!==l}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(p){return p?p:function(){return $jscomp.iteratorFromArray(this,function(l){return l})}},"es6","es3");
$jscomp.polyfill("Number.isInteger",function(p){return p?p:function(l){return Number.isFinite(l)?l===Math.floor(l):!1}},"es6","es3");$jscomp.polyfill("Array.from",function(p){return p?p:function(l,f,k){$jscomp.initSymbolIterator();f=null!=f?f:function(a){return a};var g=[],c=l[Symbol.iterator];if("function"==typeof c)for(l=c.call(l);!(c=l.next()).done;)g.push(f.call(k,c.value));else{c=l.length;for(var a=0;a<c;a++)g.push(f.call(k,l[a]))}return g}},"es6","es3");
$jscomp.checkStringArgs=function(p,l,f){if(null==p)throw new TypeError("The 'this' value for String.prototype."+f+" must not be null or undefined");if(l instanceof RegExp)throw new TypeError("First argument to String.prototype."+f+" must not be a regular expression");return p+""};
$jscomp.polyfill("String.prototype.startsWith",function(p){return p?p:function(l,f){var k=$jscomp.checkStringArgs(this,l,"startsWith");l+="";var g=k.length,c=l.length;f=Math.max(0,Math.min(f|0,k.length));for(var a=0;a<c&&f<g;)if(k[f++]!=l[a++])return!1;return a>=c}},"es6","es3");$jscomp.polyfill("Math.log2",function(p){return p?p:function(l){return Math.log(l)/Math.LN2}},"es6","es3");
$jscomp.polyfill("String.prototype.repeat",function(p){return p?p:function(l){var f=$jscomp.checkStringArgs(this,null,"repeat");if(0>l||1342177279<l)throw new RangeError("Invalid count value");l|=0;for(var k="";l;)if(l&1&&(k+=f),l>>>=1)f+=f;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 f=Object.seal({x:4}),k=new p($jscomp.makeIterator([f]));if(!k.has(f)||1!=k.size||k.add(f)!=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]!=f||c.value[1]!=f)return!1;c=g.next();return c.done||c.value[0]==f||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 l=function(f){this.map_=new Map;if(f){f=$jscomp.makeIterator(f);for(var k;!(k=f.next()).done;)this.add(k.value)}this.size=this.map_.size};l.prototype.add=function(f){this.map_.set(f,f);this.size=this.map_.size;return this};l.prototype.delete=function(f){f=this.map_.delete(f);this.size=this.map_.size;return f};l.prototype.clear=function(){this.map_.clear();this.size=0};l.prototype.has=function(f){return this.map_.has(f)};l.prototype.entries=function(){return this.map_.entries()};
l.prototype.values=function(){return this.map_.values()};l.prototype.keys=l.prototype.values;l.prototype[Symbol.iterator]=l.prototype.values;l.prototype.forEach=function(f,k){var g=this;this.map_.forEach(function(c){return f.call(k,c,c,g)})};return l},"es6","es3");$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(p){function l(){this.batch_=null}function f(a){return a instanceof g?a:new g(function(b,c){b(a)})}if(p&&!$jscomp.FORCE_POLYFILL_PROMISE)return p;l.prototype.asyncExecute=function(a){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(a);return this};l.prototype.asyncExecuteBatch_=function(){var a=this;this.asyncExecuteFunction(function(){a.executeBatch_()})};var k=$jscomp.global.setTimeout;l.prototype.asyncExecuteFunction=function(a){k(a,
0)};l.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(n){this.asyncThrow_(n)}}}this.batch_=null};l.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(e){b.reject(e)}};g.prototype.createResolveAndReject_=
function(){function a(a){return function(e){c||(c=!0,a.call(b,e))}}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(e){this.reject_(e);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 l;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(n){c.reject(n)}};g.prototype.then=function(a,b){function c(a,b){return"function"==typeof a?function(b){try{n(a(b))}catch(q){m(q)}}:b}var n,m,h=new g(function(a,
b){n=a;m=b});this.callWhenSettled_(c(a,n),c(b,m));return h};g.prototype.catch=function(a){return this.then(void 0,a)};g.prototype.callWhenSettled_=function(a,b){function e(){switch(n.state_){case 1:a(n.result_);break;case 2:b(n.result_);break;default:throw Error("Unexpected state: "+n.state_);}}var n=this;null==this.onSettledCallbacks_?c.asyncExecute(e):this.onSettledCallbacks_.push(function(){c.asyncExecute(e)})};g.resolve=f;g.reject=function(a){return new g(function(b,c){c(a)})};g.race=function(a){return new g(function(b,
c){for(var e=$jscomp.makeIterator(a),m=e.next();!m.done;m=e.next())f(m.value).callWhenSettled_(b,c)})};g.all=function(a){var b=$jscomp.makeIterator(a),c=b.next();return c.done?f([]):new g(function(a,e){function h(b){return function(c){d[b]=c;m--;0==m&&a(d)}}var d=[],m=0;do d.push(void 0),m++,f(c.value).callWhenSettled_(h(d.length-1),e),c=b.next();while(!c.done)})};return g},"es6","es3");
$jscomp.polyfill("Object.assign",function(p){return p?p:function(l,f){for(var k=1;k<arguments.length;k++){var g=arguments[k];if(g)for(var c in g)$jscomp.owns(g,c)&&(l[c]=g[c])}return l}},"es6","es3");$jscomp.polyfill("Array.prototype.entries",function(p){return p?p:function(){return $jscomp.iteratorFromArray(this,function(l,f){return[l,f]})}},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(p){return p?p:function(l,f,k){var g=this.length||0;0>f&&(f=Math.max(0,g+f));if(null==k||k>g)k=g;k=Number(k);0>k&&(k=Math.max(0,g+k));for(f=Number(f||0);f<k;f++)this[f]=l;return this}},"es6","es3");
$jscomp.polyfill("Array.prototype.copyWithin",function(p){return p?p:function(l,f,k){var g=this.length;l=Number(l);f=Number(f);k=Number(null!=k?k:g);if(l<f)for(k=Math.min(k,g);f<k;)f in this?this[l++]=this[f++]:(delete this[l++],f++);else for(k=Math.min(k,g+f-l),l+=k-f;k>f;)--k in this?this[--l]=this[k]:delete this[l];return this}},"es6","es3");
(function(p){function l(k){if(f[k])return f[k].exports;var g=f[k]={i:k,l:!1,exports:{}};p[k].call(g.exports,g,g.exports,l);g.l=!0;return g.exports}var f={};l.m=p;l.c=f;l.d=function(k,g,c){l.o(k,g)||Object.defineProperty(k,g,{configurable:!1,enumerable:!0,get:c})};l.n=function(k){var g=k&&k.__esModule?function(){return k["default"]}:function(){return k};l.d(g,"a",g);return g};l.o=function(k,g){return Object.prototype.hasOwnProperty.call(k,g)};l.p="";return l(l.s=51)})([function(p,l,f){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){d.set(a,b)}function b(a,b,c){c=void 0===c?{}:c;null!=b&&a.initializeSharedObject(b,c.id)}l.f=a;l.e=function(b,c){a(b,function(a){var b=this,r=a.id,d=new e.b;a=c.call(this,a,d);this.set(r,{promise:a,cancellationToken:d});a.then(function(a){var c=a.value;a=a.transfers;b.delete(r);b.invoke("rpc.promise.response",{id:r,value:c},a)},function(a){b.delete(r);b.invoke("rpc.promise.response",{id:r,error:a.message,errorName:a.name})})})};f.d(l,"a",function(){return q});
f.d(l,"b",function(){return w});l.d=b;f.d(l,"c",function(){return E});l.h=function(a){return function(b){b.prototype.RPC_TYPE_ID=a}};l.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");u.set(a,b)}};var e=f(14);p=f(15);var n=function G(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 G(a,
b,c)}else{if("value"in r)return r.value;b=r.get;return void 0===b?void 0:b.call(c)}},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,r){c&&a(b.prototype,c);r&&a(b,r);return b}}(),h=!("undefined"!==typeof Window&&self instanceof Window),d=new Map,v=function(a){function b(a,c){k(this,b);var r=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,c));
r.name=a;r.message=c;return r}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),r=c.resolve;c=c.reject;this.delete(b);a.hasOwnProperty("value")?r(a.value):a.errorName===e.a.name?c(e.a):c(new v(a.errorName,a.error))});var x=h?-1:0,q=function(){function a(b){var c=this;k(this,a);this.target=b;this.objects=new Map;this.nextId=x;b.onmessage=function(a){a=a.data;d.get(a.functionName).call(c,
a)}}m(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,d){var r=this;c=void 0===c?e.e:c;return Object(e.d)(c,function(c,h,q){var t=b.id=r.newId();r.set(t,
{resolve:c,reject:h});r.invoke(a,b,d);q.add(function(){r.invoke("rpc.promise.cancel",{id:t})})})}},{key:"newId",value:function(){return h?this.nextId--:this.nextId++}},{key:"numObjects",get:function(){return this.objects.size}}]);return a}(),w=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);m(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(){n(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}):n(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"refCountReachedZero",this).call(this)}},{key:"ownerDispose",value:function(){var a=this.rpc,c=this.rpcId;n(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),E=function(a){function d(a,c){c=void 0===c?{}:c;k(this,d);var r=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));b(r,a,c);return r}c(d,a);return d}(w);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 u=new Map;a("SharedObject.new",function(a){--(new (u.get(a.type))(this,a)).refCount})},function(p,l,f){function k(a,c){var b=Math.abs(a[c]),e=Math.abs(a[c+1]),h=Math.abs(a[c+2]),d=Math.max(b,e,h);1E-4>b/d&&(a[c]=0);1E-4>e/d&&(a[c+1]=0);1E-4>h/d&&(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}l.i=function(a){return a[0]*a[1]*a[2]};l.n=function(a){return a[0]+","+a[1]+","+a[2]};l.k=function(a){k(a,0);k(a,4);k(a,8)};l.l=function(a,c,n){var b=c[0],h=c[1];c=c[2];a[0]=n[0]*b+n[4]*h+n[8]*c;a[1]=n[1]*b+n[5]*h+n[9]*c;a[2]=n[2]*b+n[6]*h+n[10]*c;return a};l.b=function(a,c){var b=c[0],m=c[1],h=c[2],d=c[4],e=c[5],x=c[6],q=c[8],w=c[9];c=c[10];a[0]=Math.sqrt(b*b+m*m+h*h);a[1]=Math.sqrt(d*d+e*e+x*x);a[2]=Math.sqrt(q*q+w*w+c*c);return a};l.a=function(a){if(a.high)throw Error("Fragment ids >= 2^32 not supported yet");
var b=g(a.rshift(0)),n=g(a.rshift(1));a=g(a.rshift(2));return c.c.clone([b.low,n.low,a.low])};var c=f(31);p=f(7);f.d(l,"h",function(){return c.a});f.d(l,"j",function(){return c.b});f.d(l,"m",function(){return c.c});f=c.a.create();l.c=f;f=[c.c.fromValues(1,0,0),c.c.fromValues(0,1,0),c.c.fromValues(0,0,1)];l.d=f;f=c.c.fromValues(0,0,0);l.g=f;f=c.c.fromValues(1,1,1);l.f=f;f=c.c.fromValues(Infinity,Infinity,Infinity);l.e=f;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,l,f){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 m.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 r(new q.a(a),d.a)}function e(a,b,c,d,r,h){for(;1>b.availableItems||b.availableSize<a;){var q=r.next().value;if(void 0===q)return!1;var t=q.priorityTier;if(t<c||t===c&&q.priority>=d)return!1;h(q)}return!0}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"Chunk",function(){return G});f.d(l,"ChunkSourceBase",function(){return B});f.d(l,"ChunkSource",function(){return H});f.d(l,"ChunkQueueManager",function(){return L});f.d(l,"ChunkManager",function(){return t});
l.WithParameters=function(a,b){a=function(a){function b(a){for(var d=[],r=0;r<arguments.length;++r)d[r-0]=arguments[r];c(this,b);var h;r=k(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],$jscomp.arrayFromIterable(d))));r.parameters=d[1].parameters;return r}g(b,a);return b}(a);return a=C([Object(E.h)(b.RPC_ID)],a)};l.withChunkManager=function(a){return function(a){function b(a){for(var d=[],r=0;r<arguments.length;++r)d[r-0]=arguments[r];c(this,b);var h;r=k(this,(h=b.__proto__||
Object.getPrototypeOf(b)).call.apply(h,[].concat([this],$jscomp.arrayFromIterable(d))));r.chunkManager=d[0].get(d[1].chunkManager);return r}g(b,a);return b}(a)};var n=f(6),m=f(14);p=f(15);var h=f(53),d=f(54),v=f(30),x=f(60),q=f(61),w=f(8),E=f(0),u=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}}(),C=this&&this.__decorate||
function(a,b,c,d){var r=arguments.length,h=3>r?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,q;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var t=a.length-1;0<=t;t--)if(q=a[t])h=(3>r?q(h):3<r?q(b,c,h):q(b,c))||h;return 3<r&&h&&Object.defineProperty(b,c,h),h},G=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=n.e.NEW;this.error=null;this.newPriority=
this.priority=0;this.newPriorityTier=this.priorityTier=n.d.RECENT;this.backendOnly=!1;this.downloadCancellationToken=void 0}u(a,[{key:"initialize",value:function(a){this.key=a;this.state=n.e.NEW;this.priority=Number.NEGATIVE_INFINITY;this.priorityTier=n.d.RECENT;this.newPriority=Number.NEGATIVE_INFINITY;this.newPriorityTier=n.d.RECENT;this.error=null}},{key:"updatePriorityProperties",value:function(){this.priorityTier=this.newPriorityTier;this.priority=this.newPriority;this.newPriorityTier=n.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,n.e.FAILED)}},{key:"downloadSucceeded",value:function(){this.queueManager.updateChunkState(this,n.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}(),B=function(a){function b(a){c(this,b);var d=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));d.chunkManager=a;d.chunks=new Map;d.freeChunks=[];return d}g(b,a);u(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}(E.b),H=function(a){function b(a,d){c(this,b);var r=a.get(d.chunkManager);r=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,
r));Object(E.d)(r,a,d);return r}g(b,a);return b}(B),r=function(){function a(b,d){c(this,a);this.heapOperations=b;this.linkedListOperations=d;this.heapRoots=[null,null];this.recentHead=new G;d.initializeHead(this.recentHead)}u(a,[{key:"add",value:function(a){var b=a.priorityTier;if(b===n.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(u.heapOperations.compare!==
G.priorityLess){b=1;break}E=u;k=E.linkedListOperations;g=E.recentHead;case 3:z=k.back(g);if(null!=z){b=5;break}b=4;break;case 5:return b=7,{value:z,done:!1};case 7:if(void 0===f){b=8;break}b=-1;throw f;case 8:case 6:b=3;break;case 4:w=u,x=w.heapRoots,v=n.d.LAST_ORDERED_TIER;case 9:if(!(v>=n.d.FIRST_ORDERED_TIER)){b=11;break}case 12:e=x[v];if(null!=e){b=14;break}b=13;break;case 14:return b=16,{value:e,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:--v;
b=9;break;case 11:b=2;break;case 1:m=u.heapRoots,t=n.d.FIRST_ORDERED_TIER;case 18:if(!(t<=n.d.LAST_ORDERED_TIER)){b=20;break}case 21:q=m[t];if(null!=q){b=23;break}b=22;break;case 23:return b=25,{value:q,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:++t;b=18;break;case 20:h=u,r=h.linkedListOperations,d=h.recentHead;case 27:c=r.front(d);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,d,r,h,q,t,m,e,v,x,w,z,g,k,E,u=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===n.d.RECENT)this.linkedListOperations.pop(a);else{var c=this.heapRoots;c[b]=this.heapOperations.remove(c[b],
a)}}}]);return a}(),z=function(a){function b(a,d){c(this,b);var r=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));r.itemLimit=a;r.sizeLimit=d;r.currentSize=0;r.currentItems=0;r.capacityChanged=new w.a;r.registerDisposer(a.changed.add(r.capacityChanged.dispatch));r.registerDisposer(d.changed.add(r.capacityChanged.dispatch));return r}g(b,a);u(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),L=function(d){function q(a,d){c(this,q);var t=k(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,a,d));t.queuedPromotionQueue=b(G.priorityGreater);t.downloadEvictionQueue=b(G.priorityLess);t.systemMemoryEvictionQueue=new r(new x.a(G.priorityLess),h.a);t.gpuMemoryPromotionQueue=b(G.priorityGreater);t.gpuMemoryEvictionQueue=b(G.priorityLess);t.updatePending=null;t.numQueued=0;t.numFailed=0;var m=
function(b){b=t.registerDisposer(new z(a.get(b.itemLimit),a.get(b.sizeLimit)));b.capacityChanged.add(function(){return t.scheduleUpdate()});return b};t.gpuMemoryCapacity=m(d.gpuMemoryCapacity);t.systemMemoryCapacity=m(d.systemMemoryCapacity);t.downloadCapacity=m(d.downloadCapacity);return t}g(q,d);u(q,[{key:"scheduleUpdate",value:function(){null===this.updatePending&&(this.updatePending=setTimeout(this.process.bind(this),0))}},{key:"chunkQueuesForChunk",value:function(a){function b(b,t){for(;;)switch(c){case 0:r=
!1;d=a.state;if(!r&&d!==n.e.QUEUED){c=2;break}r=!0;c=3;return{value:h.queuedPromotionQueue,done:!1};case 3:if(void 0===t){c=4;break}c=-1;throw t;case 4:c=1;break;case 2:if(!r&&d!==n.e.DOWNLOADING){c=5;break}r=!0;c=6;return{value:h.downloadEvictionQueue,done:!1};case 6:if(void 0===t){c=7;break}c=-1;throw t;case 7:return c=8,{value:h.systemMemoryEvictionQueue,done:!1};case 8:if(void 0===t){c=9;break}c=-1;throw t;case 9:c=1;break;case 5:if(r||d===n.e.SYSTEM_MEMORY_WORKER)r=!0;if(!r&&d!==n.e.SYSTEM_MEMORY){c=
10;break}r=!0;c=11;return{value:h.systemMemoryEvictionQueue,done:!1};case 11:if(void 0===t){c=12;break}c=-1;throw t;case 12:if(a.priorityTier===n.d.RECENT||a.backendOnly){c=13;break}c=14;return{value:h.gpuMemoryPromotionQueue,done:!1};case 14:if(void 0===t){c=15;break}c=-1;throw t;case 15:case 13:c=1;break;case 10:if(!r&&d!==n.e.GPU_MEMORY){c=16;break}r=!0;c=17;return{value:h.systemMemoryEvictionQueue,done:!1};case 17:if(void 0===t){c=18;break}c=-1;throw t;case 18:return c=19,{value:h.gpuMemoryEvictionQueue,
done:!1};case 19:if(void 0===t){c=20;break}c=-1;throw t;case 20:c=1;break;case 16:case 1:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,r,h=this,t={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();t[Symbol.iterator]=function(){return this};return t}},{key:"adjustCapacitiesForChunk",value:function(a,b){b=b?-1:1;switch(a.state){case n.e.FAILED:this.numFailed-=b;break;case n.e.QUEUED:this.numQueued-=
b;break;case n.e.DOWNLOADING:this.downloadCapacity.adjust(b,0);this.systemMemoryCapacity.adjust(b,0);break;case n.e.SYSTEM_MEMORY:case n.e.SYSTEM_MEMORY_WORKER:this.systemMemoryCapacity.adjust(b,b*a.systemMemoryBytes);break;case n.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===n.e.QUEUED&&a.priorityTier===n.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=n.d.RECENT,a.newPriority=Number.NEGATIVE_INFINITY):(this.removeChunkFromQueues_(a),a.updatePriorityProperties(),
a.state===n.e.NEW&&(a.state=n.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,n.e.SYSTEM_MEMORY)}for(var b=this,c=
this.gpuMemoryPromotionQueue.candidates(),d=this.gpuMemoryEvictionQueue.candidates(),r=this.gpuMemoryCapacity;;){var t=c.next().value;if(void 0===t)break;else{if(!e(t.gpuMemoryBytes,r,t.priorityTier,t.priority,d,a))break;this.copyChunkToGPU(t);this.updateChunkState(t,n.e.GPU_MEMORY)}}}},{key:"freeChunkGPUMemory",value:function(a){this.rpc.invoke("Chunk.update",{id:a.key,state:n.e.SYSTEM_MEMORY,source:a.source.rpcId})}},{key:"freeChunkSystemMemory",value:function(a){a.state===n.e.SYSTEM_MEMORY_WORKER?
a.freeSystemMemory():this.rpc.invoke("Chunk.update",{id:a.key,state:n.e.EXPIRED,source:a.source.rpcId})}},{key:"copyChunkToGPU",value:function(a){var b=this.rpc;if(a.state===n.e.SYSTEM_MEMORY)b.invoke("Chunk.update",{id:a.key,source:a.source.rpcId,state:n.e.GPU_MEMORY});else{var c={},d=[];a.serialize(c,d);c.state=n.e.GPU_MEMORY;b.invoke("Chunk.update",c,d)}}},{key:"processQueuePromotions_",value:function(){for(var b=this,c=this,d=function(a){switch(a.state){case n.e.DOWNLOADING:var d=a.downloadCancellationToken;
a.downloadCancellationToken=void 0;d.cancel();break;case n.e.GPU_MEMORY:c.freeChunkGPUMemory(a);case n.e.SYSTEM_MEMORY_WORKER:case n.e.SYSTEM_MEMORY:c.freeChunkSystemMemory(a)}b.updateChunkState(a,n.e.QUEUED)},r=this.queuedPromotionQueue.candidates(),t=this.downloadEvictionQueue.candidates(),h=this.systemMemoryEvictionQueue.candidates(),q=this.downloadCapacity,m=this.systemMemoryCapacity;;){var v=r.next();if(v.done)break;v=v.value;var x=v.priorityTier,w=v.priority;if(!e(0,q,x,w,t,d))break;if(!e(0,
m,x,w,h,d))break;this.updateChunkState(v,n.e.DOWNLOADING);a(v)}}},{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 n.e.DOWNLOADING:var d=c.downloadCancellationToken;c.downloadCancellationToken=
void 0;d.cancel();break;case n.e.SYSTEM_MEMORY_WORKER:c.freeSystemMemory()}this.updateChunkState(c,n.e.QUEUED)}this.rpc.invoke("Chunk.update",{source:a.rpcId});this.scheduleUpdate()}}]);return q}(E.c);L=C([Object(E.g)(n.b)],L);var t=function(a){function b(a,d){c(this,b);var r=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));r.existingTierChunks=[];r.newTierChunks=[];r.updatePending=null;r.recomputeChunkPriorities=new w.a;r.recomputeChunkPrioritiesLate=new w.a;r.memoize=new v.a;r.queueManager=
a.get(d.chunkQueueManager).addRef();for(a=n.d.FIRST_TIER;a<=n.d.LAST_TIER;++a)a!==n.d.RECENT&&(r.existingTierChunks[a]=[]);return r}g(b,a);u(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([n.d.VISIBLE])}},
{key:"requestChunk",value:function(a,b,c){a.newPriorityTier===n.d.RECENT&&this.newTierChunks.push(a);a.newPriorityTier=b;a.newPriority=c}},{key:"updateQueueState",value:function(a){var b=this.existingTierChunks,c=this.queueManager;a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){var r=b[d.value],t=$jscomp.makeIterator(r);for(d=t.next();!d.done;d=t.next())d=d.value,d.newPriorityTier===n.d.RECENT&&c.performChunkPriorityUpdate(d);r.length=0}a=this.newTierChunks;r=$jscomp.makeIterator(a);
for(d=r.next();!d.done;d=r.next())d=d.value,c.performChunkPriorityUpdate(d),b[d.priorityTier].push(d);a.length=0;this.queueManager.scheduleUpdate()}}]);return b}(E.c);t=C([Object(E.g)(n.a)],t);Object(E.f)(n.c,function(a){a=this.get(a.id);a.chunkManager.queueManager.invalidateSourceCache(a)})},function(p,l,f){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,h=0;if(h<d)for(b+=c(a[h]);++h<d;)b+=",",b+=c(a[h]);return b+"]"}b="{";d=Object.keys(a).sort();h=0;var m=d.length;if(h<m){var e=d[h];b+=JSON.stringify(e);for(b=b+
":"+c(a[e]);++h<m;)b+=",",e=d[h],b+=JSON.stringify(e),b+=":",b+=c(a[e])}return b+"}"}return JSON.stringify(a)}function a(a){for(var b="";0<a.length;){var c=a.match(m);if(null===c){var d=a;c=a=""}else{d=a.substr(0,c.index);a=a.substr(c.index+c[0].length);var e=c[1];if(void 0!==e){if(c=e,2<=c.length&&"'"===c.charAt(0)&&"'"===c.charAt(c.length-1)){c=c.substr(1,c.length-2);for(e='"';0<c.length;){var n=c.match(h);if(null===n){e+=c;break}e+=n[1];'"'===n[2]?(e+="\\",e+='"'):e+="'";c=c.substr(n.index+n[0].length)}c=
e+'"'}}else c=c[2]}b+=d.replace(/\(/g,"[").replace(/\)/g,"]").replace("True","true").replace("False","false").replace(/,\s*([\}\]])/g,"$1");b+=c}return b}function b(a,b,c){var d=a.length;if(!Array.isArray(b)||b.length!==d)throw Error("Expected length "+d+" array, but received: "+JSON.stringify(b)+".");for(var h=0;h<d;++h)a[h]=c(b[h],h);return a}function e(a){if("string"!==typeof a)throw Error("Expected string, but received: "+JSON.stringify(a)+".");return a}l.b=function(a,b){var c=a.length;if(!Array.isArray(b)||
b.length!==c)throw Error("Incompatible sizes");for(var d=0;d<c;++d)if(!Number.isFinite(parseFloat(b[d])))throw Error("Non-finite value.");for(d=0;d<c;++d)a[d]=parseFloat(b[d]);return a};l.e=c;l.d=function(b){return JSON.parse(a(b))};l.a=function(a,b){if(!Array.isArray(a))throw Error("Expected array, but received: "+JSON.stringify(a)+".");return a.map(b)};l.c=b;l.i=function(a){if("object"!==typeof a||null==a||Array.isArray(a))throw Error("Expected JSON object, but received: "+JSON.stringify(a)+".");
return a};l.l=e;l.k=function(a){if(void 0!==a)return e(a)};l.j=function(a,b,c){a=a.hasOwnProperty(b)?a[b]:void 0;try{return c(a)}catch(q){throw Error("Error parsing "+JSON.stringify(b)+" property: "+q.message);}};l.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)+".");};l.g=function(a){return b(n.m.create(),a,k)};l.f=function(a){return b(n.m.create(),a,g)};l.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 n=f(1),m=new RegExp(/('(?:[^'\\]|(?:\\.))*')/.source+"|"+/("(?:[^'\\]|(?:\\.))*")/.source),h=/^((?:[^"'\\]|(?:\\[^']))*)("|\\')/},function(p,l,f){f.d(l,"a",function(){return k});l.b=1E-6;var k="undefined"!==typeof Float32Array?Float32Array:Array;l.c=Math.random},function(p,l,f){p="undefined"!==typeof Uint8Array&&
"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;l.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 e in b)Object.prototype.hasOwnProperty.call(b,e)&&(c[e]=b[e])}}return c};l.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,e,n){if(a.subarray&&c.subarray)c.set(a.subarray(b,
b+e),n);else for(var m=0;m<e;m++)c[n+m]=a[b+m]},flattenChunks:function(c){var a,b;var e=b=0;for(a=c.length;e<a;e++)b+=c[e].length;var n=new Uint8Array(b);e=b=0;for(a=c.length;e<a;e++){var m=c[e];n.set(m,b);b+=m.length}return n}},g={arraySet:function(c,a,b,e,n){for(var m=0;m<e;m++)c[n+m]=a[b+m]},flattenChunks:function(c){return[].concat.apply([],c)}};l.setTyped=function(c){c?(l.Buf8=Uint8Array,l.Buf16=Uint16Array,l.Buf32=Int32Array,l.assign(l,k)):(l.Buf8=Array,l.Buf16=Array,l.Buf32=Array,l.assign(l,
g))};l.setTyped(p)},function(p,l,f){f.d(l,"e",function(){return k});f.d(l,"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={}));l.f=1E13;l.b="ChunkQueueManager";l.a="ChunkManager";l.c="ChunkSource.invalidate"},function(p,l,f){f.d(l,"a",function(){return n});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,m){c&&a(b.prototype,c);m&&a(b,m);return b}}(),
g=new Uint32Array(2),c=[];for(p=2;36>=p;++p){l=Math.floor(32/Math.log2(p));f=Math.pow(p,l);var a=Math.floor(l/2),b=Math.pow(p,a);a=Math.pow(p,l-a);var e="^[0-"+String.fromCharCode(48+Math.min(9,p-1));10<p&&(e+="a-"+String.fromCharCode(97+p-11),e+="A-"+String.fromCharCode(65+p-11));e+="]{1,"+Math.ceil(64/Math.log2(p))+"}$";c[p]={lowDigits:l,lowBase:f,lowBase1:b,lowBase2:a,pattern:new RegExp(e)}}var n=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,h=this.high;if(0===h)return b.toString(a);h*=4294967296;var e=c[a],q=e.lowBase;e=e.lowDigits;var m=h%q;h=Math.floor(h/q);b+=m;h+=Math.floor(b/q);b=(b%q).toString(a);return h.toString(a)+"0".repeat(e-b.length)+b}},{key:"tryParseString",value:function(a,b){b=void 0===b?10:b;var d=
c[b],h=d.lowDigits,q=d.lowBase,e=d.lowBase1,m=d.lowBase2;if(!d.pattern.test(a))return!1;if(a.length<=h)return this.low=parseInt(a,b),this.high=0,!0;h=a.length-h;d=parseInt(a.substr(h),b);a=parseInt(a.substr(0,h),b);q=Math.floor(a*q/4294967296);e=d+a%4294967296*e%4294967296*m%4294967296;4294967296<e&&(++q,e-=4294967296);if(e>>>0!==e||q>>>0!==q)return!1;this.low=e;this.high=q;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,h=this.high;return 32>b?new a(c<<b,h<<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,h=this.high;return 32>b?new a(c>>>b|h<<32-b,h>>b):new a(h>>b-32,0<=h?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}();n.ZERO=new n(0,0)},function(p,l,f){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");}f.d(l,"b",function(){return a});f.d(l,"a",function(){return b});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,h){c&&a(b.prototype,c);h&&a(b,h);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,l,f){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 d=r.value.spec;r=d.lowerChunkBound;d=d.upperChunkBound;for(var q=0;3>q;++q)a[q]=Math.min(a[q],r[q]),b[q]=Math.max(b[q],d[q])}}function a(a,b,c,d){for(var r=u.FULLY_INSIDE,t=0;3>t;++t){var q=a[t];var h=b[t],e=c[t],m=d[t];q=q>=m||h<=e?u.FULLY_OUTSIDE:q>=e&&h<=m?u.FULLY_INSIDE:u.PARTIALLY_INSIDE;switch(q){case u.FULLY_OUTSIDE:return q;case u.PARTIALLY_INSIDE:r=
q}}return r}function b(a){var b=a.transform,c=a.transformedSources,r=b.changed.count;r!==a.transformedSourcesGeneration&&(a.transformedSourcesGeneration=r,c=q.h.equals(b.transform,q.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:h.a.get(c.size,m(c.transform,b)),source:a}})}),a.transformedSources=c);return c}function e(a,b){var c=b.length,r=0;if(1<
c)for(var d=0,q=0;q<c;++q){var h=b[q].chunkLayout;var e=h.size;h=h.globalToLocalSpatialVector(E,a);for(var m=0,v=0,x=1,n=0;3>n;++n){var w=e[n];x*=w;w*=h[n];m=Math.min(m,w);v=Math.max(v,w)}e=x/(v-m);e>d&&(d=e,r=q)}return b[r]}function n(a){var b=a.voxelSize,c=void 0===a.lowerVoxelBound?q.g:a.lowerVoxelBound,r=a.upperVoxelBound,d=void 0===a.maxVoxelsPerChunkLog2?18:a.maxVoxelsPerChunkLog2;a=void 0===a.transform?q.c:a.transform;a=Object(q.b)(q.m.create(),a);b=q.m.multiply(a,a,b);a=q.m.fromValues(1,1,
1);if(void 0===r)var h=q.e;else{h=q.m.create();for(var e=0;3>e;++e)h[e]=Math.pow(2,Math.floor(Math.log2(r[e]-c[e])))}for(c=0;c<d;++c){r=Infinity;e=-1;for(var m=0;3>m;++m)if(!(a[m]>=h[m])){var v=a[m]*b[m];v<r&&(r=v,e=m)}r=e;if(-1===r)break;a[r]*=2}return a}function m(a,b){b=b.transform;return void 0===b?void 0===a?q.c:a:void 0===a?b:q.h.multiply(q.h.create(),b,a)}f.d(l,"h",function(){return G});l.l=n;l.k=m;l.j=function(a){if(void 0!==a.chunkDataSizes)return a.chunkDataSizes;var b=void 0===a.chunkLayoutPreference?
B.ISOTROPIC:a.chunkLayoutPreference;switch(b){case B.ISOTROPIC:return[n(a)];case B.FLAT:b=[];for(var c=0;3>c;++c){var r=c;var d=a.lowerVoxelBound;var h=a.upperVoxelBound,e=c,m=a.voxelSize,v=a.maxVoxelsPerChunkLog2,x=a.transform;q.m.subtract(E,void 0===h?q.e:h,void 0===d?q.g:d);E[e]=1;d=n({voxelSize:m,upperVoxelBound:E,maxVoxelsPerChunkLog2:v,transform:x});b[r]=d}b.push(n(a));return b}throw Error("Invalid chunk layout preference: "+b+".");};f.d(l,"i",function(){return H});var h=f(63),d=f(21),v=f(64),
x=f(10),q=f(1);p=f(0);f.d(l,"a",function(){return x.b});var w=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}}(),E=q.m.create(),u;(function(a){a[a.FULLY_OUTSIDE=0]="FULLY_OUTSIDE";a[a.FULLY_INSIDE=1]="FULLY_INSIDE";a[a.PARTIALLY_INSIDE=2]="PARTIALLY_INSIDE"})(u||(u={}));var C=[q.m.create(),q.m.create(),q.m.create(),
q.m.create()],G=function(r){function h(){k(this,h);var a=(h.__proto__||Object.getPrototypeOf(h)).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=q.h.create();a.viewportAxes=[q.m.create(),q.m.create(),q.m.create()];a.previousViewportAxes=[q.m.create(),q.m.create()];a.centerDataPosition=q.m.create();a.viewportPlaneDistanceToOrigin=
0;a.visibleChunkLayouts=new Map;a.visibleLayers=new Map;a.visibleSourcesStale=!0;a.pixelSize=0;q.h.identity(a.viewportToData);return a}g(h,r);w(h,[{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&&q.h.equals(this.viewportToData,a))return!1;this.hasViewportToData=!0;var b=this.viewportToData;q.h.copy(b,a);Object(q.k)(b);q.m.transformMat4(this.centerDataPosition,q.g,a);a=0;for(var c=this.viewportAxes,r=this.previousViewportAxes,d=0;3>d;++d){var h=c[d];Object(q.l)(h,q.d[d],b);0===d&&(a=q.m.length(h));q.m.normalize(h,
h)}this.viewportAxes=c;this.previousViewportAxes=r;if(!Object(v.a)(a,this.pixelSize)||.95>q.m.dot(c[0],r[0])||.95>q.m.dot(c[1],r[1]))q.m.copy(r[0],c[0]),q.m.copy(r[1],c[1]),this.visibleSourcesStale=!0,this.pixelSize=a;this.viewportPlaneDistanceToOrigin=q.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,r=this.viewportAxes[2],d=this.visibleLayers;c.clear();var h={};d=$jscomp.makeIterator(d);for(var q=d.next();!q.done;h={smallestVoxelSize:h.smallestVoxelSize,visibleSources:h.visibleSources},q=d.next()){q=$jscomp.makeIterator(q.value);var m=q.next().value;h.visibleSources=q.next().value;h.visibleSources.length=0;q=b(m);var v=q.length;m=void 0;h.smallestVoxelSize=q[0][0].source.spec.voxelSize;var x=function(b){return function(c){for(var r=0;3>r;++r){var d=
c[r];if(d>a&&d>b.smallestVoxelSize[r])return!0}return!1}}(h),n=function(a){return function(b,r){var d=b.source,h=b.chunkLayout;a.visibleSources[a.visibleSources.length++]=b;b=c.get(h);void 0===b&&(b=new Map,c.set(h,b));b.set(d,r)}}(h);for(m=v-1;;){v=e(r,q[m]);n(v,m);if(0===m||!x(v.source.spec.voxelSize))break;--m}h.visibleSources.reverse()}}}},{key:"computeVisibleChunks",value:function(b,r){var h=this;this.updateVisibleSources();for(var t=this.width,e=this.height,m=this.viewportToData,v=0;3>v;++v)C[0][v]=
-q.d[0][v]*t/2-q.d[1][v]*e/2,C[1][v]=-q.d[0][v]*t/2+q.d[1][v]*e/2,C[2][v]=q.d[0][v]*t/2-q.d[1][v]*e/2,C[3][v]=q.d[0][v]*t/2+q.d[1][v]*e/2;for(t=0;4>t;++t)q.m.transformMat4(C[t],C[t],m);var x=q.m.create(),n=q.m.create(),w=q.m.create(),g=q.m.create(),z=q.m.create(),k=q.m.create(),f=[],l=[];this.visibleChunkLayouts.forEach(function(t,e){function m(){for(var a=0,b=0,c=0;3>c;++c){var r=k[c],d=x[c],h=n[c]-d,q=z[c]*h;a+=r*(d+q);b+=r*(d+h-q)}return a<H?!1:b<=H}function v(b){function c(){M=Object(d.b)(f,0,
z,function(b){var c=b.spec;switch(a(x,n,c.lowerChunkBound,c.upperChunkBound)){case u.PARTIALLY_INSIDE:return!0;case u.FULLY_INSIDE:l.push(b);default:return!1}})}if(0!==l.length||0!==M){for(var h=1,q=0;3>q;++q)h*=Math.max(0,n[q]-x[q]);if(0!==h&&m())if(1===h)r(e,y,x,l);else{for(var t;;)if(h=x[b],q=n[b],t=q-h,1===t)b=(b+1)%3;else break;t=h+Math.floor(.5*t);var w=(b+1)%3,g=l.length;n[b]=t;var z=M;c();v(w);l.length=g;M=z;n[b]=q;x[b]=t;c();v(w);x[b]=h;l.length=g;M=z}}}var y=b(e);c(w,g,t.keys());q.m.set(x,
Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);q.m.set(n,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);e.globalToLocalSpatialVector(k,h.viewportAxes[2]);for(var B=0;3>B;++B)z[B]=0<k[B]?1:0;var H=q.m.dot(e.globalToLocalGrid(E,h.centerDataPosition),k);for(B=0;4>B;++B)for(var G=e.globalToLocalGrid(E,C[B]),J=0;3>J;++J)x[J]=Math.min(x[J],Math.floor(G[J])),n[J]=Math.max(n[J],Math.floor(G[J])+1);q.m.max(x,x,w);q.m.min(n,n,g);l.length=0;f.length=
0;t=$jscomp.makeIterator(t.keys());for(B=t.next();!B.done;B=t.next())switch(B=B.value,G=B.spec,a(x,n,G.lowerChunkBound,G.upperChunkBound)){case u.FULLY_INSIDE:l.push(B);break;case u.PARTIALLY_INSIDE:f.push(B)}var M=f.length;v(0)})}}]);return h}(p.b),B;(function(a){a[a.ISOTROPIC=0]="ISOTROPIC";a[a.FLAT=1]="FLAT"})(B||(B={}));var H=function(){function a(b){k(this,a);var c=b.chunkSize,r=b.transform,d=void 0===b.lowerChunkBound?q.g:b.lowerChunkBound,e=b.upperChunkBound;this.voxelSize=b.voxelSize;this.chunkLayout=
h.a.get(c,r);this.lowerChunkBound=d;this.upperChunkBound=e}w(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}();l.f="SliceView";l.d="sliceview/RenderLayer";l.b="SliceView.addVisibleLayer";l.c="SliceView.removeVisibleLayer";l.g="SliceView.updateView";l.e="SliceView.updateTransform"},function(p,l,f){f.d(l,"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=[];l.a=p;p[k.UINT8]=1;p[k.UINT16]=2;p[k.UINT32]=4;p[k.UINT64]=8;p[k.FLOAT32]=4},function(p,l,f){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)}f.d(l,"a",function(){return n});l.b=function(a,c){c=void 0===c?"GET":c;var d=new XMLHttpRequest;d[e]=c;d[b]=a;d.open(c,a);return d};l.c=function(a,h,d){d=void 0===d?"GET":d;var m=new XMLHttpRequest;if(Array.isArray(a)){var x=a.length;x=1===x?0:Math.abs(Object(c.a)(h))%x;a=a[x]+h}else a+=h;m[e]=d;m[b]=a;m.open(d,a);return m};l.e=function(a,b,c){c=void 0===c?g.e:c;a.responseType=b;return new Promise(function(b,d){var q=function(){a.abort()};c.add(q);a.onloadend=
function(){var h=this.status;c.remove(q);200<=h&&300>h?b(this.response):d(n.fromXhr(a))};a.send()})};l.d=function(a,b,c,e){e=void 0===e?g.e:e;a.responseType=c;a.setRequestHeader("Content-Type","application/json");return new Promise(function(c,d){var q=function(){a.abort()};e.add(q);a.onloadend=function(){var b=this.status;e.remove(q);200<=b&&300>b?c(this.response):d(n.fromXhr(a))};a.send(JSON.stringify(b))})};var g=f(14),c=f(75),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,e){c&&a(b.prototype,c);e&&a(b,e);return b}}();$jscomp.initSymbol();var b=Symbol("url");$jscomp.initSymbol();var e=Symbol("method"),n=function(c){function h(a,b,c,q){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");var d=a+" "+JSON.stringify(b)+" resulted in HTTP error "+c;q&&(d+=": "+q);d+=".";var e=(h.__proto__||Object.getPrototypeOf(h)).call(this,
d);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");e=!e||"object"!==typeof e&&"function"!==typeof e?this:e;e.name="HttpError";e.message=d;e.method=a;e.url=b;e.code=c;e.statusMessage=q;return e}k(h,c);a(h,null,[{key:"fromXhr",value:function(a){return new h(a[e],a[b],a.status,a.statusText)}}]);return h}(Error)},function(p,l,f){f.d(l,"b",function(){return k});l.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 e=c[a];c[a]=c[a+1];c[a+1]=e}};l.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 e=c[a];c[a]=c[a+3];c[a+3]=e;e=c[a+1];c[a+1]=c[a+2];c[a+2]=e}};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}();l.a=g},function(p,l,f){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.d(l,"a",function(){return d});
p=f(20);var a=f(40),b=f(1),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}}(),n=function x(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 x(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:
b.call(c)}},m=b.m.create(),h=b.m.create();f=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);e(b,[{key:"initializeVolumeChunk",value:function(a,c){n(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){n(b.prototype.__proto__||
Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var d=this.chunkDataSize;d!==this.source.spec.chunkDataSize&&(a.chunkDataSize=d);a=a.data=this.data;c.push(a.buffer);this.data=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.data.byteLength;n(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.data=null}}]);return b}(p.SliceViewChunk);var d=
function(d){function q(b,c){k(this,q);b=g(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,b,c));b.spec=a.b.fromObject(c.spec);return b}c(q,d);e(q,[{key:"computeChunkBounds",value:function(a){var c=this.spec,d=c.upperVoxelBound;c=c.chunkDataSize;for(var e=b.m.multiply(h,a.chunkGridPosition,c),q=!1,n=0;3>n;++n)(m[n]=Math.min(d[n],e[n]+c[n])-e[n])!==c[n]&&(q=!0);b.m.add(e,e,this.spec.baseVoxelOffset);a.chunkDataSize=q?b.m.clone(m):c;return e}}]);return q}(p.SliceViewChunkSource);d.prototype.chunkConstructor=
f},function(p,l,f){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");}f.d(l,"b",function(){return e});f.d(l,"c",function(){return n});l.d=function(a,
c){return new Promise(function(d,h){if(a===b)c(d,h,b);else{var m=new e,q=a.add(function(){m.cancel()});c(function(a){q();d(a)},function(a){q();h(a)},m)}})};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,e){c&&a(b.prototype,c);e&&a(b,e);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}());l.a=p;var a=function(){},b={isCanceled:!1,add:function(){return a},remove:a};l.e=b;var e=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,e=this.handlers;if(null===e)return b(),a;void 0===e&&(e=this.handlers=new Set);e.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}(),n=function(a){function e(){g(this,e);var a=(e.__proto__||Object.getPrototypeOf(e)).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(e,a);c(e,[{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 e}(e)},function(p,l,f){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,d){a.addEventListener(b,c,d);return function(){return a.removeEventListener(b,c,d)}}f.d(l,"a",function(){return b});f.d(l,"b",function(){return e});var a=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}}(),
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,d,e){this.registerDisposer(c(a,b,d,e))}},{key:"registerCancellable",value:function(a){this.registerDisposer(function(){a.cancel()});return a}}]);return b}(),e=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,l,f){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)}l.c=function(a){return function(a){function b(a){for(var c=[],e=0;e<arguments.length;++e)c[e-0]=arguments[e];if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var d,n=k(this,(d=b.__proto__||Object.getPrototypeOf(b)).call.apply(d,[].concat([this],$jscomp.arrayFromIterable(c))));n.visibility=c[0].get(c[1].visibility);n.registerDisposer(n.visibility.changed.add(function(){return n.chunkManager.scheduleUpdateChunkPriorities()}));
return n}g(b,a);return b}(a)};l.b=function(a){return a===Number.POSITIVE_INFINITY?c.d.VISIBLE:c.d.PREFETCH};l.a=function(a){return a===Number.POSITIVE_INFINITY?0:a*c.f};f(65);var c=f(6)},function(p,l,f){l.a=function(c,a){Object(k.a)(c,Object(g.a)(new Uint8Array(a),c.chunkDataSize,c.source.spec.numChannels))};var k=f(25),g=f(87)},function(p,l,f){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=d.m.create(),r=d.m.create(),e=d.m.create(),q=new Float32Array(a.length),h=new Float32Array(a.length/3),
m=b.length,n=0;n<m;n+=3)for(var v=0;3>v;++v)h[b[n+v]]+=1;for(n=0;n<m;n+=3){v=3*b[n];for(var x=3*b[n+1],w=3*b[n+2],g=0;3>g;++g)r[g]=a[x+g]-a[v+g],e[g]=a[w+g]-a[x+g];d.m.cross(c,r,e);d.m.normalize(c,c);for(v=0;3>v;++v)for(w=b[n+v],x=1/h[w],w*=3,g=0;3>g;++g)q[w+g]+=x*c[g]}a=q.length;for(b=0;b<a;b+=3)c=q.subarray(b,3),d.m.normalize(c,c);return q}function b(a,b,c,d,e,q,m,n){var r=new Float32Array(c,e,3*q);Object(h.d)(r,d);void 0===m&&(m=e+12*q);var t;void 0!==n&&(t=n*b);c=void 0===t?new Uint32Array(c,
m):new Uint32Array(c,m,t);if(0!==c.length%b)throw Error("Number of indices is not a multiple of "+b+": "+c.length+".");Object(h.d)(c,d);a.vertexPositions=r;a.indices=c}l.c=function(a,b,c){Object(v.i)(b);a.fragmentIds=Object(v.j)(b,c,v.m)};l.b=a;l.e=b;l.d=function(c,r,d,e,t,q,h){b(c,3,r,d,e,t,q,h);c.vertexNormals=a(c.vertexPositions,c.indices)};f.d(l,"a",function(){return B});var e=f(2),n=f(6);p=f(77);l=f(38);var m=f(23),h=f(12),d=f(1),v=f(3),x=f(7),q=f(16);f=f(0);var w=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,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),E=function r(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 r(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}},u=this&&this.__decorate||function(a,b,c,d){var r=
arguments.length,e=3>r?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,q;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,d);else for(var t=a.length-1;0<=t;t--)if(q=a[t])e=(3>r?q(e):3<r?q(b,c,e):q(b,c))||e;return 3<r&&e&&Object.defineProperty(b,c,e),e},C=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.objectId=new x.a;return a}c(b,a);w(b,[{key:"initializeManifestChunk",value:function(a,c,d){E(b.prototype.__proto__||
Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.objectId.assign(c);d&&(this.clipBounds=d)}},{key:"freeSystemMemory",value:function(){this.fragmentIds=null}},{key:"serialize",value:function(a,c){E(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;E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",
this).call(this);this.priorityTier<n.d.RECENT&&this.source.chunkManager.scheduleUpdateChunkPriorities()}},{key:"toString",value:function(){return this.objectId.toString()}}]);return b}(e.Chunk),G=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);w(b,[{key:"initializeFragmentChunk",value:function(a,c,d){E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"initialize",this).call(this,a);this.manifestChunk=c;this.fragmentId=d}},{key:"freeSystemMemory",value:function(){this.fragmentId=this.vertexPositions=this.indices=this.vertexNormals=this.manifestChunk=null}},{key:"serialize",value:function(a,c){E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);a.objectKey=this.manifestChunk.key;var d=this.vertexPositions,e=this.indices,r=this.vertexNormals;a.vertexPositions=d;a.indices=e;a.vertexNormals=r;a=d.buffer;c.push(a);
e=e.buffer;e!==a&&c.push(e);r=r.buffer;r!==a&&r!==e&&c.push(r);this.vertexPositions=this.indices=this.vertexNormals=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.vertexPositions.byteLength+this.indices.byteLength+this.vertexNormals.byteLength;E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(e.Chunk),B=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,
a,c));return(d.fragmentSource=d.registerDisposer(a.getRef(c.fragmentSource))).meshSource=d}c(b,a);w(b,[{key:"getChunk",value:function(a,b){var c=Object(m.b)(a,b),d=this.chunks.get(c);void 0===d&&(d=this.getNewChunk_(C),d.initializeManifestChunk(c,a,b),this.addChunk(d));return d}},{key:"getFragmentChunk",value:function(a,b){var c=a.key+"/"+b,d=this.fragmentSource,e=d.chunks.get(c);void 0===e&&(e=d.getNewChunk_(G),e.initializeFragmentChunk(c,a,b),d.addChunk(e));return e}}]);return b}(e.ChunkSource);
e=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);w(b,[{key:"download",value:function(a,b){return this.meshSource.downloadFragment(a,b)}}]);return b}(e.ChunkSource);e=u([Object(f.g)(p.a)],e);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=d.registerDisposer(a.getRef(c.source));d.registerDisposer(d.chunkManager.recomputeChunkPriorities.add(function(){d.updateChunkPriorities()}));
return d}c(b,a);w(b,[{key:"updateChunkPriorities",value:function(){var a=this,b=this.visibility.value;if(b!==Number.NEGATIVE_INFINITY){var c=Object(q.b)(b),d=Object(q.a)(b),e=this.source,r=this.chunkManager;Object(m.a)(this,function(b){b=e.getChunk(b,a.clipBounds.value);r.requestChunk(b,c,d+100);var q=b.state;if(q===n.e.SYSTEM_MEMORY_WORKER||q===n.e.SYSTEM_MEMORY||q===n.e.GPU_MEMORY){q=$jscomp.makeIterator(b.fragmentIds);for(var t=q.next();!t.done;t=q.next())t=e.getFragmentChunk(b,t.value),r.requestChunk(t,
c,d+50)}})}}}]);return b}(l.a);l=u([Object(f.g)(p.b)],l)},function(p,l,f){l.a=function(b,e,n){n=void 0===n?c.a:n;var m=b.source.spec,h=m.dataType,d=Object(a.i)(b.chunkDataSize),v=g.a[h];m=d*v*m.numChannels;if(m!==e.byteLength)throw Error("Raw-format chunk is "+e.byteLength+" bytes, "+("but "+d+" * "+v+" = "+m+" bytes are expected."));switch(h){case g.b.UINT8:e=new Uint8Array(e);break;case g.b.UINT16:e=new Uint16Array(e);Object(c.c)(e,n);break;case g.b.UINT32:case g.b.UINT64:e=new Uint32Array(e);Object(c.d)(e,
n);break;case g.b.FLOAT32:e=new Float32Array(e);Object(c.d)(e,n);break;default:throw Error("Unexpected data type: "+h+".");}Object(k.a)(b,e)};var k=f(25),g=f(10),c=f(12),a=f(1)},function(p,l,f){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(l,"__esModule",{value:!0});f.d(l,"SliceView",function(){return w});f.d(l,"SliceViewChunk",function(){return E});f.d(l,"SliceViewChunkSource",function(){return u});f.d(l,"RenderLayer",function(){return C});p=f(2);
var a=f(62);l=f(9);var b=f(1),e=f(8),n=f(16);f=f(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}}(),h=function B(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 B(a,b,c)}else{if("value"in d)return d.value;
b=d.get;return void 0===b?void 0:b.call(c)}},d=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,r=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,q;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(q=a[h])r=(3>e?q(r):3<e?q(b,c,r):q(b,c))||r;return 3<e&&r&&Object.defineProperty(b,c,r),r},v=b.m.create(),x=b.m.create(),q=function(a){function b(a,c){k(this,b);var d=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));
d.initializeSharedObject(a,c.id);return d}c(b,a);return b}(l.h),w=function(a){function d(a,b){k(this,d);var c=g(this,(d.__proto__||Object.getPrototypeOf(d)).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(d,a);m(d,[{key:"onViewportChanged",value:function(){this.chunkManager.scheduleUpdateChunkPriorities()}},{key:"updateVisibleChunks",value:function(){var a=this,c=this.centerDataPosition,d=this.chunkManager,e=this.visibility.value;if(e!==Number.NEGATIVE_INFINITY){var q=Object(n.b)(e),h=Object(n.a)(e);h+=-1E12;this.computeVisibleChunks(function(b){b.globalToLocalSpatial(x,c);return a.visibleChunkLayouts.get(b)},function(a,c,e,r){b.m.multiply(v,e,a.size);a=-b.m.distance(x,v);r=$jscomp.makeIterator(r);
for(var t=r.next();!t.done;t=r.next()){var m=t.value;t=c.get(m);m=m.getChunk(e);d.requestChunk(m,q,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);h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"disposed",this).call(this)}}]);return d}(Object(n.c)(Object(p.withChunkManager)(q)));w=d([Object(f.g)(l.f)],w);Object(f.f)(l.g,function(a){var b=this.get(a.id);a.width&&b.setViewportSize(a.width,a.height);a.viewportToData&&b.setViewportToDataMatrix(a.viewportToData)});Object(f.f)(l.b,function(a){var b=
this.get(a.id);a=this.get(a.layerId);b.addVisibleLayer(a)});Object(f.f)(l.c,function(a){var b=this.get(a.id);a=this.get(a.layerId);b.removeVisibleLayer(a)});var E=function(a){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));a.source=null;a.chunkGridPosition=b.m.create();return a}c(d,a);m(d,[{key:"initializeVolumeChunk",value:function(a,c){h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"initialize",this).call(this,a);b.m.copy(this.chunkGridPosition,
c)}},{key:"serialize",value:function(a,b){h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"serialize",this).call(this,a,b);a.chunkGridPosition=this.chunkGridPosition}},{key:"downloadSucceeded",value:function(){h(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){}},{key:"toString",value:function(){return this.source.toString()+":"+Object(b.n)(this.chunkGridPosition)}}]);return d}(p.Chunk),u=function(a){function d(a,
b){k(this,d);return g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,a,b))}c(d,a);m(d,[{key:"getChunk",value:function(a){var c=Object(b.n)(a),d=this.chunks.get(c);void 0===d&&(d=this.getNewChunk_(this.chunkConstructor),d.initializeVolumeChunk(c,a),this.addChunk(d));return d}}]);return d}(p.ChunkSource),C=function(d){function q(c,d){k(this,q);var r=g(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,c,d));r.layerChanged=new e.a;r.transform=new a.a;r.transformedSourcesGeneration=-1;for(var t=
r.sources=[],h=$jscomp.makeIterator(d.sources),m=h.next();!m.done;m=h.next()){var n=m.value;m=[];t.push(m);n=$jscomp.makeIterator(n);for(var v=n.next();!v.done;v=n.next())v=c.get(v.value),r.registerDisposer(v.addRef()),m.push(v)}b.h.copy(r.transform.transform,d.transform);r.transform.changed.add(r.layerChanged.dispatch);return r}c(q,d);return q}(f.c);C=d([Object(f.g)(l.d)],C);Object(f.f)(l.e,function(a){var c=this.get(a.id);a=a.value;var d=c.transform.transform;b.h.equals(a,d)||(b.h.copy(d,a),c.transform.changed.dispatch())})},
function(p,l,f){l.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};l.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};l.c=function(k,g,c){for(var a=new k.constructor(k.length),b=0;b<g*c;b+=c)for(var e=0;e<c;e++)a[e*g+b/c]=k[b+e];return a}},function(p,l,f){function k(g,c,a,b,e,n,m){for(var h=new Map,d=Array(3),v=2,x=0;3>x;++x){var q=d[x]=Math.ceil(b[x]/c[x]);v*=q}x=d[0];q=d[1];d=d[2];var w=b[0],k=b[1];
b=b[2];var u=c[0],f=c[1],l=c[2],B=g.length,H=B,r=[0,0,0];g.resize(B+v);v=n[0];for(var z=n[1],L=n[2],t=0;t<d;++t){r[2]=Math.min(l,b-t*l);for(var M=0;M<q;++M){r[1]=Math.min(f,k-M*f);for(var J=0;J<x;++J){r[0]=Math.min(u,w-J*u);var p=g.length-B,A=$jscomp.makeIterator(m(a,e+(t*l*L+M*f*z+J*u*v),n,c,r,B,h,g)),D=A.next().value;A=A.next().value;var P=g.data;P[H++]=A|D<<24;P[H++]=p}}}}l.c=function(g,c,a,b,e,n,m,h,d){if(1===e)var v=0;else for(v=1;1<<v<e;)v*=2;var x=Math.ceil(v*b/32),q=g.length,w=x,k=!1,u=Array.prototype.join.call(n.subarray(0,
e*d),",");b=a.get(u);void 0===b&&(k=!0,w+=e*d,b=q+x-c,a.set(u,b));g.resize(q+w);g=g.data;if(0<v)switch(v){case 1:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,w|=h[m[c+1]]<<1,w|=h[m[c+2]]<<2,w|=h[m[c+3]]<<3,w|=h[m[c+4]]<<4,w|=h[m[c+5]]<<5,w|=h[m[c+6]]<<6,w|=h[m[c+7]]<<7,w|=h[m[c+8]]<<8,w|=h[m[c+9]]<<9,w|=h[m[c+10]]<<10,w|=h[m[c+11]]<<11,w|=h[m[c+12]]<<12,w|=h[m[c+13]]<<13,w|=h[m[c+14]]<<14,w|=h[m[c+15]]<<15,w|=h[m[c+16]]<<16,w|=h[m[c+17]]<<17,w|=h[m[c+18]]<<18,w|=h[m[c+19]]<<19,w|=h[m[c+20]]<<20,w|=h[m[c+
21]]<<21,w|=h[m[c+22]]<<22,w|=h[m[c+23]]<<23,w|=h[m[c+24]]<<24,w|=h[m[c+25]]<<25,w|=h[m[c+26]]<<26,w|=h[m[c+27]]<<27,w|=h[m[c+28]]<<28,w|=h[m[c+29]]<<29,w|=h[m[c+30]]<<30,w|=h[m[c+31]]<<31,g[q+a]=w,c+=32;break;case 2:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,w|=h[m[c+1]]<<2,w|=h[m[c+2]]<<4,w|=h[m[c+3]]<<6,w|=h[m[c+4]]<<8,w|=h[m[c+5]]<<10,w|=h[m[c+6]]<<12,w|=h[m[c+7]]<<14,w|=h[m[c+8]]<<16,w|=h[m[c+9]]<<18,w|=h[m[c+10]]<<20,w|=h[m[c+11]]<<22,w|=h[m[c+12]]<<24,w|=h[m[c+13]]<<26,w|=h[m[c+14]]<<28,w|=h[m[c+
15]]<<30,g[q+a]=w,c+=16;break;case 4:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,w|=h[m[c+1]]<<4,w|=h[m[c+2]]<<8,w|=h[m[c+3]]<<12,w|=h[m[c+4]]<<16,w|=h[m[c+5]]<<20,w|=h[m[c+6]]<<24,w|=h[m[c+7]]<<28,g[q+a]=w,c+=8;break;case 8:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,w|=h[m[c+1]]<<8,w|=h[m[c+2]]<<16,w|=h[m[c+3]]<<24,g[q+a]=w,c+=4;break;case 16:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,w|=h[m[c+1]]<<16,g[q+a]=w,c+=2;break;case 32:for(c=a=0;a<x;++a)w=0,w|=h[m[c+0]]<<0,g[q+a]=w,c+=1}if(k)for(m=q+x,h=0,e*=d;h<e;++h)g[m++]=
n[h];return[v,b]};l.a=k;l.b=function(g,c,a,b,e,n,m){var h=g.length,d=b[3];g.resize(h+d);for(var v=0;v<d;++v)g.data[h+v]=g.length,k(g,c,a,b,e+n[3]*v,n,m)}},function(p,l,f){l.b=function(k,g){return k.low+","+k.high+(g?"_"+g.center.toString()+"_"+g.size.toString():"")};l.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)),e=b.next();!e.done;e=
b.next())g(e.value,a)}},function(p,l,f){l.a=function(k,g){k.data=new Uint32Array(g)}},function(p,l,f){l.a=function(e,n){var m=e.source.spec;if(m.compressedSegmentationBlockSize){var h=m.dataType;a.clear();var d=e.chunkDataSize;b[0]=d[0];b[1]=d[1];b[2]=d[2];b[3]=m.numChannels;switch(h){case k.a.UINT32:Object(g.a)(a,m.compressedSegmentationBlockSize,n,b);break;case k.a.UINT64:Object(c.a)(a,m.compressedSegmentationBlockSize,n,b);break;default:throw Error("Unsupported data type for compressed segmentation: "+
k.a[h]);}e.data=new Uint32Array(a.view)}else e.data=n};var k=f(9),g=f(84),c=f(85),a=new (f(86).a)(2E4),b=Array(4)},function(p,l,f){l=f(5).assign;var k=f(91),g=f(94);f=f(47);var c={};l(c,k,g,f);p.exports=c},function(p,l,f){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,l,f){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.d(l,"a",function(){return v});
p=f(2);var a=f(6),b=f(14),e=f(11),n=f(110),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}}(),h=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)}},d=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);m(b,[{key:"initialize",value:function(a){h(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.requesters=new Set}},{key:"downloadSucceeded",value:function(){h(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 d=a.next();!d.done;d=a.next())d.value.resolve(c)}},{key:"downloadFailed",value:function(a){h(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 d=c.next();!d.done;d=c.next())d.value.reject(a)}},{key:"freeSystemMemory",value:function(){this.data=void 0}}]);return b}(p.Chunk),v=function(q){function h(a,b){k(this,h);var c=g(this,(h.__proto__||
Object.getPrototypeOf(h)).call(this,a));c.decodeFile=b;c.registerDisposer(a);c.registerDisposer(c.chunkManager.recomputeChunkPrioritiesLate.add(function(){c.updateChunkPriorities()}));return c}c(h,q);m(h,[{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 d=c.requesters;if(void 0!==d){d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value.getPriority(),a.requestChunk(c,
e.priorityTier,e.priority)}}}},{key:"download",value:function(a,b){var c=this;return Object(e.e)(Object(e.b)(a.key),"arraybuffer",b).then(function(b){a.data=c.decodeFile(b)})}},{key:"getData",value:function(c,e,q){var h=this,m=this.chunks.get(c);void 0===m&&(m=this.getNewChunk_(d),m.initialize(c),this.addChunk(m));return Object(b.d)(q,function(c,d,q){switch(m.state){case a.e.FAILED:d(m.error);return;case a.e.SYSTEM_MEMORY_WORKER:c(m.data);return}var r={resolve:c,reject:d,getPriority:e};m.requesters.add(r);
q.add(function(){var a=m.requesters;void 0!==a&&(a.delete(r),h.chunkManager.scheduleUpdateChunkPriorities());d(b.a)});h.chunkManager.scheduleUpdateChunkPriorities()})}}],[{key:"get",value:function(a,b){return a.memoize.get("getFileSource:"+Object(n.a)(b),function(){return new h(a,b)})}},{key:"getData",value:function(a,b,c,d,e){a=h.get(a,b);c=a.getData(c,d,e);a.dispose();return c}}]);return h}(p.ChunkSourceBase)},function(p,l,f){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="",e;c<a;c+=1)e=g.getUint8(c),0!==e&&(b+=String.fromCharCode(e));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,e=[],n=0;for(b=
0;8>b;b+=1)e[b]=k.Utils.getByteAt(g,c+b,a);for(b=e.length-1;0<=b;b--)n=256*n+e[b];return n};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,l,f){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");}f.d(l,"a",function(){return n});var c=f(15),a=f(3),b=function h(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 h(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}},
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,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),n=function(h){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");return!a||"object"!==typeof a&&"function"!==typeof a?this:
a}k(d,h);e(d,[{key:"get",value:function(c,e){"string"!==typeof c&&(c=Object(a.e)(c));return b(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"get",this).call(this,c,e)}},{key:"getUncounted",value:function(a,b){return this.get(a,function(){return new c.b(b())}).value}}]);return d}(function(){function a(){g(this,a);this.map=new Map}e(a,[{key:"get",value:function(a,b){var c=this.map,d=c.get(a);void 0===d?(d=b(),d.registerDisposer(function(){c.delete(a)}),c.set(a,d)):d.addRef();return d}}]);
return a}())},function(p,l,f){f(4);f(55);f(56);f(32);var k=f(57),g=f(58);f(59);var c=f(33);f(34);f.d(l,"a",function(){return k});f.d(l,"b",function(){return g});f.d(l,"c",function(){return c})},function(p,l,f){l.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=f(4)},function(p,l,f){function k(){var a=new x.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 d=new x.a(3);
d[0]=a;d[1]=b;d[2]=c;return d}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 e(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];a[2]=b[2]/c[2];return a}function n(a,b){var c=b[0]-a[0],d=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(c*c+d*d+a*a)}function m(a,b){var c=b[0]-a[0],d=b[1]-a[1];a=b[2]-a[2];return c*c+d*d+a*a}function h(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a}function d(a,b){var c=b[0],d=b[1],e=
b[2];c=c*c+d*d+e*e;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 v(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}Object.defineProperty(l,"__esModule",{value:!0});l.create=k;l.clone=function(a){var b=new x.a(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b};l.length=g;l.fromValues=c;l.copy=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a};l.set=function(a,b,c,d){a[0]=b;a[1]=c;a[2]=d;return a};l.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};l.subtract=
a;l.multiply=b;l.divide=e;l.ceil=function(a,b){a[0]=Math.ceil(b[0]);a[1]=Math.ceil(b[1]);a[2]=Math.ceil(b[2]);return a};l.floor=function(a,b){a[0]=Math.floor(b[0]);a[1]=Math.floor(b[1]);a[2]=Math.floor(b[2]);return a};l.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};l.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};l.round=function(a,b){a[0]=Math.round(b[0]);a[1]=Math.round(b[1]);a[2]=
Math.round(b[2]);return a};l.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;return a};l.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};l.distance=n;l.squaredDistance=m;l.squaredLength=h;l.negate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];return a};l.inverse=function(a,b){a[0]=1/b[0];a[1]=1/b[1];a[2]=1/b[2];return a};l.normalize=d;l.dot=v;l.cross=function(a,b,c){var d=b[0],e=b[1];b=b[2];var h=c[0],m=c[1];c=c[2];a[0]=e*c-b*m;a[1]=b*h-d*c;a[2]=
d*m-e*h;return a};l.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};l.hermite=function(a,b,c,d,e,h){var m=h*h,q=m*(2*h-3)+1,r=m*(h-2)+h,n=m*(h-1);h=m*(3-2*h);a[0]=b[0]*q+c[0]*r+d[0]*n+e[0]*h;a[1]=b[1]*q+c[1]*r+d[1]*n+e[1]*h;a[2]=b[2]*q+c[2]*r+d[2]*n+e[2]*h;return a};l.bezier=function(a,b,c,d,e,h){var m=1-h,q=m*m,r=h*h,n=q*m;q*=3*h;m*=3*r;h*=r;a[0]=b[0]*n+c[0]*q+d[0]*m+e[0]*h;a[1]=b[1]*n+c[1]*q+d[1]*m+e[1]*h;a[2]=b[2]*n+c[2]*q+d[2]*m+
e[2]*h;return a};l.random=function(a,b){b=b||1;var c=2*x.c()*Math.PI,d=2*x.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};l.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};l.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};l.transformQuat=function(a,b,c){var d=b[0],e=b[1],h=b[2];b=c[0];var m=c[1],n=c[2];c=c[3];var r=c*d+m*h-n*e,q=c*e+n*d-b*h,v=c*h+b*e-m*d;d=-b*d-m*e-n*h;a[0]=r*c+d*-b+q*-n-v*-m;a[1]=q*c+d*-m+v*-b-r*-n;a[2]=v*c+d*-n+r*-m-q*-b;return a};l.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};l.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};l.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};l.angle=function(a,b){a=c(a[0],a[1],a[2]);b=c(b[0],b[1],b[2]);d(a,
a);d(b,b);b=v(a,b);return 1<b?0:-1>b?Math.PI:Math.acos(b)};l.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};l.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]};l.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)<=x.b*Math.max(1,Math.abs(c),Math.abs(e))&&Math.abs(d-h)<=x.b*Math.max(1,Math.abs(d),Math.abs(h))&&Math.abs(a-b)<=x.b*Math.max(1,Math.abs(a),Math.abs(b))};var x=f(4);l.sub=a;l.mul=b;l.div=e;l.dist=n;l.sqrDist=m;l.len=
g;l.sqrLen=h;p=function(){var a=k();return function(b,c,d,e,h,m){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,m),b[d]=a[0],b[d+1]=a[1],b[d+2]=a[2];return b}}();l.forEach=p},function(p,l,f){function k(){var c=new g.a(4);c[0]=0;c[1]=0;c[2]=0;c[3]=0;return c}l.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};l.g=function(c,a,b,e){var n=new g.a(4);n[0]=c;n[1]=a;n[2]=b;n[3]=e;return n};l.c=function(c,a){c[0]=
a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];return c};l.l=function(c,a,b,e,n){c[0]=a;c[1]=b;c[2]=e;c[3]=n;return c};l.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};l.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};l.h=function(c){var a=c[0],b=c[1],e=c[2];c=c[3];return Math.sqrt(a*a+b*b+e*e+c*c)};l.m=function(c){var a=c[0],b=c[1],e=c[2];c=c[3];return a*a+b*b+e*e+c*c};l.j=function(c,a){var b=a[0],e=a[1],n=a[2];a=a[3];var m=b*b+e*e+n*n+a*a;
0<m&&(m=1/Math.sqrt(m),c[0]=b*m,c[1]=e*m,c[2]=n*m,c[3]=a*m);return c};l.d=function(c,a){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]};l.i=function(c,a,b,e){var n=a[0],m=a[1],h=a[2];a=a[3];c[0]=n+e*(b[0]-n);c[1]=m+e*(b[1]-m);c[2]=h+e*(b[2]-h);c[3]=a+e*(b[3]-a);return c};l.f=function(c,a){return c[0]===a[0]&&c[1]===a[1]&&c[2]===a[2]&&c[3]===a[3]};l.e=function(c,a){var b=c[0],e=c[1],n=c[2];c=c[3];var m=a[0],h=a[1],d=a[2];a=a[3];return Math.abs(b-m)<=g.b*Math.max(1,Math.abs(b),Math.abs(m))&&Math.abs(e-
h)<=g.b*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(n-d)<=g.b*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(c-a)<=g.b*Math.max(1,Math.abs(c),Math.abs(a))};var g=f(4);(function(){var c=k();return function(a,b,e,n,m,h){b||(b=4);e||(e=0);for(n=n?Math.min(n*b+e,a.length):a.length;e<n;e+=b)c[0]=a[e],c[1]=a[e+1],c[2]=a[e+2],c[3]=a[e+3],m(c,c,h),a[e]=c[0],a[e+1]=c[1],a[e+2]=c[2],a[e+3]=c[3];return a}})()},function(p,l,f){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");}f.d(l,"b",function(){return n});f.d(l,
"a",function(){return m});p=f(15);var a=f(8),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)}},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}}(),n=function(){function b(d){c(this,b);this.value_=d;this.changed=new a.a}e(b,[{key:"value",get:function(){return this.value_},set:function(a){a!==this.value_&&(this.value_=a,this.changed.dispatch())}}]);return b}();(function(a){function b(a,d,e){e=void 0===e?a:e;c(this,b);a=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a));a.validator=d;a.defaultValue=e;return a}g(b,a);e(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(w){}}this.value=this.defaultValue}}]);return b})(n);(function(b){function d(b,e){c(this,d);var m=k(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));m.changed=new a.a;m.f=b;m.ws=e;b=$jscomp.makeIterator(e);for(e=b.next();!e.done;e=b.next())m.registerDisposer(e.value.changed.add(m.changed.dispatch));return m}g(d,b);e(d,[{key:"value",get:function(){return this.f.apply(this,
[].concat($jscomp.arrayFromIterable(this.ws.map(function(a){return a.value}))))}}]);return d})(p.a);(function(b){function d(b,e){for(var m=[],n=1;n<arguments.length;++n)m[n-1]=arguments[n];c(this,d);n=k(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));n.f=b;n.changed=new a.a;m=$jscomp.makeIterator(m);for(var q=m.next();!q.done;q=m.next())n.registerDisposer(q.value.add(n.changed.dispatch));return n}g(d,b);e(d,[{key:"value",get:function(){return this.f()}}]);return d})(p.a);(function(a){function b(a,
d){c(this,b);var e=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));e.validator=a;e.jsonConverter=d;return e}g(b,a);e(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(d){function m(){c(this,m);var b=k(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments));b.changed=new a.a;return b}g(m,d);e(m,[{key:"reset",value:function(){this.value=void 0}},{key:"disposed",
value:function(){void 0!==this.value_&&this.value_.dispose();this.value_=void 0;b(m.prototype.__proto__||Object.getPrototypeOf(m.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 d=this.valueHandler=function(){b.value_===a&&(b.value_=void 0,b.changed.dispatch())};a.registerDisposer(d)}a!==c&&this.changed.dispatch()}}]);return m}(p.a));
var m=function(){function b(d){c(this,b);this.changed=new a.a;this.values=void 0===d?new Set:new Set(d)}$jscomp.initSymbol();$jscomp.initSymbolIterator();e(b,[{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 b}()},function(p,l,f){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(l,"__esModule",{value:!0});f.d(l,"PerspectiveViewState",function(){return b});f.d(l,"PerspectiveViewRenderLayer",function(){return e});p=f(66);var a=f(35);f=f(0);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,m;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(m=a[n])h=(3>e?m(h):3<e?m(b,c,h):m(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h};var b=function(a){function b(a){for(var c=[],e=0;e<arguments.length;++e)c[e-0]=arguments[e];k(this,b);var h;e=g(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],
$jscomp.arrayFromIterable(c))));e.visibility=c[0].get(c[1].visibility);return e}c(b,a);return b}(f.c);b=l([Object(f.g)(p.c)],b);var e=function(b){function e(){k(this,e);var b=g(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments));b.viewStates=new a.a;return b}c(e,b);return e}(f.c);Object(f.f)(p.a,function(a){var b=this.get(a.view);this.get(a.layer).viewStates.add(b)});Object(f.f)(p.b,function(a){var b=this.get(a.view);this.get(a.layer).viewStates.delete(b)})},function(p,l,f){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(l,"__esModule",{value:!0});f.d(l,"AnnotationMetadataChunk",function(){return x});f.d(l,"AnnotationGeometryChunk",function(){return q});f.d(l,"AnnotationSource",function(){return w});var a=f(67),b=f(2),e=f(6);p=f(36);var n=f(20),m=f(1),h=f(16);f=f(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}}(),v=function u(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 u(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};l=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,r=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(a,
b,c,d);else for(var m=a.length-1;0<=m;m--)if(h=a[m])r=(3>e?h(r):3<e?h(b,c,r):h(b,c))||r;return 3<e&&r&&Object.defineProperty(b,c,r),r};var x=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);d(b,[{key:"freeSystemMemory",value:function(){this.annotation=void 0}},{key:"serialize",value:function(a,c){v(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;v(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(b.Chunk),q=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);d(b,[{key:"serialize",value:function(a,c){v(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);a.data=this.data;a.typeToOffset=this.typeToOffset;a.typeToIds=this.typeToIds;
c.push(this.data.buffer);this.data=this.typeToIds=this.typeToOffset=void 0}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.data.byteLength;v(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.data=this.typeToIds=this.typeToOffset=void 0}}]);return b}(n.SliceViewChunk);b=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);d(b,[{key:"getChunk",value:function(a){var b=this.chunks.get(a);void 0===b&&(b=this.getNewChunk_(x),b.initialize(a),this.addChunk(b));return b}},{key:"download",value:function(a,b){return this.parent.downloadMetadata(a,b)}}]);return b}(b.ChunkSource);b=l([Object(f.g)(a.d)],b);n=function(b){function e(b,c){k(this,e);b=g(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,b,c));b.parent=void 0;b.spec=new a.h(c.spec);return b}c(e,b);d(e,[{key:"download",
value:function(a,b){return this.parent.downloadGeometry(a,b)}}]);return e}(n.SliceViewChunkSource);n=l([Object(f.g)(a.c)],n);n.prototype.chunkConstructor=q;var w=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})});h.parent=d;d.registerDisposer(e.recomputeChunkPriorities.add(function(){return d.recomputeChunkPriorities()}));return d}c(b,a);d(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),e.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}(f.c);Object(f.f)(a.f,function(a){var b=this.get(a.id);b.references.add(a.annotation);b.chunkManager.scheduleUpdateChunkPriorities()});Object(f.f)(a.g,function(a){var b=this.get(a.id);b.references.delete(a.annotation);b.chunkManager.scheduleUpdateChunkPriorities()});Object(f.f)(a.b,function(b){var c=this,d=this.get(b.id),e=b.annotationId,h=b.newAnnotation;(void 0===e?d.add(h).then(function(a){return Object.assign({},
h,{id:a})}):null===h?d.delete(e).then(function(){return null}):d.update(e,h).then(function(){return h})).then(function(b){d.wasDisposed||c.invoke(a.a,{id:d.rpcId,annotationId:e||h.id,newAnnotation:b})},function(b){d.wasDisposed||c.invoke(a.a,{id:d.rpcId,annotationId:e,error:b.message})})});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=a.get(c.source);d.viewStates.changed.add(function(){return d.source.chunkManager.scheduleUpdateChunkPriorities()});
d.registerDisposer(d.source.chunkManager.recomputeChunkPriorities.add(function(){return d.recomputeChunkPriorities()}));return d}c(b,a);d(b,[{key:"recomputeChunkPriorities",value:function(){for(var a=this.source,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(h.b)(d);d=Object(h.a)(d);for(var e=$jscomp.makeIterator(a.sources),n=e.next();!n.done;n=e.next()){n=$jscomp.makeIterator(n.value);for(var t=n.next();!t.done;t=
n.next())t=t.value.getChunk(m.g),a.chunkManager.requestChunk(t,c,d)}}}}}]);return b}(p.PerspectiveViewRenderLayer);p=l([Object(f.g)(a.e)],p);p},function(p,l,f){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.d(l,"a",function(){return c});f(78);f(80);p=f(2);l=f(16);f=f(0);var c=function(a){function b(a,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var e=k(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));e.visibleSegments=a.get(c.visibleSegments);e.clipBounds=a.get(c.clipBounds);e.highlightedSegments=a.get(c.highlightedSegments);
e.segmentEquivalences=a.get(c.segmentEquivalences);a=function(){e.chunkManager.scheduleUpdateChunkPriorities()};e.registerDisposer(e.visibleSegments.changed.add(a));e.registerDisposer(e.segmentEquivalences.changed.add(a));e.registerDisposer(e.clipBounds.changed.add(a));return e}g(b,a);return b}(Object(l.c)(Object(p.withChunkManager)(f.c)))},function(p,l,f){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.d(l,"a",function(){return q});l.b=function(b,c,d,e,h,m,n){Object(a.e)(b,2,c,d,e,h,m,n)};l=f(2);var a=f(18),b=f(38),e=f(23);p=f(83);
var n=f(7),m=f(16);f=f(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}}(),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)}},v=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var m=a.length-1;0<=m;m--)if(r=a[m])h=(3>e?r(h):3<e?r(b,c,h):r(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h},x=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.objectId=new n.a;a.vertexPositions=
null;a.vertexAttributes=null;a.indices=null;return a}c(b,a);h(b,[{key:"initializeSkeletonChunk",value:function(a,c){d(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){d(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var e=this.vertexPositions,h=this.indices;a.indices=h;c.push(h.buffer);h=this.vertexAttributes;if(null!=h&&0<h.length){var r=new Uint8Array(this.getVertexAttributeBytes());r.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));var m=a.vertexAttributeOffsets=new Uint32Array(h.length+1);m[0]=0;var n=e.byteLength;h.forEach(function(a,b){m[b+1]=n;r.set(new Uint8Array(a.buffer,a.byteOffset,
a.byteLength),n);n+=a.byteLength});c.push(r.buffer);a.vertexAttributes=r}else a.vertexAttributes=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.vertexAttributeOffsets=Uint32Array.of(0),e.buffer!==c[0]&&c.push(e.buffer);this.vertexPositions=this.indices=this.vertexAttributes=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.indices.byteLength+this.getVertexAttributeBytes();d(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",
this).call(this)}}]);return b}(l.Chunk),q=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);h(b,[{key:"getChunk",value:function(a){var b=Object(e.b)(a),c=this.chunks.get(b);void 0===c&&(c=this.getNewChunk_(x),c.initializeSkeletonChunk(b,a),this.addChunk(c));return c}}]);return b}(l.ChunkSource);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=d.registerDisposer(a.getRef(c.source));
d.registerDisposer(d.chunkManager.recomputeChunkPriorities.add(function(){d.updateChunkPriorities()}));return d}c(b,a);h(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(m.b)(a),c=Object(m.a)(a),d=this.source,h=this.chunkManager;Object(e.a)(this,function(a){a=d.getChunk(a);h.requestChunk(a,b,c+60)})}}}]);return b}(b.a);l=v([Object(f.g)(p.a)],l)},function(p,l,f){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)}f.d(l,"c",function(){return n});f.d(l,"b",function(){return m});var g=f(9),c=f(10),a=f(1);f.d(l,"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,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),e=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)}},n;(function(a){a[a.UNKNOWN=0]="UNKNOWN";a[a.IMAGE=1]="IMAGE";a[a.SEGMENTATION=2]="SEGMENTATION"})(n||(n={}));var m=function(d){function m(b){if(!(this instanceof m))throw new TypeError("Cannot call a class as a function");
for(var d=void 0===b.lowerVoxelBound?a.g:b.lowerVoxelBound,e=b.upperVoxelBound,n=b.chunkDataSize,g=b.voxelSize,k=b.transform,v=void 0===b.baseVoxelOffset?a.g:b.baseVoxelOffset,x=void 0===b.lowerClipBound?a.m.multiply(a.m.create(),g,d):b.lowerClipBound,f=void 0===b.upperClipBound?a.m.multiply(a.m.create(),g,e):b.upperClipBound,r=a.m.multiply(a.m.create(),n,g),l=a.m.create(),p=a.m.create(),t=0;3>t;++t)l[t]=Math.floor(d[t]/n[t]),p[t]=Math.floor((e[t]-1)/n[t]+1);g=(m.__proto__||Object.getPrototypeOf(m)).call(this,
{voxelSize:g,transform:k,lowerChunkBound:l,upperChunkBound:p,chunkSize:r});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");g=!g||"object"!==typeof g&&"function"!==typeof g?this:g;g.baseVoxelOffset=v;g.lowerClipBound=x;g.upperClipBound=f;g.lowerVoxelBound=d;g.upperVoxelBound=e;g.chunkDataSize=n;d=g.dataType=b.dataType;e=g.numChannels=b.numChannels;g.chunkBytes=Object(a.i)(n)*c.a[d]*e;g.compressedSegmentationBlockSize=b.compressedSegmentationBlockSize;
return g}k(m,d);b(m,[{key:"toObject",value:function(){return Object.assign({},e(m.prototype.__proto__||Object.getPrototypeOf(m.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 m(Object.assign({},a,{transform:Object(g.k)(a.transform,a.volumeSourceOptions)}))}},{key:"fromObject",value:function(a){return new m(a)}},{key:"withDefaultCompression",value:function(a){var b=a.compressedSegmentationBlockSize,d=a.dataType,e=a.voxelSize,k=a.transform,v=a.lowerVoxelBound,f=a.upperVoxelBound;k=Object(g.k)(k,a.volumeSourceOptions);void 0!==b||a.volumeType!==n.SEGMENTATION||d!==c.b.UINT32&&d!==c.b.UINT64||(b=Object(g.l)({voxelSize:e,transform:k,
lowerVoxelBound:v,upperVoxelBound:f,maxVoxelsPerChunkLog2:9}));return new m(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 m.withDefaultCompression(Object.assign({},a,{chunkDataSize:b}))})}}]);return m}(g.i)},function(p,l,f){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(l,"__esModule",{value:!0});f.d(l,"NDStoreVolumeChunkSource",function(){return d});p=f(2);l=f(89);var g=f(17),c=f(42),a=f(19),b=f(13),e=f(11);f=f(0);var n=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,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,m;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(m=a[n])h=(3>e?m(h):3<e?m(b,c,h):m(b,c))||h;return 3<e&&h&&Object.defineProperty(b,
c,h),h},h=new Map;h.set("npz",c.a);h.set("jpeg",g.a);h.set("raw",a.a);var d=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=h.get(a.parameters.encoding);return a}k(b,a);n(b,[{key:"download",value:function(a,b){for(var c=
this,d=this.parameters,h=d.urlPrefix+"/"+d.key+"/"+d.channel+"/"+(d.encoding+"/"+d.resolution),m=this.computeChunkBounds(a),n=a.chunkDataSize,g=0;3>g;++g)h+="/"+m[g]+","+(m[g]+n[g]);d.neariso&&(h+="/neariso/");return Object(e.e)(Object(e.c)(d.baseUrls,h),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(b.a,l.a));d=m([Object(f.g)()],d)},function(p,l,f){l.a=function(e,n){n=Object(a.a)(Object(b.inflate)(new Uint8Array(n)));var m=e.chunkDataSize,h=
e.source,d=h.spec.numChannels,v=n.shape;if(4!==v.length||v[0]!==d||v[1]!==m[2]||v[2]!==m[1]||v[3]!==m[0])throw Error("Shape "+JSON.stringify(v)+" does not match chunkDataSize "+Object(c.n)(m));m=n.dataType.dataType;h=h.spec;if(m!==h.dataType)throw Error("Data type "+g.a[m]+" does not match "+("expected data type "+g.a[h.dataType]));Object(k.a)(e,n.data)};var k=f(25),g=f(9),c=f(1),a=f(90),b=f(26);f.n(b)},function(p,l,f){p.exports=function(k,g,c,a){var b=k&65535|0;k=k>>>16&65535|0;for(var e;0!==c;){e=
2E3<c?2E3:c;c-=e;do b=b+g[a++]|0,k=k+b|0;while(--e);b%=65521;k%=65521}return b|k<<16|0}},function(p,l,f){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,l,f){function k(b,n){if(65537>n&&(b.subarray&&a||!b.subarray&&c))return String.fromCharCode.apply(null,g.shrinkBuf(b,n));for(var e="",h=0;h<n;h++)e+=String.fromCharCode(b[h]);return e}
var g=f(5),c=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){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;l.string2buf=function(a){var b,c,e=a.length,d=0;for(b=0;b<e;b++){var k=a.charCodeAt(b);if(55296===(k&64512)&&b+1<e){var f=a.charCodeAt(b+1);56320===(f&64512)&&(k=65536+(k-55296<<10)+(f-56320),b++)}d+=128>k?1:2048>k?2:65536>k?3:4}var q=new g.Buf8(d);for(b=
c=0;c<d;b++)k=a.charCodeAt(b),55296===(k&64512)&&b+1<e&&(f=a.charCodeAt(b+1),56320===(f&64512)&&(k=65536+(k-55296<<10)+(f-56320),b++)),128>k?q[c++]=k:(2048>k?q[c++]=192|k>>>6:(65536>k?q[c++]=224|k>>>12:(q[c++]=240|k>>>18,q[c++]=128|k>>>12&63),q[c++]=128|k>>>6&63),q[c++]=128|k&63);return q};l.buf2binstring=function(a){return k(a,a.length)};l.binstring2buf=function(a){for(var b=new g.Buf8(a.length),c=0,e=b.length;c<e;c++)b[c]=a.charCodeAt(c);return b};l.buf2string=function(a,c){var e,h=c||a.length,
d=Array(2*h);for(c=e=0;c<h;){var n=a[c++];if(128>n)d[e++]=n;else{var g=b[n];if(4<g)d[e++]=65533,c+=g-1;else{for(n&=2===g?31:3===g?15:7;1<g&&c<h;)n=n<<6|a[c++]&63,g--;1<g?d[e++]=65533:65536>n?d[e++]=n:(n-=65536,d[e++]=55296|n>>10&1023,d[e++]=56320|n&1023)}}}return k(d,e)};l.utf8border=function(a,c){var e;c=c||a.length;c>a.length&&(c=a.length);for(e=c-1;0<=e&&128===(a[e]&192);)e--;return 0>e||0===e?c:e+b[a[e]]>c?e:c}},function(p,l,f){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,l,f){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,l,f){var k=k||{};k.Utils=k.Utils||f(29);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,e,n,m,h,d,k){var f=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],q=a;f[3][0]=f[3][1]=f[3][2]=0;f[3][3]=1;a=1-(g*g+c*c+q*q);1E-7>a?(a=1/Math.sqrt(g*g+c*c+q*q),g*=a,c*=a,q*=a,a=0):a=Math.sqrt(a);m=0<m?
m:1;h=0<h?h:1;d=0<d?d:1;0>k&&(d=-d);f[0][0]=(a*a+g*g-c*c-q*q)*m;f[0][1]=2*(g*c-a*q)*h;f[0][2]=2*(g*q+a*c)*d;f[1][0]=2*(g*c+a*q)*m;f[1][1]=(a*a+c*c-g*g-q*q)*h;f[1][2]=2*(c*q-a*g)*d;f[2][0]=2*(g*q-a*c)*m;f[2][1]=2*(c*q+a*g)*h;f[2][2]=(a*a+q*q-c*c-g*g)*d;f[0][3]=b;f[1][3]=e;f[2][3]=n;return f};k.NIFTI1.prototype.convertNiftiSFormToNEMA=function(g){var c,a,b,e;var n=[[0,0,0],[0,0,0],[0,0,0]];var m=[[0,0,0],[0,0,0],[0,0,0]];var h=g[0][0];var d=g[0][1];var k=g[0][2];var f=g[1][0];var q=g[1][1];var l=g[1][2];
var p=g[2][0];var u=g[2][1];var C=g[2][2];g=Math.sqrt(h*h+f*f+p*p);if(0===g)return null;h/=g;f/=g;p/=g;g=Math.sqrt(d*d+q*q+u*u);if(0===g)return null;d/=g;q/=g;u/=g;g=h*d+f*q+p*u;if(1E-4<Math.abs(g)){d-=g*h;q-=g*f;u-=g*p;g=Math.sqrt(d*d+q*q+u*u);if(0===g)return null;d/=g;q/=g;u/=g}g=Math.sqrt(k*k+l*l+C*C);0===g?(k=f*u-p*q,l=p*d-u*h,C=h*q-f*d):(k/=g,l/=g,C/=g);g=h*k+f*l+p*C;if(1E-4<Math.abs(g)){k-=g*h;l-=g*f;C-=g*p;g=Math.sqrt(k*k+l*l+C*C);if(0===g)return null;k/=g;l/=g;C/=g}g=d*k+q*l+u*C;if(1E-4<Math.abs(g)){k-=
g*d;l-=g*q;C-=g*u;g=Math.sqrt(k*k+l*l+C*C);if(0===g)return null;k/=g;l/=g;C/=g}n[0][0]=h;n[0][1]=d;n[0][2]=k;n[1][0]=f;n[1][1]=q;n[1][2]=l;n[2][0]=p;n[2][1]=u;n[2][2]=C;p=this.nifti_mat33_determ(n);if(0===p)return null;var G=-666;h=f=q=l=1;d=2;k=3;for(u=1;3>=u;u+=1)for(C=1;3>=C;C+=1)if(u!==C)for(c=1;3>=c;c+=1)if(u!==c&&C!==c)for(m[0][0]=m[0][1]=m[0][2]=m[1][0]=m[1][1]=m[1][2]=m[2][0]=m[2][1]=m[2][2]=0,a=-1;1>=a;a+=2)for(b=-1;1>=b;b+=2)for(e=-1;1>=e;e+=2)m[0][u-1]=a,m[1][C-1]=b,m[2][c-1]=e,g=this.nifti_mat33_determ(m),
0<g*p&&(g=this.nifti_mat33_mul(m,n),g=g[0][0]+g[1][1]+g[2][2],g>G&&(G=g,h=u,d=C,k=c,f=a,q=b,l=e));n=m=g=p=u=C=0;switch(h*f){case 1:n="X";p="+";break;case -1:n="X";p="-";break;case 2:n="Y";p="+";break;case -2:n="Y";p="-";break;case 3:n="Z";p="+";break;case -3:n="Z",p="-"}switch(d*q){case 1:m="X";u="+";break;case -1:m="X";u="-";break;case 2:m="Y";u="+";break;case -2:m="Y";u="-";break;case 3:m="Z";u="+";break;case -3:m="Z",u="-"}switch(k*l){case 1:g="X";C="+";break;case -1:g="X";C="-";break;case 2:g=
"Y";C="+";break;case -2:g="Y";C="-";break;case 3:g="Z";C="+";break;case -3:g="Z",C="-"}return n+m+g+p+u+C};k.NIFTI1.prototype.nifti_mat33_mul=function(g,c){var a=[[0,0,0],[0,0,0],[0,0,0]],b,e;for(b=0;3>b;b+=1)for(e=0;3>e;e+=1)a[b][e]=g[b][0]*c[0][e]+g[b][1]*c[1][e]+g[b][2]*c[2][e];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 e=g[1][0];var n=g[1][1];var m=g[1][2];var h=g[2][0];var d=g[2][1];g=g[2][2];return c*n*g-c*d*m-e*a*g+e*d*b+h*a*m-
h*n*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,l,f){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(B);
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(C,c));c=h.next().value;h=h.next().value;return c.getMesh(b,h,d,e)}function e(b,c,d,e){var h=$jscomp.makeIterator(a(G,c));c=h.next().value;h=h.next().value;return c.getMeshVertexAttributes(b,h,d,e)}function n(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 m(a,c,d,h){for(var r=[b(a,c.meshSourceUrl,d,h)],t=$jscomp.makeIterator(c.attributeSourceUrls),m=t.next();!m.done;m=t.next())r.push(e(a,m.value,d,h));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],t=b[h],m=c,g=$jscomp.makeIterator(n(t)),k=g.next().value;g=g.next().value;e.info.vertexAttributes.push({name:r.name,
source:m,numComponents:r.numComponents,dataType:r.dataType,min:k,max:g});e.vertexAttributes.push(t)}}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})}l.a=function(a,b){C.set(a,b)};l.b=function(a,b){G.set(a,b)};p=f(2);var h=f(6),d=f(18),v=f(116),x=f(3),q=f(16);f=f(0);var w=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}}(),E=function z(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 z(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};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,t;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=Reflect.decorate(a,b,c,d);else for(var m=a.length-
1;0<=m;m--)if(t=a[m])h=(3>e?t(h):3<e?t(b,c,h):t(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h};var u=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);w(b,[{key:"freeSystemMemory",value:function(){this.data=null}},{key:"serialize",value:function(a,c){E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,c);var d=this.data,e=d.vertexPositions,h=d.indices,t=d.vertexNormals;d=d.vertexAttributes;
a.vertexPositions=e;a.indices=h;a.vertexNormals=t;a.vertexAttributes=d;a=new Set;a.add(e.buffer);a.add(h.buffer);a.add(t.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;E(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(p.Chunk),C=new Map,G=new Map,B=/^(?:([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);w(b,[{key:"getChunk",value:function(){var a=v.b,b=this.chunks.get(a);void 0===b&&(b=this.getNewChunk_(u),b.initialize(a),this.addChunk(b));
return b}},{key:"download",value:function(a,b){var c=this;return m(this.chunkManager,this.parameters,function(){return{priorityTier:a.priorityTier,priority:a.priority}},b).then(function(b){if(Object(x.e)(b.info)!==Object(x.e)(c.parameters.info))throw Error("Mesh info has changed.");void 0===b.vertexNormals&&(b.vertexNormals=Object(d.b)(b.vertexPositions,b.indices));a.data=b})}}]);return b}(Object(p.WithParameters)(p.ChunkSource,v.d));H=l([Object(f.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);w(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(q.b)(a);a=Object(q.a)(a);var c=this.chunkManager,d=this.source.getChunk();c.requestChunk(d,b,a+50)}}}]);return b}(Object(q.c)(Object(p.withChunkManager)(f.c)));
p=l([Object(f.g)(v.c)],p);Object(f.e)(v.a,function(a,b){var c=this.getRef(a.chunkManager);try{return m(c,a.parameters,function(){return{priorityTier:h.d.VISIBLE,priority:1E3}},b).then(function(a){return{value:a.info}})}finally{c.dispose()}})},function(p,l,f){l.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=f(26);
f.n(k)},function(p,l,f){f(52);f(2);f(20);f(36);f(37);f(68);f(41);f(99);f(101);f(106);f(107);f(109);f(114);f(117);p.exports=f(118)},function(p,l,f){Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"rpc",function(){return k});var k=new (f(0).a)(self);self.rpc=k},function(p,l,f){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var e=a[b];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(c,e.key,e)}}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,h){for(;;)switch(b){case 0:e=c.next0;case 1:if(e===c){b=3;break}b=4;return{value:e,done:!1};case 4:if(void 0===h){b=5;break}b=-1;throw h;case 5:case 2:e=e.next0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,n={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();
n[Symbol.iterator]=function(){return this};return n}},{key:"reverseIterator",value:function(c){function a(a,h){for(;;)switch(b){case 0:e=c.prev0;case 1:if(e===c){b=3;break}b=4;return{value:e,done:!1};case 4:if(void 0===h){b=5;break}b=-1;throw h;case 5:case 2:e=e.prev0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,n={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();
n[Symbol.iterator]=function(){return this};return n}},{key:"initializeHead",value:function(c){c.next0=c.prev0=c}}]);return g}();l.a=p},function(p,l,f){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var e=a[b];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(c,e.key,e)}}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,h){for(;;)switch(b){case 0:e=
c.next1;case 1:if(e===c){b=3;break}b=4;return{value:e,done:!1};case 4:if(void 0===h){b=5;break}b=-1;throw h;case 5:case 2:e=e.next1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,n={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();n[Symbol.iterator]=function(){return this};return n}},{key:"reverseIterator",value:function(c){function a(a,h){for(;;)switch(b){case 0:e=
c.prev1;case 1:if(e===c){b=3;break}b=4;return{value:e,done:!1};case 4:if(void 0===h){b=5;break}b=-1;throw h;case 5:case 2:e=e.prev1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,n={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();n[Symbol.iterator]=function(){return this};return n}},{key:"initializeHead",value:function(c){c.next1=c.prev1=c}}]);return g}();l.a=p},
function(p,l,f){f(4)},function(p,l,f){f(4)},function(p,l,f){function k(a,b,c){var e=b[0],m=b[1],h=b[2],d=b[3],g=b[4],k=b[5],q=b[6],f=b[7],l=b[8],u=b[9],p=b[10],G=b[11],B=b[12],H=b[13],r=b[14];b=b[15];var z=c[0],L=c[1],t=c[2],M=c[3];a[0]=z*e+L*g+t*l+M*B;a[1]=z*m+L*k+t*u+M*H;a[2]=z*h+L*q+t*p+M*r;a[3]=z*d+L*f+t*G+M*b;z=c[4];L=c[5];t=c[6];M=c[7];a[4]=z*e+L*g+t*l+M*B;a[5]=z*m+L*k+t*u+M*H;a[6]=z*h+L*q+t*p+M*r;a[7]=z*d+L*f+t*G+M*b;z=c[8];L=c[9];t=c[10];M=c[11];a[8]=z*e+L*g+t*l+M*B;a[9]=z*m+L*k+t*u+M*H;a[10]=
z*h+L*q+t*p+M*r;a[11]=z*d+L*f+t*G+M*b;z=c[12];L=c[13];t=c[14];M=c[15];a[12]=z*e+L*g+t*l+M*B;a[13]=z*m+L*k+t*u+M*H;a[14]=z*h+L*q+t*p+M*r;a[15]=z*d+L*f+t*G+M*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(l,"__esModule",{value:!0});
l.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};l.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};l.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};l.fromValues=function(a,b,e,n,m,h,d,g,k,q,f,l,u,p,G,B){var v=new c.a(16);v[0]=a;v[1]=b;v[2]=e;v[3]=n;v[4]=m;v[5]=h;v[6]=d;v[7]=g;v[8]=k;v[9]=q;v[10]=f;v[11]=l;v[12]=u;v[13]=p;v[14]=G;v[15]=B;return v};l.set=function(a,b,c,n,m,h,d,g,k,q,f,l,u,p,G,B,H){a[0]=b;a[1]=c;a[2]=n;a[3]=m;a[4]=h;a[5]=d;a[6]=g;a[7]=k;a[8]=q;a[9]=f;a[10]=l;a[11]=u;a[12]=p;a[13]=G;a[14]=B;a[15]=H;return a};l.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};l.transpose=function(a,b){if(a===b){var c=b[1],n=b[2],m=b[3],h=b[6],d=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]=n;a[9]=h;a[11]=b[14];a[12]=m;a[13]=d;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};l.invert=
function(a,b){var c=b[0],n=b[1],m=b[2],h=b[3],d=b[4],g=b[5],k=b[6],q=b[7],f=b[8],l=b[9],u=b[10],p=b[11],G=b[12],B=b[13],H=b[14];b=b[15];var r=c*g-n*d,z=c*k-m*d,L=c*q-h*d,t=n*k-m*g,M=n*q-h*g,J=m*q-h*k,F=f*B-l*G,A=f*H-u*G,D=f*b-p*G,P=l*H-u*B,I=l*b-p*B,O=u*b-p*H,K=r*O-z*I+L*P+t*D-M*A+J*F;if(!K)return null;K=1/K;a[0]=(g*O-k*I+q*P)*K;a[1]=(m*I-n*O-h*P)*K;a[2]=(B*J-H*M+b*t)*K;a[3]=(u*M-l*J-p*t)*K;a[4]=(k*D-d*O-q*A)*K;a[5]=(c*O-m*D+h*A)*K;a[6]=(H*L-G*J-b*z)*K;a[7]=(f*J-u*L+p*z)*K;a[8]=(d*I-g*D+q*F)*K;a[9]=
(n*D-c*I-h*F)*K;a[10]=(G*M-B*L+b*r)*K;a[11]=(l*L-f*M-p*r)*K;a[12]=(g*A-d*P-k*F)*K;a[13]=(c*P-n*A+m*F)*K;a[14]=(B*z-G*t-H*r)*K;a[15]=(f*t-l*z+u*r)*K;return a};l.adjoint=function(a,b){var c=b[0],n=b[1],m=b[2],h=b[3],d=b[4],g=b[5],k=b[6],q=b[7],f=b[8],l=b[9],u=b[10],p=b[11],G=b[12],B=b[13],H=b[14];b=b[15];a[0]=g*(u*b-p*H)-l*(k*b-q*H)+B*(k*p-q*u);a[1]=-(n*(u*b-p*H)-l*(m*b-h*H)+B*(m*p-h*u));a[2]=n*(k*b-q*H)-g*(m*b-h*H)+B*(m*q-h*k);a[3]=-(n*(k*p-q*u)-g*(m*p-h*u)+l*(m*q-h*k));a[4]=-(d*(u*b-p*H)-f*(k*b-q*
H)+G*(k*p-q*u));a[5]=c*(u*b-p*H)-f*(m*b-h*H)+G*(m*p-h*u);a[6]=-(c*(k*b-q*H)-d*(m*b-h*H)+G*(m*q-h*k));a[7]=c*(k*p-q*u)-d*(m*p-h*u)+f*(m*q-h*k);a[8]=d*(l*b-p*B)-f*(g*b-q*B)+G*(g*p-q*l);a[9]=-(c*(l*b-p*B)-f*(n*b-h*B)+G*(n*p-h*l));a[10]=c*(g*b-q*B)-d*(n*b-h*B)+G*(n*q-h*g);a[11]=-(c*(g*p-q*l)-d*(n*p-h*l)+f*(n*q-h*g));a[12]=-(d*(l*H-u*B)-f*(g*H-k*B)+G*(g*u-k*l));a[13]=c*(l*H-u*B)-f*(n*H-m*B)+G*(n*u-m*l);a[14]=-(c*(g*H-k*B)-d*(n*H-m*B)+G*(n*k-m*g));a[15]=c*(g*u-k*l)-d*(n*u-m*l)+f*(n*k-m*g);return a};l.determinant=
function(a){var b=a[0],c=a[1],n=a[2],m=a[3],h=a[4],d=a[5],g=a[6],k=a[7],f=a[8],l=a[9],p=a[10],u=a[11],C=a[12],G=a[13],B=a[14];a=a[15];return(b*d-c*h)*(p*a-u*B)-(b*g-n*h)*(l*a-u*G)+(b*k-m*h)*(l*B-p*G)+(c*g-n*d)*(f*a-u*C)-(c*k-m*d)*(f*B-p*C)+(n*k-m*g)*(f*G-l*C)};l.multiply=k;l.translate=function(a,b,c){var e=c[0],m=c[1];c=c[2];if(b===a)a[12]=b[0]*e+b[4]*m+b[8]*c+b[12],a[13]=b[1]*e+b[5]*m+b[9]*c+b[13],a[14]=b[2]*e+b[6]*m+b[10]*c+b[14],a[15]=b[3]*e+b[7]*m+b[11]*c+b[15];else{var h=b[0];var d=b[1];var g=
b[2];var k=b[3];var f=b[4];var l=b[5];var p=b[6];var u=b[7];var C=b[8];var G=b[9];var B=b[10];var H=b[11];a[0]=h;a[1]=d;a[2]=g;a[3]=k;a[4]=f;a[5]=l;a[6]=p;a[7]=u;a[8]=C;a[9]=G;a[10]=B;a[11]=H;a[12]=h*e+f*m+C*c+b[12];a[13]=d*e+l*m+G*c+b[13];a[14]=g*e+p*m+B*c+b[14];a[15]=k*e+u*m+H*c+b[15]}return a};l.scale=function(a,b,c){var e=c[0],m=c[1];c=c[2];a[0]=b[0]*e;a[1]=b[1]*e;a[2]=b[2]*e;a[3]=b[3]*e;a[4]=b[4]*m;a[5]=b[5]*m;a[6]=b[6]*m;a[7]=b[7]*m;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};l.rotate=function(a,b,e,g){var m=g[0],h=g[1];g=g[2];var d=Math.sqrt(m*m+h*h+g*g);if(Math.abs(d)<c.b)return null;d=1/d;m*=d;h*=d;g*=d;var n=Math.sin(e);var k=Math.cos(e);var f=1-k;e=b[0];d=b[1];var l=b[2];var p=b[3];var u=b[4];var C=b[5];var G=b[6];var B=b[7];var H=b[8];var r=b[9];var z=b[10];var L=b[11];var t=m*m*f+k;var M=h*m*f+g*n;var J=g*m*f-h*n;var F=m*h*f-g*n;var A=h*h*f+k;var D=g*h*f+m*n;var P=m*g*f+h*n;m=h*g*f-m*n;h=g*g*f+k;a[0]=e*t+u*M+H*
J;a[1]=d*t+C*M+r*J;a[2]=l*t+G*M+z*J;a[3]=p*t+B*M+L*J;a[4]=e*F+u*A+H*D;a[5]=d*F+C*A+r*D;a[6]=l*F+G*A+z*D;a[7]=p*F+B*A+L*D;a[8]=e*P+u*m+H*h;a[9]=d*P+C*m+r*h;a[10]=l*P+G*m+z*h;a[11]=p*P+B*m+L*h;b!==a&&(a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);return a};l.rotateX=function(a,b,c){var e=Math.sin(c);c=Math.cos(c);var m=b[4],h=b[5],d=b[6],g=b[7],k=b[8],f=b[9],l=b[10],p=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]=m*c+k*e;a[5]=h*c+f*e;
a[6]=d*c+l*e;a[7]=g*c+p*e;a[8]=k*c-m*e;a[9]=f*c-h*e;a[10]=l*c-d*e;a[11]=p*c-g*e;return a};l.rotateY=function(a,b,c){var e=Math.sin(c);c=Math.cos(c);var m=b[0],h=b[1],d=b[2],g=b[3],k=b[8],f=b[9],l=b[10],p=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]=m*c-k*e;a[1]=h*c-f*e;a[2]=d*c-l*e;a[3]=g*c-p*e;a[8]=m*e+k*c;a[9]=h*e+f*c;a[10]=d*e+l*c;a[11]=g*e+p*c;return a};l.rotateZ=function(a,b,c){var e=Math.sin(c);c=Math.cos(c);var m=b[0],h=b[1],d=
b[2],g=b[3],k=b[4],f=b[5],l=b[6],p=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]=m*c+k*e;a[1]=h*c+f*e;a[2]=d*c+l*e;a[3]=g*c+p*e;a[4]=k*c-m*e;a[5]=f*c-h*e;a[6]=l*c-d*e;a[7]=p*c-g*e;return a};l.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};l.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};l.fromRotation=function(a,b,e){var g=e[0],m=e[1];e=e[2];var h=Math.sqrt(g*g+m*m+e*e);if(Math.abs(h)<c.b)return null;h=1/h;g*=h;m*=h;e*=h;h=Math.sin(b);b=Math.cos(b);var d=1-b;a[0]=g*g*d+b;a[1]=m*g*d+e*h;a[2]=e*g*d-m*h;a[3]=0;a[4]=g*m*d-e*h;a[5]=m*m*d+b;a[6]=e*m*d+g*h;a[7]=0;a[8]=g*e*d+m*h;a[9]=m*e*d-g*h;a[10]=e*e*d+b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};l.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};l.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};l.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};l.fromRotationTranslation=function(a,b,c){var e=b[0],g=b[1],h=b[2],d=b[3],k=e+e,f=g+g,l=h+h;b=e*k;var p=e*f;e*=l;var E=g*f;g*=l;h*=l;k*=d;f*=d;d*=l;a[0]=1-(E+h);a[1]=p+d;a[2]=e-f;a[3]=0;a[4]=p-d;a[5]=1-(b+h);a[6]=g+k;a[7]=0;a[8]=e+f;a[9]=g-k;a[10]=1-(b+E);a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};l.getTranslation=function(a,b){a[0]=b[12];a[1]=b[13];a[2]=b[14];return a};l.getScaling=function(a,b){var c=b[0],g=b[1],m=b[2],h=b[4],d=b[5],k=b[6],f=b[8],l=b[9];b=b[10];
a[0]=Math.sqrt(c*c+g*g+m*m);a[1]=Math.sqrt(h*h+d*d+k*k);a[2]=Math.sqrt(f*f+l*l+b*b);return a};l.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};l.fromRotationTranslationScale=function(a,b,c,g){var e=b[0],h=b[1],d=b[2],k=b[3],f=e+e,n=h+h,l=d+d;b=e*f;var p=e*n;e*=l;var u=h*n;h*=l;d*=l;f*=k;n*=k;k*=l;l=g[0];var C=g[1];g=g[2];a[0]=(1-(u+d))*l;a[1]=(p+k)*l;a[2]=(e-n)*l;a[3]=0;a[4]=(p-k)*C;a[5]=(1-(b+d))*C;a[6]=(h+f)*C;a[7]=0;a[8]=(e+n)*g;a[9]=(h-f)*g;a[10]=(1-(b+u))*g;a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};l.fromRotationTranslationScaleOrigin=
function(a,b,c,g,m){var e=b[0],d=b[1],k=b[2],f=b[3],n=e+e,l=d+d,p=k+k;b=e*n;var u=e*l;e*=p;var C=d*l;d*=p;k*=p;n*=f;l*=f;f*=p;p=g[0];var G=g[1];g=g[2];var B=m[0],H=m[1];m=m[2];a[0]=(1-(C+k))*p;a[1]=(u+f)*p;a[2]=(e-l)*p;a[3]=0;a[4]=(u-f)*G;a[5]=(1-(b+k))*G;a[6]=(d+n)*G;a[7]=0;a[8]=(e+l)*g;a[9]=(d-n)*g;a[10]=(1-(b+C))*g;a[11]=0;a[12]=c[0]+B-(a[0]*B+a[4]*H+a[8]*m);a[13]=c[1]+H-(a[1]*B+a[5]*H+a[9]*m);a[14]=c[2]+m-(a[2]*B+a[6]*H+a[10]*m);a[15]=1;return a};l.fromQuat=function(a,b){var c=b[0],g=b[1],m=b[2];
b=b[3];var h=c+c,d=g+g,k=m+m;c*=h;var f=g*h;g*=d;var l=m*h,p=m*d;m*=k;h*=b;d*=b;b*=k;a[0]=1-g-m;a[1]=f+b;a[2]=l-d;a[3]=0;a[4]=f-b;a[5]=1-c-m;a[6]=p+h;a[7]=0;a[8]=l+d;a[9]=p-h;a[10]=1-c-g;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};l.frustum=function(a,b,c,g,m,h,d){var e=1/(c-b),k=1/(m-g),f=1/(h-d);a[0]=2*h*e;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=2*h*k;a[6]=0;a[7]=0;a[8]=(c+b)*e;a[9]=(m+g)*k;a[10]=(d+h)*f;a[11]=-1;a[12]=0;a[13]=0;a[14]=d*h*2*f;a[15]=0;return a};l.perspective=function(a,b,c,g,m){b=
1/Math.tan(b/2);var e=1/(g-m);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]=(m+g)*e;a[11]=-1;a[12]=0;a[13]=0;a[14]=2*m*g*e;a[15]=0;return a};l.perspectiveFromFieldOfView=function(a,b,c,g){var e=Math.tan(b.upDegrees*Math.PI/180),h=Math.tan(b.downDegrees*Math.PI/180),d=Math.tan(b.leftDegrees*Math.PI/180);b=Math.tan(b.rightDegrees*Math.PI/180);var k=2/(d+b),f=2/(e+h);a[0]=k;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=f;a[6]=0;a[7]=0;a[8]=-((d-b)*k*.5);a[9]=(e-h)*f*.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};l.ortho=function(a,b,c,g,m,h,d){var e=1/(b-c),k=1/(g-m),f=1/(h-d);a[0]=-2*e;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=-2*k;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2*f;a[11]=0;a[12]=(b+c)*e;a[13]=(m+g)*k;a[14]=(d+h)*f;a[15]=1;return a};l.lookAt=function(a,b,e,g){var m=b[0],h=b[1];b=b[2];var d=g[0];var k=g[1];var f=g[2];var l=e[0];g=e[1];var n=e[2];if(Math.abs(m-l)<c.b&&Math.abs(h-g)<c.b&&Math.abs(b-n)<c.b)return mat4.identity(a);e=m-l;g=h-g;l=b-n;var p=
1/Math.sqrt(e*e+g*g+l*l);e*=p;g*=p;l*=p;n=k*l-f*g;f=f*e-d*l;d=d*g-k*e;(p=Math.sqrt(n*n+f*f+d*d))?(p=1/p,n*=p,f*=p,d*=p):d=f=n=0;k=g*d-l*f;var u=l*n-e*d;var C=e*f-g*n;(p=Math.sqrt(k*k+u*u+C*C))?(p=1/p,k*=p,u*=p,C*=p):C=u=k=0;a[0]=n;a[1]=k;a[2]=e;a[3]=0;a[4]=f;a[5]=u;a[6]=g;a[7]=0;a[8]=d;a[9]=C;a[10]=l;a[11]=0;a[12]=-(n*m+f*h+d*b);a[13]=-(k*m+u*h+C*b);a[14]=-(e*m+g*h+l*b);a[15]=1;return a};l.targetTo=function(a,b,c,g){var e=b[0],h=b[1];b=b[2];var d=g[0],k=g[1],f=g[2];g=e-c[0];var l=h-c[1];c=b-c[2];
var n=g*g+l*l+c*c;0<n&&(n=1/Math.sqrt(n),g*=n,l*=n,c*=n);n=k*c-f*l;f=f*g-d*c;d=d*l-k*g;a[0]=n;a[1]=f;a[2]=d;a[3]=0;a[4]=l*d-c*f;a[5]=c*n-g*d;a[6]=g*f-l*n;a[7]=0;a[8]=g;a[9]=l;a[10]=c;a[11]=0;a[12]=e;a[13]=h;a[14]=b;a[15]=1;return a};l.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]+")"};l.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))};l.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};l.subtract=g;l.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};l.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};l.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]};l.equals=function(a,b){var e=a[0],g=a[1],m=a[2],h=a[3],d=a[4],k=a[5],f=a[6],l=a[7],p=a[8],E=a[9],u=a[10],C=a[11],G=
a[12],B=a[13],H=a[14];a=a[15];var r=b[0],z=b[1],L=b[2],t=b[3],M=b[4],J=b[5],F=b[6],A=b[7],D=b[8],P=b[9],I=b[10],O=b[11],K=b[12],y=b[13],N=b[14];b=b[15];return Math.abs(e-r)<=c.b*Math.max(1,Math.abs(e),Math.abs(r))&&Math.abs(g-z)<=c.b*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(m-L)<=c.b*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(h-t)<=c.b*Math.max(1,Math.abs(h),Math.abs(t))&&Math.abs(d-M)<=c.b*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(k-J)<=c.b*Math.max(1,Math.abs(k),Math.abs(J))&&Math.abs(f-
F)<=c.b*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(l-A)<=c.b*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(p-D)<=c.b*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(E-P)<=c.b*Math.max(1,Math.abs(E),Math.abs(P))&&Math.abs(u-I)<=c.b*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(C-O)<=c.b*Math.max(1,Math.abs(C),Math.abs(O))&&Math.abs(G-K)<=c.b*Math.max(1,Math.abs(G),Math.abs(K))&&Math.abs(B-y)<=c.b*Math.max(1,Math.abs(B),Math.abs(y))&&Math.abs(H-N)<=c.b*Math.max(1,Math.abs(H),Math.abs(N))&&Math.abs(a-
b)<=c.b*Math.max(1,Math.abs(a),Math.abs(b))};var c=f(4);l.mul=k;l.sub=g},function(p,l,f){function k(){var a=new e.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],e=b[1],h=b[2];b=b[3];var g=c[0],k=c[1],m=c[2];c=c[3];a[0]=d*c+b*g+e*m-h*k;a[1]=e*c+b*k+h*g-d*m;a[2]=h*c+b*m+d*k-e*g;a[3]=b*c-d*g-e*k-h*m;return a}function a(a,b,c,e){var d=b[0],h=b[1],g=b[2];b=b[3];var k=c[0],m=c[1],
f=c[2];c=c[3];var l=d*k+h*m+g*f+b*c;0>l&&(l=-l,k=-k,m=-m,f=-f,c=-c);if(1E-6<1-l){var r=Math.acos(l);var n=Math.sin(r);l=Math.sin((1-e)*r)/n;e=Math.sin(e*r)/n}else l=1-e;a[0]=l*d+e*k;a[1]=l*h+e*m;a[2]=l*g+e*f;a[3]=l*b+e*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 e=(d+1)%3,h=(d+2)%3;c=Math.sqrt(b[3*d+d]-b[3*e+e]-b[3*h+h]+1);a[d]=.5*c;c=.5/c;a[3]=
(b[3*e+h]-b[3*h+e])*c;a[e]=(b[3*e+d]+b[3*d+e])*c;a[h]=(b[3*h+d]+b[3*d+h])*c}return a}Object.defineProperty(l,"__esModule",{value:!0});l.create=k;l.identity=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};l.setAxisAngle=g;l.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};l.multiply=c;l.rotateX=function(a,b,c){c*=.5;var d=b[0],e=b[1],h=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c+b*g;a[1]=e*c+h*
g;a[2]=h*c-e*g;a[3]=b*c-d*g;return a};l.rotateY=function(a,b,c){c*=.5;var d=b[0],e=b[1],h=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c-h*g;a[1]=e*c+b*g;a[2]=h*c+d*g;a[3]=b*c-e*g;return a};l.rotateZ=function(a,b,c){c*=.5;var d=b[0],e=b[1],h=b[2];b=b[3];var g=Math.sin(c);c=Math.cos(c);a[0]=d*c+e*g;a[1]=e*c-d*g;a[2]=h*c+b*g;a[3]=b*c-h*g;return a};l.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};l.slerp=a;l.invert=function(a,
b){var c=b[0],d=b[1],e=b[2];b=b[3];var h=c*c+d*d+e*e+b*b;h=h?1/h:0;a[0]=-c*h;a[1]=-d*h;a[2]=-e*h;a[3]=b*h;return a};l.conjugate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=b[3];return a};l.fromMat3=b;l.fromEuler=function(a,b,c,e){var d=.5*Math.PI/180;b*=d;c*=d;e*=d;d=Math.sin(b);b=Math.cos(b);var h=Math.sin(c);c=Math.cos(c);var g=Math.sin(e);e=Math.cos(e);a[0]=d*c*e-b*h*g;a[1]=b*h*e+d*c*g;a[2]=b*c*g-d*h*e;a[3]=b*c*e+d*h*g;return a};l.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+
", "+a[3]+")"};var e=f(4),n=f(32),m=f(33);p=f(34);l.clone=p.b;l.fromValues=p.g;l.copy=p.c;l.set=p.l;l.add=p.a;l.mul=c;l.scale=p.k;l.dot=p.d;l.lerp=p.i;f=p.h;l.length=f;l.len=f;f=p.m;l.squaredLength=f;l.sqrLen=f;var h=p.j;l.normalize=h;l.exactEquals=p.f;l.equals=p.e;p=function(){var a=m.create(),b=m.fromValues(1,0,0),c=m.fromValues(0,1,0);return function(d,e,k){var f=m.dot(e,k);if(-.999999>f)return m.cross(a,b,e),1E-6>m.len(a)&&m.cross(a,c,e),m.normalize(a,a),g(d,a,Math.PI),d;if(.999999<f)return d[0]=
0,d[1]=0,d[2]=0,d[3]=1,d;m.cross(a,e,k);d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=1+f;return h(d,d)}}();l.rotationTo=p;p=function(){var b=k(),c=k();return function(d,e,h,g,k,m){a(b,e,k,m);a(c,h,g,m);a(d,b,c,2*m*(1-m));return d}}();l.sqlerp=p;p=function(){var a=n.a();return function(c,d,e,g){a[0]=e[0];a[3]=e[1];a[6]=e[2];a[1]=g[0];a[4]=g[1];a[7]=g[2];a[2]=-d[0];a[5]=-d[1];a[8]=-d[2];return h(c,b(c,a))}}();l.setAxes=p},function(p,l,f){function k(){var c=new g.a(2);c[0]=0;c[1]=0;return c}var g=f(4);(function(){var c=
k();return function(a,b,e,g,k,h){b||(b=2);e||(e=0);for(g=g?Math.min(g*b+e,a.length):a.length;e<g;e+=b)c[0]=a[e],c[1]=a[e+1],k(c,c,h),a[e]=c[0],a[e+1]=c[1];return a}})()},function(p,l,f){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var e=a[b];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(c,e.key,e)}}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 e=null;else e=b.next0,a=this.meld(a,b);a.next0=c;c=a;if(null===e)break;a=e}e=c;for(c=c.next0;null!==c;)a=c.next0,e=this.meld(e,c),c=a;e.prev0=null;e.next0=null;return e}},
{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,e=a.next0;b.child0===a?b.child0=e:b.next0=e;null!==e&&(e.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,m){for(;;)switch(b){case 0:if(null===c){b=1;break}h=c.child0;b=2;return{value:c,done:!1};case 2:if(void 0===
m){b=3;break}b=-1;throw m;case 3:case 4:if(null===h){b=5;break}k=h.next0;g=$jscomp.makeIterator(d.entries(h));case 6:if((e=g.next(a)).done){b=7;break}b=8;return{value:e.value,done:!1};case 8:if(void 0===m){b=9;break}b=-1;throw m;case 9:b=6;break;case 7:h=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,g,k,h,d=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,m){for(;;)switch(b){case 0:if(null===c){b=1;break}h=c.child0;c.child0=null;c.next0=null;c.prev0=null;b=2;return{value:c,done:!1};case 2:if(void 0===m){b=3;break}b=-1;throw m;case 3:case 4:if(null===h){b=5;break}k=h.next0;h.child0=null;h.next0=null;h.prev0=null;g=$jscomp.makeIterator(d.entries(h));case 6:if((e=g.next(a)).done){b=7;break}b=8;return{value:e.value,done:!1};case 8:if(void 0===m){b=
9;break}b=-1;throw m;case 9:b=6;break;case 7:h=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,g,k,h,d=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}();l.a=p},function(p,l,f){var k=function(){function g(c,a){for(var b=0;b<a.length;b++){var e=a[b];e.enumerable=e.enumerable||!1;e.configurable=
!0;"value"in e&&(e.writable=!0);Object.defineProperty(c,e.key,e)}}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 e=null;else e=b.next1,a=this.meld(a,b);a.next1=c;c=a;if(null===e)break;a=e}e=c;for(c=c.next1;null!==c;)a=c.next1,e=this.meld(e,c),c=a;e.prev1=null;e.next1=null;return e}},{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,e=a.next1;b.child1===a?b.child1=e:b.next1=e;null!==e&&(e.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,m){for(;;)switch(b){case 0:if(null===c){b=1;break}h=c.child1;b=2;return{value:c,done:!1};case 2:if(void 0===m){b=3;break}b=-1;throw m;case 3:case 4:if(null===h){b=5;break}k=h.next1;g=$jscomp.makeIterator(d.entries(h));case 6:if((e=g.next(a)).done){b=7;break}b=8;return{value:e.value,done:!1};case 8:if(void 0===m){b=9;break}b=-1;throw m;case 9:b=6;break;case 7:h=k;
b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,g,k,h,d=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,m){for(;;)switch(b){case 0:if(null===c){b=1;break}h=c.child1;c.child1=null;c.next1=null;c.prev1=null;b=2;return{value:c,done:!1};case 2:if(void 0===
m){b=3;break}b=-1;throw m;case 3:case 4:if(null===h){b=5;break}k=h.next1;h.child1=null;h.next1=null;h.prev1=null;g=$jscomp.makeIterator(d.entries(h));case 6:if((e=g.next(a)).done){b=7;break}b=8;return{value:e.value,done:!1};case 8:if(void 0===m){b=9;break}b=-1;throw m;case 9:b=6;break;case 7:h=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,e,g,k,h,d=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}();l.a=p},function(p,l,f){f.d(l,"a",function(){return b});var k=f(1),g=f(3),c=f(8),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,e){c&&a(b.prototype,c);e&&a(b,e);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(v){this.reset()}else if(16===a.length)try{Object(g.b)(this.transform,a),k.h.transpose(this.transform,this.transform)}catch(v){this.reset()}else this.reset();else if("object"===typeof a){b=k.j.create();var c=k.m.create(),d=k.m.fromValues(1,1,1);try{Object(g.b)(b,a.rotation),k.j.normalize(b,b)}catch(v){k.j.identity(b)}try{Object(g.b)(c,a.translation)}catch(v){k.m.copy(c,k.g)}try{Object(g.b)(d,a.scale)}catch(v){k.m.copy(d,k.f)}k.h.fromRotationTranslationScale(this.transform,
b,c,d);this.changed.dispatch()}else this.reset()}},{key:"clone",value:function(){return new b(k.h.clone(this.transform))}}]);return b}()},function(p,l,f){f.d(l,"a",function(){return c});var k=f(1),g=function(){function a(a,c){for(var b=0;b<c.length;b++){var e=c[b];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}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 e=a.cache,g=JSON.stringify([Array.from(b),Array.from(c)]),h=e.get(g);void 0===h&&(h=new a(b,c),e.set(g,h));return h}},{key:"fromObject",
value:function(b){return a.get(b.size,b.transform)}}]);return a}();c.cache=new Map},function(p,l,f){l.a=function(k,g){return k===g?!0:1E-6>Math.abs(k-g)/Math.min(Math.abs(k),Math.abs(g))}},function(p,l,f){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=f(35);p=f(0);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,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),a=function n(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 n(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===
b?void 0:b.call(c)}};l=this&&this.__decorate||function(a,b,c,d){var h=arguments.length,g=3>h?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,k;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var f=a.length-1;0<=f;f--)if(k=a[f])g=(3>h?k(g):3<h?k(b,c,g):k(b,c))||g;return 3<h&&g&&Object.defineProperty(b,c,g),g};f=b=function(f){function m(a,b){b=void 0===b?{}:b;if(!(this instanceof m))throw new TypeError("Cannot call a class as a function");
var c=(m.__proto__||Object.getPrototypeOf(m)).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(m,f);c(m,[{key:"initializeCounterpart",value:function(b,c){c=void 0===c?{}:c;c.value=this.value;a(m.prototype.__proto__||Object.getPrototypeOf(m.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 m}(p.c);f=b=l([Object(p.g)("SharedWatchableValue")],f);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,l,f){l.c="perspective_view/PerspectiveView";l.a="perspective_view/addLayer";l.b="perspective_view/removeLayer"},function(p,l,f){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)}f.d(l,"h",function(){return g});p=f(9);l.d="annotation.MetadataChunkSource";l.c="annotation.GeometryChunkSource";l.f="annotation.reference.add";l.g="annotation.reference.delete";l.b="annotation.commit";l.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);l.e="annotation/PerspectiveRenderLayer"},function(p,l,f){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(r.WithParameters)(Object(z.a)()(a),b)}function e(a,b){Object(M.c)(a,b,"fragmentKey");a.clipBounds&&(a.fragmentIds=n(a.fragmentIds,a.clipBounds));a.fragmentIds=d(a.fragmentIds);return a}function n(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=I.m.clone([500,500,500]),h=d;var g=e;var r=new K.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(I.a)(r);r=I.m.create();g=I.m.mul(r,h,g);h=I.m.create();I.m.scale(h,e,.5);r=I.m.create();I.m.add(r,g,h);m({center:r,size:e},b)&&c.push(d)}return c}function m(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:I.m.clone(c(a.center,a.size,-1)),max:I.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 h(a,b){Object(O.i)(b);var c=Object(O.j)(b,"fragmentKey",O.m);b=Object(O.j)(b,"supervoxelId",O.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=n(b,a.clipBounds));a.fragmentIds=d(b)}function d(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 v(a){var b=a.match(/([0-9]+),([0-9]+),([0-9]+)/);if(null===b)throw Error("Error parsing number triplet: "+JSON.stringify(a)+".");return I.m.fromValues(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3]))}function x(a){return a.volumeId+":"+a.changestack+":"}function q(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 w(a,b,c){var d=Object(O.j)(a,
"corner",function(a){return v(Object(O.l)(a))}),e=Object(O.j)(a,"size",function(a){return v(Object(O.l)(a))}),h=Object(O.j)(a,"payload",O.k),g=Object(O.j)(a,"type",O.l);a=Object(O.j)(a,"id",O.l);b=q(b,a);if(void 0!==c&&b!==c)throw Error("Received annotation has unexpected id "+JSON.stringify(a)+".");switch(g){case "LOCATION":if(I.m.equals(e,I.g))return{type:H.b.POINT,id:b,point:d,description:h};c=I.m.scale(I.m.create(),e,.5);d=I.m.add(I.m.create(),d,c);return{type:H.b.ELLIPSOID,id:b,center:d,radii:c,
description:h};case "LINE":return{type:H.b.LINE,id:b,pointA:d,pointB:I.m.add(I.m.create(),d,e),description:h};case "VOLUME":return{type:H.b.AXIS_ALIGNED_BOUNDING_BOX,id:b,pointA:d,pointB:I.m.add(I.m.create(),d,e),description:h};default:throw Error("Unknown spatial annotation type: "+JSON.stringify(g)+".");}}function E(a,b,c){Object(O.i)(a);a=Object(O.j)(a,"annotations",function(a){return Object(O.c)([void 0],a,O.i)})[0];return w(a,b,c)}function u(a,b){var c=new H.a,d=x(a.source.parent.parameters);
b.forEach(function(a,b){try{Object(O.i)(a);var e=Object(O.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 r=g.value;try{c.add(w(r,d))}catch(jb){throw Error("Error parsing annotation: "+jb.message);}}}catch(jb){throw Error("Error parsing "+Q[b]+" annotations: "+jb.message);}});Object.assign(a,c.serialize())}function C(a){var b=a.indexOf(".");
return a.substring(0,b)}function G(a){return Math.round(a[0])+","+Math.round(a[1])+","+Math.round(a[2])}function B(a){var b=a.description||"";switch(a.type){case H.b.LINE:case H.b.AXIS_ALIGNED_BOUNDING_BOX:var c=a.pointA,d=a.pointB,e=I.m.min(I.m.create(),c,d);c=I.m.max(I.m.create(),c,d);c=I.m.subtract(c,c,e);return{type:a.type===H.b.LINE?"LINE":"VOLUME",corner:G(e),size:G(c),payload:b};case H.b.POINT:return{type:"LOCATION",corner:G(a.point),size:"0,0,0",payload:b};case H.b.ELLIPSOID:return e=I.m.subtract(I.m.create(),
a.center,a.radii),a=I.m.scale(I.m.create(),a.radii,2),{type:"LOCATION",corner:G(e),size:G(a),payload:b}}}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"BrainmapsVolumeChunkSource",function(){return T});f.d(l,"BrainmapsMeshSource",function(){return ba});f.d(l,"BrainmapsSkeletonSource",function(){return ib});f.d(l,"BrainmapsAnnotationSource",function(){return hb});var H=f(69);p=f(37);var r=f(2),z=f(71),L=f(74),t=f(76),M=f(18),J=f(39);l=f(24);var F=f(17),A=f(19),D=f(13),P=f(12),I=f(1),O=f(3),
K=f(7);f=f(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}}(),N=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 r=a.length-
1;0<=r;r--)if(g=a[r])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},U=new Map([[t.d.RAW,A.a],[t.d.JPEG,F.a],[t.d.COMPRESSED_SEGMENTATION,l.a]]),T=function(b){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=U.get(a.parameters.encoding);return a}c(d,b);y(d,[{key:"applyEncodingParams",value:function(a){var b=this.parameters.encoding;switch(b){case t.d.RAW:a.subvolume_format="RAW";break;case t.d.JPEG:a.subvolume_format=
"SINGLE_IMAGE";a.image_format_options={image_format:"JPEG",jpeg_quality:70};break;case t.d.COMPRESSED_SEGMENTATION:a.subvolume_format="RAW";a.image_format_options={compressed_segmentation_block_size:Object(I.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 r="/v1/volumes/"+e.volumeId+"/subvolume:binary";h={geometry:{corner:Object(I.n)(h),
size:Object(I.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:r,responseType:"arraybuffer"},c).then(function(a){return d.chunkDecoder(b,a)})}}]);return d}(b(D.a,t.e));T=N([Object(f.g)()],T);var ba=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?h:e;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);y(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 l=f.getUint32(k+4,!0);l=(new K.a(m,l)).toString()+"\x00"}else l="";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));l+=n;if(!h.delete(l))throw Error("Received unexpected fragment key: "+
JSON.stringify(l)+".");k+=m;m=f.getUint32(k,!0);n=f.getUint32(k+4,!0);k+=8;l=f.getUint32(k,!0);var y=f.getUint32(k+4,!0);k+=8;if(0!==n||0!==y)throw Error("Invalid batch mesh fragment response.");n=k+12*l+12*m;if(n>c)throw Error("Invalid batch mesh fragment response.");g+=m;r+=3*l;t.push({buffer:b,verticesOffset:k,numVertices:m,indicesOffset:k+12*m,numIndices:3*l});k=n}if(0!==h.size)return d();b=new Float32Array(3*g);c=new Uint32Array(r);f=k=0;m=$jscomp.makeIterator(t);for(l=m.next();!l.done;l=m.next()){l=
l.value;b.set(new Float32Array(l.buffer,l.verticesOffset,3*l.numVertices),3*k);n=l.numIndices;y=new Uint32Array(l.buffer,l.indicesOffset,n);Object(P.d)(y,P.b.LITTLE);for(var q=0;q<n;++q)c[f++]=y[q]+k;k+=l.numVertices}Object(P.d)(b,P.b.LITTLE);a.vertexPositions=b;a.indices=c;a.vertexNormals=Object(M.b)(b,c)}function d(){var d=[];if(void 0!==e.changeSpec)for(var g=$jscomp.makeIterator(h),r=g.next();!r.done;r=g.next()){var t=r.value,f=t.indexOf("\x00");r=t.substring(0,f);t=t.substring(f+1);void 0!==
r&&d.push({object_id:r,fragment_keys:[]});d[d.length-1].fragment_keys.push(t)}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,r=0,t=[],k=this.credentialsProvider;return d()}}]);return b}(b(M.a,t.b));ba=
N([Object(f.g)()],ba);var ib=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(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(J.b)(b,a,P.b.LITTLE,16,d,void 0,e)})}}]);return d}(b(J.a,t.c));ib=N([Object(f.g)()],ib);var Q=["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);y(b,[{key:"downloadGeometry",
value:function(a,b){var c=this,d=this.parameters;return Promise.all(Q.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){u(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:C(d),id:c.volumeId+":"+c.changestack+":"+d}),responseType:"json"},b).then(function(b){a.annotation=E(b,x(c),d)},function(){a.annotation=null})}},{key:"add",value:function(a){var b=this,c=this.parameters;a=B(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(O.i)(a);
a=Object(O.j)(a,"ids",O.m);if(1!==a.length)throw Error("Expected list of 1 id, but received "+JSON.stringify(a)+".");var c=x(b.parameters);return q(c,a[0])})}},{key:"update",value:function(a,b){var c=this.parameters;b=B(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:C(a),ids:[b.volumeId+":"+b.changestack+":"+a]}),responseType:"json"})}}]);return b}(b(p.AnnotationSource,t.a));hb=N([Object(f.g)()],hb)},function(p,l,f){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=u.get(a.type).toJSON(a);b.type=w[a.type].toLowerCase();b.id=a.id;b.description=a.description||void 0;return b}
function b(a,b){b=void 0===b?!1:b;Object(h.i)(a);var c=Object(h.j)(a,"type",function(a){return Object(h.h)(a,w)});b={id:Object(h.j)(a,"id",b?h.k:h.l)||Object(d.a)(160),description:Object(h.j)(a,"description",h.k),type:c};u.get(c).restoreState(b,a);return b}function e(a,b){return a.id<b.id?-1:a.id===b.id?0:1}function n(a){for(var b=0,c=[],d=$jscomp.makeIterator(E),h=d.next();!h.done;h=d.next()){var g=h.value;c[g]=b;h=a[g];h.sort(e);h=h.length;g=u.get(g);b+=g.serializedBytes*h}d=[];b=new ArrayBuffer(b);
g=$jscomp.makeIterator(E);for(h=g.next();!h.done;h=g.next()){var k=h.value;h=a[k];d[k]=h.map(function(a){return a.id});var f=h.length;k=u.get(k).serializer(b,c[k],f);h.forEach(k)}return{data:new Uint8Array(b),typeToIds:d,typeToOffset:c}}f.d(l,"b",function(){return w});f.d(l,"a",function(){return C});p=f(15);var m=f(1),h=f(3),d=f(70),v=f(8),x=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(a){function b(a){k(this,b);var c=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));c.id=a;c.changed=new v.a;return c}c(b,a);return b}(p.a),w;(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"})(w||(w={}));var E=[w.POINT,w.LINE,w.AXIS_ALIGNED_BOUNDING_BOX,w.ELLIPSOID],u=new Map;u.set(w.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(h.j)(b,"pointA",h.g);a.pointB=Object(h.j)(b,"pointB",h.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]}}});u.set(w.POINT,{icon:"\u26ac",description:"Point",toJSON:function(a){return{point:Array.from(a.point)}},restoreState:function(a,
b){a.point=Object(h.j)(b,"point",h.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]}}});u.set(w.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(h.j)(b,"pointA",h.g);a.pointB=Object(h.j)(b,"pointB",h.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])}}});u.set(w.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(h.j)(b,"center",h.g);a.radii=Object(h.j)(b,"radii",h.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(e){function f(a){a=void 0===a?m.h.create():a;k(this,f);var b=g(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));b.objectToLocal=a;b.annotationMap=new Map;b.changed=new v.a;b.readonly=!1;b.pending=new Set;b.references=new Map;return b}c(f,e);
$jscomp.initSymbol();$jscomp.initSymbolIterator();x(f,[{key:"add",value:function(a,b){b=void 0===b?!0:b;if(!a.id)a.id=Object(d.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 q(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(h.a)(a,function(a){a=b(a);c.set(a.id,a)});a=$jscomp.makeIterator(this.references.values());for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=c.get(d.id);d.value=e||null;d.changed.dispatch()}this.changed.dispatch()}},{key:"reset",value:function(){this.clear()}}]);return f}(p.a));var C=function(){function a(){k(this,a);this.annotations=[[],[],[],[]]}x(a,[{key:"add",value:function(a){this.annotations[a.type].push(a)}},{key:"serialize",value:function(){return n(this.annotations)}}]);
return a}()},function(p,l,f){l.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,l,f){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)}l.a=function(){return function(a){return function(a){function b(a){for(var c=[],e=0;e<arguments.length;++e)c[e-0]=arguments[e];k(this,b);var h;e=g(this,(h=b.__proto__||Object.getPrototypeOf(b)).call.apply(h,[].concat([this],
$jscomp.arrayFromIterable(c))));e.credentialsProvider=e.rpc.getRef(c[1].credentialsProvider);return e}c(b,a);return b}(a)}};var a=f(72),b=f(73);p=f(0);l=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 k=a.length-1;0<=k;k--)if(g=a[k])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};f=
function(e){function f(){k(this,f);var c=g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments));c.get=Object(a.a)(function(a,d){return c.rpc.promiseInvoke(b.a,{providerId:c.rpcId,invalidCredentials:a},d)});return c}c(f,e);return f}(p.c);f=l([Object(p.g)(b.b)],f)},function(p,l,f){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)}l.a=function(b){var c,d,e;return function(h,g){if(void 0!==d&&(void 0===c||void 0===h||c.generation!==h.generation))return void 0===c&&e.addConsumer(g),
d;c=void 0;e=new a.c;return d=b(h,e).then(function(a){c=a;e=void 0;return a},function(a){e.isCanceled&&(d=e=void 0);throw a;})}};var a=f(14);p=f(15);var b=f(30),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,e){c&&a(b.prototype,c);e&&a(b,e);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 n=function(){function a(){k(this,a);this.providers=new Map}e(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 n))}c(b,a);e(b,[{key:"register",value:function(a,
b){this.base.register(a,b)}}]);return b})(function(a){function h(a){k(this,h);var c=g(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));c.base=a;c.memoize=new b.a;return c}c(h,a);e(h,[{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 h}(p.a))},function(p,l,f){l.b="CredentialsProvider";l.a="CredentialsProvider.get"},function(p,l,f){l.a=function(c,
a,b,e){e=void 0===e?k.e:e;var f=void 0;return new Promise(function(l,h){function d(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?(e.remove(m),l(this.response)):401===b?a.get(k,e).then(d):504===b||503===b?a.get(void 0,e).then(d):(e.remove(m),h(g.a.fromXhr(this)))}},f.send(b.payload))}var m=function(){var a=
f;f=null;null!=a&&a.abort();h(k.a)};e.add(m);a.get(void 0,e).then(d)})};var k=f(14),g=f(11)},function(p,l,f){l.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,l,f){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");}f.d(l,"d",function(){return c});f.d(l,"e",function(){return a});f.d(l,"b",function(){return b});f.d(l,"c",function(){return e});f.d(l,"a",function(){return n});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 h(){g(this,h)};a.RPC_ID="brainmaps/VolumeChunkSource";var b=function d(){g(this,d)};b.RPC_ID=
"brainmaps/MeshSource";var e=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);e.RPC_ID="brainmaps/SkeletonSource";var n=function v(){g(this,v)};n.RPC_ID="brainmaps/Annotation"},function(p,l,f){l.b="mesh/MeshLayer";l.a="mesh/FragmentSource"},function(p,l,f){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=f(79),c=f(3),a=f(8),b=f(7);p=f(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}}(),n=function v(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 v(a,b,c)}else{if("value"in e)return e.value;b=e.get;return void 0===b?void 0:b.call(c)}};l=this&&this.__decorate||function(a,b,c,e){var g=arguments.length,h=3>g?b:null===e?e=Object.getOwnPropertyDescriptor(b,c):e,k;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)h=
Reflect.decorate(a,b,c,e);else for(var f=a.length-1;0<=f;f--)if(k=a[f])h=(3>g?k(h):3<g?k(b,c,h):k(b,c))||h;return 3<g&&h&&Object.defineProperty(b,c,h),h};f=function(h){function f(){if(!(this instanceof f))throw new TypeError("Cannot call a class as a function");var b=(f.__proto__||Object.getPrototypeOf(f)).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(f,h);e(f,[{key:"disposed",value:function(){this.changed=this.disjointSets=void 0;n(f.prototype.__proto__||Object.getPrototypeOf(f.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 e=this;this.clear();if(void 0!==a){var g=[new b.a,new b.a];Object(c.a)(a,function(a){Object(c.a)(a,function(a,b){g[b%2].parseString(String(a),10);0!==b&&e.link(g[0],g[1])})})}}},{key:"size",get:function(){return this.disjointSets.size}}],
[{key:"makeWithCounterpart",value:function(a){var b=new this;b.initializeCounterpart(a);return b}}]);return f}(p.c);f=l([Object(p.g)("DisjointUint64Sets")],f);var m=new b.a,h=new b.a;Object(p.f)("DisjointUint64Sets.add",function(a){var b=this.get(a.id);m.low=a.al;m.high=a.ah;h.low=a.bl;h.high=a.bh;b.disjointSets.link(m,h)&&b.changed.dispatch()});Object(p.f)("DisjointUint64Sets.clear",function(a){a=this.get(a.id);a.disjointSets.clear()&&a.changed.dispatch()})},function(p,l,f){function k(a){for(var b=
a,c=a[e];c!==a;)a=c,c=a[e];for(a=b[e];c!==a;)b[e]=c,b=a,a=b[e];return c}function g(a){function b(b,g){for(;;)switch(c){case 0:e=!0,d=a;case 1:if(!e&&d===a){c=3;break}c=4;return{value:d,done:!1};case 4:if(void 0===g){c=5;break}c=-1;throw g;case 5:d=d[n];case 2:e=!1;c=1;break;case 3:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,e,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}f.d(l,"a",function(){return d});var c=f(7),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 e=Symbol("disjoint_sets:parent");$jscomp.initSymbol();var n=Symbol("disjoint_sets:next");
$jscomp.initSymbol();var m=Symbol("disjoint_sets:prev");$jscomp.initSymbol();var h=Symbol("disjoint_sets:min"),d=function(){function d(){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");this.map=new Map;this.generation=0}$jscomp.initSymbol();$jscomp.initSymbolIterator();a(d,[{key:"get",value:function(a){var b=this.map.get(a.toString());return void 0===b?a:k(b)[h]}},{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(),d=this.map,g=d.get(c);return void 0===g?(a=g=a.clone(),a[e]=a,a[b]=0,a[n]=a[m]=a,g[h]=g,d.set(c,g),g):k(g)}},{key:"link",value:function(a,d){a=this.makeSet(a);d=this.makeSet(d);if(a===d)return!1;this.generation++;var g=a;var k=d,f=g[b],l=k[b];f>l?k[e]=g:(g[e]=k,f===l&&(k[b]=l+1),g=k);k=a;f=d;l=k[m];var p=f[m];f[m]=l;l[n]=f;k[m]=p;p[n]=k;a=a[h];d=d[h];g[h]=c.a.less(a,d)?a:d;return!0}},{key:"setElements",value:function(a){function b(b,l){for(;;)switch(c){case 0:k=
a.toString();h=f.map.get(k);if(void 0!==h){c=1;break}c=3;return{value:a,done:!1};case 3:if(void 0===l){c=4;break}c=-1;throw l;case 4:c=2;break;case 1:e=$jscomp.makeIterator(g(h));case 5:if((d=e.next(b)).done){c=6;break}c=7;return{value:d.value,done:!1};case 7:if(void 0===l){c=8;break}c=-1;throw l;case 8:c=5;break;case 6:case 2:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,e,h,k,f=this,l={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();l[Symbol.iterator]=function(){return this};return l}},{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,r){for(;;)switch(c){case 0:a=void 0===a?Array(2):a,g=$jscomp.makeIterator(f.map.values()),e=g.next();case 1:if(e.done){c=3;break}d=e.value;a[0]=d;a[1]=k(d)[h];c=4;return{value:a,done:!1};case 4:if(void 0===r){c=5;break}c=-1;throw r;case 5:case 2:e=g.next();c=1;
break;case 3:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,e,g,f=this,l={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();l[Symbol.iterator]=function(){return this};return l}},{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 h=d.value;if(h[e]===h){d=
[];h=$jscomp.makeIterator(g(h));for(var k=h.next();!k.done;k=h.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 d}()},function(p,l,f){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=f(81),c=f(8);p=f(0);var a=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}}(),b=function m(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 m(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};l=this&&this.__decorate||function(a,b,c,e){var d=arguments.length,g=3>d?b:null===e?e=Object.getOwnPropertyDescriptor(b,c):e,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,c,e);else for(var k=a.length-1;0<=k;k--)if(h=a[k])g=(3>d?h(g):3<d?h(b,c,g):h(b,c))||g;return 3<d&&g&&Object.defineProperty(b,c,g),g};
f=e=function(f){function h(){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");var a=(h.__proto__||Object.getPrototypeOf(h)).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(h,f);$jscomp.initSymbol();$jscomp.initSymbolIterator();a(h,[{key:"disposed",value:function(){b(h.prototype.__proto__||Object.getPrototypeOf(h.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 e;b.initializeCounterpart(a);return b}}]);return h}(p.c);f=e=l([Object(p.g)("Uint64Set")],f);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 e},function(p,l,f){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");}f.d(l,"a",function(){return x});var a=
f(82),b=f(7),e=function G(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 G(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(){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=0,h=0,d=0,v=0;p=function(){function e(a){a=void 0===a?e.generateHashFunctions(3):a;c(this,e);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)}n(e,[{key:"updateHashFunctions",value:function(a){this.hashFunctions=e.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 e=0;e<b;++e)for(var g=this.getHash(e,d,d),h=0;h<b;++h)if(c[h]===g)continue a;this.mungedEmptyKey=d;break}e=this.table;g=this.emptyLow;h=this.emptyHigh;for(var k=0;k<b;++k){var f=c[k];e[f]===g&&e[f+1]===h&&(e[f]=d,e[f+1]=d)}try{a(e)}finally{for(a=0;a<b;++a)k=c[a],e[k]===d&&e[k+1]===d&&(e[k]=g,e[k+
1]=h)}}},{key:"getHash",value:function(a,b,c){a=this.hashFunctions[a];var d=this.width,e=this.height;d=a[0].compute(b,c)%d;b=a[1].compute(b,c)%e;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,q=u,p=q.emptyLow,n=q.emptyHigh,m=q.entryStride,l=u,f=l.table,k=0,h=f.length;case 1:if(!(k<h)){d=3;break}g=f[k];e=f[k+1];if(g===p&&e===n){d=4;break}a.low=g;a.high=e;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:k+=m;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}var d=0,e,g,h,k,f,l,m,n,p,q,u=this,B={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();B[Symbol.iterator]=function(){return this};return B}},{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 e=this.hashFunctions.length;d<
e;++d){var g=this.getHash(d,a,b);if(c[g]===a&&c[g+1]===b)return g}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,e,g;e=4294967296*Math.random()>>>0,g=4294967296*Math.random()>>>0,e===a&&g===b||this.hasPair(e,g););this.emptyLow=e;this.emptyHigh=g;for(var h=0,k=c.length;h<k;h+=d)c[h]===a&&c[h+1]===b&&(c[h]=e,c[h+1]=g)}},{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,e=a.length,g=0;g<e;g+=b)a[g]=c,a[g+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=m,d=h;this.storePending(a,b);a[b]=c;a[b+1]=d}},{key:"storePending",value:function(a,b){m=a[b];h=a[b+1]}},{key:"backupPending",value:function(){d=m;v=h}},{key:"restorePending",value:function(){m=d;h=v}},{key:"tryToInsert",value:function(){for(var a=0,b=this.emptyLow,c=this.emptyHigh,d=this.maxAttempts,e=this.table,g=this.hashFunctions.length,k=Math.floor(Math.random()*g);;){var f=this.getHash(k,m,h);this.swapPending(e,f);if(m===b&&h===c)return!0;
if(++a===d)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,e=0,g=a.length;e<g;e+=d){var h=a[e+1];if(a[e]!==b||
h!==c)if(this.storePending(a,e),!this.tryToInsert())return!1}return!0}},{key:"grow",value:function(a){for(var b=this.table,c=this.width,d=this.height,e=this.maxWidth,g=this.maxHeight;;){var h=c*d;c=Math.min(e,Math.ceil(a/this.height));c*d<a&&(d=Math.min(g,Math.ceil(a/c)));var k=c*d;if(k<a&&k===h)throw Error("Maximum table size exceeded");for(h=0;h<this.maxRehashAttempts;++h)if(this.rehash(b,c,d))return;a=Math.ceil(this.growFactor*a)}}},{key:"insertInternal",value:function(){++this.generation;m===
this.emptyLow&&h===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 e=[a.a.generate(),a.a.generate()];c.push(e)}return c}}]);return e}();var x=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();n(b,[{key:"add",value:function(a){var b=a.low;a=a.high;if(this.hasPair(b,a))return!1;m=b;h=a;this.insertInternal();return!0}},{key:Symbol.iterator,value:function(){return this.keys()}}]);return b}(p);x.prototype.entryStride=2;var q=0,w=0,E=0,u=0;(function(a){function d(){c(this,d);return k(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}g(d,a);
$jscomp.initSymbol();$jscomp.initSymbolIterator();n(d,[{key:"set",value:function(a,b){var c=a.low;a=a.high;if(this.hasPair(c,a))return!1;m=c;h=a;q=b.low;w=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=q,g=w;e(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"swapPending",this).call(this,a,b);a[b+2]=c;a[b+3]=g}},{key:"storePending",
value:function(a,b){e(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"storePending",this).call(this,a,b);q=a[b+2];w=a[b+3]}},{key:"backupPending",value:function(){e(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"backupPending",this).call(this);E=q;u=w}},{key:"restorePending",value:function(){e(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"restorePending",this).call(this);q=E;w=u}},{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,N=v,y=N.emptyLow,u=N.emptyHigh,q=N.entryStride,p=v,n=p.table,m=$jscomp.makeIterator(a),l=m.next().value,f=m.next().value,k=0,h=n.length;case 1:if(!(k<h)){d=3;break}g=n[k];e=n[k+1];if(g===y&&e===u){d=4;break}l.low=g;l.high=e;f.low=n[k+2];f.high=n[k+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:k+=q;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}var d=0,e,g,h,k,f,l,m,n,p,q,u,y,
N,v=this,T={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();T[Symbol.iterator]=function(){return this};return T}}]);return d})(p).prototype.entryStride=4},function(p,l,f){f.d(l,"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,e){b&&c(a.prototype,b);e&&c(a,e);return a}}(),g=function(){function c(a,b,e,g){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.a0=a;this.a1=b;this.b=e;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,l,f){l.a="skeleton/SkeletonLayer"},function(p,l,f){function k(c,d,k,f,l,p,E,u){var h=l[0],q=l[1],v=l[2];l=f[0];var w=f[1];f=f[2];
var r=k[0],z=k[1],x=k[2];x-=z*q;z-=r*h;if(0===h*q*v)return[0,0];k=l*w*f+31;if(void 0===a||a.length<k)a=new Uint32Array(k),b=new Uint32Array(1*k),e=new Uint32Array(1*k),n=new Uint32Array(k),m=new Uint32Array(k);k=a.subarray(0,k);k.fill(0);for(var t=b,M=e,J=n,F=m,A=0,D=c[d]+1>>>0,P=0,I=l-h,O=l*w-l*q,K=0;K<v;++K,d+=x,P+=O)for(var y=0;y<q;++y,d+=z,P+=I)for(var N=0;N<h;++N,d+=r){var U=c[d];U!==D&&(D=t[1*A]=U,J[A]=A++);k[P++]=A}J.subarray(0,A).sort(function(a,b){return t[a]-t[b]});c=-1;h=t[1*J[0]]+1>>>
0;for(q=0;q<A;++q)v=J[q],r=t[1*v],r!==h&&(++c,h=M[1*c]=r),F[v+1]=c;++c;return Object(g.c)(u,p,E,l*w*f,c,M,k,F,1)}l.a=function(a,b,e,f,l,m){l=void 0===l?0:l;m=void 0===m?Object(c.a)(f,1):m;return Object(g.b)(a,b,e,f,l,m,k)};var g=f(22),c=f(21),a,b,e,n,m},function(p,l,f){function k(c,d,k,f,l,p,E,u){var h=l[0],q=l[1],v=l[2];l=f[0];var w=f[1];f=f[2];var r=k[0],z=k[1],x=k[2];x-=z*q;z-=r*h;if(0===h*q*v)return[0,0];k=l*w*f+31;if(void 0===a||a.length<k)a=new Uint32Array(k),b=new Uint32Array(2*k),e=new Uint32Array(2*
k),n=new Uint32Array(k),m=new Uint32Array(k);k=a.subarray(0,k);k.fill(0);for(var t=b,M=e,J=n,F=m,A=0,D=c[d]+1>>>0,P=0,I=0,O=l-h,K=l*w-l*q,y=0;y<v;++y,d+=x,I+=K)for(var N=0;N<q;++N,d+=z,I+=O)for(var U=0;U<h;++U,d+=r){var T=c[d],ba=c[d+1];if(T!==D||ba!==P)D=t[2*A]=T,P=t[2*A+1]=ba,J[A]=A++;k[I++]=A}J.subarray(0,A).sort(function(a,b){var c=t[2*a],d=t[2*b];return t[2*a+1]-t[2*b+1]||c-d});c=-1;h=t[2*J[0]]+1>>>0;for(q=z=0;q<A;++q){v=J[q];x=2*v;r=t[x];x=t[x+1];if(r!==h||x!==z)++c,z=2*c,h=M[z]=r,z=M[z+1]=
x;F[v+1]=c}++c;return Object(g.c)(u,p,E,l*w*f,c,M,k,F,2)}l.a=function(a,b,e,f,l,m){l=void 0===l?0:l;m=void 0===m?Object(c.a)(f,2):m;return Object(g.b)(a,b,e,f,l,m,k)};var g=f(22),c=f(21),a,b,e,n,m},function(p,l,f){f.d(l,"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,e){b&&c(a.prototype,b);e&&c(a,e);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,l,f){l.a=function(a,b,e){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!==
e)throw Error("JPEG data does not have the expected number of components: "+("components="+f.numComponents+", expected="+e));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=f(88);f.n(k);var g=f(21),c=f(1)},function(p,l,f){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 e=c.length-1;0<=e;e--)b[e]=c.charCodeAt(e);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)}}l=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 k=this._parser.getData(b,c,!1);for(c=b=0;b<g;){var h=k[c++];a[b++]=h;a[b++]=h;a[b++]=h;a[b++]=
255}}else for(k=this._parser.getData(b,c,!0),c=b=0;b<g;)a[b++]=k[c++],a[b++]=k[c++],a[b++]=k[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 e(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 k=function(){function a(){}function b(a,b){for(var c=0,d=[],e,g,h=16;0<h&&!a[h-1];)h--;d.push({children:[],
index:0});var k=d[0],f;for(e=0;e<h;e++){for(g=0;g<a[e];g++){k=d.pop();for(k.children[k.index]=b[c];0<k.index;)k=d.pop();k.index++;for(d.push(k);d.length<=e;)d.push(f={children:[],index:0}),k.children[k.index]=f.children,k=f;c++}e+1<h&&(d.push(f={children:[],index:0}),k.children[k.index]=f.children,k=f)}return d[0].children}function c(a,b,c,d,e,h,k,f,l){function r(){if(0<v)return v--,F>>v&1;F=a[b++];if(255===F){var c=a[b++];if(c)throw"unexpected marker: "+(F<<8|c).toString(16);}v=7;return F>>>7}function t(a){for(;;){a=
a[r()];if("number"===typeof a)return a;if("object"!==typeof a)throw"invalid huffman sequence";}}function m(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=m(a);return b>=1<<a-1?b:b+(-1<<a)+1}function y(a,b){var c=t(a.huffmanTableDC);c=0===c?0:n(c);a.blockData[b]=a.pred+=c;for(c=1;64>c;){var d=t(a.huffmanTableAC),e=d&15;d>>=4;if(0===e){if(15>d)break;c+=16}else c+=d,a.blockData[b+g[c]]=n(e),c++}}function p(a,b){var c=t(a.huffmanTableDC);c=0===c?0:n(c)<<l;
a.blockData[b]=a.pred+=c}function q(a,b){a.blockData[b]|=r()<<l}function J(a,b){if(0<A)A--;else for(var c=h;c<=k;){var d=t(a.huffmanTableAC),e=d&15;d>>=4;if(0===e){if(15>d){A=m(d)+(1<<d)-1;break}c+=16}else c+=d,a.blockData[b+g[c]]=n(e)*(1<<l),c++}}function u(a,b){for(var c=h,d=0,e;c<=k;){e=g[c];switch(w){case 0:d=t(a.huffmanTableAC);e=d&15;d>>=4;if(0===e)15>d?(A=m(d)+(1<<d),w=4):(d=16,w=1);else{if(1!==e)throw"invalid ACn encoding";B=n(e);w=d?2:3}continue;case 1:case 2:a.blockData[b+e]?a.blockData[b+
e]+=r()<<l:(d--,0===d&&(w=2===w?3:0));break;case 3:a.blockData[b+e]?a.blockData[b+e]+=r()<<l:(a.blockData[b+e]=B<<l,w=0);break;case 4:a.blockData[b+e]&&(a.blockData[b+e]+=r()<<l)}c++}4===w&&(A--,0===A&&(w=0))}var M=c.mcusPerLine,z=b,F=0,v=0,A=0,w=0,B,x=d.length,H,D,C,L;f=c.progressive?0===h?0===f?p:q:0===f?J:u:y;var G=0;c=1===x?d[0].blocksPerLine*d[0].blocksPerColumn:M*c.mcusPerColumn;e||(e=c);for(var E,Lb;G<c;){for(H=0;H<x;H++)d[H].pred=0;A=0;if(1===x){var Z=d[0];for(L=0;L<e;L++)f(Z,64*((Z.blocksPerLine+
1)*(G/Z.blocksPerLine|0)+G%Z.blocksPerLine)),G++}else for(L=0;L<e;L++){for(H=0;H<x;H++)for(Z=d[H],E=Z.h,Lb=Z.v,D=0;D<Lb;D++)for(C=0;C<E;C++)f(Z,64*((Z.blocksPerLine+1)*((G/M|0)*Z.v+D)+(G%M*Z.h+C)));G++}v=0;Z=a[b]<<8|a[b+1];if(65280>=Z)throw"marker was not found";if(65488<=Z&&65495>=Z)b+=2;else break}return b-z}function d(a,b){a=b.blocksPerLine;for(var c=b.blocksPerColumn,d=new Int16Array(64),e=0;e<c;e++)for(var g=0;g<a;g++){for(var h,k,f,l,r,m,n,y,p,q,u,z,v=64*((b.blocksPerLine+1)*e+g),Q=d,w=b.quantizationTable,
B=b.blockData,x=0;64>x;x+=8)h=B[v+x],y=B[v+x+1],n=B[v+x+2],m=B[v+x+3],r=B[v+x+4],l=B[v+x+5],f=B[v+x+6],k=B[v+x+7],h*=w[x],0===(y|n|m|r|l|f|k)?(h=5793*h+512>>10,Q[x]=h,Q[x+1]=h,Q[x+2]=h,Q[x+3]=h,Q[x+4]=h,Q[x+5]=h,Q[x+6]=h,Q[x+7]=h):(y*=w[x+1],n*=w[x+2],m*=w[x+3],r*=w[x+4],l*=w[x+5],f*=w[x+6],k*=w[x+7],z=5793*h+128>>8,u=5793*r+128>>8,q=n,p=f,r=2896*(y-k)+128>>8,k=2896*(y+k)+128>>8,m<<=4,l<<=4,z=z+u+1>>1,u=z-u,h=3784*q+1567*p+128>>8,q=1567*q-3784*p+128>>8,p=h,r=r+l+1>>1,l=r-l,k=k+m+1>>1,m=k-m,z=z+p+
1>>1,p=z-p,u=u+q+1>>1,q=u-q,h=2276*r+3406*k+2048>>12,r=3406*r-2276*k+2048>>12,k=h,h=799*m+4017*l+2048>>12,m=4017*m-799*l+2048>>12,l=h,Q[x]=z+k,Q[x+7]=z-k,Q[x+1]=u+l,Q[x+6]=u-l,Q[x+2]=q+m,Q[x+5]=q-m,Q[x+3]=p+r,Q[x+4]=p-r);for(w=0;8>w;++w)h=Q[w],y=Q[w+8],n=Q[w+16],m=Q[w+24],r=Q[w+32],l=Q[w+40],f=Q[w+48],k=Q[w+56],0===(y|n|m|r|l|f|k)?(h=5793*h+8192>>14,h=-2040>h?0:2024<=h?255:h+2056>>4,B[v+w]=h,B[v+w+8]=h,B[v+w+16]=h,B[v+w+24]=h,B[v+w+32]=h,B[v+w+40]=h,B[v+w+48]=h,B[v+w+56]=h):(z=5793*h+2048>>12,u=5793*
r+2048>>12,q=n,p=f,r=2896*(y-k)+2048>>12,k=2896*(y+k)+2048>>12,z=(z+u+1>>1)+4112,u=z-u,h=3784*q+1567*p+2048>>12,q=1567*q-3784*p+2048>>12,p=h,r=r+l+1>>1,l=r-l,k=k+m+1>>1,m=k-m,z=z+p+1>>1,p=z-p,u=u+q+1>>1,q=u-q,h=2276*r+3406*k+2048>>12,r=3406*r-2276*k+2048>>12,k=h,h=799*m+4017*l+2048>>12,m=4017*m-799*l+2048>>12,l=h,h=z+k,k=z-k,y=u+l,f=u-l,n=q+m,l=q-m,m=p+r,r=p-r,h=16>h?0:4080<=h?255:h>>4,y=16>y?0:4080<=y?255:y>>4,n=16>n?0:4080<=n?255:n>>4,m=16>m?0:4080<=m?255:m>>4,r=16>r?0:4080<=r?255:r>>4,l=16>l?0:
4080<=l?255:l>>4,f=16>f?0:4080<=f?255:f>>4,k=16>k?0:4080<=k?255:k>>4,B[v+w]=h,B[v+w+8]=y,B[v+w+16]=n,B[v+w+24]=m,B[v+w+32]=r,B[v+w+40]=l,B[v+w+48]=f,B[v+w+56]=k)}return b.blockData}function e(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 e(){var b=a[f]<<8|a[f+1];f+=2;return b}
function h(){var b=e();b=a.subarray(f,f+b-2);f+=b.length;return b}function k(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++){Q=a.components[d];var e=Math.ceil(Math.ceil(a.samplesPerLine/8)*Q.h/a.maxH),g=Math.ceil(Math.ceil(a.scanLines/8)*Q.v/a.maxV);Q.blockData=new Int16Array(64*c*Q.v*(b*Q.h+1));Q.blocksPerLine=e;Q.blocksPerColumn=g}a.mcusPerLine=b;a.mcusPerColumn=c}var f=0,l=null,r=null,m=[],n=[],p=[];var q=e();if(65496!==q)throw"SOI not found";
for(q=e();65497!==q;){switch(q){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 u=h();65504===q&&74===u[0]&&70===u[1]&&73===u[2]&&70===u[3]&&0===u[4]&&(l={version:{major:u[5],minor:u[6]},densityUnits:u[7],xDensity:u[8]<<8|u[9],yDensity:u[10]<<8|u[11],thumbWidth:u[12],thumbHeight:u[13],thumbData:u.subarray(14,14+3*u[12]*u[13])});65518===q&&65===u[0]&&100===
u[1]&&111===u[2]&&98===u[3]&&101===u[4]&&0===u[5]&&(r={version:u[6],flags0:u[7]<<8|u[8],flags1:u[9]<<8|u[10],transformCode:u[11]});break;case 65499:q=e()+f-2;for(var v;f<q;){var y=a[f++],N=new Uint16Array(64);if(0===y>>4)for(u=0;64>u;u++)v=g[u],N[v]=a[f++];else if(1===y>>4)for(u=0;64>u;u++)v=g[u],N[v]=e();else throw"DQT: invalid table spec";m[y&15]=N}break;case 65472:case 65473:case 65474:if(w)throw"Only single frame JPEGs supported";e();var w={};w.extended=65473===q;w.progressive=65474===q;w.precision=
a[f++];w.scanLines=e();w.samplesPerLine=e();w.components=[];w.componentIds={};u=a[f++];for(q=N=y=0;q<u;q++){v=a[f];var T=a[f+1]>>4;var ba=a[f+1]&15;y<T&&(y=T);N<ba&&(N=ba);T=w.components.push({h:T,v:ba,quantizationTable:m[a[f+2]]});w.componentIds[v]=T-1;f+=3}w.maxH=y;w.maxV=N;k(w);break;case 65476:v=e();for(q=2;q<v;){y=a[f++];N=new Uint8Array(16);for(u=T=0;16>u;u++,f++)T+=N[u]=a[f];ba=new Uint8Array(T);for(u=0;u<T;u++,f++)ba[u]=a[f];q+=17+T;(0===y>>4?p:n)[y&15]=b(N,ba)}break;case 65501:e();var B=
e();break;case 65498:e();v=a[f++];u=[];for(q=0;q<v;q++){y=w.componentIds[a[f++]];var Q=w.components[y];y=a[f++];Q.huffmanTableDC=p[y>>4];Q.huffmanTableAC=n[y&15];u.push(Q)}q=a[f++];v=a[f++];y=a[f++];q=c(a,f,w,u,B,q,v,y>>4,y&15);f+=q;break;case 65535:255!==a[f]&&f--;break;default:if(255===a[f-3]&&192<=a[f-2]&&254>=a[f-2])f-=3;else throw"unknown JPEG marker "+q.toString(16);}q=e()}this.width=w.samplesPerLine;this.height=w.scanLines;this.jfif=l;this.adobe=r;this.components=[];for(q=0;q<w.components.length;q++)Q=
w.components[q],this.components.push({output:d(w,Q),scaleX:Q.h/w.maxH,scaleY:Q.v/w.maxV,blocksPerLine:Q.blocksPerLine,blocksPerColumn:Q.blocksPerColumn});this.numComponents=this.components.length},_getLinearizedBlockData:function(a,b){var c=this.width/a,d=this.height/b,e,g,h=this.components.length,k=a*b*h,f=new Uint8Array(k),l=new Uint32Array(a);for(g=0;g<h;g++){var r=this.components[g];var m=r.scaleX*c;var n=r.scaleY*d;var y=g;var p=r.output;var q=r.blocksPerLine+1<<3;for(e=0;e<a;e++)r=0|e*m,l[e]=
(r&4294967288)<<3|r&7;for(m=0;m<b;m++)for(r=0|m*n,r=q*(r&4294967288)|(r&7)<<3,e=0;e<a;e++)f[y]=p[r+l[e]],y+=h}if(b=this.decodeTransform)for(g=0;g<k;)for(a=r=0;r<h;r++,g++,a+=2)f[g]=(f[g]*b[a]>>8)+b[a+1];return f},_isColorConversionNeeded:function(){return this.adobe&&this.adobe.transformCode?!0:3===this.numComponents?!0:!1},_convertYccToRgb:function(a){for(var b,c,d,g=0,h=a.length;g<h;g+=3)b=a[g],c=a[g+1],d=a[g+2],a[g]=e(b-179.456+1.402*d),a[g+1]=e(b+135.459-.344*c-.714*d),a[g+2]=e(b-226.816+1.772*
c);return a},_convertYcckToRgb:function(a){for(var b,c,d,g,h=0,k=0,f=a.length;k<f;k+=4){b=a[k];c=a[k+1];d=a[k+2];g=a[k+3];var l=-122.67195406894+c*(-6.60635669420364E-5*c+4.37130475926232E-4*d-5.4080610064599E-5*b+4.8449797120281E-4*g-.154362151871126)+d*(-9.57964378445773E-4*d+8.17076911346625E-4*b-.00477271405408747*g+1.53380253221734)+b*(9.61250184130688E-4*b-.00266257332283933*g+.48357088451265)+g*(-3.36197177618394E-4*g+.484791561490776),r=107.268039397724+c*(2.19927104525741E-5*c-6.40992018297945E-4*
d+6.59397001245577E-4*b+4.26105652938837E-4*g-.176491792462875)+d*(-7.78269941513683E-4*d+.00130872261408275*b+7.70482631801132E-4*g-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*g+.25802910206845)+g*(-3.18913117588328E-4*g-.213742400323665);b=-20.810012546947+c*(-5.70115196973677E-4*c-2.63409051004589E-5*d+.0020741088115012*b-.00288260236853442*g+.814272968359295)+d*(-1.53496057440975E-5*d-1.32689043961446E-4*b+5.60833691242812E-4*g-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*
g+.116935020465145)+g*(-3.43531996510555E-4*g+.24165260232407);a[h++]=e(l);a[h++]=e(r);a[h++]=e(b)}return a},_convertYcckToCmyk:function(a){for(var b,c,d,g=0,h=a.length;g<h;g+=4)b=a[g],c=a[g+1],d=a[g+2],a[g]=e(434.456-b-1.402*d),a[g+1]=e(119.541-b+.344*c+.714*d),a[g+2]=e(481.816-b-1.772*c);return a},_convertCmykToRgb:function(a){for(var b,c,d,e,g=0,h=1/255/255,k=0,f=a.length;k<f;k+=4){b=a[k];c=a[k+1];d=a[k+2];e=a[k+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),r=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[g++]=0<=l?255:-16581375>=l?0:255+l*h|0;a[g++]=0<=r?255:-16581375>=r?0:255+r*h|0;a[g++]=0<=b?255:-16581375>=b?0:255+b*h|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 h=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 g=d.qe,h=this.a-g;if(this.chigh<g)h<g?(h=g,g=e,d=d.nmps):(h=g,g=1^e,1===d.switchFlag&&(e=g),d=d.nlps);else{this.chigh-=g;if(0!==(h&32768))return this.a=h,e;h<g?(g=1^e,1===d.switchFlag&&(e=g),d=d.nlps):(g=e,d=d.nmps)}do 0===this.ct&&this.byteIn(),h<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(h&32768));
this.a=h;a[c]=d<<1|e;return g}};return a}();"use strict";var d=function(){function c(){this.failOnCorruptedImage=!1}function d(a,b,c){a=c.xcb_;c=c.ycb_;var d=1<<a,e=1<<c,g=b.tbx0>>a,h=b.tby0>>c,k=b.tbx1+d-1>>a,f=b.tby1+e-1>>c,l=b.resolution.precinctParameters,r=[],m=[],t,y;for(y=h;y<f;y++)for(t=g;t<k;t++){var n={cbx:t,cby:y,tbx0:d*t,tby0:e*y,tbx1:d*(t+1),tby1:e*(y+1)};n.tbx0_=Math.max(b.tbx0,n.tbx0);n.tby0_=Math.max(b.tby0,n.tby0);n.tbx1_=Math.min(b.tbx1,n.tbx1);n.tby1_=Math.min(b.tby1,n.tby1);var p=
Math.floor((n.tbx0_-b.tbx0)/l.precinctWidthInSubband)+Math.floor((n.tby0_-b.tby0)/l.precinctHeightInSubband)*l.numprecinctswide;n.precinctNumber=p;n.subbandType=b.type;n.Lblock=3;if(!(n.tbx1_<=n.tbx0_||n.tby1_<=n.tby0_)){r.push(n);var q=m[p];void 0!==q?(t<q.cbxMin?q.cbxMin=t:t>q.cbxMax&&(q.cbxMax=t),y<q.cbyMin?q.cbxMin=y:y>q.cbyMax&&(q.cbyMax=y)):m[p]=q={cbxMin:t,cbyMin:y,cbxMax:t,cbyMax:y};n.precinct=q}}b.codeblockParameters={codeblockWidth:a,codeblockHeight:c,numcodeblockwide:k-g+1,numcodeblockhigh:f-
h+1};b.codeblocks=r;b.precincts=m}function g(a,b,c){var d=[];a=a.subbands;for(var e=0,g=a.length;e<g;e++)for(var h=a[e].codeblocks,k=0,f=h.length;k<f;k++){var l=h[k];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,k=0,f=0,l=0;this.nextPacket=function(){for(;h<c;h++){for(;k<=
e;k++){for(;f<d;f++){var a=b.components[f];if(!(k>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[k];for(var r=a.precinctParameters.numprecincts;l<r;)return a=g(a,l,h),l++,a;l=0}}f=0}k=0}throw Error("JPX Error: Out of packets");}}function f(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,k=0,f=0,l=0;this.nextPacket=function(){for(;h<=
e;h++){for(;k<c;k++){for(;f<d;f++){var a=b.components[f];if(!(h>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[h];for(var r=a.precinctParameters.numprecincts;l<r;)return a=g(a,l,k),l++,a;l=0}}f=0}k=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,h,k,f=0;for(k=0;k<d;k++)f=Math.max(f,b.components[k].codingStyleParameters.decompositionLevelsCount);var l=new Int32Array(f+1);for(h=
0;h<=f;++h){for(k=a=0;k<d;++k){var r=b.components[k].resolutions;h<r.length&&(a=Math.max(a,r[h].precinctParameters.numprecincts))}l[h]=a}var t=k=h=e=0;this.nextPacket=function(){for(;h<=f;h++){for(;t<l[h];t++){for(;k<d;k++){var a=b.components[k];if(!(h>a.codingStyleParameters.decompositionLevelsCount||(a=a.resolutions[h],t>=a.precinctParameters.numprecincts))){for(;e<c;)return a=g(a,t,e),e++,a;e=0}}k=0}t=0}throw Error("JPX Error: Out of packets");}}function r(a){var b=a.tiles[a.currentTile.index],
c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=t(b),h=0,k=0,f=0,l=0,r=0;this.nextPacket=function(){for(;r<e.maxNumHigh;r++){for(;l<e.maxNumWide;l++){for(;f<d;f++){for(var a=b.components[f],t=a.codingStyleParameters.decompositionLevelsCount;k<=t;k++){var m=a.resolutions[k],y=n(l,r,e.components[f].resolutions[k],e,m);if(null!==y){for(;h<c;)return a=g(m,y,h),h++,a;h=0}}k=0}f=0}l=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=t(b),h=0,k=0,f=0,l=0,r=0;this.nextPacket=function(){for(;f<d;++f){for(var a=b.components[f],t=e.components[f],m=a.codingStyleParameters.decompositionLevelsCount;r<t.maxNumHigh;r++){for(;l<t.maxNumWide;l++){for(;k<=m;k++){var y=a.resolutions[k],p=n(l,r,t.resolutions[k],t,y);if(null!==p){for(;h<c;)return a=g(y,p,h),h++,a;h=0}}k=0}l=0}r=0}throw Error("JPX Error: Out of packets");}}function n(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 t(a){for(var b=a.components.length,c=Number.MAX_VALUE,d=Number.MAX_VALUE,e=0,g=0,h=Array(b),k=0;k<b;k++){for(var f=a.components[k],l=f.codingStyleParameters.decompositionLevelsCount,r=Array(l+1),t=Number.MAX_VALUE,m=Number.MAX_VALUE,n=0,p=0,q=1;0<=l;--l){var u=f.resolutions[l],J=q*u.precinctParameters.precinctWidth,v=q*u.precinctParameters.precinctHeight;t=Math.min(t,J);m=Math.min(m,v);n=Math.max(n,u.precinctParameters.numprecinctswide);p=Math.max(p,
u.precinctParameters.numprecinctshigh);r[l]={width:J,height:v};q<<=1}c=Math.min(c,t);d=Math.min(d,m);e=Math.max(e,n);g=Math.max(g,p);h[k]={resolutions:r,minWidth:t,minHeight:m,maxNumWide:n,maxNumHigh:p}}return{components:h,minWidth:c,minHeight:d,maxNumWide:e,maxNumHigh:g}}function q(b,c,d,e){function g(a){for(;r<a;){var b=c[d+f];f++;t?(l=l<<7|b,r+=7,t=!1):(l=l<<8|b,r+=8);255===b&&(t=!0)}r-=a;return l>>>r&(1<<a)-1}function h(a){return 255===c[d+f-1]&&c[d+f]===a?(f+=1,!0):255===c[d+f]&&c[d+f+1]===a?
(f+=2,!0):!1}function k(){if(0===g(1))return 1;if(0===g(1))return 2;var a=g(2);if(3>a)return a+3;a=g(5);if(31>a)return a+6;a=g(7);return a+37}var f=0,l,r=0,t=!1,m=b.COD.sopMarkerUsed,n=b.COD.ephMarkerUsed;for(b=b.tiles[b.currentTile.index].packetsIterator;f<e;){r=0;t&&(f++,t=!1);m&&h(145)&&(f+=4);var y=b.nextPacket();if(g(1)){for(var p=y.layerNumber,q=[],u,J=0,N=y.codeblocks.length;J<N;J++){u=y.codeblocks[J];var w=u.precinct,z=u.cbx-w.cbxMin,M=u.cby-w.cbyMin,I=!1,B=!1;if(void 0!==u.included)I=!!g(1);
else{w=u.precinct;if(void 0!==w.inclusionTree)var A=w.inclusionTree;else{var F=w.cbxMax-w.cbxMin+1;var K=w.cbyMax-w.cbyMin+1;A=new x(F,K,p);F=new v(F,K);w.inclusionTree=A;w.zeroBitPlanesTree=F}if(A.reset(z,M,p))for(;;)if(g(1)){if(K=!A.nextLevel()){I=B=u.included=!0;break}}else{A.incrementValue(p);break}}if(I){if(B){F=w.zeroBitPlanesTree;for(F.reset(z,M);;)if(g(1)){if(K=!F.nextLevel())break}else F.incrementValue();u.zeroBitPlanes=F.value}for(w=k();g(1);)u.Lblock++;z=a(w);z=g((w<1<<z?z-1:z)+u.Lblock);
q.push({codeblock:u,codingpasses:w,dataLength:z})}}r=0;t&&(f++,t=!1);for(n&&h(146);0<q.length;)y=q.shift(),u=y.codeblock,void 0===u.data&&(u.data=[]),u.data.push({data:c,start:d+f,end:d+f+y.dataLength,codingpasses:y.codingpasses}),f+=y.dataLength}}return f}var J={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,h=e(a,c),k=e(a,c+4);c+=g;1===h&&(h=4294967296*e(a,c)+e(a,c+4),c+=8,g+=8);0===h&&(h=d-c+g);
if(h<g)throw Error("JPX Error: Invalid box field size");g=h-g;h=!0;switch(k){case 1785737832:h=!1;break;case 1668246642:k=a[c];if(1===k)switch(k=e(a,c+3),k){case 16:case 17:case 18:break;default:p("Unknown colorspace "+k)}else 2===k&&w("ICC profile not supported");break;case 1785737827:this.parseCodestream(a,c,c+g);break;case 1783636E3:218793738!==e(a,c)&&p("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var f=String.fromCharCode(k>>
24&255,k>>16&255,k>>8&255,k&255);p("Unsupported header type "+k+" ("+f+")")}h&&(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,g){var t={};try{var n=
!1;for(var y=c;y+1<g;){var u=b(a,y);y+=2;var v=0,w;switch(u){case 65359:t.mainHeader=!0;break;case 65497:break;case 65361:v=b(a,y);var N={};N.Xsiz=e(a,y+4);N.Ysiz=e(a,y+8);N.XOsiz=e(a,y+12);N.YOsiz=e(a,y+16);N.XTsiz=e(a,y+20);N.YTsiz=e(a,y+24);N.XTOsiz=e(a,y+28);N.YTOsiz=e(a,y+32);var z=b(a,y+36);N.Csiz=z;var M=[];var x=y+38;for(var B=0;B<z;B++){var A={precision:(a[x]&127)+1,isSigned:!!(a[x]&128),XRsiz:a[x+1],YRsiz:a[x+1]},F=A,H=N;F.x0=Math.ceil(H.XOsiz/F.XRsiz);F.x1=Math.ceil(H.Xsiz/F.XRsiz);F.y0=
Math.ceil(H.YOsiz/F.YRsiz);F.y1=Math.ceil(H.Ysiz/F.YRsiz);F.width=F.x1-F.x0;F.height=F.y1-F.y0;M.push(A)}t.SIZ=N;t.components=M;for(var C=void 0,G=t,L=M,E=G.SIZ,K=[],P=Math.ceil((E.Xsiz-E.XTOsiz)/E.XTsiz),pc=Math.ceil((E.Ysiz-E.YTOsiz)/E.YTsiz),Xa=0;Xa<pc;Xa++)for(var Ya=0;Ya<P;Ya++)C={},C.tx0=Math.max(E.XTOsiz+Ya*E.XTsiz,E.XOsiz),C.ty0=Math.max(E.YTOsiz+Xa*E.YTsiz,E.YOsiz),C.tx1=Math.min(E.XTOsiz+(Ya+1)*E.XTsiz,E.Xsiz),C.ty1=Math.min(E.YTOsiz+(Xa+1)*E.YTsiz,E.Ysiz),C.width=C.tx1-C.tx0,C.height=C.ty1-
C.ty0,C.components=[],K.push(C);G.tiles=K;for(var Za=0,qc=E.Csiz;Za<qc;Za++)for(var $a=L[Za],kb=0,rc=K.length;kb<rc;kb++){var ia={};C=K[kb];ia.tcx0=Math.ceil(C.tx0/$a.XRsiz);ia.tcy0=Math.ceil(C.ty0/$a.YRsiz);ia.tcx1=Math.ceil(C.tx1/$a.XRsiz);ia.tcy1=Math.ceil(C.ty1/$a.YRsiz);ia.width=ia.tcx1-ia.tcx0;ia.height=ia.tcy1-ia.tcy0;C.components[Za]=ia}t.QCC=[];t.COC=[];break;case 65372:v=b(a,y);var Ja={};x=y+2;var va=a[x++];switch(va&31){case 0:var na=8;var wa=!0;break;case 1:na=16;wa=!1;break;case 2:na=
16;wa=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+va);}Ja.noQuantization=8===na;Ja.scalarExpounded=wa;Ja.guardBits=va>>5;for(w=[];x<v+y;){var ja={};8===na?(ja.epsilon=a[x++]>>3,ja.mu=0):(ja.epsilon=a[x]>>3,ja.mu=(a[x]&7)<<8|a[x+1],x+=2);w.push(ja)}Ja.SPqcds=w;t.mainHeader?t.QCD=Ja:(t.currentTile.QCD=Ja,t.currentTile.QCC=[]);break;case 65373:v=b(a,y);var Ka={};x=y+2;if(257>t.SIZ.Csiz)var lb=a[x++];else lb=b(a,x),x+=2;va=a[x++];switch(va&31){case 0:na=8;wa=!0;break;case 1:na=16;wa=
!1;break;case 2:na=16;wa=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+va);}Ka.noQuantization=8===na;Ka.scalarExpounded=wa;Ka.guardBits=va>>5;for(w=[];x<v+y;)ja={},8===na?(ja.epsilon=a[x++]>>3,ja.mu=0):(ja.epsilon=a[x]>>3,ja.mu=(a[x]&7)<<8|a[x+1],x+=2),w.push(ja);Ka.SPqcds=w;t.mainHeader?t.QCC[lb]=Ka:t.currentTile.QCC[lb]=Ka;break;case 65362:v=b(a,y);var S={};x=y+2;var mb=a[x++];S.entropyCoderWithCustomPrecincts=!!(mb&1);S.sopMarkerUsed=!!(mb&2);S.ephMarkerUsed=!!(mb&4);S.progressionOrder=
a[x++];S.layersCount=b(a,x);x+=2;S.multipleComponentTransform=a[x++];S.decompositionLevelsCount=a[x++];S.xcb=(a[x++]&15)+2;S.ycb=(a[x++]&15)+2;var La=a[x++];S.selectiveArithmeticCodingBypass=!!(La&1);S.resetContextProbabilities=!!(La&2);S.terminationOnEachCodingPass=!!(La&4);S.verticalyStripe=!!(La&8);S.predictableTermination=!!(La&16);S.segmentationSymbolUsed=!!(La&32);S.reversibleTransformation=a[x++];if(S.entropyCoderWithCustomPrecincts){for(var Mb=[];x<v+y;){var Nb=a[x++];Mb.push({PPx:Nb&15,PPy:Nb>>
4})}S.precinctsSizes=Mb}var xa=[];S.selectiveArithmeticCodingBypass&&xa.push("selectiveArithmeticCodingBypass");S.resetContextProbabilities&&xa.push("resetContextProbabilities");S.terminationOnEachCodingPass&&xa.push("terminationOnEachCodingPass");S.verticalyStripe&&xa.push("verticalyStripe");S.predictableTermination&&xa.push("predictableTermination");if(0<xa.length)throw n=!0,Error("JPX Error: Unsupported COD options ("+xa.join(", ")+")");t.mainHeader?t.COD=S:(t.currentTile.COD=S,t.currentTile.COC=
[]);break;case 65424:v=b(a,y);var Y={};Y.index=b(a,y+2);Y.length=e(a,y+4);Y.dataEnd=Y.length+y-2;Y.partIndex=a[y+8];Y.partsCount=a[y+9];t.mainHeader=!1;0===Y.partIndex&&(Y.COD=t.COD,Y.COC=t.COC.slice(0),Y.QCD=t.QCD,Y.QCC=t.QCC.slice(0));t.currentTile=Y;break;case 65427:Y=t.currentTile;if(0===Y.partIndex){for(var oa=t,sc=oa.SIZ.Csiz,Ob=oa.tiles[Y.index],ya=0;ya<sc;ya++){var Pb=Ob.components[ya];Pb.quantizationParameters=void 0!==oa.currentTile.QCC[ya]?oa.currentTile.QCC[ya]:oa.currentTile.QCD;Pb.codingStyleParameters=
void 0!==oa.currentTile.COC[ya]?oa.currentTile.COC[ya]:oa.currentTile.COD}Ob.codingStyleDefaultParameters=oa.currentTile.COD;for(var ea=t,za=ea.tiles[ea.currentTile.index],tc=ea.SIZ.Csiz,nb=0;nb<tc;nb++){for(var V=za.components[nb],ob=V.codingStyleParameters.decompositionLevelsCount,Qb=[],Oa=[],Aa=0;Aa<=ob;Aa++){var ab=Aa,Ba=V.codingStyleParameters,ka={};Ba.entropyCoderWithCustomPrecincts?(ka.PPx=Ba.precinctsSizes[ab].PPx,ka.PPy=Ba.precinctsSizes[ab].PPy):(ka.PPx=15,ka.PPy=15);ka.xcb_=0<ab?Math.min(Ba.xcb,
ka.PPx-1):Math.min(Ba.xcb,ka.PPx);ka.ycb_=0<ab?Math.min(Ba.ycb,ka.PPy-1):Math.min(Ba.ycb,ka.PPy);var ra=ka;var W={},sa=1<<ob-Aa;W.trx0=Math.ceil(V.tcx0/sa);W.try0=Math.ceil(V.tcy0/sa);W.trx1=Math.ceil(V.tcx1/sa);W.try1=Math.ceil(V.tcy1/sa);W.resLevel=Aa;var pb=1<<ra.PPx,qb=1<<ra.PPy,Rb=0===W.resLevel,Sb=W.trx1>W.trx0?Math.ceil(W.trx1/pb)-Math.floor(W.trx0/pb):0,Tb=W.try1>W.try0?Math.ceil(W.try1/qb)-Math.floor(W.try0/qb):0;W.precinctParameters={precinctWidth:pb,precinctHeight:qb,numprecinctswide:Sb,
numprecinctshigh:Tb,numprecincts:Sb*Tb,precinctWidthInSubband:1<<ra.PPx+(Rb?0:-1),precinctHeightInSubband:1<<ra.PPy+(Rb?0:-1)};Qb.push(W);if(0===Aa){var R={type:"LL"};R.tbx0=Math.ceil(V.tcx0/sa);R.tby0=Math.ceil(V.tcy0/sa);R.tbx1=Math.ceil(V.tcx1/sa);R.tby1=Math.ceil(V.tcy1/sa);R.resolution=W;d(ea,R,ra);Oa.push(R);W.subbands=[R]}else{var fa=1<<ob-Aa+1,bb=[];R={type:"HL"};R.tbx0=Math.ceil(V.tcx0/fa-.5);R.tby0=Math.ceil(V.tcy0/fa);R.tbx1=Math.ceil(V.tcx1/fa-.5);R.tby1=Math.ceil(V.tcy1/fa);R.resolution=
W;d(ea,R,ra);Oa.push(R);bb.push(R);R={type:"LH"};R.tbx0=Math.ceil(V.tcx0/fa);R.tby0=Math.ceil(V.tcy0/fa-.5);R.tbx1=Math.ceil(V.tcx1/fa);R.tby1=Math.ceil(V.tcy1/fa-.5);R.resolution=W;d(ea,R,ra);Oa.push(R);bb.push(R);R={type:"HH"};R.tbx0=Math.ceil(V.tcx0/fa-.5);R.tby0=Math.ceil(V.tcy0/fa-.5);R.tbx1=Math.ceil(V.tcx1/fa-.5);R.tby1=Math.ceil(V.tcy1/fa-.5);R.resolution=W;d(ea,R,ra);Oa.push(R);bb.push(R);W.subbands=bb}}V.resolutions=Qb;V.subbands=Oa}var Ub=za.codingStyleDefaultParameters.progressionOrder;
switch(Ub){case 0:za.packetsIterator=new k(ea);break;case 1:za.packetsIterator=new f(ea);break;case 2:za.packetsIterator=new l(ea);break;case 3:za.packetsIterator=new r(ea);break;case 4:za.packetsIterator=new m(ea);break;default:throw Error("JPX Error: Unsupported progression order "+Ub);}}v=Y.dataEnd-y;q(t,a,y,v);break;case 65365:case 65367:case 65368:case 65380:v=b(a,y);break;case 65363:throw Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw Error("JPX Error: Unknown codestream code: "+
u.toString(16));}y+=v}}catch(Vb){if(n||this.failOnCorruptedImage)throw Vb;p("Trying to recover from "+Vb.message)}for(var Wb=t.components,Ma=t.SIZ.Csiz,Xb=[],rb=0,uc=t.tiles.length;rb<uc;rb++){var sb=t.tiles[rb],Ca=[],ha;for(ha=0;ha<Ma;ha++){for(var vc=Ca,wc=ha,Da=sb.components[ha],tb=Da.codingStyleParameters,ub=Da.quantizationParameters,xc=tb.decompositionLevelsCount,cb=ub.SPqcds,yc=ub.scalarExpounded,zc=ub.guardBits,Ac=tb.segmentationSymbolUsed,Bc=t.components[ha].precision,vb=tb.reversibleTransformation,
Cc=vb?new O:new I,Yb=[],wb=0,Pa=0;Pa<=xc;Pa++){for(var Na=Da.resolutions[Pa],xb=Na.trx1-Na.trx0,Zb=Na.try1-Na.try0,$b=new Float32Array(xb*Zb),yb=0,Dc=Na.subbands.length;yb<Dc;yb++){if(yc){var ac=cb[wb].mu;var zb=cb[wb].epsilon;wb++}else ac=cb[0].mu,zb=cb[0].epsilon+(0<Pa?1-Pa:0);for(var bc=Na.subbands[yb],Ec=J[bc.type],Fc=$b,cc=xb,ta=bc,Gc=vb?1:Math.pow(2,Bc+Ec-zb)*(1+ac/2048),Ab=zc+zb-1,dc=vb,Hc=Ac,Ic=ta.tbx0,Jc=ta.tby0,db=ta.tbx1-ta.tbx0,ec=ta.codeblocks,Kc="H"===ta.type.charAt(0)?1:0,Lc="H"===
ta.type.charAt(1)?cc:0,Bb=0,Mc=ec.length;Bb<Mc;++Bb){var la=ec[Bb],eb=la.tbx1_-la.tbx0_,Cb=la.tby1_-la.tby0_;if(0!==eb&&0!==Cb&&void 0!==la.data){var ua=new D(eb,Cb,la.subbandType,la.zeroBitPlanes,Ab);var Db=2;var fb=la.data,Eb=0,fc=0,gb;var ca=0;for(gb=fb.length;ca<gb;ca++){var Ea=fb[ca];Eb+=Ea.end-Ea.start;fc+=Ea.codingpasses}var gc=new Uint8Array(Eb),Fa=0;ca=0;for(gb=fb.length;ca<gb;ca++){Ea=fb[ca];var hc=Ea.data.subarray(Ea.start,Ea.end);gc.set(hc,Fa);Fa+=hc.length}var Nc=new h(gc,0,Eb);ua.setDecoder(Nc);
for(ca=0;ca<fc;ca++){switch(Db){case 0:ua.runSignificancePropogationPass();break;case 1:ua.runMagnitudeRefinementPass();break;case 2:ua.runCleanupPass(),Hc&&ua.checkSegmentationSymbol()}Db=(Db+1)%3}var Qa=la.tbx0_-Ic+(la.tby0_-Jc)*db,Oc=ua.coefficentsSign,Pc=ua.coefficentsMagnitude,Qc=ua.bitsDecoded,Rc=dc?0:.5,Fb;Fa=0;var Sc="LL"!==ta.type;for(ca=0;ca<Cb;ca++){var Tc=2*(Qa/db|0)*(cc-db)+Kc+Lc;for(Fb=0;Fb<eb;Fb++){var Ga=Pc[Fa];if(0!==Ga){Ga=(Ga+Rc)*Gc;0!==Oc[Fa]&&(Ga=-Ga);var ic=Qc[Fa];Fc[Sc?Tc+(Qa<<
1):Qa]=dc&&ic>=Ab?Ga:Ga*(1<<Ab-ic)}Qa++;Fa++}Qa+=db-eb}}}}Yb.push({width:xb,height:Zb,items:$b})}var Gb=Cc.calculate(Yb,Da.tcx0,Da.tcy0);vc[wc]={left:Da.tcx0,top:Da.tcy0,width:Gb.width,height:Gb.height,items:Gb.items}}var Ra=Ca[0],pa=new Uint8Array(Ra.items.length*Ma),Uc={left:Ra.left,top:Ra.top,width:Ra.width,height:Ra.height,items:pa},aa=0,X;if(sb.codingStyleDefaultParameters.multipleComponentTransform){var jc=4===Ma,Hb=Ca[0].items,kc=Ca[1].items,lc=Ca[2].items,Vc=jc?Ca[3].items:null;var da=Wb[0].precision-
8;var Sa=(128<<da)+.5;var ma=255*(1<<da);var mc=.5*ma;var Ib=-mc;var Wc=sb.components[0],nc=Ma-3;var Ta=Hb.length;if(Wc.codingStyleParameters.reversibleTransformation)for(X=0;X<Ta;X++,aa+=nc){var Ua=Hb[X]+Sa;var Va=kc[X];var Wa=lc[X];var qa=Ua-(Wa+Va>>2);var Ha=qa+Wa;var Ia=qa+Va;pa[aa++]=0>=Ha?0:Ha>=ma?255:Ha>>da;pa[aa++]=0>=qa?0:qa>=ma?255:qa>>da;pa[aa++]=0>=Ia?0:Ia>=ma?255:Ia>>da}else for(X=0;X<Ta;X++,aa+=nc)Ua=Hb[X]+Sa,Va=kc[X],Wa=lc[X],Ha=Ua+1.402*Wa,qa=Ua-.34413*Va-.71414*Wa,Ia=Ua+1.772*Va,
pa[aa++]=0>=Ha?0:Ha>=ma?255:Ha>>da,pa[aa++]=0>=qa?0:qa>=ma?255:qa>>da,pa[aa++]=0>=Ia?0:Ia>=ma?255:Ia>>da;if(jc)for(X=0,aa=3;X<Ta;X++,aa+=4){var Jb=Vc[X];pa[aa]=Jb<=Ib?0:Jb>=mc?255:Jb+Sa>>da}}else for(ha=0;ha<Ma;ha++){var oc=Ca[ha].items;da=Wb[ha].precision-8;Sa=(128<<da)+.5;ma=127.5*(1<<da);Ib=-ma;aa=ha;X=0;for(Ta=oc.length;X<Ta;X++){var Kb=oc[X];pa[aa]=Kb<=Ib?0:Kb>=ma?255:Kb+Sa>>da;aa+=Ma}}Xb.push(Uc)}this.tiles=Xb;this.width=t.SIZ.Xsiz-t.SIZ.XOsiz;this.height=t.SIZ.Ysiz-t.SIZ.YOsiz;this.componentsCount=
t.SIZ.Csiz}};var v=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 g=a+b*e.width;if(void 0!==e.items[g]){d=e.items[g];break}e.index=g;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}(),x=function(){function b(b,c,d){var e=a(Math.max(b,c))+1;this.levels=[];for(var g=0;g<e;g++){for(var h=new Uint8Array(b*c),k=0,f=h.length;k<f;k++)h[k]=d;this.levels.push({width:b,height:c,items:h});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],g=a+b*e.width;e.index=g;e=e.items[g];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}(),D=function(){function a(a,e,g,h,k){this.width=a;this.height=e;this.contextLabelTable="HH"===g?d:"HL"===g?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!==h)for(e=0;e<a;e++)k[e]=h;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,g=this.height,h=0<b;b=b+1<e;if(0<a){var k=c-e;h&&(d[k-1]+=16);b&&(d[k+1]+=16);d[k]+=4}a+1<g&&(k=c+e,h&&(d[k-1]+=16),b&&(d[k+1]+=16),d[k]+=4);h&&(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,g=this.neighborsSignificance,h=this.processingFlags,k=this.contexts,f=this.contextLabelTable,l=this.bitsDecoded,t=0;t<c;t+=4)for(var r=0;r<b;r++)for(var m=t*b+r,n=0;4>n;n++,m+=b){var y=t+n;if(y>=c)break;h[m]&=-2;if(!d[m]&&g[m]){if(a.readBit(k,f[g[m]])){var p=this.decodeSignBit(y,r,m);e[m]=p;d[m]=1;this.setNeighborsSignificance(y,r,m);h[m]|=2}l[m]++;h[m]|=1}}},decodeSignBit:function(a,b,c){var d=this.width,e=
this.height,g=this.coefficentsMagnitude,h=this.coefficentsSign;var k=0<b&&0!==g[c-1];b+1<d&&0!==g[c+1]?(b=h[c+1],k?(k=h[c-1],b=1-b-k):b=1-b-b):k?(k=h[c-1],b=1-k-k):b=0;var f=3*b;k=0<a&&0!==g[c-d];a+1<e&&0!==g[c+d]?(b=h[c+d],k?(k=h[c-d],b=1-b-k+f):b=1-b-b+f):k?(k=h[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,g=this.bitsDecoded,h=this.processingFlags,k=b*this.height,f=4*b,l=0,t;l<k;l=t){t=Math.min(k,l+f);for(var r=0;r<b;r++)for(var m=l+r;m<t;m+=b)if(c[m]&&0===(h[m]&1)){var n=16;0!==(h[m]&2)&&(h[m]^=2,n=0===(d[m]&127)?15:14);n=a.readBit(e,n);c[m]=c[m]<<1|n;g[m]++;h[m]|=1}}},runCleanupPass:function(){for(var a=this.decoder,b=this.width,c=this.height,d=this.neighborsSignificance,e=this.coefficentsMagnitude,g=this.coefficentsSign,h=this.contexts,k=this.contextLabelTable,f=this.bitsDecoded,
l=this.processingFlags,t=2*b,m=3*b,r,n=0;n<c;n=r){r=Math.min(n+4,c);for(var y=n*b,p=n+3<c,q=0;q<b;q++){var u=y+q,J=0,v=u,w=n;if(p&&0===l[u]&&0===l[u+b]&&0===l[u+t]&&0===l[u+m]&&0===d[u]&&0===d[u+b]&&0===d[u+t]&&0===d[u+m]){if(!a.readBit(h,18)){f[u]++;f[u+b]++;f[u+t]++;f[u+m]++;continue}J=a.readBit(h,17)<<1|a.readBit(h,17);0!==J&&(w=n+J,v+=J*b);var z=this.decodeSignBit(w,q,v);g[v]=z;e[v]=1;this.setNeighborsSignificance(w,q,v);l[v]|=2;v=u;for(u=n;u<=w;u++,v+=b)f[v]++;J++}for(w=n+J;w<r;w++,v+=b)e[v]||
0!==(l[v]&1)||(1===a.readBit(h,k[d[v]])&&(z=this.decodeSignBit(w,q,v),g[v]=z,e[v]=1,this.setNeighborsSignificance(w,q,v),l[v]|=2),f[v]++)}}},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}(),P=function(){function a(){}a.prototype.calculate=function(a,b,c){for(var d=a[0],e=1,g=a.length;e<g;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,g=b+c-2;b+=c;a[d--]=a[e++];a[b++]=a[g--];a[d--]=a[e++];a[b++]=a[g--];a[d--]=a[e++];a[b++]=a[g--];a[d]=a[e];a[b]=a[g]};a.prototype.iterate=function(a,b,c,d){var e=a.width,g=a.height,h=a.items,k=b.width,f=b.height;b=b.items;var l,t,m;for(l=m=0;l<g;l++){var r=2*l*k;for(t=0;t<e;t++,m++,r+=2)b[r]=h[m]}a.items=null;a=new Float32Array(k+8);if(1===k){if(0!==(c&1))for(m=r=0;r<f;r++,m+=k)b[m]*=.5}else for(m=r=0;r<f;r++,m+=k)a.set(b.subarray(m,m+k),4),this.extend(a,
4,k),this.filter(a,4,k),b.set(a.subarray(4,4+k),m);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);m=d;for(r=4;r<a;m+=k,r++)for(g=0;g<c;g++)e[g][r]=b[m+g];l=c}l--;m=e[l];this.extend(m,4,f);this.filter(m,4,f);if(0===l)for(m=d-c+1,r=4;r<a;m+=k,r++)for(g=0;g<c;g++)b[m+g]=e[g][r]}return{width:k,height:f,items:b}};return a}(),I=function(){function a(){P.call(this)}a.prototype=Object.create(P.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 g=.443506852043971*a[e-1];for(d=c+3;d--;e+=2){var h=.443506852043971*a[e+1];a[e]=1.230174104914001*a[e]-g-h;if(d--)e+=2,g=.443506852043971*a[e+1],a[e]=1.230174104914001*a[e]-g-h;else break}e=b-1;g=.882911075530934*a[e-1];for(d=c+2;d--;e+=2)if(h=.882911075530934*a[e+1],a[e]-=g+h,d--)e+=2,g=.882911075530934*a[e+1],a[e]-=g+h;else break;e=b;g=-.052980118572961*a[e-1];for(d=c+1;d--;e+=2)if(h=
-.052980118572961*a[e+1],a[e]-=g+h,d--)e+=2,g=-.052980118572961*a[e+1],a[e]-=g+h;else break;if(0!==c)for(e=b+1,g=-1.586134342059924*a[e-1],d=c;d--;e+=2)if(h=-1.586134342059924*a[e+1],a[e]-=g+h,d--)e+=2,g=-1.586134342059924*a[e+1],a[e]-=g+h;else break};return a}(),O=function(){function a(){P.call(this)}a.prototype=Object.create(P.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 f=function(){function c(){}function d(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 h=c.readBit(e,g);g=256>g?g<<1|h:(g<<1|h)&511|256;b=b<<1|h}return b>>>0}var e=a.getContexts(b),g=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 g=b.readBit(a,d);d=d<<1|g}return 31>c?d&(1<<c)-1:d&
2147483647}function m(a,b,c){var d=c.decoder;c=c.contextCache.getContexts("GB");var e,g,h,k=[];for(e=0;e<b;e++){var f=k[e]=new Uint8Array(a);var l=1>e?f:k[e-1];var t=2>e?f:k[e-2];var m=t[0]<<13|t[1]<<12|t[2]<<11|l[0]<<7|l[1]<<6|l[2]<<5|l[3]<<4;for(g=0;g<a;g++)f[g]=h=d.readBit(c,m),m=(m&31735)<<1|(g+3<a?t[g+3]<<11:0)|(g+4<a?l[g+4]<<4:0)|h}return k}function n(a,b,c,d,e,g,h,k){a&&l("JBIG2 error: MMR encoding is not supported");if(0===d&&!g&&!e&&4===h.length&&3===h[0].x&&-1===h[0].y&&-3===h[1].x&&-1===
h[1].y&&2===h[2].x&&-2===h[2].y&&-2===h[3].x&&-2===h[3].y)return m(b,c,k);a=!!g;var f=w[d].concat(h);f.sort(function(a,b){return a.y-b.y||a.x-b.x});h=f.length;var t=new Int8Array(h),r=new Int8Array(h),n=[],p=0,q=0,y=0,u=0,J,v;for(v=0;v<h;v++)t[v]=f[v].x,r[v]=f[v].y,q=Math.min(q,f[v].x),y=Math.max(y,f[v].x),u=Math.min(u,f[v].y),v<h-1&&f[v].y===f[v+1].y&&f[v].x===f[v+1].x-1?p|=1<<h-1-v:n.push(v);var z=n.length,x=new Int8Array(z),M=new Int8Array(z),B=new Uint16Array(z);for(J=0;J<z;J++)v=n[J],x[J]=f[v].x,
M[J]=f[v].y,B[J]=1<<h-1-v;f=-q;u=-u;y=b-y;d=D[d];n=new Uint8Array(b);q=[];J=k.decoder;k=k.contextCache.getContexts("GB");for(var F=0,A,I,N,H=0,C,E=0;E<c;E++){if(e&&(v=J.readBit(k,d),F^=v)){q.push(n);continue}n=new Uint8Array(n);q.push(n);for(A=0;A<b;A++)if(a&&g[E][A])n[A]=0;else{if(A>=f&&A<y&&E>=u)for(H=H<<1&p,v=0;v<z;v++){if(I=E+M[v],N=A+x[v],I=q[I][N])I=B[v],H|=I}else for(H=0,C=h-1,v=0;v<h;v++,C--)N=A+t[v],0<=N&&N<b&&(I=E+r[v],0<=I&&(I=q[I][N])&&(H|=I<<C));v=J.readBit(k,H);n[A]=v}}return q}function r(a,
b,c,d,e,g,h,k,f){var t=x[c].coding;0===c&&(t=t.concat([k[0]]));var m=t.length,r=new Int32Array(m),n=new Int32Array(m),p;for(p=0;p<m;p++)r[p]=t[p].x,n[p]=t[p].y;var q=x[c].reference;0===c&&(q=q.concat([k[1]]));k=q.length;t=new Int32Array(k);var y=new Int32Array(k);for(p=0;p<k;p++)t[p]=q[p].x,y[p]=q[p].y;q=d[0].length;var u=d.length;c=P[c];var v=[],J=f.decoder;f=f.contextCache.getContexts("GR");for(var w=0,z=0;z<b;z++){h&&(p=J.readBit(f,c),(w^=p)&&l("JBIG2 error: prediction is not supported"));var M=
new Uint8Array(a);v.push(M);for(var A=0;A<a;A++){var B=0;for(p=0;p<m;p++){var F=z+n[p];var I=A+r[p];B=0>F||0>I||I>=a?B<<1:B<<1|v[F][I]}for(p=0;p<k;p++)F=z+y[p]+g,I=A+t[p]+e,B=0>F||F>=u||0>I||I>=q?B<<1:B<<1|d[F][I];p=J.readBit(f,B);M[A]=p}}return v}function p(a,b,c,d,e,g,h,t,m,n,p,q,u,v,J,w,z){a&&l("JBIG2 error: huffman is not supported");a=[];for(v=0;v<d;v++){var y=new Uint8Array(c);if(e)for(var x=0;x<c;x++)y[x]=e;a.push(y)}d=z.decoder;e=z.contextCache;x=-k(e,"IADT",d);var M=0;for(v=0;v<g;){var A=
k(e,"IADT",d);x+=A;A=k(e,"IAFS",d);A=M+=A;do{var B=1===h?0:k(e,"IAIT",d);y=h*x+B;B=f(e,d,m);var F=b&&k(e,"IARI",d);B=t[B];var I=B[0].length,H=B.length;if(F){F=k(e,"IARDW",d);var N=k(e,"IARDH",d),C=k(e,"IARDX",d),E=k(e,"IARDY",d);I+=F;H+=N;B=r(I,H,J,B,(F>>1)+C,(N>>1)+E,!1,w,z)}F=y-(q&1?0:H);N=A-(q&2?I:0);if(n){for(C=0;C<H;C++)if(y=a[N+C]){var D=B[C];var G=Math.min(c-F,I);switch(u){case 0:for(E=0;E<G;E++)y[F+E]|=D[E];break;case 2:for(E=0;E<G;E++)y[F+E]^=D[E];break;default:l("JBIG2 error: operator "+
u+" is not supported")}}A+=H-1}else{for(E=0;E<H;E++)if(y=a[F+E])switch(D=B[E],u){case 0:for(C=0;C<I;C++)y[N+C]|=D[C];break;case 2:for(C=0;C<I;C++)y[N+C]^=D[C];break;default:l("JBIG2 error: operator "+u+" is not supported")}A+=I-1}v++;B=k(e,"IADS",d);if(null===B)break;A+=B+p}while(1)}return a}function q(a,b){return{width:e(a,b),height:e(a,b+4),x:e(a,b+8),y:e(a,b+12),combinationOperator:a[b+16]&7}}function t(){}function v(){}c.prototype={getContexts:function(a){return a in this?this[a]:this[a]=new Int8Array(65536)}};
d.prototype={get decoder(){var a=new h(this.data,this.start,this.end);return g(this,"decoder",a)},get contextCache(){var a=new c;return g(this,"contextCache",a)}};var J=["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"],w=[[{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}]],x=[{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}]}],D=[39717,1941,229,405],P=[32,8];t.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,g=c.width+7>>3,h=c.combinationOperatorOverride?a.combinationOperator:c.combinationOperator;
c=this.buffer;var k=128>>(a.x&7);a=a.y*g+(a.x>>3);var f;switch(h){case 0:for(h=0;h<e;h++){var t=k;var m=a;for(f=0;f<d;f++)b[h][f]&&(c[m]|=t),t>>=1,t||(t=128,m++);a+=g}break;case 2:for(h=0;h<e;h++){t=k;m=a;for(f=0;f<d;f++)b[h][f]&&(c[m]^=t),t>>=1,t||(t=128,m++);a+=g}break;default:l("JBIG2 error: operator "+h+" is not supported")}},onImmediateGenericRegion:function(a,b,c,e){var g=a.info;b=new d(b,c,e);a=n(a.mmr,g.width,g.height,a.template,a.prediction,null,a.at,b);this.drawBitmap(g,a)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,
arguments)},onSymbolDictionary:function(b,c,e,g,h,t){b.huffman&&l("JBIG2 error: huffman is not supported");var m=this.symbols;m||(this.symbols=m={});for(var q=[],y=0,u=e.length;y<u;y++)q=q.concat(m[e[y]]);t=new d(g,h,t);y=b.huffman;u=b.refinement;e=q;q=b.numberOfNewSymbols;var v=b.template,J=b.at,w=b.refinementTemplate,z=b.refinementAt;y&&l("JBIG2 error: huffman is not supported");b=[];var x=0,M=a(e.length+q);g=t.decoder;for(h=t.contextCache;b.length<q;){var B=k(h,"IADH",g);x+=B;for(B=0;;){var A=
k(h,"IADW",g);if(null===A)break;B+=A;if(u)if(A=k(h,"IAAI",g),1<A)A=p(y,u,B,x,0,A,1,e.concat(b),M,0,0,1,0,void 0,w,z,t);else{A=f(h,g,M);var F=k(h,"IARDX",g),H=k(h,"IARDY",g);A=r(B,x,w,A<e.length?e[A]:b[A-e.length],F,H,!1,z,t)}else A=n(!1,B,x,v,!1,null,J,t);b.push(A)}}t=[];y=[];u=!1;for(v=e.length+q;y.length<v;){for(J=k(h,"IAEX",g);J--;)y.push(u);u=!u}g=0;for(h=e.length;g<h;g++)y[g]&&t.push(e[g]);for(e=0;e<q;g++,e++)y[g]&&t.push(b[e]);m[c]=t},onImmediateTextRegion:function(b,c,e,g,h){for(var k=b.info,
f=this.symbols,l=[],t=0,m=c.length;t<m;t++)l=l.concat(f[c[t]]);c=a(l.length);e=new d(e,g,h);b=p(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,e);this.drawBitmap(k,b)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}};v.prototype={parseChunks:function(a){for(var c=new t,d=0,g=a.length;d<g;d++){for(var h=
a[d],k={},f=h.data,m=h.end,r=[],n=h.start;n<m;){h=f;var p=n;n={};n.number=e(h,p);var u=h[p+4];var v=u&63;J[v]||l("JBIG2 error: invalid segment type: "+v);n.type=v;n.typeName=J[v];n.deferredNonRetain=!!(u&128);u=!!(u&64);var w=h[p+5],z=w>>5&7;var x=[w&31];p+=6;if(7===w)for(z=e(h,p-1)&536870911,p+=3,w=z+7>>3,x[0]=h[p++];0<--w;)x.push(h[p++]);else 5!==w&&6!==w||l("JBIG2 error: invalid referred-to flags");n.retainBits=x;w=256>=n.number?1:65536>=n.number?2:4;var A=[];for(x=0;x<z;x++){var M=1===w?h[p]:
2===w?b(h,p):e(h,p);A.push(M);p+=w}n.referredTo=A;u?(n.pageAssociation=e(h,p),p+=4):n.pageAssociation=h[p++];n.length=e(h,p);p+=4;if(4294967295===n.length)if(38===v){u=q(h,p);z=!!(h[p+17]&1);v=new Uint8Array(6);z||(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;x=p;for(u=h.length;x<u;x++){for(z=0;6>z&&v[z]===h[x+z];)z++;if(6===z){n.length=x+6;break}}4294967295===n.length&&l("JBIG2 error: segment end was not found")}else l("JBIG2 error: invalid unknown segment length");
n.headerEnd=p;h=n;n=h.headerEnd;p={header:h,data:f};k.randomAccess||(p.start=n,n+=h.length,p.end=n);r.push(p);if(51===h.type)break}if(k.randomAccess)for(k=0,f=r.length;k<f;k++)r[k].start=n,n+=r[k].header.length,r[k].end=n;k=c;f=0;for(m=r.length;f<m;f++){z=void 0;u=r[f];h=k;n=u.header;p=u.data;v=u.start;u=u.end;switch(n.type){case 0:A={};z=b(p,v);A.huffman=!!(z&1);A.refinement=!!(z&2);A.huffmanDHSelector=z>>2&3;A.huffmanDWSelector=z>>4&3;A.bitmapSizeSelector=z>>6&1;A.aggregationInstancesSelector=z>>
7&1;A.bitmapCodingContextUsed=!!(z&256);A.bitmapCodingContextRetained=!!(z&512);A.template=z>>10&3;A.refinementTemplate=z>>12&1;v+=2;if(!A.huffman){w=0===A.template?4:1;x=[];for(z=0;z<w;z++)x.push({x:p[v]<<24>>24,y:p[v+1]<<24>>24}),v+=2;A.at=x}if(A.refinement&&!A.refinementTemplate){x=[];for(z=0;2>z;z++)x.push({x:p[v]<<24>>24,y:p[v+1]<<24>>24}),v+=2;A.refinementAt=x}A.numberOfExportedSymbols=e(p,v);v+=4;A.numberOfNewSymbols=e(p,v);z=[A,n.number,n.referredTo,p,v+4,u];break;case 6:case 7:w={};w.info=
q(p,v);v+=17;z=b(p,v);v+=2;w.huffman=!!(z&1);w.refinement=!!(z&2);w.stripSize=1<<(z>>2&3);w.referenceCorner=z>>4&3;w.transposed=!!(z&64);w.combinationOperator=z>>7&3;w.defaultPixelValue=z>>9&1;w.dsOffset=z<<17>>27;w.refinementTemplate=z>>15&1;w.huffman&&(z=b(p,v),v+=2,w.huffmanFS=z&3,w.huffmanDS=z>>2&3,w.huffmanDT=z>>4&3,w.huffmanRefinementDW=z>>6&3,w.huffmanRefinementDH=z>>8&3,w.huffmanRefinementDX=z>>10&3,w.huffmanRefinementDY=z>>12&3,w.huffmanRefinementSizeSelector=!!(z&14));if(w.refinement&&!w.refinementTemplate){x=
[];for(z=0;2>z;z++)x.push({x:p[v]<<24>>24,y:p[v+1]<<24>>24}),v+=2;w.refinementAt=x}w.numberOfSymbolInstances=e(p,v);v+=4;w.huffman&&l("JBIG2 error: huffman is not supported");z=[w,n.referredTo,p,v,u];break;case 38:case 39:A={};A.info=q(p,v);v+=17;z=p[v++];A.mmr=!!(z&1);A.template=z>>1&3;A.prediction=!!(z&8);if(!A.mmr){w=0===A.template?4:1;x=[];for(z=0;z<w;z++)x.push({x:p[v]<<24>>24,y:p[v+1]<<24>>24}),v+=2;A.at=x}z=[A,p,v,u];break;case 48:u={width:e(p,v),height:e(p,v+4),resolutionX:e(p,v+8),resolutionY:e(p,
v+12)};4294967295===u.height&&delete u.height;z=p[v+16];b(p,v+17);u.lossless=!!(z&1);u.refinement=!!(z&2);u.defaultPixelValue=z>>2&1;u.combinationOperator=z>>3&3;u.requiresBuffer=!!(z&32);u.combinationOperatorOverride=!!(z&64);z=[u];break;case 49:break;case 50:break;case 51:break;case 62:break;default:l("JBIG2 error: segment type "+n.typeName+"("+n.type+") is not implemented")}n="on"+n.typeName;n in h&&h[n].apply(h,z)}}return c}};return v}(),l=function(){console.error.apply(console,arguments);throw Error("PDFJS error: "+
arguments[0]);},p=function(){console.warn.apply(console,arguments)},w=function(){console.info.apply(console,arguments)};f.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]||l("JBIG2 error: invalid header");b+=8;a[b++]&2||(e(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 g=0,h=0,k=0;k<c;k++)for(var f=
0,m,t=0;t<b;t++)f||(f=128,m=d[h++]),a[g++]=m&f?0:255,f>>=1;this.width=b;this.height=c;this.data=a};c.JpegImage=k;c.JpxImage=d;c.Jbig2Image=f})(g||(g={}));p.exports={JpegImage:l,JpegDecoder:g.JpegImage,JpxDecoder:g.JpxImage,Jbig2Decoder:g.Jbig2Image}},function(p,l,f){f.d(l,"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,l,f){l.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],d=a[7];if(1!==b||0!==d)throw Error("Unsupported npy version "+b+"."+d);b=(new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint16(8,!0);d=(new TextDecoder("utf-8")).decode(a.subarray(10,b+10));b+=10;try{var e=Object(g.d)(d)}catch(u){throw Error("Failed to parse npy header: "+u);}var k=e.descr;d=e.shape;var f=1;if(!Array.isArray(d))throw Error("Invalid shape ${JSON.stringify(shape)}");for(var l=$jscomp.makeIterator(d),
m=l.next();!m.done;m=l.next()){m=m.value;if("number"!==typeof m)throw Error("Invalid shape ${JSON.stringify(shape)}");f*=m}l=c.get(k);if(void 0===l)throw Error("Unsupported numpy data type "+JSON.stringify(k));k=l.arrayConstructor;f*=l.javascriptElementsPerArrayElement;if(k.BYTES_PER_ELEMENT*f+b!==a.byteLength)throw Error("Expected length does not match length of data");a=new k(a.buffer,a.byteOffset+b,f);l.fixEndianness(a);return new n(a,d,l,!0===e.fortran_order)};p=f(10);var k=f(12),g=f(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});f={};l=$jscomp.makeIterator([["<",k.b.LITTLE],[">",k.b.BIG]]);for(var a=l.next();!a.done;f={endianness:f.endianness},a=l.next()){var b=$jscomp.makeIterator(a.value);a=b.next().value;f.endianness=b.next().value;b=$jscomp.makeIterator(["u",
"i"]);for(var e=b.next();!e.done;e=b.next())e=e.value,c.set(""+a+e+"2",{arrayConstructor:Uint16Array,elementBytes:2,fixEndianness:function(a){return function(b){Object(k.c)(b,a.endianness)}}(f),javascriptElementsPerArrayElement:1,dataType:p.b.UINT16}),c.set(""+a+e+"4",{arrayConstructor:Uint32Array,elementBytes:4,fixEndianness:function(a){return function(b){Object(k.d)(b,a.endianness)}}(f),javascriptElementsPerArrayElement:1,dataType:p.b.UINT32}),c.set(""+a+e+"8",{arrayConstructor:Uint32Array,elementBytes:8,
fixEndianness:function(a){return function(b){Object(k.d)(b,a.endianness)}}(f),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)}}(f),javascriptElementsPerArrayElement:1,dataType:p.b.FLOAT32})}var n=function h(a,b,c,e){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");this.data=a;this.shape=b;this.dataType=c;this.fortranOrder=e}},
function(p,l,f){function k(g){if(!(this instanceof k))return new k(g);g=this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},g||{});g.raw&&0<g.windowBits?g.windowBits=-g.windowBits:g.gzip&&0<g.windowBits&&16>g.windowBits&&(g.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var d=c.deflateInit2(this.strm,g.level,g.method,g.windowBits,g.memLevel,g.strategy);if(0!==d)throw Error(e[d]);g.header&&c.deflateSetHeader(this.strm,
g.header);if(g.dictionary){g="string"===typeof g.dictionary?b.string2buf(g.dictionary):"[object ArrayBuffer]"===m.call(g.dictionary)?new Uint8Array(g.dictionary):g.dictionary;d=c.deflateSetDictionary(this.strm,g);if(0!==d)throw Error(e[d]);this._dict_set=!0}}function g(a,b){b=new k(b);b.push(a,!0);if(b.err)throw b.msg||e[b.err];return b.result}var c=f(92),a=f(5),b=f(45),e=f(27),n=f(46),m=Object.prototype.toString;k.prototype.push=function(e,d){var g=this.strm,h=this.options.chunkSize;if(this.ended)return!1;
d=d===~~d?d:!0===d?4:0;"string"===typeof e?g.input=b.string2buf(e):"[object ArrayBuffer]"===m.call(e)?g.input=new Uint8Array(e):g.input=e;g.next_in=0;g.avail_in=g.input.length;do{0===g.avail_out&&(g.output=new a.Buf8(h),g.next_out=0,g.avail_out=h);e=c.deflate(g,d);if(1!==e&&0!==e)return this.onEnd(e),this.ended=!0,!1;if(0===g.avail_out||0===g.avail_in&&(4===d||2===d))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!==e);if(4===d)return e=c.deflateEnd(this.strm),this.onEnd(e),this.ended=!0,0===e;2===d&&(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};l.Deflate=k;l.deflate=g;l.deflateRaw=function(a,b){b=b||{};b.raw=!0;return g(a,b)};l.gzip=
function(a,b){b=b||{};b.gzip=!0;return g(a,b)}},function(p,l,f){function k(a,b){a.msg=z[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&&(G.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){B._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 e(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function n(a,b){var c=a.max_chain_length,d=a.strstart,e=a.prev_length,g=a.nice_match,h=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,t=k[d+e-1],r=k[d+e];a.prev_length>=a.good_match&&(c>>=2);g>a.lookahead&&(g=a.lookahead);do{var n=b;if(k[n+e]===r&&k[n+e-1]===t&&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>=g)break;t=k[d+e-1];r=k[d+e]}}}while((b=l[b&f])>h&&0!==--c);return e<=a.lookahead?e:a.lookahead}function m(a){var b=a.w_size,c;do{var d=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){G.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 g=a.head[--e];a.head[e]=g>=b?g-b:0}while(--c);e=c=b;do g=a.prev[--e],a.prev[e]=g>=b?g-b:0;while(--c);d+=b}if(0===a.strm.avail_in)break;e=a.strm;c=a.window;g=a.strstart+a.lookahead;var k=e.avail_in;k>d&&(k=d);0===k?c=0:(e.avail_in-=k,G.arraySet(c,e.input,e.next_in,k,g),1===e.state.wrap?e.adler=H(e.adler,c,k,g):2===e.state.wrap&&(e.adler=r(e.adler,c,k,g)),e.next_in+=k,e.total_in+=k,c=k);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 h(b,c){for(var d;;){if(262>b.lookahead){m(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=n(b,d));if(3<=b.match_length)if(d=B._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=B._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 d(b,c){for(var d,e;;){if(262>b.lookahead){m(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=n(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=B._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=B._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&&(B._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 v(b,c){for(var d,e,g,k=b.window;;){if(258>=b.lookahead){m(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=k[e],d===k[++e]&&d===k[++e]&&d===k[++e])){for(g=b.strstart+258;d===
k[++e]&&d===k[++e]&&d===k[++e]&&d===k[++e]&&d===k[++e]&&d===k[++e]&&d===k[++e]&&d===k[++e]&&e<g;);b.match_length=258-(g-e);b.match_length>b.lookahead&&(b.match_length=b.lookahead)}3<=b.match_length?(d=B._tr_tally(b,1,b.match_length-3),b.lookahead-=b.match_length,b.strstart+=b.match_length,b.match_length=0):(d=B._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 x(b,c){for(var d;;){if(0===b.lookahead&&(m(b),0===b.lookahead)){if(0===c)return 1;break}b.match_length=0;d=B._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 q(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 w(){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 G.Buf16(1146);this.dyn_dtree=new G.Buf16(122);this.bl_tree=new G.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 G.Buf16(16);this.heap=new G.Buf16(573);g(this.heap);this.heap_max=this.heap_len=0;this.depth=new G.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 E(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;B._tr_init(b);return 0}function u(a){var b=E(a);0===b&&(a=a.state,a.window_size=2*a.w_size,g(a.head),a.max_lazy_match=L[a.level].max_lazy,a.good_match=L[a.level].good_length,a.nice_match=L[a.level].nice_length,a.max_chain_length=L[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 C(a,b,c,d,e,g){if(!a)return-2;var h=1;-1===b&&(b=6);0>d?(h=0,d=-d):15<d&&(h=2,d-=16);if(1>e||9<e||8!==c||8>d||15<d||0>b||9<b||0>g||4<g)return k(a,-2);8===d&&(d=9);var f=new w;a.state=f;f.strm=a;f.wrap=h;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 G.Buf8(2*
f.w_size);f.head=new G.Buf16(f.hash_size);f.prev=new G.Buf16(f.w_size);f.lit_bufsize=1<<e+6;f.pending_buf_size=4*f.lit_bufsize;f.pending_buf=new G.Buf8(f.pending_buf_size);f.d_buf=1*f.lit_bufsize;f.l_buf=3*f.lit_bufsize;f.level=b;f.strategy=g;f.method=c;return u(a)}var G=f(5),B=f(93),H=f(43),r=f(44),z=f(27);var L=[new q(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){m(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 q(4,4,8,4,h),new q(4,5,16,8,h),new q(4,6,32,32,h),new q(4,4,16,16,d),new q(8,16,32,32,d),new q(8,16,128,128,d),new q(8,32,128,256,d),new q(32,128,258,
1024,d),new q(32,258,258,4096,d)];l.deflateInit=function(a,b){return C(a,b,8,15,8,0)};l.deflateInit2=C;l.deflateReset=u;l.deflateResetKeep=E;l.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;a.state.gzhead=b;return 0};l.deflate=function(a,d){if(!a||!a.state||5<d||0>d)return a?k(a,-2):-2;var h=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===h.status&&4!==d)return k(a,0===a.avail_out?-5:-2);h.strm=a;var f=h.last_flush;h.last_flush=d;if(42===h.status)if(2===h.wrap)a.adler=
0,b(h,31),b(h,139),b(h,8),h.gzhead?(b(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),b(h,h.gzhead.time&255),b(h,h.gzhead.time>>8&255),b(h,h.gzhead.time>>16&255),b(h,h.gzhead.time>>24&255),b(h,9===h.level?2:2<=h.strategy||2>h.level?4:0),b(h,h.gzhead.os&255),h.gzhead.extra&&h.gzhead.extra.length&&(b(h,h.gzhead.extra.length&255),b(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=r(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=
69):(b(h,0),b(h,0),b(h,0),b(h,0),b(h,0),b(h,9===h.level?2:2<=h.strategy||2>h.level?4:0),b(h,3),h.status=113);else{var l=8+(h.w_bits-8<<4)<<8;l|=(2<=h.strategy||2>h.level?0:6>h.level?1:6===h.level?2:3)<<6;0!==h.strstart&&(l|=32);h.status=113;e(h,l+(31-l%31));0!==h.strstart&&(e(h,a.adler>>>16),e(h,a.adler&65535));a.adler=1}if(69===h.status)if(h.gzhead.extra){for(l=h.pending;h.gzindex<(h.gzhead.extra.length&65535)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,
h.pending-l,l)),c(a),l=h.pending,h.pending!==h.pending_buf_size));)b(h,h.gzhead.extra[h.gzindex]&255),h.gzindex++;h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,h.pending-l,l));h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=73)}else h.status=73;if(73===h.status)if(h.gzhead.name){l=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,h.pending-l,l)),c(a),l=h.pending,h.pending===h.pending_buf_size)){var m=1;break}m=h.gzindex<
h.gzhead.name.length?h.gzhead.name.charCodeAt(h.gzindex++)&255:0;b(h,m)}while(0!==m);h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,h.pending-l,l));0===m&&(h.gzindex=0,h.status=91)}else h.status=91;if(91===h.status)if(h.gzhead.comment){l=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,h.pending-l,l)),c(a),l=h.pending,h.pending===h.pending_buf_size)){m=1;break}m=h.gzindex<h.gzhead.comment.length?h.gzhead.comment.charCodeAt(h.gzindex++)&
255:0;b(h,m)}while(0!==m);h.gzhead.hcrc&&h.pending>l&&(a.adler=r(a.adler,h.pending_buf,h.pending-l,l));0===m&&(h.status=103)}else h.status=103;103===h.status&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&c(a),h.pending+2<=h.pending_buf_size&&(b(h,a.adler&255),b(h,a.adler>>8&255),a.adler=0,h.status=113)):h.status=113);if(0!==h.pending){if(c(a),0===a.avail_out)return h.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===h.status&&0!==a.avail_in)return k(a,
-5);if(0!==a.avail_in||0!==h.lookahead||0!==d&&666!==h.status){f=2===h.strategy?x(h,d):3===h.strategy?v(h,d):L[h.level].func(h,d);if(3===f||4===f)h.status=666;if(1===f||3===f)return 0===a.avail_out&&(h.last_flush=-1),0;if(2===f&&(1===d?B._tr_align(h):5!==d&&(B._tr_stored_block(h,0,0,!1),3===d&&(g(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),c(a),0===a.avail_out))return h.last_flush=-1,0}if(4!==d)return 0;if(0>=h.wrap)return 1;2===h.wrap?(b(h,a.adler&255),b(h,a.adler>>8&255),
b(h,a.adler>>16&255),b(h,a.adler>>24&255),b(h,a.total_in&255),b(h,a.total_in>>8&255),b(h,a.total_in>>16&255),b(h,a.total_in>>24&255)):(e(h,a.adler>>>16),e(h,a.adler&65535));c(a);0<h.wrap&&(h.wrap=-h.wrap);return 0!==h.pending?0:1};l.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};l.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 G.Buf8(d.w_size);G.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(m(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;m(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};l.deflateInfo="pako deflate (from Nodeca project)"},function(p,l,f){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 e(a,c,d){b(a,d[2*c],d[2*c+1])}function n(a,b){var c=0;do c|=a&1,a>>>=1,c<<=1;while(0<--b);return c>>>1}function m(a,b,c){var d=Array(16),e=0,g;for(g=1;15>=g;g++)d[g]=e=e+c[g-1]<<1;for(c=
0;c<=b;c++)e=a[2*c+1],0!==e&&(a[2*c]=n(d[e]++,e))}function h(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 d(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 v(a,b,c,d){var e=2*b,g=2*c;return a[e]<a[g]||a[e]===a[g]&&d[b]<=d[c]}function x(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len;){e<
a.heap_len&&v(b,a.heap[e+1],a.heap[e],a.depth)&&e++;if(v(b,d,a.heap[e],a.depth))break;a.heap[c]=a.heap[e];c=e;e<<=1}a.heap[c]=d}function q(a,c,d){var g=0;if(0!==a.last_lit){do{var h=a.pending_buf[a.d_buf+2*g]<<8|a.pending_buf[a.d_buf+2*g+1];var k=a.pending_buf[a.l_buf+g];g++;if(0===h)e(a,k,c);else{var f=F[k];e(a,f+256+1,c);var l=H[f];0!==l&&(k-=A[f],b(a,k,l));h--;f=256>h?J[h]:J[256+(h>>>7)];e(a,f,d);l=r[f];0!==l&&(h-=D[f],b(a,h,l))}}while(g<a.last_lit)}e(a,256,c)}function w(a,b){var c=b.dyn_tree,
d=b.stat_desc.static_tree,e=b.stat_desc.has_stree,g=b.stat_desc.elems,h,k=-1;a.heap_len=0;a.heap_max=573;for(h=0;h<g;h++)0!==c[2*h]?(a.heap[++a.heap_len]=k=h,a.depth[h]=0):c[2*h+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(h=a.heap_len>>1;1<=h;h--)x(a,c,h);f=g;do h=a.heap[1],a.heap[1]=a.heap[a.heap_len--],x(a,c,1),d=a.heap[1],a.heap[--a.heap_max]=h,a.heap[--a.heap_max]=d,c[2*f]=c[2*h]+c[2*d],a.depth[f]=
(a.depth[h]>=a.depth[d]?a.depth[h]:a.depth[d])+1,c[2*h+1]=c[2*d+1]=f,a.heap[1]=f++,x(a,c,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];h=b.dyn_tree;f=b.max_code;d=b.stat_desc.static_tree;e=b.stat_desc.has_stree;g=b.stat_desc.extra_bits;var l=b.stat_desc.extra_base,r=b.stat_desc.max_length,n,p=0;for(n=0;15>=n;n++)a.bl_count[n]=0;h[2*a.heap[a.heap_max]+1]=0;for(b=a.heap_max+1;573>b;b++){var q=a.heap[b];n=h[2*h[2*q+1]+1]+1;n>r&&(n=r,p++);h[2*q+1]=n;if(!(q>f)){a.bl_count[n]++;var u=0;q>=l&&(u=
g[q-l]);var t=h[2*q];a.opt_len+=t*(n+u);e&&(a.static_len+=t*(d[2*q+1]+u))}}if(0!==p){do{for(n=r-1;0===a.bl_count[n];)n--;a.bl_count[n]--;a.bl_count[n+1]+=2;a.bl_count[r]--;p-=2}while(0<p);for(n=r;0!==n;n--)for(q=a.bl_count[n];0!==q;)d=a.heap[--b],d>f||(h[2*d+1]!==n&&(a.opt_len+=(n-h[2*d+1])*h[2*d],h[2*d+1]=n),q--)}m(c,k,a.bl_count)}function E(a,b,c){var d,e=-1,h=b[1],g=0,k=7,f=4;0===h&&(k=138,f=3);b[2*(c+1)+1]=65535;for(d=0;d<=c;d++){var l=h;h=b[2*(d+1)+1];++g<k&&l===h||(g<f?a.bl_tree[2*l]+=g:0!==
l?(l!==e&&a.bl_tree[2*l]++,a.bl_tree[32]++):10>=g?a.bl_tree[34]++:a.bl_tree[36]++,g=0,e=l,0===h?(k=138,f=3):l===h?(k=6,f=3):(k=7,f=4))}}function u(a,c,d){var h,g=-1,k=c[1],f=0,l=7,m=4;0===k&&(l=138,m=3);for(h=0;h<=d;h++){var r=k;k=c[2*(h+1)+1];if(!(++f<l&&r===k)){if(f<m){do e(a,r,a.bl_tree);while(0!==--f)}else 0!==r?(r!==g&&(e(a,r,a.bl_tree),f--),e(a,16,a.bl_tree),b(a,f-3,2)):10>=f?(e(a,17,a.bl_tree),b(a,f-3,3)):(e(a,18,a.bl_tree),b(a,f-11,7));f=0;g=r;0===k?(l=138,m=3):r===k?(l=6,m=3):(l=7,m=4)}}}
function C(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 G(c,e,h,g){b(c,0+(g?1:0),3);d(c);a(c,h);a(c,~h);B.arraySet(c.pending_buf,c.window,e,h,c.pending);c.pending+=h}var B=f(5),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],r=[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],z=[0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t=Array(576);k(t);var M=Array(60);k(M);var J=Array(512);k(J);var F=Array(256);k(F);var A=Array(29);k(A);var D=Array(30);k(D);var P,I,O,K=!1;l._tr_init=function(a){if(!K){var b,d,e,k=Array(16);for(e=d=0;28>e;e++)for(A[e]=d,b=0;b<1<<H[e];b++)F[d++]=e;F[d-1]=e;for(e=d=0;16>e;e++)for(D[e]=d,b=0;b<1<<r[e];b++)J[d++]=e;for(d>>=7;30>e;e++)for(D[e]=d<<7,b=0;b<1<<r[e]-7;b++)J[256+d++]=e;for(b=0;15>=b;b++)k[b]=0;for(b=0;143>=
b;)t[2*b+1]=8,b++,k[8]++;for(;255>=b;)t[2*b+1]=9,b++,k[9]++;for(;279>=b;)t[2*b+1]=7,b++,k[7]++;for(;287>=b;)t[2*b+1]=8,b++,k[8]++;m(t,287,k);for(b=0;30>b;b++)M[2*b+1]=5,M[2*b]=n(b,5);P=new g(t,H,257,286,15);I=new g(M,r,0,30,15);O=new g([],z,0,19,7);K=!0}a.l_desc=new c(a.dyn_ltree,P);a.d_desc=new c(a.dyn_dtree,I);a.bl_desc=new c(a.bl_tree,O);a.bi_buf=0;a.bi_valid=0;h(a)};l._tr_stored_block=G;l._tr_flush_block=function(a,c,e,g){var k=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=C(a));w(a,
a.l_desc);w(a,a.d_desc);E(a,a.dyn_ltree,a.l_desc.max_code);E(a,a.dyn_dtree,a.d_desc.max_code);w(a,a.bl_desc);for(k=18;3<=k&&0===a.bl_tree[2*L[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=e+5;if(e+4<=f&&-1!==c)G(a,c,e,g);else if(4===a.strategy||l===f)b(a,2+(g?1:0),3),q(a,t,M);else{b(a,4+(g?1:0),3);c=a.l_desc.max_code+1;e=a.d_desc.max_code+1;k+=1;b(a,c-257,5);b(a,e-1,5);b(a,k-4,4);for(f=0;f<k;f++)b(a,a.bl_tree[2*L[f]+1],3);u(a,a.dyn_ltree,
c-1);u(a,a.dyn_dtree,e-1);q(a,a.dyn_ltree,a.dyn_dtree)}h(a);g&&d(a)};l._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*(F[c]+256+1)]++,a.dyn_dtree[2*(256>b?J[b]:J[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};l._tr_align=function(c){b(c,2,3);e(c,256,t);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,l,f){function k(b){if(!(this instanceof k))return new k(b);var d=this.options=a.assign({chunkSize:16384,windowBits:0,to:""},b||{});d.raw&&0<=d.windowBits&&16>d.windowBits&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15));!(0<=d.windowBits&&16>d.windowBits)||b&&b.windowBits||(d.windowBits+=32);15<d.windowBits&&48>d.windowBits&&0===(d.windowBits&15)&&(d.windowBits|=15);this.err=0;this.msg="";this.ended=
!1;this.chunks=[];this.strm=new m;this.strm.avail_out=0;b=c.inflateInit2(this.strm,d.windowBits);if(b!==e.Z_OK)throw Error(n[b]);this.header=new h;c.inflateGetHeader(this.strm,this.header)}function g(a,b){b=new k(b);b.push(a,!0);if(b.err)throw b.msg||n[b.err];return b.result}var c=f(95),a=f(5),b=f(45),e=f(47),n=f(27),m=f(46),h=f(98),d=Object.prototype.toString;k.prototype.push=function(h,g){var k=this.strm,f=this.options.chunkSize,l=this.options.dictionary,m=!1;if(this.ended)return!1;g=g===~~g?g:
!0===g?e.Z_FINISH:e.Z_NO_FLUSH;"string"===typeof h?k.input=b.binstring2buf(h):"[object ArrayBuffer]"===d.call(h)?k.input=new Uint8Array(h):k.input=h;k.next_in=0;k.avail_in=k.input.length;do{0===k.avail_out&&(k.output=new a.Buf8(f),k.next_out=0,k.avail_out=f);h=c.inflate(k,e.Z_NO_FLUSH);h===e.Z_NEED_DICT&&l&&(h="string"===typeof l?b.string2buf(l):"[object ArrayBuffer]"===d.call(l)?new Uint8Array(l):l,h=c.inflateSetDictionary(this.strm,h));h===e.Z_BUF_ERROR&&!0===m&&(h=e.Z_OK,m=!1);if(h!==e.Z_STREAM_END&&
h!==e.Z_OK)return this.onEnd(h),this.ended=!0,!1;if(k.next_out&&(0===k.avail_out||h===e.Z_STREAM_END||0===k.avail_in&&(g===e.Z_FINISH||g===e.Z_SYNC_FLUSH)))if("string"===this.options.to){var n=b.utf8border(k.output,k.next_out);var p=k.next_out-n;var v=b.buf2string(k.output,n);k.next_out=p;k.avail_out=f-p;p&&a.arraySet(k.output,k.output,n,p,0);this.onData(v)}else this.onData(a.shrinkBuf(k.output,k.next_out));0===k.avail_in&&0===k.avail_out&&(m=!0)}while((0<k.avail_in||0===k.avail_out)&&h!==e.Z_STREAM_END);
h===e.Z_STREAM_END&&(g=e.Z_FINISH);if(g===e.Z_FINISH)return h=c.inflateEnd(this.strm),this.onEnd(h),this.ended=!0,h===e.Z_OK;g===e.Z_SYNC_FLUSH&&(this.onEnd(e.Z_OK),k.avail_out=0);return!0};k.prototype.onData=function(a){this.chunks.push(a)};k.prototype.onEnd=function(b){b===e.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};l.Inflate=k;l.inflate=g;l.inflateRaw=function(a,b){b=b||{};b.raw=!0;return g(a,
b)};l.ungzip=g},function(p,l,f){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 m.Buf16(320);this.work=
new m.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 m.Buf32(852);b.distcode=b.distdyn=new m.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 e(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 n(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 m.Buf8(e.wsize));d>=e.wsize?(m.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),m.arraySet(e.window,b,c-d,a,e.wnext),(d-=a)?(m.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 m=f(5),h=f(43),d=f(44),v=f(96),x=f(97),q=!0,w,E;l.inflateReset=a;l.inflateReset2=b;l.inflateResetKeep=c;l.inflateInit=function(a){return e(a,15)};l.inflateInit2=e;l.inflate=function(a,b){var c,e=new m.Buf8(4),g=[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 l=a.next_out;var p=a.output;var t=a.avail_out;var u=a.next_in;var C=a.input;var F=a.avail_in;var A=f.hold;var D=f.bits;var P=F;var I=t;var O=0;a:for(;;)switch(f.mode){case 1:if(0===f.wrap){f.mode=13;break}for(;16>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if(f.wrap&2&&35615===A){f.check=0;e[0]=A&255;e[1]=A>>>8&255;f.check=d(f.check,e,2,0);D=A=0;f.mode=2;break}f.flags=0;f.head&&(f.head.done=!1);if(!(f.wrap&1)||(((A&255)<<8)+(A>>8))%31){a.msg="incorrect header check";
f.mode=30;break}if(8!==(A&15)){a.msg="unknown compression method";f.mode=30;break}A>>>=4;D-=4;var K=(A&15)+8;if(0===f.wbits)f.wbits=K;else if(K>f.wbits){a.msg="invalid window size";f.mode=30;break}f.dmax=1<<K;a.adler=f.check=1;f.mode=A&512?10:12;D=A=0;break;case 2:for(;16>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.flags=A;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=A>>8&1);f.flags&
512&&(e[0]=A&255,e[1]=A>>>8&255,f.check=d(f.check,e,2,0));D=A=0;f.mode=3;case 3:for(;32>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.head&&(f.head.time=A);f.flags&512&&(e[0]=A&255,e[1]=A>>>8&255,e[2]=A>>>16&255,e[3]=A>>>24&255,f.check=d(f.check,e,4,0));D=A=0;f.mode=4;case 4:for(;16>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.head&&(f.head.xflags=A&255,f.head.os=A>>8);f.flags&512&&(e[0]=A&255,e[1]=A>>>8&255,f.check=d(f.check,e,2,0));D=A=0;f.mode=5;case 5:if(f.flags&1024){for(;16>D;){if(0===F)break a;
F--;A+=C[u++]<<D;D+=8}f.length=A;f.head&&(f.head.extra_len=A);f.flags&512&&(e[0]=A&255,e[1]=A>>>8&255,f.check=d(f.check,e,2,0));D=A=0}else f.head&&(f.head.extra=null);f.mode=6;case 6:if(f.flags&1024){var y=f.length;y>F&&(y=F);y&&(f.head&&(K=f.head.extra_len-f.length,f.head.extra||(f.head.extra=Array(f.head.extra_len)),m.arraySet(f.head.extra,C,u,y,K)),f.flags&512&&(f.check=d(f.check,C,y,u)),F-=y,u+=y,f.length-=y);if(f.length)break a}f.length=0;f.mode=7;case 7:if(f.flags&2048){if(0===F)break a;y=0;
do K=C[u+y++],f.head&&K&&65536>f.length&&(f.head.name+=String.fromCharCode(K));while(K&&y<F);f.flags&512&&(f.check=d(f.check,C,y,u));F-=y;u+=y;if(K)break a}else f.head&&(f.head.name=null);f.length=0;f.mode=8;case 8:if(f.flags&4096){if(0===F)break a;y=0;do K=C[u+y++],f.head&&K&&65536>f.length&&(f.head.comment+=String.fromCharCode(K));while(K&&y<F);f.flags&512&&(f.check=d(f.check,C,y,u));F-=y;u+=y;if(K)break a}else f.head&&(f.head.comment=null);f.mode=9;case 9:if(f.flags&512){for(;16>D;){if(0===F)break a;
F--;A+=C[u++]<<D;D+=8}if(A!==(f.check&65535)){a.msg="header crc mismatch";f.mode=30;break}D=A=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>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}a.adler=f.check=k(A);D=A=0;f.mode=11;case 11:if(0===f.havedict)return a.next_out=l,a.avail_out=t,a.next_in=u,a.avail_in=F,f.hold=A,f.bits=D,2;a.adler=f.check=1;f.mode=12;case 12:if(5===b||6===b)break a;case 13:if(f.last){A>>>=D&7;D-=D&7;f.mode=27;break}for(;3>D;){if(0===
F)break a;F--;A+=C[u++]<<D;D+=8}f.last=A&1;A>>>=1;--D;switch(A&3){case 0:f.mode=14;break;case 1:K=f;if(q){w=new m.Buf32(512);E=new m.Buf32(32);for(y=0;144>y;)K.lens[y++]=8;for(;256>y;)K.lens[y++]=9;for(;280>y;)K.lens[y++]=7;for(;288>y;)K.lens[y++]=8;x(1,K.lens,0,288,w,0,K.work,{bits:9});for(y=0;32>y;)K.lens[y++]=5;x(2,K.lens,0,32,E,0,K.work,{bits:5});q=!1}K.lencode=w;K.lenbits=9;K.distcode=E;K.distbits=5;f.mode=20;if(6===b){A>>>=2;D-=2;break a}break;case 2:f.mode=17;break;case 3:a.msg="invalid block type",
f.mode=30}A>>>=2;D-=2;break;case 14:A>>>=D&7;for(D-=D&7;32>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if((A&65535)!==(A>>>16^65535)){a.msg="invalid stored block lengths";f.mode=30;break}f.length=A&65535;D=A=0;f.mode=15;if(6===b)break a;case 15:f.mode=16;case 16:if(y=f.length){y>F&&(y=F);y>t&&(y=t);if(0===y)break a;m.arraySet(p,C,u,y,l);F-=y;u+=y;t-=y;l+=y;f.length-=y;break}f.mode=12;break;case 17:for(;14>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.nlen=(A&31)+257;A>>>=5;D-=5;f.ndist=(A&31)+1;A>>>=
5;D-=5;f.ncode=(A&15)+4;A>>>=4;D-=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>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.lens[g[f.have++]]=A&7;A>>>=3;D-=3}for(;19>f.have;)f.lens[g[f.have++]]=0;f.lencode=f.lendyn;f.lenbits=7;y={bits:f.lenbits};O=x(0,f.lens,0,19,f.lencode,0,f.work,y);f.lenbits=y.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 N=f.lencode[A&(1<<f.lenbits)-1];y=N>>>24;N&=65535;if(y<=D)break;if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if(16>N)A>>>=y,D-=y,f.lens[f.have++]=N;else{if(16===N){for(K=y+2;D<K;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}A>>>=y;D-=y;if(0===f.have){a.msg="invalid bit length repeat";f.mode=30;break}K=f.lens[f.have-1];y=3+(A&3);A>>>=2;D-=2}else if(17===N){for(K=y+3;D<K;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}A>>>=y;D-=y;K=0;y=3+(A&7);A>>>=3;D-=3}else{for(K=y+7;D<K;){if(0===F)break a;F--;
A+=C[u++]<<D;D+=8}A>>>=y;D-=y;K=0;y=11+(A&127);A>>>=7;D-=7}if(f.have+y>f.nlen+f.ndist){a.msg="invalid bit length repeat";f.mode=30;break}for(;y--;)f.lens[f.have++]=K}}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;y={bits:f.lenbits};O=x(1,f.lens,0,f.nlen,f.lencode,0,f.work,y);f.lenbits=y.bits;if(O){a.msg="invalid literal/lengths set";f.mode=30;break}f.distbits=6;f.distcode=f.distdyn;y={bits:f.distbits};O=x(2,f.lens,f.nlen,f.ndist,
f.distcode,0,f.work,y);f.distbits=y.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<=F&&258<=t){a.next_out=l;a.avail_out=t;a.next_in=u;a.avail_in=F;f.hold=A;f.bits=D;v(a,I);l=a.next_out;p=a.output;t=a.avail_out;u=a.next_in;C=a.input;F=a.avail_in;A=f.hold;D=f.bits;12===f.mode&&(f.back=-1);break}for(f.back=0;;){N=f.lencode[A&(1<<f.lenbits)-1];y=N>>>24;K=N>>>16&255;N&=65535;if(y<=D)break;if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if(K&&0===
(K&240)){var U=y;var T=K;for(c=N;;){N=f.lencode[c+((A&(1<<U+T)-1)>>U)];y=N>>>24;K=N>>>16&255;N&=65535;if(U+y<=D)break;if(0===F)break a;F--;A+=C[u++]<<D;D+=8}A>>>=U;D-=U;f.back+=U}A>>>=y;D-=y;f.back+=y;f.length=N;if(0===K){f.mode=26;break}if(K&32){f.back=-1;f.mode=12;break}if(K&64){a.msg="invalid literal/length code";f.mode=30;break}f.extra=K&15;f.mode=22;case 22:if(f.extra){for(K=f.extra;D<K;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}f.length+=A&(1<<f.extra)-1;A>>>=f.extra;D-=f.extra;f.back+=f.extra}f.was=
f.length;f.mode=23;case 23:for(;;){N=f.distcode[A&(1<<f.distbits)-1];y=N>>>24;K=N>>>16&255;N&=65535;if(y<=D)break;if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if(0===(K&240)){U=y;T=K;for(c=N;;){N=f.distcode[c+((A&(1<<U+T)-1)>>U)];y=N>>>24;K=N>>>16&255;N&=65535;if(U+y<=D)break;if(0===F)break a;F--;A+=C[u++]<<D;D+=8}A>>>=U;D-=U;f.back+=U}A>>>=y;D-=y;f.back+=y;if(K&64){a.msg="invalid distance code";f.mode=30;break}f.offset=N;f.extra=K&15;f.mode=24;case 24:if(f.extra){for(K=f.extra;D<K;){if(0===F)break a;F--;
A+=C[u++]<<D;D+=8}f.offset+=A&(1<<f.extra)-1;A>>>=f.extra;D-=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===t)break a;y=I-t;if(f.offset>y){y=f.offset-y;if(y>f.whave&&f.sane){a.msg="invalid distance too far back";f.mode=30;break}y>f.wnext?(y-=f.wnext,K=f.wsize-y):K=f.wnext-y;y>f.length&&(y=f.length);U=f.window}else U=p,K=l-f.offset,y=f.length;y>t&&(y=t);t-=y;f.length-=y;do p[l++]=U[K++];while(--y);0===f.length&&(f.mode=21);
break;case 26:if(0===t)break a;p[l++]=f.length;t--;f.mode=21;break;case 27:if(f.wrap){for(;32>D;){if(0===F)break a;F--;A|=C[u++]<<D;D+=8}I-=t;a.total_out+=I;f.total+=I;I&&(a.adler=f.check=f.flags?d(f.check,p,I,l-I):h(f.check,p,I,l-I));I=t;if((f.flags?A:k(A))!==f.check){a.msg="incorrect data check";f.mode=30;break}D=A=0}f.mode=28;case 28:if(f.wrap&&f.flags){for(;32>D;){if(0===F)break a;F--;A+=C[u++]<<D;D+=8}if(A!==(f.total&4294967295)){a.msg="incorrect length check";f.mode=30;break}D=A=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=l;a.avail_out=t;a.next_in=u;a.avail_in=F;f.hold=A;f.bits=D;if((f.wsize||I!==a.avail_out&&30>f.mode&&(27>f.mode||4!==b))&&n(a,a.output,a.next_out,I-a.avail_out))return f.mode=31,-4;P-=a.avail_in;I-=a.avail_out;a.total_in+=P;a.total_out+=I;f.total+=I;f.wrap&&I&&(a.adler=f.check=f.flags?d(f.check,p,I,a.next_out-I):h(f.check,p,I,a.next_out-I));a.data_type=f.bits+(f.last?64:0)+(12===f.mode?128:0)+(20===f.mode||15===f.mode?
256:0);(0===P&&0===I||4===b)&&0===O&&(O=-5);return O};l.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};l.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};l.inflateSetDictionary=function(a,b){var c=b.length;if(!a||!a.state)return-2;var d=a.state;if(0!==d.wrap&&11!==d.mode)return-2;if(11===d.mode){var e=h(1,b,c,0);if(e!==d.check)return-3}if(n(a,b,c,c))return d.mode=
31,-4;d.havedict=1;return 0};l.inflateInfo="pako inflate (from Nodeca project)"},function(p,l,f){p.exports=function(f,g){var c=f.state;var a=f.next_in;var b=f.input;var e=a+(f.avail_in-5);var k=f.next_out;var l=f.output;g=k-(g-f.avail_out);var h=k+(f.avail_out-257);var d=c.dmax;var p=c.wsize;var x=c.whave;var q=c.wnext;var w=c.window;var E=c.hold;var u=c.bits;var C=c.lencode;var G=c.distcode;var B=(1<<c.lenbits)-1;var H=(1<<c.distbits)-1;a:do{15>u&&(E+=b[a++]<<u,u+=8,E+=b[a++]<<u,u+=8);var r=C[E&
B];b:for(;;){var z=r>>>24;E>>>=z;u-=z;z=r>>>16&255;if(0===z)l[k++]=r&65535;else if(z&16){var L=r&65535;if(z&=15)u<z&&(E+=b[a++]<<u,u+=8),L+=E&(1<<z)-1,E>>>=z,u-=z;15>u&&(E+=b[a++]<<u,u+=8,E+=b[a++]<<u,u+=8);r=G[E&H];c:for(;;){z=r>>>24;E>>>=z;u-=z;z=r>>>16&255;if(z&16){r&=65535;z&=15;u<z&&(E+=b[a++]<<u,u+=8,u<z&&(E+=b[a++]<<u,u+=8));r+=E&(1<<z)-1;if(r>d){f.msg="invalid distance too far back";c.mode=30;break a}E>>>=z;u-=z;z=k-g;if(r>z){z=r-z;if(z>x&&c.sane){f.msg="invalid distance too far back";c.mode=
30;break a}var t=0;var M=w;if(0===q){if(t+=p-z,z<L){L-=z;do l[k++]=w[t++];while(--z);t=k-r;M=l}}else if(q<z){if(t+=p+q-z,z-=q,z<L){L-=z;do l[k++]=w[t++];while(--z);t=0;if(q<L){z=q;L-=z;do l[k++]=w[t++];while(--z);t=k-r;M=l}}}else if(t+=q-z,z<L){L-=z;do l[k++]=w[t++];while(--z);t=k-r;M=l}for(;2<L;)l[k++]=M[t++],l[k++]=M[t++],l[k++]=M[t++],L-=3;L&&(l[k++]=M[t++],1<L&&(l[k++]=M[t++]))}else{t=k-r;do l[k++]=l[t++],l[k++]=l[t++],l[k++]=l[t++],L-=3;while(2<L);L&&(l[k++]=l[t++],1<L&&(l[k++]=l[t++]))}}else if(0===
(z&64)){r=G[(r&65535)+(E&(1<<z)-1)];continue c}else{f.msg="invalid distance code";c.mode=30;break a}break}}else if(0===(z&64)){r=C[(r&65535)+(E&(1<<z)-1)];continue b}else{z&32?c.mode=12:(f.msg="invalid literal/length code",c.mode=30);break a}break}}while(a<e&&k<h);L=u>>3;a-=L;u-=L<<3;f.next_in=a;f.next_out=k;f.avail_in=a<e?5+(e-a):5-(a-e);f.avail_out=k<h?257+(h-k):257-(k-h);c.hold=E&(1<<u)-1;c.bits=u}},function(p,l,f){var k=f(5),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(e,f,l,h,d,p,x,q){var m=q.bits,n,u,v,G,B,H,r=0,z=new k.Buf16(16);var L=new k.Buf16(16);var t,M=0;for(n=0;15>=n;n++)z[n]=0;for(u=0;u<h;u++)z[f[l+
u]]++;var J=m;for(v=15;1<=v&&0===z[v];v--);J>v&&(J=v);if(0===v)return d[p++]=20971520,d[p++]=20971520,q.bits=1,0;for(m=1;m<v&&0===z[m];m++);J<m&&(J=m);for(n=G=1;15>=n;n++)if(G<<=1,G-=z[n],0>G)return-1;if(0<G&&(0===e||1!==v))return-1;L[1]=0;for(n=1;15>n;n++)L[n+1]=L[n]+z[n];for(u=0;u<h;u++)0!==f[l+u]&&(x[L[f[l+u]]++]=u);if(0===e){var F=t=x;var A=19}else 1===e?(F=g,r-=257,t=c,M-=257,A=256):(F=a,t=b,A=-1);u=B=0;n=m;var D=p;h=J;L=0;var P=-1;var I=1<<J;var O=I-1;if(1===e&&852<I||2===e&&592<I)return 1;
for(;;){var K=n-L;if(x[u]<A){var y=0;var N=x[u]}else x[u]>A?(y=t[M+x[u]],N=F[r+x[u]]):(y=96,N=0);G=1<<n-L;m=H=1<<h;do H-=G,d[D+(B>>L)+H]=K<<24|y<<16|N|0;while(0!==H);for(G=1<<n-1;B&G;)G>>=1;0!==G?(B&=G-1,B+=G):B=0;u++;if(0===--z[n]){if(n===v)break;n=f[l+x[u]]}if(n>J&&(B&O)!==P){0===L&&(L=J);D+=m;h=n-L;for(G=1<<h;h+L<v;){G-=z[h+L];if(0>=G)break;h++;G<<=1}I+=1<<h;if(1===e&&852<I||2===e&&592<I)return 1;P=B&O;d[P]=J<<24|h<<16|D-p|0}}0!==B&&(d[D+B]=n-L<<24|4194304);q.bits=J;return 0}},function(p,l,f){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,l,f){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(l,"__esModule",{value:!0});f.d(l,"DVIDVolumeChunkSource",function(){return v});f.d(l,"TileChunkSource",function(){return x});p=f(2);var a=f(100),b=f(24),e=f(17);l=f(13);var n=f(11);f=f(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}}(),h=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var g=a.length-1;0<=g;g--)if(h=a[g])f=(3>e?h(f):3<e?h(b,c,f):h(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},d=new Map([[a.b.JPEG,
e.a]]),v=function(d){function f(){k(this,f);return g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}c(f,d);m(f,[{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(n.e)(Object(n.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?e.a:b.a}}]);return f}(Object(p.WithParameters)(l.a,a.d));v=h([Object(f.g)()],v);var x=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=d.get(a.parameters.encoding);
return a}c(b,a);m(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=a.chunkGridPosition;a.chunkDataSize=this.spec.chunkDataSize;return Object(n.e)(Object(n.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)(l.a,a.a));x=h([Object(f.g)()],x)},function(p,l,f){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");}f.d(l,"c",function(){return a});f.d(l,
"d",function(){return b});f.d(l,"b",function(){return e});f.d(l,"a",function(){return n});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.COMPRESSED_SEGMENTATION=1]="COMPRESSED_SEGMENTATION"})(a||(a={}));p=function h(){c(this,h)};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 e;(function(a){a[a.JPEG=0]="JPEG"})(e||(e={}));var n=function(a){function b(){c(this,b);return k(this,
(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);n.RPC_ID="dvid/TileChunkSource"},function(p,l,f){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(E.a)(a,function(a){Object(E.i)(a);b.push(Object(E.l)(a.sectionId))});return b}function b(a,b,c){return Object(w.d)(Object(w.c)(b.baseUrls,"/render-ws/v1/owner/"+b.owner+"/project/"+b.project+"/"+("stack/"+b.stack+"/local-to-world-coordinates"),"PUT"),a,"json",c)}function e(a,c,d,e){var f=
[];Object(E.a)(c,function(a){var b=Object(E.l)(a.pId),c=Object(E.l)(a.qId),d=Object(E.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 x.a,d=0;d<b.length;d++){var e=Object(E.i)(b[d]);e=Object(E.g)(e.world);c.appendArray(e)}a.vertexPositions=c.view})}function n(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(w.e)(Object(w.c)(c.baseUrls,b),"json",d).then(function(b){return e(a,b,c,d)})}function m(b,c,d,e){return Object(w.e)(Object(w.c)(d.baseUrls,c),"json",e).then(function(c){return n(b,a(c),d,e)})}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,
"TileChunkSource",function(){return B});f.d(l,"PointMatchSource",function(){return H});p=f(2);l=f(102);var h=f(17),d=f(103),v=f(13),x=f(105),q=f(1),w=f(11),E=f(3);f=f(0);var u=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}}(),C=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},G=new Map;G.set("jpg",h.a);var B=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=G.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);u(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=a.chunkGridPosition,f=1/Math.pow(2,
d.level);a.chunkDataSize=this.spec.chunkDataSize;var g=a.chunkDataSize[0]*Math.pow(2,d.level),h=a.chunkDataSize[1]*Math.pow(2,d.level),k=q.m.create();k[0]=e[0]*g;k[1]=e[1]*h;k[2]=e[2];return Object(w.e)(Object(w.c)(d.baseUrls,"/render-ws/v1/owner/"+d.owner+"/project/"+d.project+"/stack/"+d.stack+"/z/"+k[2]+"/box/"+k[0]+","+k[1]+","+g+","+h+","+f+"/jpeg-image?"+this.queryString),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(p.WithParameters)(v.a,l.b));B=C([Object(f.g)()],
B);var H=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);u(b,[{key:"download",value:function(a,b){var c=this.parameters,d=a.chunkGridPosition;return m(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)(d.a,l.a));H=C([Object(f.g)()],H)},function(p,l,f){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");}f.d(l,"b",function(){return a});f.d(l,
"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 n(){c(this,n)});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,l,f){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.d(l,"a",function(){return n});p=f(20);var a=f(104),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,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),e=function h(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 h(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=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){e(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){e(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;e(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 n=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);n.prototype.chunkConstructor=
f},function(p,l,f){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)}f.d(l,"a",function(){return e});var g=f(9),c=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}}(),a=function m(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 m(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 e=function(b){function e(a){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");
a=(e.__proto__||Object.getPrototypeOf(e)).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(e,b);c(e,[{key:"toObject",value:function(){return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"toObject",this).call(this)}}],[{key:"make",value:function(a){return new e(Object.assign({},a,{transform:Object(g.k)(a.transform,a.vectorGraphicsSourceOptions)}))}},{key:"fromObject",
value:function(a){return new e(a)}}]);return e}(g.i)},function(p,l,f){f.d(l,"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,e){b&&c(a.prototype,b);e&&c(a,e);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,l,f){Object.defineProperty(l,"__esModule",{value:!0});f(41)},function(p,l,f){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(e.c)(a,b,"fragments")}function b(a,b){var c=(new DataView(b)).getUint32(0,!0);Object(e.d)(a,b,v.b.LITTLE,4,c)}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"PrecomputedVolumeChunkSource",
function(){return u});l.decodeManifestChunk=a;l.decodeFragmentChunk=b;f.d(l,"PrecomputedMeshSource",function(){return C});p=f(2);l=f(108);var e=f(18),n=f(24),m=f(17),h=f(19),d=f(13),v=f(12),x=f(11);f=f(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}}(),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},E=new Map;E.set(l.b.RAW,h.a);E.set(l.b.JPEG,m.a);E.set(l.b.COMPRESSED_SEGMENTATION,n.a);var u=function(a){function b(){k(this,b);var a=g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));
a.chunkDecoder=E.get(a.parameters.encoding);return a}c(b,a);q(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=this.computeChunkBounds(a),f=a.chunkDataSize;return Object(x.e)(Object(x.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)(d.a,l.c));u=w([Object(f.g)()],u);var C=function(d){function e(){k(this,e);return g(this,(e.__proto__||
Object.getPrototypeOf(e)).apply(this,arguments))}c(e,d);q(e,[{key:"download",value:function(b,c){var d=this.parameters;return Object(x.e)(Object(x.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(x.e)(Object(x.c)(d.baseUrls,d.path+"/"+a.fragmentId),"arraybuffer",c).then(function(c){return b(a,c)})}}]);return e}(Object(p.WithParameters)(e.a,l.a));C=w([Object(f.g)()],C)},function(p,
l,f){function k(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}f.d(l,"b",function(){return g});f.d(l,"c",function(){return c});f.d(l,"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 e(){k(this,e)};c.RPC_ID="precomputed/VolumeChunkSource";var a=function n(){k(this,n)};a.RPC_ID="precomputed/MeshSource"},function(p,l,f){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(w.isCompressed)(a)&&(a=Object(w.decompress)(a));var b=new u;b.uncompressedData=a;a=Object(w.readHeader)(a);
if(null===a)throw Error("Failed to parse NIFTI header.");b.header=a;return b}function a(a,b,d,e){return n.a.getData(a,c,b,d,e)}function b(b,c,d){return a(b,c,function(){return{priorityTier:e.d.VISIBLE,priority:1E3}},d).then(function(a){return a.header})}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"NiftiFileData",function(){return u});f.d(l,"NiftiVolumeChunkSource",function(){return G});p=f(2);var e=f(6),n=f(28),m=f(111),h=f(19);l=f(13);var d=f(40),v=f(12),x=f(1),q=f(0),w=f(112);f.n(w);
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}}();f=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 u=function H(){g(this,H)},C=new Map([[m.b.INT8,{dataType:d.a.UINT8,volumeType:d.c.IMAGE}],[m.b.UINT8,{dataType:d.a.UINT8,volumeType:d.c.IMAGE}],[m.b.INT16,{dataType:d.a.UINT16,volumeType:d.c.IMAGE}],[m.b.UINT16,{dataType:d.a.UINT16,volumeType:d.c.IMAGE}],[m.b.INT32,{dataType:d.a.UINT32,volumeType:d.c.SEGMENTATION}],[m.b.UINT32,{dataType:d.a.UINT32,volumeType:d.c.SEGMENTATION}],[m.b.INT64,{dataType:d.a.UINT64,
volumeType:d.c.SEGMENTATION}],[m.b.UINT64,{dataType:d.a.UINT64,volumeType:d.c.SEGMENTATION}],[m.b.FLOAT32,{dataType:d.a.FLOAT32,volumeType:d.c.IMAGE}]]);Object(q.e)(m.a,function(a,c){return b(this.getRef(a.chunkManager),a.url,c).then(function(a){var b=C.get(a.datatypeCode);if(void 0===b)throw Error("Unsupported data type: "+((m.b[a.datatypeCode]||a.datatypeCode)+"."));if(1!==a.dims[4])throw Error("Time series data not supported.");var c=1;switch(a.xyzt_units&w.NIFTI1.SPATIAL_UNITS_MASK){case w.NIFTI1.UNITS_METER:c=
1E9;break;case w.NIFTI1.UNITS_MM:c=1E6;break;case w.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 l=a.affine;l=x.h.fromValues(l[0][0],l[1][0],l[2][0],l[3][0],l[0][1],l[1][1],l[2][1],l[3][1],l[0][2],l[1][2],l[2][2],l[3][2],l[0][3],l[1][3],l[2][3],l[3][3]);return{value:{description:k,affine:l,dataType:b.dataType,numChannels:a.dims[5],volumeType:b.volumeType,voxelSize:x.m.fromValues(c*a.pixDims[1],c*a.pixDims[2],
c*a.pixDims[3]),volumeSize:x.m.fromValues(a.dims[1],a.dims[2],a.dims[3]),qoffset:x.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:x.j.fromValues(d,e,f,g)}}})});var G=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);
E(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(w.readImage)(a.header,a.uncompressedData);Object(h.a)(b,c,a.header.littleEndian?v.b.LITTLE:v.b.BIG)})}}]);return c}(Object(p.WithParameters)(l.a,m.c));G=f([Object(q.g)()],G)},function(p,l,f){l.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,l,f){f.d(l,"b",function(){return k});f.d(l,"c",function(){return g});l.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,l,f){var k=k||{};k.NIFTI1=k.NIFTI1||f(48);k.NIFTI2=k.NIFTI2||f(113);k.Utils=k.Utils||f(29);var g=g||f(26);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,e=1,f=1;c.dims[4]&&(e=c.dims[4]);c.dims[5]&&(f=c.dims[5]);return a.slice(b,b+c.numBitsPerVoxel/8*c.dims[2]*c.dims[3]*e*f*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,l,f){var k=k||{};k.Utils=k.Utils||f(29);k.NIFTI1=k.NIFTI1||f(48);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,l,f){function k(a){return Object(c.a)(Object(b.a)(a))}Object.defineProperty(l,"__esModule",{value:!0});var g=f(28),c=f(115);p=f(49);var a=f(10),b=f(50);Object(p.a)("vtk",{description:"VTK",getMesh:function(b,c,f,h){return g.a.getData(b.addRef(),k,c,f,h).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,l,f){l.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,e=b[4],f=b[3];b={version:b[1],comment:b[2],
datasetType:e,dataFormat:f};a=new Uint8Array(a.buffer,a.byteOffset+c,a.byteLength-c);if("ASCII"===f){f=d.get(e);if(void 0===f)throw Error("VTK dataset type "+JSON.stringify(e)+" 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]*$/,e=/^[ \t]*POLYGONS[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,n=/^[ \t]*3[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,m=/^[ \t]*$/,h=function x(a,b,c,d,e,f){if(!(this instanceof x))throw new TypeError("Cannot call a class as a function");this.header=a;this.numVertices=b;this.vertexPositions=c;this.numTriangles=d;this.indices=e;this.vertexAttributes=f},d=new Map([["POLYDATA",function(d,
f){function k(a,b,c,d){d=RegExp("^[ \t]*"+"([^s]+)[ \t]+".repeat(c-1)+"([^s]+)[ \t]*$");if(B-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=x[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 l(a,b){if(void 0!==t)throw Error("POINTS specified more than once.");r=a;z=k("POINTS",a,3,b)}function p(a,b){if(void 0!==
t)throw Error("VERTICES specified more than once.");if(B-H<a)throw Error("VTK data ended unexpectedly");if(b!==4*a)throw Error("Only triangular faces are supported.");L=a;t=new Uint32Array(3*a);for(var c=b=0;c<a;++c){var d=x[H++].match(n);if(null===d)throw Error("Failed to parse indices for face "+c);t[b++]=parseInt(d[1],10);t[b++]=parseInt(d[2],10);t[b++]=parseInt(d[3],10)}}function q(c){if(r!==c)throw Error("Number of vertices specified in POINT_DATA section ("+c+") "+("must match number of points ("+
r+")."));for(;H<B;)if(c=x[H],c.match(m))++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===B)throw Error("Expected LOOKUP_TABLE directive.");var f=x[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+")",r,e,d);M.push({name:c,data:h,numComponents:e,dataType:d,tableName:f})}}}for(var x=(new TextDecoder).decode(f).split("\n"),B=x.length,H=0,r=-1,z=void 0,L=-1,t=void 0,M=[];H<
B;)if(f=x[H],f.match(m))++H;else{var J=void 0;J=f.match(c);if(null!==J)++H,l(parseInt(J[1],10),J[2]);else if(J=f.match(e),null!==J)++H,p(parseInt(J[1],10),parseInt(J[2],10));else{J=f.match(g);if(null!==J){++H;q(parseInt(J[1],10));break}throw Error("Failed to parse VTK line "+JSON.stringify(f)+".");}}if(void 0===z)throw Error("Vertex positions not specified.");if(void 0===t)throw Error("Indices not specified.");return new h(d,r,z,L,t,M)}]])},function(p,l,f){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");}f.d(l,"d",function(){return c});l.c="single_mesh/SingleMeshLayer";l.a="single_mesh/getSingleMeshInfo";l.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,l,f){function k(b){b=(new TextDecoder).decode(Object(a.a)(b)).trim().split(/\n+/);if(!b)throw Error("CSV file is empty.");var e=b[0].split(","),f=e.map(function(a){return{name:a.trim(),
dataType:c.b.FLOAT32,numComponents:1}}),g=b.length-1,h=e.length;e=e.map(function(){return new Float32Array(g)});for(var d=0;d<g;++d)for(var k=b[d+1].split(","),l=0;l<h;++l)e[l][d]=parseFloat(k[l]);return{numVertices:g,attributeInfo:f,attributes:e}}Object.defineProperty(l,"__esModule",{value:!0});var g=f(28);p=f(49);var c=f(10),a=f(50);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,l,f){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(e.d)(a,b,x.b.LITTLE,4,c)}Object.defineProperty(l,"__esModule",{value:!0});f.d(l,"PythonVolumeChunkSource",function(){return C});l.decodeFragmentChunk=a;f.d(l,"PythonMeshSource",function(){return G});f.d(l,"PythonSkeletonSource",function(){return B});p=f(2);var b=f(119),e=f(18),n=f(39);l=f(17);var m=f(42),h=f(19),d=f(13),v=f(10),x=f(12),q=f(11);f=f(0);var w=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}}(),E=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var g=a.length-1;0<=g;g--)if(h=a[g])f=(3>e?h(f):3<e?h(b,c,f):h(b,
c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},u=new Map;u.set(b.c.NPZ,m.a);u.set(b.c.JPEG,l.a);u.set(b.c.RAW,h.a);var C=function(a){function d(){k(this,d);var a=g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=u.get(a.parameters.encoding);a.encoding=b.c[a.parameters.encoding].toLowerCase();return a}c(d,a);w(d,[{key:"download",value:function(a,b){var c=this,d=this.parameters;d="/neuroglancer/"+this.encoding+"/"+d.key+"/"+d.scaleKey;for(var e=this.computeChunkBounds(a),
f=a.chunkDataSize,h=0;3>h;++h)d+="/"+e[h]+","+(e[h]+f[h]);return Object(q.e)(Object(q.b)(d),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return d}(Object(p.WithParameters)(d.a,b.d));C=E([Object(f.g)()],C);var G=function(b){function d(){k(this,d);return g(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}c(d,b);w(d,[{key:"download",value:function(a){a.fragmentIds=[""];return Promise.resolve(void 0)}},{key:"downloadFragment",value:function(b,c){return Object(q.e)(Object(q.b)("/neuroglancer/mesh/"+
this.parameters.key+"/"+b.manifestChunk.objectId),"arraybuffer",c).then(function(c){return a(b,c)})}}]);return d}(Object(p.WithParameters)(e.a,b.a));G=E([Object(f.g)()],G);var B=function(a){function b(){k(this,b);return g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);w(b,[{key:"download",value:function(a,b){var c=this.parameters;return Object(q.e)(Object(q.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 h=8+12*f,g=[];d=$jscomp.makeIterator(d.values());for(var k=d.next();!k.done;k=d.next()){k=k.value;k=v.a[k.dataType]*k.numComponents;var l=k*f,m=new Uint8Array(b,h,l);switch(k){case 2:Object(x.c)(m,x.b.LITTLE);break;case 4:case 8:Object(x.d)(m,x.b.LITTLE)}g.push(m);h+=l}a.vertexAttributes=g;Object(n.b)(a,b,x.b.LITTLE,8,f,h,e)})}}]);return b}(Object(p.WithParameters)(n.a,b.b));B=E([Object(f.g)()],B)},function(p,l,f){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");}f.d(l,"c",function(){return a});f.d(l,
"d",function(){return b});f.d(l,"a",function(){return e});f.d(l,"b",function(){return n});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.NPZ=1]="NPZ";a[a.RAW=2]="RAW"})(a||(a={}));p=function h(){c(this,h)};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 e=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);
e.RPC_ID="python/MeshSource";var n=function(a){function b(){c(this,b);return k(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}g(b,a);return b}(p);n.RPC_ID="python/SkeletonSource"}]);
