-
Notifications
You must be signed in to change notification settings - Fork 67
/
jeri.min.js
33 lines (33 loc) · 104 KB
/
jeri.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("Jeri",["react","react-dom"],t):"object"==typeof exports?exports.Jeri=t(require("react"),require("react-dom")):e.Jeri=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=14)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r=new Float32Array(16),o=0;o<4;++o)r[o+4*o]=1;var i=function(){function e(e){void 0===e&&(e=r),this.data=new Float32Array(e)}return e.create=function(){return new e},e.fromScaling=function(e,t){if(3!==t.length)throw new Error("Matrix4x4.fromScaling requires a 3-dimentional vector as input");t.forEach(function(t,n){e.data[n+4*n]=t})},e.multiply=function(e,t,n){for(var r=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=0;o<4;++o)for(var i=0;i<4;++i)for(var a=0;a<4;++a)r[4*i+o]+=t.data[4*a+o]*n.data[4*i+a];e.data=r},e.scale=function(e,t,n){if(3!==n.length)throw new Error("Matrix4x4.scale expects the third argument to have 3 numbers");for(var r=new Float32Array(t.data),o=0;o<3;++o)for(var i=0;i<4;++i)r[4*o+i]*=n[o];e.data=r},e.translate=function(e,t,n){if(3!==n.length)throw new Error("Matrix4x4.translate expects the third argument to have 3 numbers");for(var r=new Float32Array(t.data),o=0;o<4;++o)for(var i=0;i<3;++i)r[12+o]+=t.data[4*i+o]*n[i];e.data=r},e.clone=function(t){return new e(t.data)},e.invert=function(e,t){var n=t.data,r=e.data;r[0]=-n[7]*n[10]*n[13]+n[6]*n[11]*n[13]+n[7]*n[9]*n[14]-n[5]*n[11]*n[14]-n[6]*n[9]*n[15]+n[5]*n[10]*n[15],r[1]=n[3]*n[10]*n[13]-n[2]*n[11]*n[13]-n[3]*n[9]*n[14]+n[1]*n[11]*n[14]+n[2]*n[9]*n[15]-n[1]*n[10]*n[15],r[2]=-n[3]*n[6]*n[13]+n[2]*n[7]*n[13]+n[3]*n[5]*n[14]-n[1]*n[7]*n[14]-n[2]*n[5]*n[15]+n[1]*n[6]*n[15],r[3]=n[3]*n[6]*n[9]-n[2]*n[7]*n[9]-n[3]*n[5]*n[10]+n[1]*n[7]*n[10]+n[2]*n[5]*n[11]-n[1]*n[6]*n[11],r[4]=n[7]*n[10]*n[12]-n[6]*n[11]*n[12]-n[7]*n[8]*n[14]+n[4]*n[11]*n[14]+n[6]*n[8]*n[15]-n[4]*n[10]*n[15],r[5]=-n[3]*n[10]*n[12]+n[2]*n[11]*n[12]+n[3]*n[8]*n[14]-n[0]*n[11]*n[14]-n[2]*n[8]*n[15]+n[0]*n[10]*n[15],r[6]=n[3]*n[6]*n[12]-n[2]*n[7]*n[12]-n[3]*n[4]*n[14]+n[0]*n[7]*n[14]+n[2]*n[4]*n[15]-n[0]*n[6]*n[15],r[7]=-n[3]*n[6]*n[8]+n[2]*n[7]*n[8]+n[3]*n[4]*n[10]-n[0]*n[7]*n[10]-n[2]*n[4]*n[11]+n[0]*n[6]*n[11],r[8]=-n[7]*n[9]*n[12]+n[5]*n[11]*n[12]+n[7]*n[8]*n[13]-n[4]*n[11]*n[13]-n[5]*n[8]*n[15]+n[4]*n[9]*n[15],r[9]=n[3]*n[9]*n[12]-n[1]*n[11]*n[12]-n[3]*n[8]*n[13]+n[0]*n[11]*n[13]+n[1]*n[8]*n[15]-n[0]*n[9]*n[15],r[10]=-n[3]*n[5]*n[12]+n[1]*n[7]*n[12]+n[3]*n[4]*n[13]-n[0]*n[7]*n[13]-n[1]*n[4]*n[15]+n[0]*n[5]*n[15],r[11]=n[3]*n[5]*n[8]-n[1]*n[7]*n[8]-n[3]*n[4]*n[9]+n[0]*n[7]*n[9]+n[1]*n[4]*n[11]-n[0]*n[5]*n[11],r[12]=n[6]*n[9]*n[12]-n[5]*n[10]*n[12]-n[6]*n[8]*n[13]+n[4]*n[10]*n[13]+n[5]*n[8]*n[14]-n[4]*n[9]*n[14],r[13]=-n[2]*n[9]*n[12]+n[1]*n[10]*n[12]+n[2]*n[8]*n[13]-n[0]*n[10]*n[13]-n[1]*n[8]*n[14]+n[0]*n[9]*n[14],r[14]=n[2]*n[5]*n[12]-n[1]*n[6]*n[12]-n[2]*n[4]*n[13]+n[0]*n[6]*n[13]+n[1]*n[4]*n[14]-n[0]*n[5]*n[14],r[15]=-n[2]*n[5]*n[8]+n[1]*n[6]*n[8]+n[2]*n[4]*n[9]-n[0]*n[6]*n[9]-n[1]*n[4]*n[10]+n[0]*n[5]*n[10];var o=n[0]*r[0]+n[1]*r[4]+n[2]*r[8]+n[3]*r[12];if(0===o)throw new Error("Matrix is not invertible.");for(var i=1/o,a=0;a<16;++a)r[a]*=i},e}();t.Matrix4x4=i;var a=function(){function e(){this.data=new Float32Array([0,0,0,0])}return e.create=function(){return new e},e.set=function(e,t,n,r,o){e.data[0]=t,e.data[1]=n,e.data[2]=r,e.data[3]=o},e.fromValues=function(t,n,r,o){var i=new e;return e.set(i,t,n,r,o),i},e.transformMat4=function(e,t,n){for(var r=t.data,o=n.data,i=new Float32Array([0,0,0,0]),a=0;a<4;++a)for(var s=0;s<4;++s)i[a]+=r[s]*o[4*s+a];e.data=i},e}();t.Vector4=a},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?d=p.concat(d):g=-1,d.length&&s())}function s(){if(!m){var e=o(a);m=!0;for(var t=d.length;t;){for(p=d,d=[];++g<t;)p&&p[g].run();g=-1,t=d.length}p=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,f,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var p,d=[],m=!1,g=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new c(e,t)),1!==d.length||m||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(e){return e.replace(S,"-$1").toLowerCase()}function o(e){return M(e).replace(A,"-ms-")}function i(e){return"string"==typeof e}function a(e){return"function"==typeof e&&"string"==typeof e.styledComponentId}function s(e){return e.displayName||e.name||"Component"}function c(e,t){for(var n=1540483477,r=t^e.length,o=e.length,i=0;o>=4;){var a=u(e,i);a=f(a,n),a^=a>>>24,a=f(a,n),r=f(r,n),r^=a,i+=4,o-=4}switch(o){case 3:r^=l(e,i),r^=e.charCodeAt(i+2)<<16,r=f(r,n);break;case 2:r^=l(e,i),r=f(r,n);break;case 1:r^=e.charCodeAt(i),r=f(r,n)}return r^=r>>>13,r=f(r,n),(r^=r>>>15)>>>0}function u(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function l(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function f(e,t){return e|=0,t|=0,(65535&e)*t+(((e>>>16)*t&65535)<<16)|0}n.d(t,"css",function(){return N}),n.d(t,"keyframes",function(){return Pe}),n.d(t,"injectGlobal",function(){return _e}),n.d(t,"ThemeProvider",function(){return we}),n.d(t,"withTheme",function(){return Me}),n.d(t,"ServerStyleSheet",function(){return ae}),n.d(t,"StyleSheetManager",function(){return ne});var h,p=n(23),d=n.n(p),m=n(25),g=n.n(m),v=n(0),y=n.n(v),b=n(26),w=n.n(b),x=n(31),E=n.n(x),T=n(32),C=n.n(T),S=/([A-Z])/g,k=r,M=k,A=/^ms-/,O=o,R=function e(t,n){var r=Object.keys(t).filter(function(e){var n=t[e];return void 0!==n&&null!==n&&!1!==n&&""!==n}).map(function(n){return d()(t[n])?e(t[n],n):O(n)+": "+t[n]+";"}).join(" ");return n?n+" {\n "+r+"\n}":r},P=function e(t,n){return t.reduce(function(t,r){return void 0===r||null===r||!1===r||""===r?t:Array.isArray(r)?[].concat(t,e(r,n)):r.hasOwnProperty("styledComponentId")?[].concat(t,["."+r.styledComponentId]):"function"==typeof r?n?t.concat.apply(t,e([r(n)],n)):t.concat(r):t.concat(d()(r)?R(r):r.toString())},[])},_=new g.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!0}),I=function(e,t,n){var r=e.join("").replace(/^\s*\/\/.*$/gm,""),o=t&&n?n+" "+t+" { "+r+" }":r;return _(n||!t?"":t,o)},F="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=F.length,L=function(e){var t="",n=void 0;for(n=e;n>D;n=Math.floor(n/D))t=F[n%D]+t;return F[n%D]+t},j=function(e,t){return t.reduce(function(t,n,r){return t.concat(n,e[r+1])},[e[0]])},N=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return P(j(e,n))},U=/^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//gm,B=function(e){var t=""+(e||""),n=[];return t.replace(U,function(e,t,r){return n.push({componentId:t,matchIndex:r}),e}),n.map(function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}})},V=function(){return n.nc},W=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},X=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},G=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},z=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Y=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";W(this,e),this.el=t,this.isLocal=n,this.ready=!1;var o=B(r);this.size=o.length,this.components=o.reduce(function(e,t){return e[t.componentId]=t,e},{})}return e.prototype.isFull=function(){return this.size>=40},e.prototype.addComponent=function(e){if(this.ready||this.replaceElement(),this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");var t={componentId:e,textNode:document.createTextNode("")};this.el.appendChild(t.textNode),this.size+=1,this.components[e]=t},e.prototype.inject=function(e,t,n){this.ready||this.replaceElement();var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");if(""===r.textNode.data&&r.textNode.appendData("\n/* sc-component-id: "+e+" */\n"),r.textNode.appendData(t),n){var o=this.el.getAttribute($);this.el.setAttribute($,o?o+" "+n:n)}var i=V();i&&this.el.setAttribute("nonce",i)},e.prototype.toHTML=function(){return this.el.outerHTML},e.prototype.toReactElement=function(){throw new Error("BrowserTag doesn't implement toReactElement!")},e.prototype.clone=function(){throw new Error("BrowserTag cannot be cloned!")},e.prototype.replaceElement=function(){var e=this;if(this.ready=!0,0!==this.size){var t=this.el.cloneNode();if(t.appendChild(document.createTextNode("\n")),Object.keys(this.components).forEach(function(n){var r=e.components[n];r.textNode=document.createTextNode(r.cssFromDOM),t.appendChild(r.textNode)}),!this.el.parentNode)throw new Error("Trying to replace an element that wasn't mounted!");this.el.parentNode.replaceChild(t,this.el),this.el=t}},e}(),K={create:function(){for(var e=[],t={},n=document.querySelectorAll("["+$+"]"),r=n.length,o=0;o<r;o+=1){var i=n[o];e.push(new Y(i,"true"===i.getAttribute(J),i.innerHTML));var a=i.getAttribute($);a&&a.trim().split(/\s+/).forEach(function(e){t[e]=!0})}return new te(function(e){var t=document.createElement("style");if(t.type="text/css",t.setAttribute($,""),t.setAttribute(J,e?"true":"false"),!document.head)throw new Error("Missing document <head>");return document.head.appendChild(t),new Y(t,e)},e,t)}},$="data-styled-components",J="data-styled-components-is-local",Z="__styled-components-stylesheet__",Q=null,ee=[],te=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};W(this,e),this.hashes={},this.deferredInjections={},this.stylesCacheable="undefined"!=typeof document,this.tagConstructor=t,this.tags=n,this.names=r,this.constructComponentTagMap()}return e.prototype.constructComponentTagMap=function(){var e=this;this.componentTags={},this.tags.forEach(function(t){Object.keys(t.components).forEach(function(n){e.componentTags[n]=t})})},e.prototype.getName=function(e){return this.hashes[e.toString()]},e.prototype.alreadyInjected=function(e,t){return!!this.names[t]&&(this.hashes[e.toString()]=t,!0)},e.prototype.hasInjectedComponent=function(e){return!!this.componentTags[e]},e.prototype.deferredInject=function(e,t,n){this===Q&&ee.forEach(function(r){r.deferredInject(e,t,n)}),this.getOrCreateTag(e,t),this.deferredInjections[e]=n},e.prototype.inject=function(e,t,n,r,o){this===Q&&ee.forEach(function(r){r.inject(e,t,n)});var i=this.getOrCreateTag(e,t),a=this.deferredInjections[e];a&&(i.inject(e,a),delete this.deferredInjections[e]),i.inject(e,n,o),r&&o&&(this.hashes[r.toString()]=o)},e.prototype.toHTML=function(){return this.tags.map(function(e){return e.toHTML()}).join("")},e.prototype.toReactElements=function(){return this.tags.map(function(e,t){return e.toReactElement("sc-"+t)})},e.prototype.getOrCreateTag=function(e,t){var n=this.componentTags[e];if(n)return n;var r=this.tags[this.tags.length-1],o=!r||r.isFull()||r.isLocal!==t?this.createNewTag(t):r;return this.componentTags[e]=o,o.addComponent(e),o},e.prototype.createNewTag=function(e){var t=this.tagConstructor(e);return this.tags.push(t),t},e.reset=function(t){Q=e.create(t)},e.create=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof document)?ae:K).create()},e.clone=function(t){var n=new e(t.tagConstructor,t.tags.map(function(e){return e.clone()}),H({},t.names));return n.hashes=H({},t.hashes),n.deferredInjections=H({},t.deferredInjections),ee.push(n),n},X(e,null,[{key:"instance",get:function(){return Q||(Q=e.create())}}]),e}(),ne=function(e){function t(){return W(this,t),z(this,e.apply(this,arguments))}return q(t,e),t.prototype.getChildContext=function(){var e;return e={},e[Z]=this.props.sheet,e},t.prototype.render=function(){return y.a.Children.only(this.props.children)},t}(v.Component);ne.childContextTypes=(h={},h[Z]=w.a.oneOfType([w.a.instanceOf(te),w.a.instanceOf(ae)]).isRequired,h),ne.propTypes={sheet:w.a.oneOfType([w.a.instanceOf(te),w.a.instanceOf(ae)]).isRequired};var re,oe,ie=function(){function e(t){W(this,e),this.isLocal=t,this.components={},this.size=0,this.names=[]}return e.prototype.isFull=function(){return!1},e.prototype.addComponent=function(e){if(this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");this.components[e]={componentId:e,css:""},this.size+=1},e.prototype.concatenateCSS=function(){var e=this;return Object.keys(this.components).reduce(function(t,n){return t+e.components[n].css},"")},e.prototype.inject=function(e,t,n){var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");""===r.css&&(r.css="/* sc-component-id: "+e+" */\n"),r.css+=t.replace(/\n*$/,"\n"),n&&this.names.push(n)},e.prototype.toHTML=function(){var e=['type="text/css"',$+'="'+this.names.join(" ")+'"',J+'="'+(this.isLocal?"true":"false")+'"'],t=V();return t&&e.push('nonce="'+t+'"'),"<style "+e.join(" ")+">"+this.concatenateCSS()+"</style>"},e.prototype.toReactElement=function(e){var t,n=(t={},t[$]=this.names.join(" "),t[J]=this.isLocal.toString(),t),r=V();return r&&(n.nonce=r),y.a.createElement("style",H({key:e,type:"text/css"},n,{dangerouslySetInnerHTML:{__html:this.concatenateCSS()}}))},e.prototype.clone=function(){var t=this,n=new e(this.isLocal);return n.names=[].concat(this.names),n.size=this.size,n.components=Object.keys(this.components).reduce(function(e,n){return e[n]=H({},t.components[n]),e},{}),n},e}(),ae=function(){function e(){W(this,e),this.instance=te.clone(te.instance)}return e.prototype.collectStyles=function(e){if(this.closed)throw new Error("Can't collect styles once you've called getStyleTags!");return y.a.createElement(ne,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.closed||(ee.splice(ee.indexOf(this.instance),1),this.closed=!0),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.closed||(ee.splice(ee.indexOf(this.instance),1),this.closed=!0),this.instance.toReactElements()},e.create=function(){return new te(function(e){return new ie(e)})},e}(),se=function(e){var t={},n=!1;return function(r){n||(t[r]=!0,Object.keys(t).length>=200&&(console.warn("Over 200 classes were generated for component "+e+". \nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs({\n style: ({ background }) => ({\n background,\n }),\n })`width: 100%;`\n\n <Component />"),n=!0,t={}))}},ce={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,valueLink:!0,defaultChecked:!0,checkedLink:!0,innerHTML:!0,suppressContentEditableWarning:!0,onFocusIn:!0,onFocusOut:!0,className:!0,onCopy:!0,onCut:!0,onPaste:!0,onCompositionEnd:!0,onCompositionStart:!0,onCompositionUpdate:!0,onKeyDown:!0,onKeyPress:!0,onKeyUp:!0,onFocus:!0,onBlur:!0,onChange:!0,onInput:!0,onSubmit:!0,onReset:!0,onClick:!0,onContextMenu:!0,onDoubleClick:!0,onDrag:!0,onDragEnd:!0,onDragEnter:!0,onDragExit:!0,onDragLeave:!0,onDragOver:!0,onDragStart:!0,onDrop:!0,onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOut:!0,onMouseOver:!0,onMouseUp:!0,onSelect:!0,onTouchCancel:!0,onTouchEnd:!0,onTouchMove:!0,onTouchStart:!0,onScroll:!0,onWheel:!0,onAbort:!0,onCanPlay:!0,onCanPlayThrough:!0,onDurationChange:!0,onEmptied:!0,onEncrypted:!0,onEnded:!0,onError:!0,onLoadedData:!0,onLoadedMetadata:!0,onLoadStart:!0,onPause:!0,onPlay:!0,onPlaying:!0,onProgress:!0,onRateChange:!0,onSeeked:!0,onSeeking:!0,onStalled:!0,onSuspend:!0,onTimeUpdate:!0,onVolumeChange:!0,onWaiting:!0,onLoad:!0,onAnimationStart:!0,onAnimationEnd:!0,onAnimationIteration:!0,onTransitionEnd:!0,onCopyCapture:!0,onCutCapture:!0,onPasteCapture:!0,onCompositionEndCapture:!0,onCompositionStartCapture:!0,onCompositionUpdateCapture:!0,onKeyDownCapture:!0,onKeyPressCapture:!0,onKeyUpCapture:!0,onFocusCapture:!0,onBlurCapture:!0,onChangeCapture:!0,onInputCapture:!0,onSubmitCapture:!0,onResetCapture:!0,onClickCapture:!0,onContextMenuCapture:!0,onDoubleClickCapture:!0,onDragCapture:!0,onDragEndCapture:!0,onDragEnterCapture:!0,onDragExitCapture:!0,onDragLeaveCapture:!0,onDragOverCapture:!0,onDragStartCapture:!0,onDropCapture:!0,onMouseDownCapture:!0,onMouseEnterCapture:!0,onMouseLeaveCapture:!0,onMouseMoveCapture:!0,onMouseOutCapture:!0,onMouseOverCapture:!0,onMouseUpCapture:!0,onSelectCapture:!0,onTouchCancelCapture:!0,onTouchEndCapture:!0,onTouchMoveCapture:!0,onTouchStartCapture:!0,onScrollCapture:!0,onWheelCapture:!0,onAbortCapture:!0,onCanPlayCapture:!0,onCanPlayThroughCapture:!0,onDurationChangeCapture:!0,onEmptiedCapture:!0,onEncryptedCapture:!0,onEndedCapture:!0,onErrorCapture:!0,onLoadedDataCapture:!0,onLoadedMetadataCapture:!0,onLoadStartCapture:!0,onPauseCapture:!0,onPlayCapture:!0,onPlayingCapture:!0,onProgressCapture:!0,onRateChangeCapture:!0,onSeekedCapture:!0,onSeekingCapture:!0,onStalledCapture:!0,onSuspendCapture:!0,onTimeUpdateCapture:!0,onVolumeChangeCapture:!0,onWaitingCapture:!0,onLoadCapture:!0,onAnimationStartCapture:!0,onAnimationEndCapture:!0,onAnimationIterationCapture:!0,onTransitionEndCapture:!0},ue={accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,as:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,charSet:!0,challenge:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,default:!0,defer:!0,dir:!0,disabled:!0,download:!0,draggable:!0,encType:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,icon:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loop:!0,low:!0,manifest:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,results:!0,security:!0,unselectable:0},le={accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baseProfile:!0,baselineShift:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPath:!0,clipRule:!0,clipPathUnits:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,paintOrder:!0,panose1:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0},fe=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),he={}.hasOwnProperty,pe=function(e){return he.call(ue,e)||he.call(le,e)||fe(e.toLowerCase())||he.call(ce,e)},de=function(e,t,n){var r=n&&e.theme===n.theme;return e.theme&&!r?e.theme:t},me=function(e){function t(e){a=e;for(var t in o){var n=o[t];void 0!==n&&n(a)}}function n(e){var t=i;return o[t]=e,i+=1,e(a),t}function r(e){o[e]=void 0}var o={},i=0,a=e;return{publish:t,subscribe:n,unsubscribe:r}},ge="__styled-components__",ve=ge+"next__",ye=w.a.shape({getTheme:w.a.func,subscribe:w.a.func,unsubscribe:w.a.func}),be=function(e){var t=!1;return function(){t||(t=!0,e())}}(function(){console.error("Warning: Usage of `context."+ge+"` as a function is deprecated. It will be replaced with the object on `.context."+ve+"` in a future version.")}),we=function(e){function t(){W(this,t);var n=z(this,e.call(this));return n.unsubscribeToOuterId=-1,n.getTheme=n.getTheme.bind(n),n}return q(t,e),t.prototype.componentWillMount=function(){var e=this,t=this.context[ve];void 0!==t&&(this.unsubscribeToOuterId=t.subscribe(function(t){e.outerTheme=t})),this.broadcast=me(this.getTheme())},t.prototype.getChildContext=function(){var e,t=this;return H({},this.context,(e={},e[ve]={getTheme:this.getTheme,subscribe:this.broadcast.subscribe,unsubscribe:this.broadcast.unsubscribe},e[ge]=function(e){be();var n=t.broadcast.subscribe(e);return function(){return t.broadcast.unsubscribe(n)}},e))},t.prototype.componentWillReceiveProps=function(e){this.props.theme!==e.theme&&this.broadcast.publish(this.getTheme(e.theme))},t.prototype.componentWillUnmount=function(){-1!==this.unsubscribeToOuterId&&this.context[ve].unsubscribe(this.unsubscribeToOuterId)},t.prototype.getTheme=function(e){var t=e||this.props.theme;if(E()(t)){var n=t(this.outerTheme);if(!d()(n))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return n}if(!d()(t))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return H({},this.outerTheme,t)},t.prototype.render=function(){return this.props.children?y.a.Children.only(this.props.children):null},t}(v.Component);we.childContextTypes=(re={},re[ge]=w.a.func,re[ve]=ye,re),we.contextTypes=(oe={},oe[ve]=ye,oe);var xe=/[[\].#*$><+~=|^:(),"'`]/g,Ee=/--+/g,Te={},Ce=function e(t,n){for(var r=0;r<t.length;r+=1){var o=t[r];if(Array.isArray(o)&&!e(o))return!1;if("function"==typeof o&&!a(o))return!1}if(void 0!==n)for(var i in n){var s=n[i];if("function"==typeof s)return!1}return!0},Se=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],ke=function(e){return e.replace(/\s|\\n/g,"")},Me=function(t){var n,r=t.displayName||t.name||"Component",o=a(t),i=function(n){function r(){var e,t,o;W(this,r);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return e=t=z(this,n.call.apply(n,[this].concat(a))),t.state={},t.unsubscribeId=-1,o=e,z(t,o)}return q(r,n),r.prototype.componentWillMount=function(){var t=this,n=this.constructor.defaultProps,r=this.context[ve],o=de(this.props,void 0,n);if(void 0===r&&void 0===o&&"production"!==e.env.NODE_ENV)console.warn("[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps");else if(void 0===r&&void 0!==o)this.setState({theme:o});else{var i=r.subscribe;this.unsubscribeId=i(function(e){var r=de(t.props,e,n);t.setState({theme:r})})}},r.prototype.componentWillReceiveProps=function(e){var t=this.constructor.defaultProps;this.setState(function(n){return{theme:de(e,n.theme,t)}})},r.prototype.componentWillUnmount=function(){-1!==this.unsubscribeId&&this.context[ve].unsubscribe(this.unsubscribeId)},r.prototype.render=function(){var e=this.props.innerRef,n=this.state.theme;return y.a.createElement(t,H({theme:n},this.props,{innerRef:o?e:void 0,ref:o?void 0:e}))},r}(y.a.Component);return i.displayName="WithTheme("+r+")",i.styledComponentId="withTheme",i.contextTypes=(n={},n[ge]=w.a.func,n[ve]=ye,n),C()(i,t)},Ae=function(t,n,r){return function(){function o(t,n,r){if(W(this,o),this.rules=t,this.isStatic=Ce(t,n),this.componentId=r,!te.instance.hasInjectedComponent(this.componentId)){var i="production"!==e.env.NODE_ENV?"."+r+" {}":"";te.instance.deferredInject(r,!0,i)}}return o.prototype.generateAndInjectStyles=function(e,o){var i=this.isStatic,a=this.lastClassName;if(i&&void 0!==a)return a;var s=n(this.rules,e),u=c(this.componentId+s.join("")),l=o.getName(u);if(void 0!==l)return o.stylesCacheable&&(this.lastClassName=l),l;var f=t(u);if(o.stylesCacheable&&(this.lastClassName=l),o.alreadyInjected(u,f))return f;var h="\n"+r(s,"."+f);return o.inject(this.componentId,!0,h,u,f),f},o.generateName=function(e){return t(c(e))},o}()}(L,P,I),Oe=function(e){return function t(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"!=typeof r&&"function"!=typeof r)throw new Error("Cannot create styled-component for component: "+r);var i=function(t){for(var i=arguments.length,a=Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return n(r,o,e.apply(void 0,[t].concat(a)))};return i.withConfig=function(e){return t(n,r,H({},o,e))},i.attrs=function(e){return t(n,r,H({},o,{attrs:H({},o.attrs||{},e)}))},i}}(N),Re=function(t,n){var r={},o=function(e,n){var o="string"!=typeof e?"sc":e.replace(xe,"-").replace(Ee,"-"),i=(r[o]||0)+1;r[o]=i;var a=t.generateName(o+i),s=o+"-"+a;return void 0!==n?n+"-"+s:s},c=function(e){function t(){var n,r,o;W(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=z(this,e.call.apply(e,[this].concat(a))),r.attrs={},r.state={theme:null,generatedClassName:""},r.unsubscribeId=-1,o=n,z(r,o)}return q(t,e),t.prototype.unsubscribeFromContext=function(){-1!==this.unsubscribeId&&this.context[ve].unsubscribe(this.unsubscribeId)},t.prototype.buildExecutionContext=function(e,t){var n=this.constructor.attrs,r=H({},t,{theme:e});return void 0===n?r:(this.attrs=Object.keys(n).reduce(function(e,t){var o=n[t];return e[t]="function"==typeof o?o(r):o,e},{}),H({},r,this.attrs))},t.prototype.generateAndInjectStyles=function(e,t){var n=this.constructor,r=n.attrs,o=n.componentStyle,i=n.warnTooManyClasses,a=this.context[Z]||te.instance;if(o.isStatic&&void 0===r)return o.generateAndInjectStyles(Te,a);var s=this.buildExecutionContext(e,t),c=o.generateAndInjectStyles(s,a);return void 0!==i&&i(c),c},t.prototype.componentWillMount=function(){var e=this,t=this.constructor.componentStyle,n=this.context[ve];if(t.isStatic){var r=this.generateAndInjectStyles(Te,this.props);this.setState({generatedClassName:r})}else if(void 0!==n){var o=n.subscribe;this.unsubscribeId=o(function(t){var n=de(e.props,t,e.constructor.defaultProps),r=e.generateAndInjectStyles(n,e.props);e.setState({theme:n,generatedClassName:r})})}else{var i=this.props.theme||{},a=this.generateAndInjectStyles(i,this.props);this.setState({theme:i,generatedClassName:a})}},t.prototype.componentWillReceiveProps=function(e){var t=this;this.constructor.componentStyle.isStatic||this.setState(function(n){var r=de(e,n.theme,t.constructor.defaultProps);return{theme:r,generatedClassName:t.generateAndInjectStyles(r,e)}})},t.prototype.componentWillUnmount=function(){this.unsubscribeFromContext()},t.prototype.render=function(){var e=this,t=this.props.innerRef,n=this.state.generatedClassName,r=this.constructor,o=r.styledComponentId,s=r.target,c=i(s),u=[this.props.className,o,this.attrs.className,n].filter(Boolean).join(" "),l=H({},this.attrs,{className:u});a(s)?l.innerRef=t:l.ref=t;var f=Object.keys(this.props).reduce(function(t,n){return"innerRef"===n||"className"===n||c&&!pe(n)||(t[n]=e.props[n]),t},l);return Object(v.createElement)(s,f)},t}(v.Component);return function r(a,u,l){var f,h=u.displayName,p=void 0===h?i(a)?"styled."+a:"Styled("+s(a)+")":h,d=u.componentId,m=void 0===d?o(u.displayName,u.parentComponentId):d,g=u.ParentComponent,v=void 0===g?c:g,y=u.rules,b=u.attrs,x=u.displayName&&u.componentId?u.displayName+"-"+u.componentId:m,E=void 0;"production"!==e.env.NODE_ENV&&(E=se(p));var T=new t(void 0===y?l:y.concat(l),b,x),C=function(e){function t(){return W(this,t),z(this,e.apply(this,arguments))}return q(t,e),t.withComponent=function(e){var n=u.componentId,o=G(u,["componentId"]),a=n&&n+"-"+(i(e)?e:s(e)),c=H({},o,{componentId:a,ParentComponent:t});return r(e,c,l)},X(t,null,[{key:"extend",get:function(){var e=u.rules,o=u.componentId,i=G(u,["rules","componentId"]),s=void 0===e?l:e.concat(l),c=H({},i,{rules:s,parentComponentId:o,ParentComponent:t});return n(r,a,c)}}]),t}(v);return C.contextTypes=(f={},f[ge]=w.a.func,f[ve]=ye,f[Z]=w.a.oneOfType([w.a.instanceOf(te),w.a.instanceOf(ae)]),f),C.displayName=p,C.styledComponentId=x,C.attrs=b,C.componentStyle=T,C.warnTooManyClasses=E,C.target=a,C}}(Ae,Oe),Pe=function(e,t,n){return function(r){for(var o=arguments.length,i=Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];var s=n.apply(void 0,[r].concat(i)),u=c(ke(JSON.stringify(s))),l=te.instance.getName(u);if(l)return l;var f=e(u);if(te.instance.alreadyInjected(u,f))return f;var h=t(s,f,"@keyframes");return te.instance.inject("sc-keyframes-"+f,!0,h,u,f),f}}(L,I,N),_e=function(e,t){return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var a=t.apply(void 0,[n].concat(o)),s=c(JSON.stringify(a)),u="sc-global-"+s;te.instance.hasInjectedComponent(u)||te.instance.inject(u,!1,e(a))}}(I,N),Ie=function(e,t){var n=function(n){return t(e,n)};return Se.forEach(function(e){n[e]=n(e)}),n}(Re,Oe);t.default=Ie}.call(t,n(2))},function(e,t,n){"use strict";function r(e){if(s.hasOwnProperty(e))return s[e];throw Error("Loss function "+e+" is invalid. Available options: "+Object.keys(s))}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=function(){function e(e,t){this.canvas=e,this.image=t,this.transformation=o.Matrix4x4.create(),this.aspectMatrixBuffer=o.Matrix4x4.create(),this.viewMatrixBuffer=o.Matrix4x4.create(),this.image=t,this.resize()}return e.prototype.resize=function(){var e=Math.floor(this.canvas.clientWidth*window.devicePixelRatio),t=Math.floor(this.canvas.clientHeight*window.devicePixelRatio);return(this.canvas.width!==e||this.canvas.height!==t)&&(this.canvas.width=e,this.canvas.height=t,!0)},e.prototype.getAspect=function(){var e=this.canvas.clientWidth/this.canvas.clientHeight,t=this.image.width/this.image.height;return e>t?{x:t/e,y:1}:{x:1,y:e/t}},e.prototype.getViewMatrix=function(){var e=this.getAspect();return o.Matrix4x4.fromScaling(this.aspectMatrixBuffer,[e.x,e.y,1]),o.Matrix4x4.multiply(this.viewMatrixBuffer,this.aspectMatrixBuffer,this.transformation),this.viewMatrixBuffer},e}();t.default=i;var a;!function(e){e[e.L1=1]="L1",e[e.L2=2]="L2",e[e.MAPE=3]="MAPE",e[e.MRSE=4]="MRSE",e[e.SMAPE=5]="SMAPE",e[e.SSIM=6]="SSIM"}(a=t.LossFunction||(t.LossFunction={}));var s={L1:a.L1,L2:a.L2,MAPE:a.MAPE,MRSE:a.MRSE,SMAPE:a.SMAPE,SSIM:a.SSIM};t.lossFunctionFromString=r},function(e,t,n){"use strict";function r(e,t){return f.parse(e,t)}function o(e){var t=e.split(".").pop();return t&&"exr"===t.toLocaleLowerCase()?i(e):a(e)}function i(e){return console.time("Downloading '"+e+"'"),fetch(e).then(function(t){return console.timeEnd("Downloading '"+e+"'"),t}).then(function(e){return e.arrayBuffer()}).then(function(t){return r(e,t)})}function a(e){return console.time("Downloading '"+e+"'"),new Promise(function(t,n){var r=new Image;r.onerror=function(t){return n(new Error("Failed to load '"+e+"'."))},r.onload=function(){console.timeEnd("Downloading '"+e+"'");try{var o=document.createElement("canvas");o.width=r.width,o.height=r.height;var i=o.getContext("2d");if(!i)return void n(new Error("Failed to get 2d canvas context."));i.drawImage(r,0,0),t({url:e,width:r.width,height:r.height,nChannels:4,data:r,type:"LdrImage"})}catch(t){n(new Error("Failed to load image '"+e+"': "+t))}},r.src=e})}function s(e,t,n,r){if("HdrImage"===e.type)return e.data[(t+n*e.width)*e.nChannels+r];var o=h.get(e);if(null==o){var i=document.createElement("canvas");i.width=e.width,i.height=e.height;var a=i.getContext("2d");if(!a)throw new Error("Failed to create 2d context to retrieve LDR image data");a.drawImage(e.data,0,0,e.width,e.height),o=function(e,t,n){return a.getImageData(e,t,1,1).data[n]/256},h.set(e,o)}return o(t,n,r)}var c=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var u=n(17),l=function(){function e(e){this.nWorkers=e,this.nextWorkerId=0,this.jobId=0,this.returnHandlers={},this.workers=[];for(var t=0;t<e;++t){var n=new u;this.workers.push(n),n.onmessage=this.handleResult.bind(this)}}return e.prototype.parse=function(e,t){var n=this;return new Promise(function(r,o){var i=n.nextWorker(),a=n.jobId++;n.returnHandlers[a]=function(t){t.data.success?r(c({url:e},t.data.image)):o(new Error(t.data.message))},i.postMessage({jobId:a,data:t},[t])})},e.prototype.handleResult=function(e){if(null==e.data.jobId)throw new Error("Got a message from the webworker without job id.");var t=this.returnHandlers[e.data.jobId];delete this.returnHandlers[e.data.jobId],t(e)},e.prototype.nextWorker=function(){var e=this.workers[this.nextWorkerId];return this.nextWorkerId=(this.nextWorkerId+1)%this.nWorkers,e},e}(),f=new l(2);t.loadImage=o,t.loadExr=i,t.loadLdr=a;var h=new Map;t.getPixelColor=s;var p=function(){function e(){this.images={},this.downloading={}}return e.prototype.contains=function(e){return this.images.hasOwnProperty(e)},e.prototype.currentlyDownloading=function(e){return this.downloading.hasOwnProperty(e)},e.prototype.size=function(){return Object.keys(this.images).length},e.prototype.get=function(e){return this.contains(e)?Promise.resolve(this.images[e]):this.currentlyDownloading(e)?this.downloading[e]:this.load(e)},e.prototype.store=function(e,t){return this.currentlyDownloading(e)&&delete this.currentlyDownloading[e],this.images[e]=t,t},e.prototype.load=function(e){var t=this,n=o(e);return this.downloading[e]=n,n.then(function(n){return t.store(e,n)})},e}();t.ImageCache=p},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";(function(t){function n(e,t,n,o,i,a,s,c){if(r(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,c],f=0;u=new Error(t.replace(/%s/g,function(){return l[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(2))},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(1),a=n(10),s=n(11),c=n(12),u=n(3),l=(p=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],p.raw=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],u.default.canvas(p)),f=(d=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],d.raw=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],u.default.div(d)),h=function(e){function t(t){var n=e.call(this,t)||this;return n.transformation=i.Matrix4x4.create(),n.defaultTransformation=i.Matrix4x4.create(),n.handleTransformationChange=n.handleTransformationChange.bind(n),n}return r(t,e),t.prototype.componentDidMount=function(){this.imageLayer=new a.default(this.imageLayerElement,this.props.image),this.textLayer=new s.default(this.textLayerElement,this.props.image),this.mouseLayer=new c.default(this.mouseLayerElement,this.props.image,this.props.enableMouseEvents),this.mouseLayer.onTransformationChange(this.handleTransformationChange),this.updateCanvasProps(),this.handleTransformationChange(this.transformation)},t.prototype.componentDidUpdate=function(e){this.updateCanvasProps(e),this.mouseLayer.setEnableMouseEvents(this.props.enableMouseEvents)},t.prototype.componentWillUnmount=function(){this.mouseLayer.onPointAt(void 0),this.mouseLayer.onTransformationChange(void 0),this.mouseLayer.destruct()},t.prototype.setDefaultTransformation=function(e){this.defaultTransformation=e},t.prototype.reset=function(){this.handleTransformationChange(this.defaultTransformation)},t.prototype.setTransformation=function(e){this.handleTransformationChange(e)},t.prototype.getTransformation=function(){return this.transformation},t.prototype.render=function(){var e=this;return o.createElement(f,null,o.createElement(l,{innerRef:function(t){return e.imageLayerElement=t}}),o.createElement(l,{innerRef:function(t){return e.textLayerElement=t}}),o.createElement(l,{innerRef:function(t){return e.mouseLayerElement=t}}))},t.prototype.handleTransformationChange=function(e){this.props.allowMovement&&(this.transformation=e,this.imageLayer.setTransformation(e),this.textLayer.setTransformation(e),this.mouseLayer.setTransformation(e),null!=this.props.onTransform&&this.props.onTransform(e))},t.prototype.updateCanvasProps=function(e){void 0===e&&(e=null),e&&e.viewTransform===this.props.viewTransform&&e.exposure===this.props.exposure&&e.gamma===this.props.gamma&&e.offset===this.props.offset||this.imageLayer.setTonemapping({viewTransform:this.props.viewTransform,exposure:this.props.exposure,offset:this.props.offset,gamma:this.props.gamma}),e&&e.image===this.props.image||(this.imageLayer.setImage(this.props.image),this.textLayer.setImage(this.props.image),this.mouseLayer.setImage(this.props.image)),this.mouseLayer.onPointAt(this.props.onPoint)},t}(o.Component);t.default=h;var p,d},function(e,t,n){"use strict";function r(e,t,n){var r=n.createShader(t);if(n.shaderSource(r,e),n.compileShader(r),!r||!n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error("Compiling shader failed with error '"+n.getShaderInfoLog(r)+"'.");return r}var o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(16),s=n(4);!function(e){e[e.LDR=0]="LDR",e[e.HDR=1]="HDR",e[e.ColorMap=2]="ColorMap"}(i||(i={}));var c;!function(e){e[e.None=-1]="None",e[e.Gamma22=0]="Gamma22",e[e.K1S1=1]="K1S1"}(c||(c={}));var u="\nprecision mediump float;\nuniform int viewTransform;\nuniform float exposure;\nuniform float offset;\nuniform float gamma;\nuniform int mode;\nuniform int nChannels;\nuniform int lossFunction;\nuniform int imageHeight; // Height and width are used to access neighboring pixels\nuniform int imageWidth;\nvarying vec2 vTextureCoord;\nuniform sampler2D imASampler;\nuniform sampler2D imBSampler;\nuniform sampler2D cmapSampler;\n\nvec3 lookupOffset(sampler2D sampler, vec2 position, vec2 offset) {\n // Read neighbouring pixels from an image texture\n // Takes 'position' (range 0 - 1) and an integer pixel offset 'offset'\n vec2 imageSize = vec2(imageWidth, imageHeight);\n return texture2D(sampler, position + offset / imageSize).rgb;\n}\n\nfloat log10(float a) {\n const float logBase10 = 1.0 / log2( 10.0 );\n\n return log2(a) * logBase10;\n}\n\nfloat luminance(vec3 rgb) {\n return dot(vec3(0.2126, 0.7152, 0.0722), rgb);\n}\n\nvec3 GOG(vec3 rgb, float gain, float offset, float gamma) {\n return pow(gain * rgb + offset, vec3(1.0 / gamma));\n}\n\nfloat logEncodingLogC(float a) {\n float LogC = a >= 0.01059106816664 ? 0.385537 + 0.2471896 * log10(a * 5.555556 + 0.052272) : a * 5.367655 + 0.092809;\n\n return LogC;\n}\n\nfloat sigmoidK1S1(float a) {\n float sigmoid = 1.0 / (1.0 + pow(2.718281828459045, -8.9 * (a - 0.435)));\n\n return sigmoid;\n}\n\nvec3 viewTransformNone(vec3 rgb) {\n return rgb;\n}\n\nvec3 viewTransformGamma22(vec3 rgb) {\n const float exponent = 1.0 / 2.2;\n\n return pow(max(rgb, 0.0), vec3(exponent, exponent, exponent));\n}\n\nvec3 viewTransformK1S1(vec3 rgb) {\n vec3 LogC = vec3(logEncodingLogC(rgb.x), logEncodingLogC(rgb.y), logEncodingLogC(rgb.z));\n\n return vec3(sigmoidK1S1(LogC.x), sigmoidK1S1(LogC.y), sigmoidK1S1(LogC.z));\n}\n\nvec3 applyViewTransform(vec3 rgb, int which) {\n if (which == "+c.None+") {\n return viewTransformNone(rgb);\n } else if (which == "+c.Gamma22+") {\n return viewTransformGamma22(rgb);\n } else if (which == "+c.K1S1+") {\n return viewTransformK1S1(rgb);\n }\n}\n\nvoid main(void) {\n vec3 col;\n vec2 position = vec2(vTextureCoord.s, vTextureCoord.t);\n if (lossFunction == "+s.LossFunction.L1+") {\n col = texture2D(imASampler, position).rgb;\n col = col - texture2D(imBSampler, position).rgb;\n col = abs(col);\n } else if (lossFunction == "+s.LossFunction.MAPE+") {\n vec3 img = texture2D(imASampler, position).rgb;\n vec3 ref = texture2D(imBSampler, position).rgb;\n vec3 diff = img - ref;\n col = abs(diff) / (abs(ref) + 1e-2);\n } else if (lossFunction == "+s.LossFunction.SMAPE+") {\n vec3 img = texture2D(imASampler, position).rgb;\n vec3 ref = texture2D(imBSampler, position).rgb;\n vec3 diff = img - ref;\n col = 2.0 * abs(diff) / (abs(ref) + abs(img) + 2e-2);\n } else if (lossFunction == "+s.LossFunction.MRSE+") {\n vec3 img = texture2D(imASampler, position).rgb;\n vec3 ref = texture2D(imBSampler, position).rgb;\n vec3 diff = img - ref;\n col = diff * diff / (ref * ref + 1e-4);\n } else if (lossFunction == "+s.LossFunction.L2+") {\n vec3 img = texture2D(imASampler, position).rgb;\n vec3 ref = texture2D(imBSampler, position).rgb;\n vec3 diff = img - ref;\n col = diff * diff;\n } else if (lossFunction == "+s.LossFunction.SSIM+") {\n const int windowRadius = 2; // We use a symmetric 5x5 window as opposed to the customary 8x8 (wiki)\n const float L = 1.; // The dynamic range\n const float k1 = 0.01, k2 = 0.03; // Default constants\n const float c1 = (k1*L)*(k1*L), c2 = (k2*L)*(k2*L);\n const float n = float((2 * windowRadius + 1) * (2 * windowRadius + 1));\n\n // Compute means and standard deviations of both images\n float aSum, aaSum, bSum, bbSum, abSum;\n for (int x = 0; x <= 2 * windowRadius; ++x) {\n for (int y = 0; y <= 2 * windowRadius; ++y) {\n vec2 offset = vec2(float(x - windowRadius), float(y - windowRadius));\n float a = luminance(applyViewTransform(lookupOffset(imASampler, position, offset), viewTransform));\n float b = luminance(applyViewTransform(lookupOffset(imBSampler, position, offset), viewTransform));\n aSum += a; bSum += b;\n aaSum += a * a; bbSum += b * b;\n abSum += a * b;\n }\n }\n float aMean = aSum / n, bMean = bSum / n;\n float aVar = (aaSum - n * aMean * aMean) / (n + 1.);\n float bVar = (bbSum - n * bMean * bMean) / (n + 1.);\n float abCovar = (abSum - n * aMean * bMean) / (n + 1.);\n\n float numerator = (2. * aMean * bMean + c1) * (2. * abCovar + c2);\n float denominator = (aMean * aMean + bMean * bMean + c1) * (aVar + bVar + c2);\n float ssim = numerator / denominator;\n col = vec3(1. - ssim, 1. - ssim, 1. - ssim);\n } else {\n col = texture2D(imASampler, position).rgb;\n if (nChannels == 1) {\n col = vec3(col.r, col.r, col.r);\n }\n }\n\n if (mode == "+i.LDR+") {\n col = pow(col, vec3(2.2));\n col = GOG(col, exposure, offset, gamma);\n col = applyViewTransform(col, viewTransform);\n } else if (mode == "+i.HDR+") {\n col = GOG(col, exposure, offset, gamma);\n col = applyViewTransform(col, viewTransform);\n } else {\n float avg = (col.r + col.g + col.b) * 0.3333333333 * exposure;\n col = texture2D(cmapSampler, vec2(avg, 0.0)).rgb;\n }\n\n gl_FragColor = vec4(col, 1.0);\n}",l=new Float32Array([-1,-1,0,0,1,-1,1,0,0,0,1,-1,0,1,1,1,1,0,1,0]),f=new Uint8Array([0,0,3,255,23,15,60,255,67,15,117,255,113,31,129,255,158,46,126,255,205,63,112,255,240,96,93,255,253,149,103,255,254,201,141,255,251,252,191,255]),h={viewTransform:0,exposure:1,gamma:1,offset:0},p=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.tonemappingSettings=h,r.needsRerender=!0,r.checkRender=r.checkRender.bind(r),r.invalidate=r.invalidate.bind(r),r.initWebGl(t),r.getTexture=a.default(r.createTexture.bind(r)),r.needsRerender=!0,requestAnimationFrame(r.checkRender),r}return o(t,e),t.prototype.setTransformation=function(e){this.transformation=e,this.invalidate()},t.prototype.setTonemapping=function(e){this.tonemappingSettings=e,this.invalidate()},t.prototype.setImage=function(e){this.image=e,this.invalidate()},t.prototype.invalidate=function(){this.needsRerender=!0},t.prototype.checkRender=function(){(this.resize()||this.needsRerender)&&(this.needsRerender=!1,this.draw()),requestAnimationFrame(this.checkRender)},t.prototype.draw=function(){if(!this.cmapTexture)throw new Error("Textures need to be initialized before calling draw()");this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight),this.gl.uniform1i(this.glUniforms.viewTransform,this.tonemappingSettings.viewTransform),this.gl.uniform1f(this.glUniforms.exposure,this.tonemappingSettings.exposure),this.gl.uniform1f(this.glUniforms.offset,this.tonemappingSettings.offset),this.gl.uniform1f(this.glUniforms.gamma,this.tonemappingSettings.gamma),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quadVertexBuffer),this.gl.vertexAttribPointer(this.glAttributes.vertexPosition,3,this.gl.FLOAT,!1,5*l.BYTES_PER_ELEMENT,0),this.gl.vertexAttribPointer(this.glAttributes.vertexTextureCoordinate,2,this.gl.FLOAT,!1,5*l.BYTES_PER_ELEMENT,3*l.BYTES_PER_ELEMENT),this.gl.uniform1i(this.glUniforms.imageHeight,this.image.height),this.gl.uniform1i(this.glUniforms.imageWidth,this.image.width),"Difference"===this.image.type?(this.gl.uniform1i(this.glUniforms.drawMode,i.ColorMap),this.gl.uniform1i(this.glUniforms.lossFunction,this.image.lossFunction),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.getTexture(this.image.imageA)),this.gl.uniform1i(this.glUniforms.imASampler,0),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.getTexture(this.image.imageB)),this.gl.uniform1i(this.glUniforms.imBSampler,1)):(1===this.image.nChannels?this.gl.uniform1i(this.glUniforms.drawMode,i.ColorMap):"HdrImage"===this.image.type?this.gl.uniform1i(this.glUniforms.drawMode,i.HDR):this.gl.uniform1i(this.glUniforms.drawMode,i.LDR),this.gl.uniform1i(this.glUniforms.lossFunction,0),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.getTexture(this.image)),this.gl.uniform1i(this.glUniforms.imASampler,0),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.getTexture(this.image)),this.gl.uniform1i(this.glUniforms.imBSampler,1)),this.gl.activeTexture(this.gl.TEXTURE2),this.gl.bindTexture(this.gl.TEXTURE_2D,this.cmapTexture),this.gl.uniform1i(this.glUniforms.cmapSampler,2),this.gl.uniform1i(this.glUniforms.nChannels,this.image.nChannels);var e=this.getViewMatrix();this.gl.uniformMatrix4fv(this.glUniforms.viewMatrix,!1,e.data),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)},t.prototype.initWebGl=function(e){if(this.gl=e.getContext("webgl"),!this.gl)throw new Error("Please upgrade your browser to one that supports WebGL.");if(!this.gl.getExtension("OES_texture_float"))throw new Error("Your browser does not supports WebGL FLoating Point Textures.");this.gl.clearColor(.25,.25,.25,1),this.gl.enable(this.gl.DEPTH_TEST);var t=this.initShaders();this.quadVertexBuffer=this.initQuadVertexBuffer(),this.glAttributes=this.initAttributes(t),this.glUniforms=this.initUniforms(t),this.cmapTexture=this.initCmapTexture()},t.prototype.initShaders=function(){var e=r("\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying vec2 vTextureCoord;\nuniform mat4 viewMatrix;\nvoid main(void) {\n gl_Position = viewMatrix * vec4(aVertexPosition, 1.0);\n vTextureCoord = aTextureCoord;\n}",this.gl.VERTEX_SHADER,this.gl),t=r(u,this.gl.FRAGMENT_SHADER,this.gl),n=this.gl.createProgram();if(this.gl.attachShader(n,e),this.gl.attachShader(n,t),this.gl.linkProgram(n),!n||!this.gl.getProgramParameter(n,this.gl.LINK_STATUS))throw new Error("Failed to link the program.");return this.gl.useProgram(n),n},t.prototype.initCmapTexture=function(){var e=this.gl.createTexture();if(this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,f.length/4,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,f),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),!e)throw new Error("Failed to initialize color map texture.");return e},t.prototype.initQuadVertexBuffer=function(){var e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,l,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),!e)throw new Error("Failed to initialize quad vertex buffer.");return e},t.prototype.initAttributes=function(e){var t={vertexPosition:this.gl.getAttribLocation(e,"aVertexPosition"),vertexTextureCoordinate:this.gl.getAttribLocation(e,"aTextureCoord")};return this.gl.enableVertexAttribArray(t.vertexPosition),this.gl.enableVertexAttribArray(t.vertexTextureCoordinate),t},t.prototype.initUniforms=function(e){var t=this,n=function(n){var r=t.gl.getUniformLocation(e,n);if(!r)throw new Error("Failed to get uniform location for '"+n+"'.");return r};return{drawMode:n("mode"),lossFunction:n("lossFunction"),nChannels:n("nChannels"),viewMatrix:n("viewMatrix"),imASampler:n("imASampler"),imBSampler:n("imBSampler"),cmapSampler:n("cmapSampler"),viewTransform:n("viewTransform"),exposure:n("exposure"),offset:n("offset"),gamma:n("gamma"),imageWidth:n("imageWidth"),imageHeight:n("imageHeight")}},t.prototype.createTexture=function(e){var t=this.gl.createTexture();if(!t)throw new Error("Failed to initialize image texture");if(this.gl.bindTexture(this.gl.TEXTURE_2D,t),"HdrImage"===e.type)if(1===e.nChannels)this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.LUMINANCE,e.width,e.height,0,this.gl.LUMINANCE,this.gl.FLOAT,e.data);else{if(3!==e.nChannels)throw new Error("Don't know what to do with "+e.nChannels+" image channels.");this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGB,e.width,e.height,0,this.gl.RGB,this.gl.FLOAT,e.data)}else this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e.data);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t},t}(s.default);t.default=p},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(4),a=n(5),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.needsRerender=!0;var o=t.getContext("2d");if(null==o)throw new Error("Failed to create 2D context for TextOverlay");return r.context=o,r.checkRender=r.checkRender.bind(r),r.invalidate=r.invalidate.bind(r),r.needsRerender=!0,requestAnimationFrame(r.checkRender),r}return r(t,e),t.prototype.setTransformation=function(e){this.transformation=e,this.invalidate()},t.prototype.setImage=function(e){this.image=e,this.invalidate()},t.prototype.invalidate=function(){this.needsRerender=!0},t.prototype.checkRender=function(){(this.resize()||this.needsRerender)&&(this.needsRerender=!1,this.draw()),requestAnimationFrame(this.checkRender)},t.prototype.draw=function(){var e=this.context.canvas,t=o.Vector4.fromValues(-1,1,0,1),n=o.Vector4.fromValues(1,-1,0,1),r=this.getViewMatrix(),i=o.Matrix4x4.create();o.Matrix4x4.invert(i,r);var s=this.image;o.Vector4.transformMat4(t,t,i),o.Vector4.transformMat4(n,n,i),this.convertClipToRaster(t,t,s.width,s.height),this.convertClipToRaster(n,n,s.width,s.height);var c=Math.floor(t.data[0]),u=Math.floor(t.data[1]),l=Math.floor(n.data[0]),f=Math.floor(n.data[1]),h=Math.floor(20*window.devicePixelRatio),p=Math.floor(16*window.devicePixelRatio),d=e.width/(3*h+2),m=e.height/(3*h+2);if(this.context.clearRect(0,0,e.width,e.height),"Difference"!==s.type){if(n.data[0]-t.data[0]<d&&n.data[1]-t.data[1]<m){this.context.font=p+"px sans-serif";for(var g=Math.max(0,u);g<=Math.min(s.height-1,f);g++)for(var v=Math.max(0,c);v<=Math.min(s.width-1,l);v++){o.Vector4.set(t,v,g,0,1),this.convertRasterToClip(t,t,s.width,s.height),o.Vector4.transformMat4(t,t,r),this.convertClipToRaster(t,t,e.width,e.height);var y=void 0,b=void 0,w=void 0;1===s.nChannels?(y=a.getPixelColor(s,v,g,0),this.context.fillStyle="#888888",this.context.fillText(y.toFixed(4),t.data[0],t.data[1]+p)):(y=a.getPixelColor(s,v,g,0),b=a.getPixelColor(s,v,g,1),w=a.getPixelColor(s,v,g,2),this.context.fillStyle="#990000",this.context.fillText(y.toFixed(4),t.data[0],t.data[1]+p),this.context.fillStyle="#009900",this.context.fillText(b.toFixed(4),t.data[0],t.data[1]+p+h),this.context.fillStyle="#0000FF",this.context.fillText(w.toFixed(4),t.data[0],t.data[1]+p+2*h))}}}},t.prototype.convertClipToRaster=function(e,t,n,r){return e.data[0]=.5*(t.data[0]+1)*n,e.data[1]=.5*(1-t.data[1])*r,e},t.prototype.convertRasterToClip=function(e,t,n,r){return e.data[0]=2*t.data[0]/n-1,e.data[1]=1-2*t.data[1]/r,e},t}(i.default);t.default=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(4),a=n(18),s=function(e){function t(t,n,r){var o=e.call(this,t,n)||this;o.panningState=null,o.unsubscribeFunctions=[],o.handleMouseMove=o.handleMouseMove.bind(o),o.handleMouseDown=o.handleMouseDown.bind(o),o.handleMouseUp=o.handleMouseUp.bind(o),o.handleScroll=o.handleScroll.bind(o),o.handlePointReporting=o.handlePointReporting.bind(o),o.enableMouseEvents=r;var i;return document.addEventListener("mouseup",o.handleMouseUp),i=document.removeEventListener.bind(document,"mouseup",o.handleMouseUp),o.unsubscribeFunctions.push(i),document.addEventListener("mousemove",o.handleMouseMove),i=document.removeEventListener.bind(document,"mousemove",o.handleMouseMove),o.unsubscribeFunctions.push(i),t.addEventListener("wheel",o.handleScroll),i=t.removeEventListener.bind(t,"wheel",o.handleScroll),o.unsubscribeFunctions.push(i),t.addEventListener("mousedown",o.handleMouseDown),i=t.removeEventListener.bind(t,"mousedown",o.handleMouseDown),o.unsubscribeFunctions.push(i),t.addEventListener("mousemove",o.handlePointReporting),i=t.removeEventListener.bind(t,"mousemove",o.handlePointReporting),o.unsubscribeFunctions.push(i),o}return r(t,e),t.prototype.setTransformation=function(e,t){void 0===t&&(t=!1),this.transformation=e,t&&null!=this.transformationCallback&&this.transformationCallback(e)},t.prototype.setEnableMouseEvents=function(e){this.enableMouseEvents=e},t.prototype.onTransformationChange=function(e){this.transformationCallback=e},t.prototype.setImage=function(e){this.image=e},t.prototype.onPointAt=function(e){this.pointCallback=e},t.prototype.destruct=function(){this.unsubscribeFunctions.forEach(function(e){return e()})},t.prototype.handleMouseMove=function(e){if(this.enableMouseEvents&&this.panningState){var t=this.relativeMousePosition(e.clientX,e.clientY),n=t.x,r=t.y,i=n-this.panningState.previousMouse.x,a=r-this.panningState.previousMouse.y,s=o.Matrix4x4.create(),c=this.getAspect();o.Matrix4x4.translate(s,s,[i/c.x,a/c.y,0]),o.Matrix4x4.multiply(s,s,this.transformation),this.setTransformation(s,!0),this.panningState.previousMouse={x:n,y:r}}},t.prototype.handleMouseUp=function(e){this.panningState&&(this.panningState=null)},t.prototype.handleMouseDown=function(e){var t=this.relativeMousePosition(e.clientX,e.clientY);this.panningState={transformationAtStart:o.Matrix4x4.clone(this.transformation),previousMouse:t}},t.prototype.handleScroll=function(e){if(this.enableMouseEvents){e.preventDefault();var t=a(e).pixelY,n=this.relativeMousePosition(e.clientX,e.clientY),r=o.Matrix4x4.create(),i=o.Matrix4x4.create(),s=this.getAspect();o.Matrix4x4.translate(i,i,[n.x/s.x,n.y/s.y,0]);var c=Math.pow(1.001,t);o.Matrix4x4.scale(i,i,[c,c,1]),o.Matrix4x4.translate(i,i,[-n.x/s.x,-n.y/s.y,0]),o.Matrix4x4.multiply(r,i,this.transformation),this.setTransformation(r,!0)}},t.prototype.handlePointReporting=function(e){if(this.pointCallback&&!this.panningState){var t=this.relativeMousePosition(e.clientX,e.clientY),n=t.x,r=t.y,o=this.canvasToImage(n,r);this.pointCallback(o.x,o.y)}},t.prototype.relativeMousePosition=function(e,t){var n=this.canvas,r=n.clientWidth,o=n.clientHeight,i=this.canvas.getBoundingClientRect();return{x:2*(e-i.left)/r-1,y:1-2*(t-i.top)/o}},t.prototype.canvasToImage=function(e,t){var n=o.Vector4.create();o.Vector4.set(n,e,t,1,1);var r=o.Matrix4x4.create(),i=this.getViewMatrix();return o.Matrix4x4.invert(r,i),o.Vector4.transformMat4(n,n,r),{x:n.data[0],y:n.data[1]}},t}(i.default);t.default=s},function(e,t,n){"use strict";(function(t){var r=n(6),o=r;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}e.exports=o}).call(t,n(2))},function(e,t,n){"use strict";function r(e,t,n){void 0===n&&(n="");var r=o.createElement(s.default,{data:t,baseUrl:n,sortMenu:!1,removeCommonPrefix:!1});return i.render(r,e)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(15),a=n(9);t.ImageFrame=a.default;var s=n(33);t.ImageViewer=s.default;var c=n(10);t.ImageLayer=c.default;var u=n(11);t.TextLayer=u.default;var l=n(12);t.MouseLayer=l.default;var f=n(5);t.loadImage=f.loadImage,t.ImageCache=f.ImageCache;var h=n(1);t.Matrix4x4=h.Matrix4x4,t.Vector4=h.Vector4,t.renderViewer=r,t.default=s.default},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){var t=new Map;return function(n){var r=t.get(n);if(r)return r;var o=e(n);return t.set(n,o),o}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){e.exports=function(){return new Worker(n.p+"exr.worker.js")}},function(e,t,n){e.exports=n(19)},function(e,t,n){"use strict";function r(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*a,o=n*a,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=s,o*=s):(r*=c,o*=c)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}var o=n(20),i=n(21),a=10,s=40,c=800;r.getEventType=function(){return o.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=r},function(e,t){function n(){if(!y){y=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),h=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,r&&document&&document.documentMode&&(r=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(e);c=b?parseFloat(b[1])+4:r,o=t[2]?parseFloat(t[2]):NaN,i=t[3]?parseFloat(t[3]):NaN,a=t[4]?parseFloat(t[4]):NaN,a?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),s=t&&t[1]?parseFloat(t[1]):NaN):s=NaN}else r=o=i=s=a=NaN;if(n){if(n[1]){var w=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=!w||parseFloat(w[1].replace("_","."))}else u=!1;l=!!n[2],f=!!n[3]}else u=l=f=!1}}var r,o,i,a,s,c,u,l,f,h,p,d,m,g,v,y=!1,b={ie:function(){return n()||r},ieCompatibilityMode:function(){return n()||c>r},ie64:function(){return b.ie()&&p},firefox:function(){return n()||o},opera:function(){return n()||i},webkit:function(){return n()||a},safari:function(){return b.webkit()},chrome:function(){return n()||s},windows:function(){return n()||l},osx:function(){return n()||u},linux:function(){return n()||f},iphone:function(){return n()||d},mobile:function(){return n()||d||m||h||v},nativeApp:function(){return n()||g},android:function(){return n()||h},ipad:function(){return n()||m}};e.exports=b},function(e,t,n){"use strict";/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(22);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=r},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";function r(e){return!0===o(e)&&"[object Object]"===Object.prototype.toString.call(e)}/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var o=n(24);e.exports=function(e){var t,n;return!1!==r(e)&&("function"==typeof(t=e.constructor)&&(n=t.prototype,!1!==r(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},function(e,t,n){"use strict";/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t,n){!function(t){e.exports=t(null)}(function e(t){"use strict";function n(e,t,o,a){for(var u,l,f=0,h=0,m=0,g=0,v=0,y=0,b=0,w=0,x=0,E=0,T=0,C=0,A=0,O=0,R=0,P=0,_=0,I=0,J=0,Te=o.length,Ce=Te-1,Ae="",Re="",Pe="",Ve="",We="",Xe="";R<Te;){if(b=o.charCodeAt(R),h+g+m+f===0){if(R===Ce&&(P>0&&(Re=Re.replace(d,"")),(Re=Re.trim()).length>0)){switch(b){case Y:case G:case j:case q:case H:break;default:Re+=o.charAt(R)}b=j}if(1===_)switch(b){case U:case Q:_=0;break;case G:case q:case H:case Y:break;default:R--,b=j}switch(b){case U:for(Re=Re.trim(),v=Re.charCodeAt(0),T=1,R++;R<Te;){switch(b=o.charCodeAt(R)){case U:T++;break;case N:T--}if(0===T)break;Pe+=o.charAt(R++)}switch(v===se&&(v=(Re=Re.replace(p,"").trim()).charCodeAt(0)),v){case z:switch(P>0&&(Re=Re.replace(d,"")),y=Re.charCodeAt(1)){case ve:case fe:case he:u=t;break;default:u=Me}if(Pe=n(t,u,Pe,y),J=Pe.length,ke>0&&0===J&&(J=Re.length),Oe>0&&(u=r(Me,Re,I),l=c(De,Pe,u,t,be,ye,J,y),Re=u.join(""),void 0!==l&&0===(J=(Pe=l.trim()).length)&&(y=0,Pe="")),J>0)switch(y){case ve:case fe:case he:Pe=Re+"{"+Pe+"}";break;case le:Re=Re.replace(S,"$1 $2"+(je>0?Ne:"")),Pe=Re+"{"+Pe+"}",Pe="@"+(Ee>0?F+Pe+"@"+Pe:Pe);break;default:Pe=Re+Pe}else Pe="";break;default:Pe=n(t,r(t,Re,I),Pe,a)}We+=Pe,C=0,_=0,O=0,P=0,I=0,A=0,Re="",Pe="",b=o.charCodeAt(++R);break;case N:case j:if(Re=(P>0?Re.replace(d,""):Re).trim(),b!==N||Re.length>0)switch(0===O&&((v=Re.charCodeAt(0))===$||v>96&&v<123)&&Re.indexOf(" ")&&(Re=Re.replace(" ",": ")),Oe>0&&void 0!==(l=c(Ie,Re,t,e,be,ye,Ve.length,a))&&0===(Re=l.trim()).length&&(Re="\0\0"),v=Re.charCodeAt(0),y=Re.charCodeAt(1),v+y){case se:break;case me:case ge:Xe+=Re+o.charAt(R);break;default:Ve+=O>0?i(Re,v,y,Re.charCodeAt(2)):Re+";"}C=0,_=0,O=0,P=0,I=0,Re="",R++}}switch(b){case q:case H:if(h+g+m+f+Se===0)switch(E){case z:case ae:case oe:case Z:case ie:case re:case $:case ee:case Q:case j:case U:case N:break;default:O>0&&(_=1)}h===re&&(h=0),Oe*Le>0&&c(_e,Re,t,e,be,ye,Ve.length,a),ye=1,be++;break;default:if(ye++,Ae=o.charAt(R),b===G&&0===g)switch(w){case G:case Y:Ae="";break;default:Ae=0===m?"":" "}switch(b){case se:Ae="\\0";break;case ce:Ae="\\f";break;case ue:Ae="\\v";break;case K:g+h+f===0&&xe>0&&(I=1,P=1,Ae="\f"+Ae);break;case 108:if(g+h+f+we===0&&O>0)switch(R-O){case 2:w===pe&&o.charCodeAt(R-3)===ee&&(we=w);case 8:x===de&&(we=x)}break;case ee:g+h+f===0&&(O=R);break;case Q:h+m+g+f===0&&(P=1,Ae+="\r");break;case ne:case te:0===h&&(g=g===b?0:0===g?b:g,R===Ce&&(Ce++,Te++));break;case W:g+h+m===0&&f++;break;case X:g+h+m===0&&f--;break;case V:g+h+f===0&&(R===Ce&&(Ce++,Te++),m--);break;case B:if(g+h+f===0){if(0===C)switch(2*w+3*x){case 533:break;default:T=0,C=1}m++}break;case z:h+m+g+f+O+A===0&&(A=1);break;case Z:case re:if(g+f+m>0)break;switch(h){case 0:switch(2*b+3*o.charCodeAt(R+1)){case 235:h=re;break;case 220:h=Z}break;case Z:b===re&&w===Z&&(Ae="",h=0)}}if(0===h){if(xe+g+f+A===0&&a!==le&&b!==j)switch(b){case Q:case ae:case oe:case ie:case V:case B:if(0===C){switch(w){case G:case Y:case H:case q:Ae+="\0";break;default:Ae="\0"+Ae+(b===Q?"":"\0")}P=1}else switch(b){case B:C=++T;break;case V:0==(C=--T)&&(P=1,Ae+="\0")}break;case Y:switch(w){case se:case U:case N:case j:case Q:case ce:case G:case Y:case H:case q:break;default:0===C&&(P=1,Ae+="\0")}}Re+=Ae,b!==Y&&(E=b)}}x=w,w=b,R++}if(J=Ve.length,ke>0&&0===J&&0===We.length&&0===t[0].length==!1&&(a!==fe||1===t.length&&(xe>0?Ue:Be)===t[0])&&(J=t.join(",").length+2),J>0){if(0===xe&&a!==le&&s(t),Oe>0&&void 0!==(l=c(Fe,Ve,t,e,be,ye,J,a))&&0===(Ve=l).length)return Xe+Ve+We;if(Ve=t.join(",")+"{"+Ve+"}",Ee*we>0){switch(we){case de:Ve=Ve.replace(M,":"+D+"$1")+Ve;break;case pe:Ve=Ve.replace(k,"::"+F+"input-$1")+Ve.replace(k,"::"+D+"$1")+Ve.replace(k,":"+L+"input-$1")+Ve}we=0}}return Xe+Ve+We}function r(e,t,n){var r=t.trim().split(x),i=r,a=r.length,s=e.length;switch(s){case 0:case 1:for(var c=0,u=0===s?"":e[0]+" ";c<a;c++)i[c]=o(u,i[c],n,s).trim();break;default:for(var c=0,l=0,i=[];c<a;c++)for(var f=0;f<s;f++)i[l++]=o(e[f]+" ",r[c],n,s).trim()}return i}function o(e,t,n,r){var o=t,i=o.charCodeAt(0);switch(i<33&&(i=(o=o.trim()).charCodeAt(0)),i){case K:switch(xe+r){case 0:case 1:if(0===e.trim().length)break;default:return o.replace(E,"$1"+e.trim())}break;case ee:switch(o.charCodeAt(1)){case 103:if(Te>0&&xe>0)return o.replace(T,"$1").replace(E,"$1"+Be);break;default:return e.trim()+o}default:if(n*xe>0&&o.indexOf("\f")>0)return o.replace(E,(e.charCodeAt(0)===ee?"":"$1")+e.trim())}return e+o}function i(e,t,n,r){var o,i=e+";",s=0,c=2*t+3*n+4*r;if(944===c)i=a(i);else if(Ee>0)switch(c){case 963:110===i.charCodeAt(5)&&(i=F+i+i);break;case 978:i=F+i+D+i+i;break;case 1019:case 983:i=F+i+D+i+L+i+i;break;case 883:i.charCodeAt(8)===$&&(i=F+i+i);break;case 932:i=F+i+L+i+i;break;case 964:i=F+i+L+"flex-"+i+i;break;case 1023:o=i.substring(i.indexOf(":",15)).replace("flex-",""),i=F+"box-pack"+o+F+i+L+"flex-pack"+o+i;break;case 975:switch(s=(i=e).length-10,o=(33===i.charCodeAt(s)?i.substring(0,s):i).substring(8).trim(),c=o.charCodeAt(0)+(0|o.charCodeAt(7))){case 203:o.charCodeAt(8)>110&&(i=i.replace(o,F+o)+";"+i);break;case 207:case 102:i=i.replace(o,F+(c>102?"inline-":"")+"box")+";"+i.replace(o,F+o)+";"+i.replace(o,L+o+"box")+";"+i}i+=";";break;case 938:if(i.charCodeAt(5)===$)switch(i.charCodeAt(6)){case 105:o=i.replace("-items",""),i=F+i+F+"box-"+o+L+"flex-"+o+i;break;case 115:i=F+i+L+"flex-item-"+i.replace("-self","")+i;break;default:i=F+i+L+"flex-line-pack"+i.replace("align-content","")+i}break;case 1005:g.test(i)&&(i=i.replace(m,": "+F)+i.replace(m,": "+D)+i);break;case 953:(s=i.indexOf("-content",9))>0&&(o=i.substring(s-3),i="width:"+F+o+"width:"+D+o+"width:"+o);break;case 1015:if(e.charCodeAt(9)!==$)break;case 962:i=F+i+(102===i.charCodeAt(5)?L+i:"")+i,n+r===211&&105===i.charCodeAt(13)&&i.indexOf("transform",10)>0&&(i=i.substring(0,i.indexOf(";",27)+1).replace(v,"$1"+F+"$2")+i);break;case 1e3:switch(o=i.substring(13).trim(),s=o.indexOf("-")+1,o.charCodeAt(0)+o.charCodeAt(s)){case 226:o=i.replace(I,"tb");break;case 232:o=i.replace(I,"tb-rl");break;case 220:o=i.replace(I,"lr");break;default:return i}i=F+i+L+o+i}return i}function a(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim(),i="";if(e.charCodeAt(9)!==$)for(var a=o.split(y),s=0,n=0,t=a.length;s<t;n=0,s++){for(var c=a[s],u=c.split(b);c=u[n];){var l=c.charCodeAt(0);if(1===je&&(l>z&&l<90||l>96&&l<123||l===J||l===$&&c.charCodeAt(1)!==$))switch(isNaN(parseFloat(c))+(-1!==c.indexOf("("))){case 1:switch(c){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:c+=Ne}}u[n++]=c}i+=(0===s?"":",")+u.join(" ")}else i+=110===e.charCodeAt(10)?o+(1===je?Ne:""):o;return i=r+i+";",Ee>0?F+i+i:i}function s(e){for(var t,n,r=0,o=e.length;r<o;r++){for(var i=e[r].split(w),a="",s=0,c=0,u=0,l=0,f=i.length;s<f;s++)if(!(0===(c=(n=i[s]).length)&&f>1)){if(u=a.charCodeAt(a.length-1),l=n.charCodeAt(0),t="",0!==s)switch(u){case Z:case ae:case oe:case ie:case Y:case B:break;default:t=" "}switch(l){case K:n=t+Ue;case ae:case oe:case ie:case Y:case V:case B:break;case W:n=t+n+Ue;break;case ee:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(Te>0){n=t+n.substring(8,c-1);break}default:(s<1||i[s-1].length<1)&&(n=t+Ue+n)}break;case Q:t="";default:n=c>1&&n.indexOf(":")>0?t+n.replace(_,"$1"+Ue+"$2"):t+n+Ue}a+=n}e[r]=a.replace(d,"").trim()}}function c(e,t,n,r,o,i,a,s){for(var c,u=0,l=t;u<Oe;u++)switch(c=Ae[u].call(h,e,l,n,r,o,i,a,s)){case void 0:case!1:case!0:case null:break;default:l=c}switch(l){case void 0:case!1:case!0:case null:case t:break;default:return l}}function u(e){return e.replace(d,"").replace(A,"").replace(O,"$1").replace(R,"$1").replace(P," ")}function l(e){switch(e){case void 0:case null:Oe=Ae.length=0;break;default:switch(e.constructor){case Array:for(var t=0,n=e.length;t<n;t++)l(e[t]);break;case Function:Ae[Oe++]=e;break;case Boolean:Le=0|!!e}}return l}function f(e){for(var t in e){var n=e[t];switch(t){case"keyframe":je=0|n;break;case"global":Te=0|n;break;case"cascade":xe=0|n;break;case"compress":Ce=0|n;break;case"prefix":Ee=0|n;break;case"semicolon":Se=0|n;break;case"preserve":ke=0|n}}return f}function h(t,r){if(void 0!==this&&this.constructor===h)return e(t);var o=t,i=o.charCodeAt(0);i<33&&(i=(o=o.trim()).charCodeAt(0)),je>0&&(Ne=o.replace(C,i===W?"":"-")),i=1,1===xe?Be=o:Ue=o;var a,s=[Be];Oe>0&&void 0!==(a=c(Pe,r,s,s,be,ye,0,0))&&"string"==typeof a&&(r=a);var l=n(Me,s,r,0);return Oe>0&&void 0!==(a=c(Re,l,s,s,be,ye,l.length,0))&&"string"!=typeof(l=a)&&(i=0),Ne="",Be="",Ue="",we=0,be=1,ye=1,Ce*i==0?l:u(l)}var p=/^\0+/g,d=/[\0\r\f]/g,m=/: */g,g=/zoo|gra/,v=/([,: ])(transform)/g,y=/,+\s*(?![^(]*[)])/g,b=/ +\s*(?![^(]*[)])/g,w=/ *[\0] */g,x=/,\r+?/g,E=/([\t\r\n ])*\f?&/g,T=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,C=/\W+/g,S=/@(k\w+)\s*(\S*)\s*/,k=/::(place)/g,M=/:(read-only)/g,A=/\s+(?=[{\];=:>])/g,O=/([[}=:>])\s+/g,R=/(\{[^{]+?);(?=\})/g,P=/\s{2,}/g,_=/([^\(])(:+) */g,I=/[svh]\w+-[tblr]{2}/,F="-webkit-",D="-moz-",L="-ms-",j=59,N=125,U=123,B=40,V=41,W=91,X=93,H=10,q=13,G=9,z=64,Y=32,K=38,$=45,J=95,Z=42,Q=44,ee=58,te=39,ne=34,re=47,oe=62,ie=43,ae=126,se=0,ce=12,ue=11,le=107,fe=109,he=115,pe=112,de=111,me=169,ge=163,ve=100,ye=1,be=1,we=0,xe=1,Ee=1,Te=1,Ce=0,Se=0,ke=0,Me=[],Ae=[],Oe=0,Re=-2,Pe=-1,_e=0,Ie=1,Fe=2,De=3,Le=0,je=1,Ne="",Ue="",Be="";return h.use=l,h.set=f,void 0!==t&&f(t),h})},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r};e.exports=n(27)(o,!0)}else e.exports=n(30)()}).call(t,n(2))},function(e,t,n){"use strict";(function(t){var r=n(6),o=n(7),i=n(13),a=n(28),s=n(8),c=n(29);e.exports=function(e,n){function u(e){var t=e&&(M&&e[M]||e[A]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function f(e){this.message=e,this.stack=""}function h(e){function r(r,u,l,h,p,d,m){if(h=h||O,d=d||l,m!==s)if(n)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=h+":"+l;!a[g]&&c<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",d,h),a[g]=!0,c++)}return null==u[l]?r?new f(null===u[l]?"The "+p+" `"+d+"` is marked as required in `"+h+"`, but its value is `null`.":"The "+p+" `"+d+"` is marked as required in `"+h+"`, but its value is `undefined`."):null:e(u,l,h,p,d)}if("production"!==t.env.NODE_ENV)var a={},c=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function p(e){function t(t,n,r,o,i,a){var s=t[n];if(T(s)!==e)return new f("Invalid "+o+" `"+i+"` of type `"+C(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return h(t)}function d(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new f("Invalid "+o+" `"+i+"` of type `"+T(a)+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<a.length;c++){var u=e(a,c,r,o,i+"["+c+"]",s);if(u instanceof Error)return u}return null}return h(t)}function m(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||O;return new f("Invalid "+o+" `"+i+"` of type `"+k(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return h(t)}function g(e){function n(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(l(a,e[s]))return null;return new f("Invalid "+o+" `"+i+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?h(n):("production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOf, expected an instance of array."),r.thatReturnsNull)}function v(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],c=T(a);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var l=e(a,u,r,o,i+"."+u,s);if(l instanceof Error)return l}return null}return h(t)}function y(e){function n(t,n,r,o,i){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,o,i,s))return null}return new f("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),r.thatReturnsNull;for(var o=0;o<e.length;o++){var a=e[o];if("function"!=typeof a)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",S(a),o),r.thatReturnsNull}return h(n)}function b(e){function t(t,n,r,o,i){var a=t[n],c=T(a);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var u in e){var l=e[u];if(l){var h=l(a,u,r,o,i+"."+u,s);if(h)return h}}return null}return h(t)}function w(e){function t(t,n,r,o,i){var c=t[n],u=T(c);if("object"!==u)return new f("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var l=a({},t[n],e);for(var h in l){var p=e[h];if(!p)return new f("Invalid "+o+" `"+i+"` key `"+h+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=p(c,h,r,o,i+"."+h,s);if(d)return d}return null}return h(t)}function x(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(x);if(null===t||e(t))return!0;var n=u(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!x(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!x(i[1]))return!1}return!0;default:return!1}}function E(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":E(t,e)?"symbol":t}function C(e){if(void 0===e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function S(e){var t=C(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function k(e){return e.constructor&&e.constructor.name?e.constructor.name:O}var M="function"==typeof Symbol&&Symbol.iterator,A="@@iterator",O="<<anonymous>>",R={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return h(r.thatReturnsNull)}(),arrayOf:d,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new f("Invalid "+o+" `"+i+"` of type `"+T(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return h(t)}(),instanceOf:m,node:function(){function e(e,t,n,r,o){return x(e[t])?null:new f("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return h(e)}(),objectOf:v,oneOf:g,oneOfType:y,shape:b,exact:w};return f.prototype=Error.prototype,R.checkPropTypes=c,R.PropTypes=R,R}}).call(t,n(2))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=r(e),u=1;u<arguments.length;u++){n=Object(arguments[u]);for(var l in n)i.call(n,l)&&(c[l]=n[l]);if(o){s=o(n);for(var f=0;f<s.length;f++)a.call(n,s[f])&&(c[s[f]]=n[s[f]])}}return c}},function(e,t,n){"use strict";(function(t){function r(e,n,r,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var f;try{o("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",c||"React class",r,l,typeof e[l]),f=e[l](n,l,c,r,null,a)}catch(e){f=e}if(i(!f||f instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,l,typeof f),f instanceof Error&&!(f.message in s)){s[f.message]=!0;var h=u?u():"";i(!1,"Failed %s type: %s%s",r,f.message,null!=h?h:"")}}}if("production"!==t.env.NODE_ENV)var o=n(7),i=n(13),a=n(8),s={};e.exports=r}).call(t,n(2))},function(e,t,n){"use strict";var r=n(6),o=n(7),i=n(8);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){function n(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}e.exports=n;var r=Object.prototype.toString},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},i="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,n){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);i&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;++s)if(!(r[a[s]]||o[a[s]]||n&&n[a[s]]))try{e[a[s]]=t[a[s]]}catch(e){}}return e}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(3),s=n(1),c=n(34),u=n(35),l=n(36),f=n(4),h=n(37),p=n(38),d=(y=["\n background-color: #fff;\n font-size: .9em;\n position: absolute;\n top: 0; bottom: 0; left: 0; right: 0;\n display: flex;\n flex-direction: column;\n color: #AAA;\n"],y.raw=["\n background-color: #fff;\n font-size: .9em;\n position: absolute;\n top: 0; bottom: 0; left: 0; right: 0;\n display: flex;\n flex-direction: column;\n color: #AAA;\n"],a.default.div(y)),m=(b=["\n flex-grow: 1;\n position: relative;\n"],b.raw=["\n flex-grow: 1;\n position: relative;\n"],a.default.div(b)),g=!1;document.addEventListener("keydown",function(e){"Shift"===e.key&&(g=!0)}),document.addEventListener("keyup",function(e){"Shift"===e.key&&(g=!1)});var v=function(e){function t(t){var n=e.call(this,t)||this;return n.menuData=n.props.data,t.sortMenu&&(n.menuData=n.sortMenuRows(n.menuData)),n.state={activeRow:0,selection:n.getDefaultSelection(n.menuData).slice(1),viewTransform:{default:0},exposure:{default:1},helpIsOpen:!1,defaultTransformation:s.Matrix4x4.create(),transformationNeedsUpdate:!0,hasFocus:!1},n.keyboardHandler=n.keyboardHandler.bind(n),n.setFocus=n.setFocus.bind(n),n.unsetFocus=n.unsetFocus.bind(n),n}return r(t,e),t.prototype.componentDidMount=function(){this.mainContainer.setAttribute("tabindex","1"),this.mainContainer.addEventListener("keydown",this.keyboardHandler),this.mainContainer.addEventListener("focus",this.setFocus),this.mainContainer.addEventListener("focusout",this.unsetFocus)},t.prototype.componentDidUpdate=function(){this.imageFrame&&this.state.transformationNeedsUpdate&&(this.imageFrame.setTransformation(this.state.defaultTransformation),this.setState({transformationNeedsUpdate:!1}))},t.prototype.componentWillReceiveProps=function(e){this.menuData=e.data,this.props.sortMenu&&(this.menuData=this.sortMenuRows(this.menuData)),this.validateSelection(this.state.selection,this.state.activeRow)},t.prototype.componentWillUnmount=function(){this.mainContainer.removeEventListener("keydown",this.keyboardHandler)},t.prototype.setTransformation=function(e){null!=this.imageFrame&&this.imageFrame.setTransformation(e),this.setState({defaultTransformation:e})},t.prototype.render=function(){var e=this,t=this.activeRows(this.menuData,this.state.selection),n=this.imageSpec();return i.createElement(d,{innerRef:function(t){return e.mainContainer=t}},i.createElement("div",null,t.map(function(n,r){return i.createElement(p.NavRow,{key:n.title,row:n,selection:e.state.selection[r],handleClick:e.navigateTo.bind(e,t,r),removeCommonPrefix:e.props.removeCommonPrefix,active:e.state.activeRow===r})})),i.createElement(m,null,i.createElement(h.default,{viewTransform:this.state.viewTransform[n.tonemapGroup],exposure:this.state.exposure[n.tonemapGroup]||1,gamma:1,offset:0,imageSpec:n,ref:function(t){return e.imageFrame=null!=t?t.imageFrame:null},allowMovement:!0,enableMouseEvents:this.state.hasFocus}),this.state.helpIsOpen?i.createElement(l.default,null):null))},t.prototype.activeRows=function(e,t){if(0===t.length)return[];if(!e.hasOwnProperty("children"))throw new Error("Can't find match for "+t);var n=e,r=n.children.find(function(e){return e.title===t[0]});if(null==r)throw new Error("Failed to find a match for "+t);return[n].concat(this.activeRows(r,t.slice(1)))},t.prototype.sortMenuRows=function(e){var t=this;if(e.hasOwnProperty("children")){var n=e,r=n.children.map(function(e){return t.sortMenuRows(e)});return r.sort(function(e,t){return e.title===t.title?0:"Color"===e.title?-1:"Color"===t.title?1:c.default(e.title,t.title)}),{title:n.title,children:r}}return e},t.prototype.currentImage=function(e){void 0===e&&(e=this.state.selection);for(var t=e.slice(),n=this.menuData;t.length>0;)!function(){var e=t.shift();n=n.children.find(function(t){return t.title===e})}();return n},t.prototype.imageSpec=function(e){void 0===e&&(e=this.state.selection);var t=this.currentImage(e);if(t.hasOwnProperty("lossMap")){var n=t;return{type:"Difference",lossFunction:f.lossFunctionFromString(n.lossMap.function),urlA:this.props.baseUrl+n.lossMap.imageA,urlB:this.props.baseUrl+n.lossMap.imageB,tonemapGroup:n.tonemapGroup||"default"}}return{type:"Url",url:this.props.baseUrl+t.image,tonemapGroup:t.tonemapGroup||"default"}},t.prototype.navigateTo=function(e,t,n){var r=this.state.selection.slice();r[t]=n;var o=this.state.activeRow;g&&(o=t),this.validateSelection(r,o)},t.prototype.validateSelection=function(e,t){for(var n=[],r=0,o=this.menuData;o.hasOwnProperty("children");){var i=o.children.find(function(t){return t.title===e[r]});i?(o=i,n.push(i.title)):(o=o.children[0],n.push(o.title)),r++}this.setState({selection:n,activeRow:Math.min(t,n.length-1)})},t.prototype.getDefaultSelection=function(e){if(e.hasOwnProperty("children")){var t=e;return t.children.length>0?[t.title].concat(this.getDefaultSelection(t.children[0])):[t.title]}return[e.title]},t.prototype.dumpTransformation=function(){if(null!=this.imageFrame){var e=this.imageFrame.getTransformation();console.log(e.data)}},t.prototype.keyboardHandler=function(e){var t=this,n=e.key,r={},i={},a=function(e){return function(){var n=t.activeRows(t.menuData,t.state.selection),r=t.state.activeRow,o=n[r].children[e];null!=o&&t.navigateTo(n,r,o.title)}};r[0]=a(9);for(var s=1;s<=9;++s)r[s.toString()]=a(s-1);var c=function(e){return function(){var n=t.activeRows(t.menuData,t.state.selection),r=t.state.activeRow,o=t.state.selection[r],i=n[r].children.findIndex(function(e){return e.title===o}),a=(i+e+n[r].children.length)%n[r].children.length,s=n[r].children[a];t.navigateTo(n,r,s.title)}};i.ArrowLeft=c(-1),i.ArrowRight=c(1),r["-"]=c(-1),r["="]=c(1);var l=function(e){return function(){var n=t.state.activeRow+e;n<0&&(n=0),n>=t.state.selection.length-1&&(n=t.state.selection.length-1),t.setState({activeRow:n})}};i.ArrowUp=l(-1),i.ArrowDown=l(1),r["["]=l(-1),r["]"]=l(1);r.t=function(){return function(){var e=t.imageSpec().tonemapGroup,n=o({},t.state.viewTransform,(r={},r[e]=Math.abs(t.state.viewTransform[e]-1),r));t.setState({viewTransform:n});var r}}();var f=function(e){return function(){var n=t.imageSpec().tonemapGroup,r=o({},t.state.exposure,(i={},i[n]=e*(t.state.exposure[n]||1),i));t.setState({exposure:r});var i}};return r.e=f(1.1),r.E=f(1/1.1),r.r=function(){t.setState({viewTransform:{default:0}}),t.setState({exposure:{default:1}}),t.imageFrame&&t.imageFrame.reset()},r["/"]=r["?"]=function(){t.setState({helpIsOpen:!t.state.helpIsOpen})},r.Escape=function(){t.setState({helpIsOpen:!1})},r.f=function(){return u.default(t.mainContainer)},r.d=function(){return t.dumpTransformation()},!r.hasOwnProperty(n)||e.metaKey||e.altKey||e.ctrlKey?i.hasOwnProperty(n)&&e.shiftKey?(e.preventDefault(),void i[n]()):void 0:(e.preventDefault(),void r[n]())},t.prototype.setFocus=function(){this.setState({hasFocus:!0})},t.prototype.unsetFocus=function(){this.setState({hasFocus:!1})},t.defaultProps={baseUrl:"",sortMenu:!1,removeCommonPrefix:!1},t}(i.Component);t.default=v;var y,b},function(e,t,n){"use strict";function r(e,t){for(var n=e.match(o)||[],r=t.match(o)||[];n.length>0&&r.length>0;){var i=n.shift(),a=r.shift(),s=parseInt(i,10),c=parseInt(a,10);if(isNaN(s)||isNaN(c)){if(!isNaN(s)||!isNaN(c))return isNaN(c)?-1:1;if(i<a)return-1;if(i>a)return 1}else{if(s<c)return-1;if(s>c)return 1}}return 0===n.length&&0===r.length?0:0===n.length?-1:1}Object.defineProperty(t,"__esModule",{value:!0});var o=/\d+|\D+/g;t.default=r},function(e,t,n){"use strict";function r(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(3),i=(a=["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 2em 0;\n background-color: rgba(0, 0, 0, 0.8);\n line-height: 1.4em;\n color: white;\n table {\n width: 40em;\n margin: 0 auto;\n }\n h1 {\n font-size: 1em;\n margin: 0;\n padding: 0;\n line-height: 2em;\n text-align: center;\n padding-bottom: .5em;\n }\n th, td {\n text-align: left;\n padding: .4em 1em;\n vertical-align: top;\n }\n th {\n width: 10em;\n }\n"],a.raw=["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 2em 0;\n background-color: rgba(0, 0, 0, 0.8);\n line-height: 1.4em;\n color: white;\n table {\n width: 40em;\n margin: 0 auto;\n }\n h1 {\n font-size: 1em;\n margin: 0;\n padding: 0;\n line-height: 2em;\n text-align: center;\n padding-bottom: .5em;\n }\n th, td {\n text-align: left;\n padding: .4em 1em;\n vertical-align: top;\n }\n th {\n width: 10em;\n }\n"],o.default.div(a));t.default=function(){return r.createElement(i,null,r.createElement("h1",null,"Shortcuts"),r.createElement("table",null,r.createElement("tbody",null,r.createElement("tr",null,r.createElement("th",null,"0-9"),r.createElement("td",null,"Switch images")),r.createElement("tr",null,r.createElement("th",null,"Shift + 0-9"),r.createElement("td",null,"Switch comparison (to for example reference or input)")),r.createElement("tr",null,r.createElement("th",null,"Shift + Arrows"),r.createElement("td",null,"Navigate through the menu")),r.createElement("tr",null,r.createElement("th",null,"Shift + click"),r.createElement("td",null,"Open a tab, and activate keyboard shortcuts for the row clicked")),r.createElement("tr",null,r.createElement("th",null,"e / E"),r.createElement("td",null,"Increase / decrease ",r.createElement("strong",null,"e"),"xposure")),r.createElement("tr",null,r.createElement("th",null,"r"),r.createElement("td",null,"Reset exposure, view transform, positioning and zooming")),r.createElement("tr",null,r.createElement("th",null,"t"),r.createElement("td",null,"Toggle between the Gamma 2.2 and the Pseudo ARRI K1S1 view transforms")),r.createElement("tr",null,r.createElement("th",null,"f"),r.createElement("td",null,"Enter ",r.createElement("strong",null,"f"),"ullscreen mode")),r.createElement("tr",null,r.createElement("th",null,"?"),r.createElement("td",null,"Toggle this help screen")))))};var a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(3),a=n(9),s=n(5),c=(f=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],f.raw=["\n position: absolute;\n top: 0; bottom: 0;\n left: 0; right: 0;\n width: 100%; height: 100%;\n"],i.default.div(f)),u=(h=["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n text-align: left;\n padding: .6em;\n background-color: rgb(64, 64, 64);\n"],h.raw=["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n text-align: left;\n padding: .6em;\n background-color: rgb(64, 64, 64);\n"],i.default.div(h)),l=function(e){function t(t){var n=e.call(this,t)||this;return n.cache=new s.ImageCache,n.requestId=0,n.currentRequest=0,n.state={isLoading:!1,errorMsg:null,image:null},n.handleImageChange(t,!1),n}return r(t,e),t.prototype.componentWillReceiveProps=function(e){e.imageSpec!==this.props.imageSpec&&this.handleImageChange(e)},t.prototype.componentWillUnmount=function(){this.requestId=-1},t.prototype.render=function(){var e=this;return o.createElement(c,null,null!=this.state.image?o.createElement(a.default,{viewTransform:this.props.viewTransform,exposure:this.props.exposure,gamma:this.props.gamma,offset:this.props.offset,image:this.state.image,ref:function(t){return e.imageFrame=t},allowMovement:this.props.allowMovement,enableMouseEvents:this.props.enableMouseEvents}):null,this.state.isLoading?o.createElement(u,null,"Downloading ..."):null,this.state.errorMsg?o.createElement(u,null,this.state.errorMsg):null)},t.prototype.handleImageChange=function(e,t){var n=this;void 0===t&&(t=!0),this.currentRequest++;var r=this.currentRequest;t&&this.setState({isLoading:!0,errorMsg:null}),this.downloadImage(e.imageSpec).then(function(e){r===n.currentRequest&&n.setState({errorMsg:null,isLoading:!1,image:e})}).catch(function(e){r===n.requestId&&n.setState({errorMsg:e.message,isLoading:!1})})},t.prototype.downloadImage=function(e){var t=this;if("Url"===e.type)return this.cache.get(e.url);if("Difference"===e.type)return Promise.all([e.urlA,e.urlB].map(function(e){return t.cache.get(e)})).then(function(t){var n=t[0],r=t[1],o=n.height,i=n.width,a=n.nChannels;if(o!==r.height)throw Error(e.urlA+" & "+e.urlB+" with heights "+o+" & "+r.height+" cannot be compared.");if(i!==r.width)throw Error(e.urlA+" & "+e.urlB+" with widths "+i+" & "+r.width+" cannot be compared.");if(a!==r.nChannels)throw Error(e.urlA+" & "+e.urlB+" with unequal nChannels "+a+" & "+r.nChannels+".");return{type:e.type,imageA:n,imageB:r,width:i,height:o,nChannels:a,lossFunction:e.lossFunction}});throw Error("Unkonwn imageSpec type for "+e+".")},t}(o.Component);t.default=l;var f,h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(3),i=n(39),a=function(e){return e.split("").reverse().join("")},s=(l=["\n cursor: pointer;\n display: inline-block;\n margin: 0;\n flex-grow: 0;\n flex-shrink: ",";\n padding: .4em .7em;\n overflow: hidden;\n text-decoration: none;\n white-space: nowrap;\n position: relative;\n background-color: ",";\n color: ",";\n &:active {\n background-color: ",";\n }\n &:hover {\n flex-shrink: 0;\n }\n user-select: none;\n -moz-user-select: none;\n"],l.raw=["\n cursor: pointer;\n display: inline-block;\n margin: 0;\n flex-grow: 0;\n flex-shrink: ",";\n padding: .4em .7em;\n overflow: hidden;\n text-decoration: none;\n white-space: nowrap;\n position: relative;\n background-color: ",";\n color: ",";\n &:active {\n background-color: ",";\n }\n &:hover {\n flex-shrink: 0;\n }\n user-select: none;\n -moz-user-select: none;\n"],o.default.a(l,function(e){return e.active?"0":"1"},function(e){return e.active?"#238":"inherit"},function(e){return e.active?"#FFFFFF !important":"#AAA !important"},function(e){return e.active?"#666":"#fff"})),c=(f=["\n display: block;\n padding: 0;\n border-bottom: 1px solid #aaa;\n background: #fff;\n color: #111;\n display: flex;\n &:first-child {\n// border-top: 1px solid #aaa;\n }\n &:hover "," {\n flex-shrink: 1;\n }\n &:hover ",":hover {\n flex-shrink: 0;\n }\n"],f.raw=["\n display: block;\n padding: 0;\n border-bottom: 1px solid #aaa;\n background: #fff;\n color: #111;\n display: flex;\n &:first-child {\n// border-top: 1px solid #aaa;\n }\n &:hover "," {\n flex-shrink: 1;\n }\n &:hover ",":hover {\n flex-shrink: 0;\n }\n"],o.default.div(f,s,s)),u=(h=["\n color: white;\n font-size: .6em;\n position: absolute;\n top: .3em;\n right: .4em;\n"],h.raw=["\n color: white;\n font-size: .6em;\n position: absolute;\n top: .3em;\n right: .4em;\n"],o.default.span(h));t.NavRow=function(e){var t,n=e.row,o=e.active,l=e.selection,f=e.handleClick,h=e.removeCommonPrefix,p=n.children.map(function(e){return e.title});if(h){var d=i(p),m=a(i(p.map(a)));t=p.map(function(e){return e.slice(d.lastIndexOf("/")+1,e.length-m.length)})}else t=p;return r.createElement(c,null,n.children.map(function(e,n){return r.createElement(s,{onClick:function(){return f(e.title)},key:e.title,active:e.title===l},0===n?p[n]:t[n],o&&n<10?r.createElement(u,null,(n+1)%10):null)}))};var l,f,h},function(e,t){function n(e){if(!Array.isArray(e))throw new Error("common-prefix expects an array of strings");for(var t=e[0]||"",n=t.length,r=1;r<e.length;++r)for(var o=0;o<n;++o)if(e[r].charAt(o)!==t.charAt(o)){n=o;break}return t.slice(0,n)}e.exports=n}])});
//# sourceMappingURL=jeri.min.js.map