Edit on

        <!-- where the cube will be injected -->
        <div class="ad-wrapper"></div>

        <div style="display: none;">
            <!-- front face -->
            <div data-face="front">
                <div>FRONT</div>
            </div><!-- / end front face -->

            <!-- left face -->
            <div data-face="left">
                <div>LEFT</div>
            </div><!-- / end left face -->

            <!-- back face -->
            <div data-face="back">
                <div>BACK</div>
            </div><!-- / end back face -->

            <!-- right face -->
            <div data-face="right">
                <div>RIGHT</div>
            </div><!-- / end right face -->

            <!-- top face -->
            <div data-face="top">
                <div>TOP</div>
                <button data-rotate="GOBACK" data-face="LEFT">Go to bottom face</button>
            </div><!-- / end top face -->

            <!-- bottom face -->
            <div data-face="bottom">
                <div>BOTTOM</div>
            </div><!-- / end bottom face -->
        </div>
body,
html {
	padding: 0px;
	margin: 0px;
	width: 100%;
	height: 100%;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	overflow: hidden;
	background: gray;
  -webkit-overflow-scrolling: none;
  position: fixed;
}
body {
  position: absolute;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /*-webkit-perspective: 1000;
  perspective: none;*/
  overflow: hidden;
  -webkit-overflow-scrolling: none;
}

.chrome {
  perspective: 1000px;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.safari {
	-webkit-transform:translate3d(0,0,0);
  -webkit-backface-visibility: hidden;
}

.netscape {
  perspective: 1000px;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d; 
}

.netscape .famous-dom-element {
  -ms-backface-visibility: hidden;
}

.famous-dom-renderer {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.famous-webgl-renderer {
	display: none !important;
}


/*
.famous-dom-element-content {
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
}

.firefox * {
  backface-visibility: normal !important;
}

.chrome {
  -webkit-perspective: 1000;
  -webkit-backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
}

.safari {
	-webkit-transform:translate3d(0, 0, 0);
	transform:translate3d(0, 0, 0);
  -webkit-perspective: 1000;
}

.chrome .famous-dom-element-content {
	-webkit-transform: translate3d(0,0,0);
  -webkit-backface-visibility: hidden;
}*/

body.drag {
	cursor: move;
}

body .pointer {
	cursor: pointer;
}

.ad-wrapper {
	position: relative;
	overflow: hidden;
}

.famous-dom-renderer {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.plane-face-wrapper {
	position: relative;
}

a {
	text-decoration: none;
}
.ad-wrapper {
	background: black;
	width: 300px;
	height: 300px;
	top: 50%;
	position: relative;
	overflow: hidden;
	margin: -125px auto 0px auto;
}

.plane-face-wrapper {
	position: relative;
	margin: 0px 0px;
	width: 300px;
	height: 300px;
}

a {
	text-decoration: none;
}


.face-front-wrapper {
  background: #2ecc71;
}
.face-front-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000;
}

.face-left-wrapper {
  background: #f39c12;
}
.face-left-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000;
}

.face-back-wrapper {
  background: #9b59b6;
}
.face-back-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000;
}

.face-right-wrapper {
  background: #3498db;
}
.face-right-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000;
}.face-top-wrapper {
  background: #c0392b;
}
.face-top-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000;
}
.face-top-wrapper button {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 0px);
  -webkit-transform: translate(-50%, 0px);
}

.face-bottom-wrapper {
  background: #34495e;
}
.face-bottom-wrapper div {
  width: 100%; height: 100%; line-height: 3.5; color: black; text-align: center; font-size: 70px; border: 1px solid #000, color: white;
}
// autorotate cube in this order
var FACE_STEP = ['FRONT', 'LEFT', 'BACK', 'RIGHT', 'TOP'];
// var FACE_STEP = ['TOP'];

var CUBE_CONFIG = {
  cube_size: 300,
  camera_depth: 3000,
  transition_duration: 1500,
  face_wait: 2000,
  scale_back: .90,
  transition_scale: .75
};

!function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){(function(e){"use strict";if(t("core-js/shim"),t("regenerator/runtime"),e._babelPolyfill)throw new Error("only one instance of babel/polyfill is allowed");e._babelPolyfill=!0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"core-js/shim":164,"regenerator/runtime":165}],2:[function(t,e,n){e.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],3:[function(t,e,n){var i=t("./$.is-object");e.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},{"./$.is-object":32}],4:[function(t,e,n){var i=t("./$.to-object"),r=t("./$.to-length"),o=t("./$.to-index");e.exports=function(t){return function(e,n,s){var a,u=i(e),h=r(u.length),c=o(s,h);if(t&&n!=n){for(;h>c;)if(a=u[c++],a!=a)return!0}else for(;h>c;c++)if((t||c in u)&&u[c]===n)return t||c;return!t&&-1}}},{"./$.to-index":65,"./$.to-length":67,"./$.to-object":68}],5:[function(t,e,n){var i=t("./$.to-object"),r=t("./$.es5-object"),o=t("./$.ctx"),s=t("./$.to-length");e.exports=function(t){var e=1==t,n=2==t,a=3==t,u=4==t,h=6==t,c=5==t||h;return function(l,f,p){for(var d,m,g=i(l,!0),_=r(g),y=o(f,p,3),v=s(_.length),b=0,w=e?Array(v):n?[]:void 0;v>b;b++)if((c||b in _)&&(d=_[b],m=y(d,b,g),t))if(e)w[b]=m;else if(m)switch(t){case 3:return!0;case 5:return d;case 6:return b;case 2:w.push(d)}else if(u)return!1;return h?-1:a||u?u:w}}},{"./$.ctx":14,"./$.es5-object":19,"./$.to-length":67,"./$.to-object":68}],6:[function(t,e,n){var i=t("./$.to-object"),r=t("./$.es5-object"),o=t("./$.enum-keys");e.exports=Object.assign||function(t,e){for(var n=i(t,!0),s=arguments.length,a=1;s>a;)for(var u,h=r(arguments[a++]),c=o(h),l=c.length,f=0;l>f;)n[u=c[f++]]=h[u];return n}},{"./$.enum-keys":18,"./$.es5-object":19,"./$.to-object":68}],7:[function(t,e,n){var i=t("./$.cof"),r=t("./$.wks")("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=(e=Object(t))[r])?n:o?i(e):"Object"==(s=i(e))&&"function"==typeof e.callee?"Arguments":s}},{"./$.cof":8,"./$.wks":71}],8:[function(t,e,n){var i={}.toString;e.exports=function(t){return i.call(t).slice(8,-1)}},{}],9:[function(t,e,n){"use strict";function i(t,e){if(!m(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!d(t,p)){if(!g(t))return"F";if(!e)return"E";s(t,p,++v)}return"O"+t[p]}function r(t,e){var n,r=i(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n}var o=t("./$"),s=t("./$.hide"),a=t("./$.ctx"),u=t("./$.species"),h=t("./$.strict-new"),c=t("./$.defined"),l=t("./$.for-of"),f=t("./$.iter-step"),p=t("./$.uid")("id"),d=t("./$.has"),m=t("./$.is-object"),g=Object.isExtensible||m,_=t("./$.support-desc"),y=_?"_s":"size",v=0;e.exports={getConstructor:function(e,n,i,s){var u=e(function(t,e){h(t,u,n),t._i=o.create(null),t._f=void 0,t._l=void 0,t[y]=0,void 0!=e&&l(e,i,t[s],t)});return t("./$.mix")(u.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[y]=0},delete:function(t){var e=this,n=r(e,t);if(n){var i=n.n,o=n.p;delete e._i[n.i],n.r=!0,o&&(o.n=i),i&&(i.p=o),e._f==n&&(e._f=i),e._l==n&&(e._l=o),e[y]--}return!!n},forEach:function(t){for(var e,n=a(t,arguments[1],3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!r(this,t)}}),_&&o.setDesc(u.prototype,"size",{get:function(){return c(this[y])}}),u},def:function(t,e,n){var o,s,a=r(t,e);return a?a.v=n:(t._l=a={i:s=i(e,!0),k:e,v:n,p:o=t._l,n:void 0,r:!1},t._f||(t._f=a),o&&(o.n=a),t[y]++,"F"!==s&&(t._i[s]=a)),t},getEntry:r,setStrong:function(e,n,i){t("./$.iter-define")(e,n,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?f(0,n.k):"values"==e?f(0,n.v):f(0,[n.k,n.v]):(t._t=void 0,f(1))},i?"entries":"values",!i,!0),u(e),u(t("./$.core")[n])}}},{"./$":40,"./$.core":13,"./$.ctx":14,"./$.defined":16,"./$.for-of":23,"./$.has":26,"./$.hide":27,"./$.is-object":32,"./$.iter-define":36,"./$.iter-step":38,"./$.mix":43,"./$.species":55,"./$.strict-new":56,"./$.support-desc":61,"./$.uid":69}],10:[function(t,e,n){var i=t("./$.for-of"),r=t("./$.classof");e.exports=function(t){return function(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");var e=[];return i(this,!1,e.push,e),e}}},{"./$.classof":7,"./$.for-of":23}],11:[function(t,e,n){"use strict";function i(t){return t._l||(t._l=new r)}function r(){this.a=[]}function o(t,e){return m(t.a,function(t){return t[0]===e})}var s=t("./$.hide"),a=t("./$.an-object"),u=t("./$.strict-new"),h=t("./$.for-of"),c=t("./$.array-methods"),l=t("./$.uid")("weak"),f=t("./$.is-object"),p=t("./$.has"),d=Object.isExtensible||f,m=c(5),g=c(6),_=0;r.prototype={get:function(t){var e=o(this,t);return e?e[1]:void 0},has:function(t){return!!o(this,t)},set:function(t,e){var n=o(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=g(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(e,n,r,o){var s=e(function(t,e){u(t,s,n),t._i=_++,t._l=void 0,void 0!=e&&h(e,r,t[o],t)});return t("./$.mix")(s.prototype,{delete:function(t){return f(t)?d(t)?p(t,l)&&p(t[l],this._i)&&delete t[l][this._i]:i(this).delete(t):!1},has:function(t){return f(t)?d(t)?p(t,l)&&p(t[l],this._i):i(this).has(t):!1}}),s},def:function(t,e,n){return d(a(e))?(p(e,l)||s(e,l,{}),e[l][t._i]=n):i(t).set(e,n),t},frozenStore:i,WEAK:l}},{"./$.an-object":3,"./$.array-methods":5,"./$.for-of":23,"./$.has":26,"./$.hide":27,"./$.is-object":32,"./$.mix":43,"./$.strict-new":56,"./$.uid":69}],12:[function(t,e,n){"use strict";var i=t("./$.global"),r=t("./$.def"),o=t("./$.iter-buggy"),s=t("./$.for-of"),a=t("./$.strict-new");e.exports=function(e,n,u,h,c,l){function f(e){var n=g[e];t("./$.redef")(g,e,"delete"==e?function(t){return n.call(this,0===t?0:t)}:"has"==e?function(t){return n.call(this,0===t?0:t)}:"get"==e?function(t){return n.call(this,0===t?0:t)}:"add"==e?function(t){return n.call(this,0===t?0:t),this}:function(t,e){return n.call(this,0===t?0:t,e),this})}var p=i[e],d=p,m=c?"set":"add",g=d&&d.prototype,_={};if("function"==typeof d&&(l||!o&&g.forEach&&g.entries)){var y,v=new d,b=v[m](l?{}:-0,1);t("./$.iter-detect")(function(t){new d(t)})||(d=n(function(t,n){a(t,d,e);var i=new p;return void 0!=n&&s(n,c,i[m],i),i}),d.prototype=g,g.constructor=d),l||v.forEach(function(t,e){y=1/e===-(1/0)}),y&&(f("delete"),f("has"),c&&f("get")),(y||b!==v)&&f(m),l&&g.clear&&delete g.clear}else d=h.getConstructor(n,e,c,m),t("./$.mix")(d.prototype,u);return t("./$.tag")(d,e),_[e]=d,r(r.G+r.W+r.F*(d!=p),_),l||h.setStrong(d,e,c),d}},{"./$.def":15,"./$.for-of":23,"./$.global":25,"./$.iter-buggy":33,"./$.iter-detect":37,"./$.mix":43,"./$.redef":49,"./$.strict-new":56,"./$.tag":62}],13:[function(t,e,n){var i=e.exports={};"number"==typeof __e&&(__e=i)},{}],14:[function(t,e,n){var i=t("./$.a-function");e.exports=function(t,e,n){if(i(t),~n&&void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},{"./$.a-function":2}],15:[function(t,e,n){function i(t,e){return function(){return t.apply(e,arguments)}}function r(t,e,n){var c,l,f,p,d=t&r.G,m=t&r.P,g=d?o:t&r.S?o[e]||(o[e]={}):(o[e]||{})[h],_=d?s:s[e]||(s[e]={});d&&(n=e);for(c in n)l=!(t&r.F)&&g&&c in g,f=(l?g:n)[c],p=t&r.B&&l?i(f,o):m&&"function"==typeof f?i(Function.call,f):f,g&&!l&&u(g,c,f),_[c]!=f&&a(_,c,p),m&&((_[h]||(_[h]={}))[c]=f)}var o=t("./$.global"),s=t("./$.core"),a=t("./$.hide"),u=t("./$.redef"),h="prototype";o.core=s,r.F=1,r.G=2,r.S=4,r.P=8,r.B=16,r.W=32,e.exports=r},{"./$.core":13,"./$.global":25,"./$.hide":27,"./$.redef":49}],16:[function(t,e,n){e.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},{}],17:[function(t,e,n){var i=t("./$.is-object"),r=t("./$.global").document,o=i(r)&&i(r.createElement);e.exports=function(t){return o?r.createElement(t):{}}},{"./$.global":25,"./$.is-object":32}],18:[function(t,e,n){var i=t("./$");e.exports=function(t){var e=i.getKeys(t),n=i.isEnum,r=i.getSymbols;if(r)for(var o,s=r(t),a=0;s.length>a;)n.call(t,o=s[a++])&&e.push(o);return e}},{"./$":40}],19:[function(t,e,n){var i=t("./$.cof"),r=Object;e.exports=0 in r("z")?r:function(t){return"String"==i(t)?t.split(""):r(t)}},{"./$.cof":8}],20:[function(t,e,n){e.exports=Math.expm1||function(t){return 0==(t=+t)?t:t>-1e-6&&1e-6>t?t+t*t/2:Math.exp(t)-1}},{}],21:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=t("./$.wks")(e),o=""[e];(function(){try{var t={};return t[r]=function(){return 7},7!=""[e](t)}catch(t){return!0}})()&&(t("./$.redef")(String.prototype,e,i(r,o)),t("./$.hide")(RegExp.prototype,r,2==n?function(t,e){return o.call(t,this,e)}:function(t){return o.call(t,this)}))}},{"./$.hide":27,"./$.redef":49,"./$.wks":71}],22:[function(t,e,n){var i=t("./$.an-object");e.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},{"./$.an-object":3}],23:[function(t,e,n){var i=t("./$.ctx"),r=t("./$.iter-call"),o=t("./$.is-array-iter"),s=t("./$.an-object"),a=t("./$.to-length"),u=t("./core.get-iterator-method");e.exports=function(t,e,n,h){var c,l,f,p=u(t),d=i(n,h,e?2:1),m=0;if("function"!=typeof p)throw TypeError(t+" is not iterable!");if(o(p))for(c=a(t.length);c>m;m++)e?d(s(l=t[m])[0],l[1]):d(t[m]);else for(f=p.call(t);!(l=f.next()).done;)r(f,d,l.value,e)}},{"./$.an-object":3,"./$.ctx":14,"./$.is-array-iter":30,"./$.iter-call":34,"./$.to-length":67,"./core.get-iterator-method":72}],24:[function(t,e,n){function i(t){try{return s(t)}catch(t){return a.slice()}}var r={}.toString,o=t("./$.to-object"),s=t("./$").getNames,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.get=function(t){return a&&"[object Window]"==r.call(t)?i(t):s(o(t))}},{"./$":40,"./$.to-object":68}],25:[function(t,e,n){var i="undefined"!=typeof self&&self.Math==Math?self:Function("return this")();e.exports=i,"number"==typeof __g&&(__g=i)},{}],26:[function(t,e,n){var i={}.hasOwnProperty;e.exports=function(t,e){return i.call(t,e)}},{}],27:[function(t,e,n){var i=t("./$"),r=t("./$.property-desc");e.exports=t("./$.support-desc")?function(t,e,n){return i.setDesc(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},{"./$":40,"./$.property-desc":48,"./$.support-desc":61}],28:[function(t,e,n){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":25}],29:[function(t,e,n){e.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);case 5:return i?t(e[0],e[1],e[2],e[3],e[4]):t.call(n,e[0],e[1],e[2],e[3],e[4])}return t.apply(n,e)}},{}],30:[function(t,e,n){var i=t("./$.iterators"),r=t("./$.wks")("iterator");e.exports=function(t){return("Array"in i?i.Array:Array.prototype[r])===t}},{"./$.iterators":39,"./$.wks":71}],31:[function(t,e,n){var i=t("./$.is-object"),r=Math.floor;e.exports=function(t){return!i(t)&&isFinite(t)&&r(t)===t}},{"./$.is-object":32}],32:[function(t,e,n){e.exports=function(t){return null!==t&&("object"==typeof t||"function"==typeof t)}},{}],33:[function(t,e,n){e.exports="keys"in[]&&!("next"in[].keys())},{}],34:[function(t,e,n){function i(t){var e=t.return;void 0!==e&&r(e.call(t))}var r=t("./$.an-object");e.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){throw i(t),e}}},{"./$.an-object":3}],35:[function(t,e,n){"use strict";var i=t("./$"),r={};t("./$.hide")(r,t("./$.wks")("iterator"),function(){return this}),e.exports=function(e,n,o){e.prototype=i.create(r,{next:t("./$.property-desc")(1,o)}),t("./$.tag")(e,n+" Iterator")}},{"./$":40,"./$.hide":27,"./$.property-desc":48,"./$.tag":62,"./$.wks":71}],36:[function(t,e,n){"use strict";function i(){return this}var r=t("./$.library"),o=t("./$.def"),s=t("./$.redef"),a=t("./$.hide"),u=t("./$.has"),h=t("./$.wks")("iterator"),c=t("./$.iterators"),l="@@iterator",f="keys",p="values";e.exports=function(e,n,d,m,g,_,y){function v(t){switch(t){case f:return function(){return new d(this,t)};case p:return function(){return new d(this,t)}}return function(){return new d(this,t)}}t("./$.iter-create")(d,n,m);var b,w,T=n+" Iterator",E=e.prototype,S=E[h]||E[l]||g&&E[g],x=S||v(g);if(S){var O=t("./$").getProto(x.call(new e));t("./$.tag")(O,T,!0),!r&&u(E,l)&&a(O,h,i)}if((!r||y)&&a(E,h,x),c[n]=x,c[T]=i,g)if(b={keys:_?x:v(f),values:g==p?x:v(p),entries:g!=p?x:v("entries")},y)for(w in b)w in E||s(E,w,b[w]);else o(o.P+o.F*t("./$.iter-buggy"),n,b)}},{"./$":40,"./$.def":15,"./$.has":26,"./$.hide":27,"./$.iter-buggy":33,"./$.iter-create":35,"./$.iterators":39,"./$.library":42,"./$.redef":49,"./$.tag":62,"./$.wks":71}],37:[function(t,e,n){var i=t("./$.wks")("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,function(){throw 2})}catch(t){}e.exports=function(t){if(!r)return!1;var e=!1;try{var n=[7],o=n[i]();o.next=function(){e=!0},n[i]=function(){return o},t(n)}catch(t){}return e}},{"./$.wks":71}],38:[function(t,e,n){e.exports=function(t,e){return{value:e,done:!!t}}},{}],39:[function(t,e,n){e.exports={}},{}],40:[function(t,e,n){var i=Object;e.exports={create:i.create,getProto:i.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:i.getOwnPropertyDescriptor,setDesc:i.defineProperty,setDescs:i.defineProperties,getKeys:i.keys,getNames:i.getOwnPropertyNames,getSymbols:i.getOwnPropertySymbols,each:[].forEach}},{}],41:[function(t,e,n){var i=t("./$"),r=t("./$.to-object");e.exports=function(t,e){for(var n,o=r(t),s=i.getKeys(o),a=s.length,u=0;a>u;)if(o[n=s[u++]]===e)return n}},{"./$":40,"./$.to-object":68}],42:[function(t,e,n){e.exports=!1},{}],43:[function(t,e,n){var i=t("./$.redef");e.exports=function(t,e){for(var n in e)i(t,n,e[n]);return t}},{"./$.redef":49}],44:[function(t,e,n){var i=t("./$"),r=t("./$.to-object");e.exports=function(t){return function(e){var n,o=r(e),s=i.getKeys(o),a=s.length,u=0,h=Array(a);if(t)for(;a>u;)h[u]=[n=s[u++],o[n]];else for(;a>u;)h[u]=o[s[u++]];return h}}},{"./$":40,"./$.to-object":68}],45:[function(t,e,n){var i=t("./$"),r=t("./$.an-object");e.exports=function(t){var e=i.getNames(r(t)),n=i.getSymbols;return n?e.concat(n(t)):e}},{"./$":40,"./$.an-object":3}],46:[function(t,e,n){"use strict";var i=t("./$.path"),r=t("./$.invoke"),o=t("./$.a-function");e.exports=function(){for(var t=o(this),e=arguments.length,n=Array(e),s=0,a=i._,u=!1;e>s;)(n[s]=arguments[s++])===a&&(u=!0);return function(){var i,o=this,s=arguments.length,h=0,c=0;if(!u&&!s)return r(t,n,o);if(i=n.slice(),u)for(;e>h;h++)i[h]===a&&(i[h]=arguments[c++]);for(;s>c;)i.push(arguments[c++]);return r(t,i,o)}}},{"./$.a-function":2,"./$.invoke":29,"./$.path":47}],47:[function(t,e,n){e.exports=t("./$.global")},{"./$.global":25}],48:[function(t,e,n){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],49:[function(t,e,n){function i(t,e,n,i){if("function"==typeof n){var o=t[e];s(n,u,o?String(o):a.replace(/hasOwnProperty/,String(e))),"name"in n||(n.name=e)}t===r?t[e]=n:(i||delete t[e],s(t,e,n))}var r=t("./$.global"),o=t("./$.has"),s=t("./$.hide"),a=String({}.hasOwnProperty),u=t("./$.uid")("src"),h=Function.toString;i(Function.prototype,"toString",function(){return o(this,u)?this[u]:h.call(this)}),t("./$.core").inspectSource=function(t){return h.call(t)},e.exports=i},{"./$.core":13,"./$.global":25,"./$.has":26,"./$.hide":27,"./$.uid":69}],50:[function(t,e,n){e.exports=function(t,e){var n=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,n)}}},{}],51:[function(t,e,n){e.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},{}],52:[function(t,e,n){function i(t,e){if(s(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")}var r=t("./$").getDesc,o=t("./$.is-object"),s=t("./$.an-object");e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n){try{(n=t("./$.ctx")(Function.call,r(Object.prototype,"__proto__").set,2))({},[])}catch(t){e=!0}return function(t,r){return i(t,r),e?t.__proto__=r:n(t,r),t}}():void 0),check:i}},{"./$":40,"./$.an-object":3,"./$.ctx":14,"./$.is-object":32}],53:[function(t,e,n){var i=t("./$.global"),r="__core-js_shared__",o=i[r]||(i[r]={});e.exports=function(t){return o[t]||(o[t]={})}},{"./$.global":25}],54:[function(t,e,n){e.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1}},{}],55:[function(t,e,n){var i=t("./$"),r=t("./$.wks")("species");e.exports=function(e){!t("./$.support-desc")||r in e||i.setDesc(e,r,{configurable:!0,get:function(){return this}})}},{"./$":40,"./$.support-desc":61,"./$.wks":71}],56:[function(t,e,n){e.exports=function(t,e,n){if(!(t instanceof e))throw TypeError(n+": use the 'new' operator!");return t}},{}],57:[function(t,e,n){var i=t("./$.to-integer"),r=t("./$.defined");e.exports=function(t){return function(e,n){var o,s,a=String(r(e)),u=i(n),h=a.length;return 0>u||u>=h?t?"":void 0:(o=a.charCodeAt(u),55296>o||o>56319||u+1===h||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):(o-55296<<10)+(s-56320)+65536)}}},{"./$.defined":16,"./$.to-integer":66}],58:[function(t,e,n){var i=t("./$.defined"),r=t("./$.cof");e.exports=function(t,e,n){if("RegExp"==r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},{"./$.cof":8,"./$.defined":16}],59:[function(t,e,n){var i=t("./$.to-integer"),r=t("./$.string-repeat"),o=t("./$.defined");e.exports=function(t,e,n,s){var a=String(o(t));if(void 0===e)return a;var u=i(e),h=u-a.length;if(0>h||h===1/0)throw new RangeError("Cannot satisfy string length "+e+" for string: "+a);var c=void 0===n?" ":String(n),l=r.call(c,Math.ceil(h/c.length));return l.length>h&&(l=s?l.slice(l.length-h):l.slice(0,h)),s?l.concat(a):a.concat(l)}},{"./$.defined":16,"./$.string-repeat":60,"./$.to-integer":66}],60:[function(t,e,n){"use strict";var i=t("./$.to-integer"),r=t("./$.defined");e.exports=function(t){var e=String(r(this)),n="",o=i(t);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},{"./$.defined":16,"./$.to-integer":66}],61:[function(t,e,n){e.exports=!!function(){try{return 2==Object.defineProperty({},"a",{get:function(){return 2}}).a}catch(t){}}()},{}],62:[function(t,e,n){var i=t("./$.has"),r=t("./$.hide"),o=t("./$.wks")("toStringTag");e.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,e)}},{"./$.has":26,"./$.hide":27,"./$.wks":71}],63:[function(t,e,n){"use strict";function i(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}}function r(t){i.call(t.data)}var o,s,a,u=t("./$.ctx"),h=t("./$.invoke"),c=t("./$.html"),l=t("./$.dom-create"),f=t("./$.global"),p=f.process,d=f.setImmediate,m=f.clearImmediate,g=f.MessageChannel,_=0,y={},v="onreadystatechange";d&&m||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++_]=function(){h("function"==typeof t?t:Function(t),e)},o(_),_},m=function(t){delete y[t]},"process"==t("./$.cof")(p)?o=function(t){p.nextTick(u(i,t,1))}:f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(o=function(t){f.postMessage(t,"*")},f.addEventListener("message",r,!1)):g?(s=new g,a=s.port2,s.port1.onmessage=r,o=u(a.postMessage,a,1)):o=v in l("script")?function(t){c.appendChild(l("script"))[v]=function(){c.removeChild(this),i.call(t)}}:function(t){setTimeout(u(i,t,1),0)}),e.exports={set:d,clear:m}},{"./$.cof":8,"./$.ctx":14,"./$.dom-create":17,"./$.global":25,"./$.html":28,"./$.invoke":29}],64:[function(t,e,n){e.exports=function(t){try{return t(),!1}catch(t){return!0}}},{}],65:[function(t,e,n){var i=t("./$.to-integer"),r=Math.max,o=Math.min;e.exports=function(t,e){return t=i(t),0>t?r(t+e,0):o(t,e)}},{"./$.to-integer":66}],66:[function(t,e,n){var i=Math.ceil,r=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?r:i)(t)}},{}],67:[function(t,e,n){var i=t("./$.to-integer"),r=Math.min;e.exports=function(t){return t>0?r(i(t),9007199254740991):0}},{"./$.to-integer":66}],68:[function(t,e,n){var i=t("./$.es5-object"),r=t("./$.defined");e.exports=function(t,e){return(e?Object:i)(r(t))}},{"./$.defined":16,"./$.es5-object":19}],69:[function(t,e,n){var i=0,r=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+r).toString(36))}},{}],70:[function(t,e,n){var i=t("./$.wks")("unscopables");i in[]||t("./$.hide")(Array.prototype,i,{}),e.exports=function(t){[][i][t]=!0}},{"./$.hide":27,"./$.wks":71}],71:[function(t,e,n){var i=t("./$.shared")("wks"),r=t("./$.global").Symbol;e.exports=function(e){return i[e]||(i[e]=r&&r[e]||(r||t("./$.uid"))("Symbol."+e))}},{"./$.global":25,"./$.shared":53,"./$.uid":69}],72:[function(t,e,n){var i=t("./$.global"),r=t("./$.classof"),o=t("./$.wks")("iterator"),s=t("./$.iterators");e.exports=t("./$.core").getIteratorMethod=function(t){var e=i.Symbol;return void 0!=t?t[e&&e.iterator||"@@iterator"]||t[o]||s[r(t)]:void 0}},{"./$.classof":7,"./$.core":13,"./$.global":25,"./$.iterators":39,"./$.wks":71}],73:[function(t,e,n){function i(t,e){return function(n){var i,r=T(n),o=0,s=[];for(i in r)i!=y&&p(r,i)&&s.push(i);for(;e>o;)p(r,i=t[o++])&&(~z(s,i)||s.push(i));return s}}function r(){}function o(t,e,n){if(!(e in G)){for(var i=[],r=0;e>r;r++)i[r]="a["+r+"]";G[e]=Function("F,a","return new F("+i.join(",")+")")}return G[e](t,n)}function s(t){return function(e,n){w(e);var i=T(this),r=x(i.length),o=t?r-1:0,s=t?-1:1;if(arguments.length<2)for(;;){if(o in i){n=i[o],o+=s;break}if(o+=s,t?0>o:o>=r)throw TypeError("Reduce of empty array with no initial value")}for(;t?o>=0:r>o;o+=s)o in i&&(n=e(n,i[o],o,this));return n}}function a(t){return t>9?t:"0"+t}var u=t("./$"),h=t("./$.support-desc"),c=t("./$.property-desc"),l=t("./$.html"),f=t("./$.dom-create"),p=t("./$.has"),d=t("./$.cof"),m=t("./$.def"),g=t("./$.invoke"),_=t("./$.array-methods"),y=t("./$.uid")("__proto__"),v=t("./$.is-object"),b=t("./$.an-object"),w=t("./$.a-function"),T=t("./$.to-object"),E=t("./$.to-integer"),S=t("./$.to-index"),x=t("./$.to-length"),O=t("./$.es5-object"),C=Object.prototype,$=[],R=$.slice,I=$.join,A=u.setDesc,N=u.getDesc,M=u.setDescs,L=!1,z=t("./$.array-includes")(!1),P=_(0),D=_(1),U=_(2),F=_(3),k=_(4),G={},H=t("./$.replacer")(/^\s*([\s\S]*\S)?\s*$/,"$1");if(!h){try{L=8==A(f("div"),"x",{get:function(){return 8}}).x}catch(t){}u.setDesc=function(t,e,n){if(L)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(b(t)[e]=n.value),t},u.getDesc=function(t,e){if(L)try{return N(t,e)}catch(t){}return p(t,e)?c(!C.propertyIsEnumerable.call(t,e),t[e]):void 0},u.setDescs=M=function(t,e){b(t);for(var n,i=u.getKeys(e),r=i.length,o=0;r>o;)u.setDesc(t,n=i[o++],e[n]);return t}}m(m.S+m.F*!h,"Object",{getOwnPropertyDescriptor:u.getDesc,defineProperty:u.setDesc,defineProperties:M});var j="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),q=j.concat("length","prototype"),B=j.length,V=function(){var t,e=f("iframe"),n=B,i=">";for(e.style.display="none",l.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object</script"+i),t.close(),V=t.F;n--;)delete V.prototype[j[n]];return V()};m(m.S,"Object",{getPrototypeOf:u.getProto=u.getProto||function(t){return t=T(t,!0),p(t,y)?t[y]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?C:null},getOwnPropertyNames:u.getNames=u.getNames||i(q,q.length,!0),create:u.create=u.create||function(t,e){var n;return null!==t?(r.prototype=b(t),n=new r,r.prototype=null,n[y]=t):n=V(),void 0===e?n:M(n,e)},keys:u.getKeys=u.getKeys||i(j,B,!1),seal:function(t){return t},freeze:function(t){return t},preventExtensions:function(t){return t},isSealed:function(t){return!v(t)},isFrozen:function(t){return!v(t)},isExtensible:function(t){return v(t)}}),m(m.P,"Function",{bind:function(t){function e(){var r=i.concat(R.call(arguments));return this instanceof e?o(n,r.length,r):g(n,r,t)}var n=w(this),i=R.call(arguments,1);return v(n.prototype)&&(e.prototype=n.prototype),e}});var W=!0;try{l&&R.call(l),W=!1}catch(t){}m(m.P+m.F*W,"Array",{slice:function(t,e){var n=x(this.length),i=d(this);if(e=void 0===e?n:e,"Array"==i)return R.call(this,t,e);for(var r=S(t,n),o=S(e,n),s=x(o-r),a=Array(s),u=0;s>u;u++)a[u]="String"==i?this.charAt(r+u):this[r+u];return a}}),m(m.P+m.F*(O!=Object),"Array",{join:function(){return I.apply(O(this),arguments)}}),m(m.S,"Array",{isArray:function(t){return"Array"==d(t)}}),m(m.P,"Array",{forEach:u.each=u.each||function(t){return P(this,t,arguments[1])},map:function(t){return D(this,t,arguments[1])},filter:function(t){return U(this,t,arguments[1])},some:function(t){return F(this,t,arguments[1])},every:function(t){return k(this,t,arguments[1])},reduce:s(!1),reduceRight:s(!0),indexOf:function(t){return z(this,t,arguments[1])},lastIndexOf:function(t,e){var n=T(this),i=x(n.length),r=i-1;for(arguments.length>1&&(r=Math.min(r,E(e))),0>r&&(r=x(i+r));r>=0;r--)if(r in n&&n[r]===t)return r;return-1}}),m(m.P,"String",{trim:function(){return H(this)}}),m(m.S,"Date",{now:function(){return+new Date}});var Y=new Date(-5e13-1),Q=!(Y.toISOString&&"0385-07-25T07:06:39.999Z"==Y.toISOString()&&t("./$.throws")(function(){new Date(NaN).toISOString()}));m(m.P+m.F*Q,"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),i=0>e?"-":e>9999?"+":"";return i+("00000"+Math.abs(e)).slice(i?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}})},{"./$":40,"./$.a-function":2,"./$.an-object":3,"./$.array-includes":4,"./$.array-methods":5,"./$.cof":8,"./$.def":15,"./$.dom-create":17,"./$.es5-object":19,"./$.has":26,"./$.html":28,"./$.invoke":29,"./$.is-object":32,"./$.property-desc":48,"./$.replacer":50,"./$.support-desc":61,"./$.throws":64,"./$.to-index":65,"./$.to-integer":66,"./$.to-length":67,"./$.to-object":68,"./$.uid":69}],74:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.to-object"),o=t("./$.to-index"),s=t("./$.to-length");i(i.P,"Array",{copyWithin:function(t,e){var n=r(this,!0),i=s(n.length),a=o(t,i),u=o(e,i),h=arguments[2],c=void 0===h?i:o(h,i),l=Math.min(c-u,i-a),f=1;for(a>u&&u+l>a&&(f=-1,u=u+l-1,a=a+l-1);l-->0;)u in n?n[a]=n[u]:delete n[a],a+=f,u+=f;return n}}),t("./$.unscope")("copyWithin")},{"./$.def":15,"./$.to-index":65,"./$.to-length":67,"./$.to-object":68,"./$.unscope":70}],75:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.to-object"),o=t("./$.to-index"),s=t("./$.to-length");i(i.P,"Array",{fill:function(t){for(var e=r(this,!0),n=s(e.length),i=o(arguments[1],n),a=arguments[2],u=void 0===a?n:o(a,n);u>i;)e[i++]=t;return e}}),t("./$.unscope")("fill")},{"./$.def":15,"./$.to-index":65,"./$.to-length":67,"./$.to-object":68,"./$.unscope":70}],76:[function(t,e,n){"use strict";var i="findIndex",r=t("./$.def"),o=!0,s=t("./$.array-methods")(6);i in[]&&Array(1)[i](function(){o=!1}),r(r.P+r.F*o,"Array",{findIndex:function(t){return s(this,t,arguments[1])}}),t("./$.unscope")(i)},{"./$.array-methods":5,"./$.def":15,"./$.unscope":70}],77:[function(t,e,n){"use strict";var i="find",r=t("./$.def"),o=!0,s=t("./$.array-methods")(5);i in[]&&Array(1)[i](function(){o=!1}),r(r.P+r.F*o,"Array",{find:function(t){return s(this,t,arguments[1])}}),t("./$.unscope")(i)},{"./$.array-methods":5,"./$.def":15,"./$.unscope":70}],78:[function(t,e,n){var i=t("./$.ctx"),r=t("./$.def"),o=t("./$.to-object"),s=t("./$.iter-call"),a=t("./$.is-array-iter"),u=t("./$.to-length"),h=t("./core.get-iterator-method");r(r.S+r.F*!t("./$.iter-detect")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,r,c,l=o(t,!0),f="function"==typeof this?this:Array,p=arguments[1],d=void 0!==p,m=0,g=h(l);if(d&&(p=i(p,arguments[2],2)),void 0==g||f==Array&&a(g))for(n=new f(e=u(l.length));e>m;m++)n[m]=d?p(l[m],m):l[m];else for(c=g.call(l),n=new f;!(r=c.next()).done;m++)n[m]=d?s(c,p,[r.value,m],!0):r.value;return n.length=m,n}})},{"./$.ctx":14,"./$.def":15,"./$.is-array-iter":30,"./$.iter-call":34,"./$.iter-detect":37,"./$.to-length":67,"./$.to-object":68,"./core.get-iterator-method":72}],79:[function(t,e,n){var i=t("./$.unscope"),r=t("./$.iter-step"),o=t("./$.iterators"),s=t("./$.to-object");t("./$.iter-define")(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},{"./$.iter-define":36,"./$.iter-step":38,"./$.iterators":39,"./$.to-object":68,"./$.unscope":70}],80:[function(t,e,n){var i=t("./$.def");i(i.S,"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)n[t]=arguments[t++];return n.length=e,n}})},{"./$.def":15}],81:[function(t,e,n){t("./$.species")(Array)},{"./$.species":55}],82:[function(t,e,n){var i=t("./$"),r=t("./$.is-object"),o=t("./$.wks")("hasInstance"),s=Function.prototype;o in s||i.setDesc(s,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i.getProto(t);)if(this.prototype===t)return!0;return!1}})},{"./$":40,"./$.is-object":32,"./$.wks":71}],83:[function(t,e,n){"use strict";var i=t("./$"),r=t("./$.has"),o=t("./$.property-desc"),s=i.setDesc,a=Function.prototype,u="name";u in a||t("./$.support-desc")&&s(a,u,{configurable:!0,get:function(){var t=String(this).match(/^\s*function ([^ (]*)/),e=t?t[1]:"";return r(this,u)||s(this,u,o(5,e)),e},set:function(t){r(this,u)||s(this,u,o(0,t))}})},{"./$":40,"./$.has":26,"./$.property-desc":48,"./$.support-desc":61}],84:[function(t,e,n){"use strict";var i=t("./$.collection-strong");t("./$.collection")("Map",function(t){return function(){return t(this,arguments[0])}},{get:function(t){var e=i.getEntry(this,t);return e&&e.v},set:function(t,e){return i.def(this,0===t?0:t,e)}},i,!0)},{"./$.collection":12,"./$.collection-strong":9}],85:[function(t,e,n){var i=t("./$.def"),r=Math.E,o=Math.sqrt;i(i.S,"Math",{acosh:function(t){return(t=+t)<1?NaN:isFinite(t)?Math.log(t/r+o(t+1)*o(t-1)/r)+1:t}})},{"./$.def":15}],86:[function(t,e,n){function i(t){return isFinite(t=+t)&&0!=t?0>t?-i(-t):Math.log(t+Math.sqrt(t*t+1)):t}var r=t("./$.def");r(r.S,"Math",{asinh:i})},{"./$.def":15}],87:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{"./$.def":15}],88:[function(t,e,n){var i=t("./$.def"),r=t("./$.sign");i(i.S,"Math",{cbrt:function(t){return r(t=+t)*Math.pow(Math.abs(t),1/3)}})},{"./$.def":15,"./$.sign":54}],89:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{"./$.def":15}],90:[function(t,e,n){var i=t("./$.def"),r=Math.exp;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},{"./$.def":15}],91:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{expm1:t("./$.expm1")})},{"./$.def":15,"./$.expm1":20}],92:[function(t,e,n){function i(t){return t+1/a-1/a}var r=t("./$.def"),o=t("./$.sign"),s=Math.pow,a=s(2,-52),u=s(2,-23),h=s(2,127)*(2-u),c=s(2,-126);
r(r.S,"Math",{fround:function(t){var e,n,r=Math.abs(t),s=o(t);return c>r?s*i(r/c/u)*c*u:(e=(1+u/a)*r,n=e-(e-r),n>h||n!=n?s*(1/0):s*n)}})},{"./$.def":15,"./$.sign":54}],93:[function(t,e,n){var i=t("./$.def"),r=Math.abs;i(i.S,"Math",{hypot:function(t,e){for(var n,i,o=0,s=0,a=arguments.length,u=0;a>s;)n=r(arguments[s++]),n>u?(i=u/n,o=o*i*i+1,u=n):n>0?(i=n/u,o+=i*i):o+=n;return u===1/0?1/0:u*Math.sqrt(o)}})},{"./$.def":15}],94:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{imul:function(t,e){var n=65535,i=+t,r=+e,o=n&i,s=n&r;return 0|o*s+((n&i>>>16)*s+o*(n&r>>>16)<<16>>>0)}})},{"./$.def":15}],95:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},{"./$.def":15}],96:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{log1p:function(t){return(t=+t)>-1e-8&&1e-8>t?t-t*t/2:Math.log(1+t)}})},{"./$.def":15}],97:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},{"./$.def":15}],98:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{sign:t("./$.sign")})},{"./$.def":15,"./$.sign":54}],99:[function(t,e,n){var i=t("./$.def"),r=t("./$.expm1"),o=Math.exp;i(i.S,"Math",{sinh:function(t){return Math.abs(t=+t)<1?(r(t)-r(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{"./$.def":15,"./$.expm1":20}],100:[function(t,e,n){var i=t("./$.def"),r=t("./$.expm1"),o=Math.exp;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},{"./$.def":15,"./$.expm1":20}],101:[function(t,e,n){var i=t("./$.def");i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},{"./$.def":15}],102:[function(t,e,n){"use strict";function i(t){var e,n;if("function"==typeof(e=t.valueOf)&&!h(n=e.call(t)))return n;if("function"==typeof(e=t.toString)&&!h(n=e.call(t)))return n;throw TypeError("Can't convert object to number")}function r(t){if(h(t)&&(t=i(t)),"string"==typeof t&&t.length>2&&48==t.charCodeAt(0)){var e=!1;switch(t.charCodeAt(1)){case 66:case 98:e=!0;case 79:case 111:return parseInt(t.slice(2),e?2:8)}}return+t}var o=t("./$"),s=t("./$.global"),a=t("./$.has"),u=t("./$.cof"),h=t("./$.is-object"),c="Number",l=s[c],f=l,p=l.prototype,d=u(o.create(p))==c?function(t){try{return p.valueOf.call(t),!1}catch(t){return!0}}:function(t){return u(t)!=c};l("0o1")&&l("0b1")||(l=function(t){return this instanceof l&&d(this)?new f(r(t)):r(t)},o.each.call(t("./$.support-desc")?o.getNames(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(t){a(f,t)&&!a(l,t)&&o.setDesc(l,t,o.getDesc(f,t))}),l.prototype=p,p.constructor=l,t("./$.redef")(s,c,l))},{"./$":40,"./$.cof":8,"./$.global":25,"./$.has":26,"./$.is-object":32,"./$.redef":49,"./$.support-desc":61}],103:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},{"./$.def":15}],104:[function(t,e,n){var i=t("./$.def"),r=t("./$.global").isFinite;i(i.S,"Number",{isFinite:function(t){return"number"==typeof t&&r(t)}})},{"./$.def":15,"./$.global":25}],105:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{isInteger:t("./$.is-integer")})},{"./$.def":15,"./$.is-integer":31}],106:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{isNaN:function(t){return t!=t}})},{"./$.def":15}],107:[function(t,e,n){var i=t("./$.def"),r=t("./$.is-integer"),o=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},{"./$.def":15,"./$.is-integer":31}],108:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./$.def":15}],109:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{"./$.def":15}],110:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{parseFloat:parseFloat})},{"./$.def":15}],111:[function(t,e,n){var i=t("./$.def");i(i.S,"Number",{parseInt:parseInt})},{"./$.def":15}],112:[function(t,e,n){var i=t("./$.def");i(i.S,"Object",{assign:t("./$.assign")})},{"./$.assign":6,"./$.def":15}],113:[function(t,e,n){var i=t("./$.def");i(i.S,"Object",{is:t("./$.same")})},{"./$.def":15,"./$.same":51}],114:[function(t,e,n){var i=t("./$.def");i(i.S,"Object",{setPrototypeOf:t("./$.set-proto").set})},{"./$.def":15,"./$.set-proto":52}],115:[function(t,e,n){var i=t("./$"),r=t("./$.core"),o=t("./$.def"),s=t("./$.to-object"),a=t("./$.is-object");i.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(e,n){var i=(r.Object||{})[e]||Object[e],u=0,h={};h[e]=0==n?function(t){return a(t)?i(t):t}:1==n?function(t){return a(t)?i(t):t}:2==n?function(t){return a(t)?i(t):t}:3==n?function(t){return a(t)?i(t):!0}:4==n?function(t){return a(t)?i(t):!0}:5==n?function(t){return a(t)?i(t):!1}:6==n?function(t,e){return i(s(t),e)}:7==n?function(t){return i(s(t,!0))}:8==n?function(t){return i(s(t))}:t("./$.get-names").get;try{i("z")}catch(t){u=1}o(o.S+o.F*u,"Object",h)})},{"./$":40,"./$.core":13,"./$.def":15,"./$.get-names":24,"./$.is-object":32,"./$.to-object":68}],116:[function(t,e,n){"use strict";var i=t("./$.classof"),r={};r[t("./$.wks")("toStringTag")]="z",r+""!="[object z]"&&t("./$.redef")(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},{"./$.classof":7,"./$.redef":49,"./$.wks":71}],117:[function(t,e,n){"use strict";function i(t){var e=new M(function(){});return t&&(e.constructor=Object),M.resolve(e)===e}function r(t){return v(t)&&(L?"Promise"==_(t):$ in t)}function o(t,e){return d&&t===M&&e===f?!0:x(t,e)}function s(t){var e=b(t)[C];return void 0!=e?e:t}function a(t){var e;return v(t)&&"function"==typeof(e=t.then)?e:!1}function u(t,e){if(!t.n){t.n=!0;var n=t.c;N.call(m,function(){function i(e){var n,i,s=o?e.ok:e.fail;try{s?(o||(t.h=!0),n=s===!0?r:s(r),n===e.P?e.rej(TypeError("Promise-chain cycle")):(i=a(n))?i.call(n,e.res,e.rej):e.res(n)):e.rej(r)}catch(t){e.rej(t)}}for(var r=t.v,o=1==t.s,s=0;n.length>s;)i(n[s++]);n.length=0,t.n=!1,e&&setTimeout(function(){N.call(m,function(){h(t.p)&&(A?I.emit("unhandledRejection",r,t.p):m.console&&console.error&&console.error("Unhandled promise rejection",r)),t.a=void 0})},1)})}}function h(t){var e,n=t[$],i=n.a||n.c,r=0;if(n.h)return!1;for(;i.length>r;)if(e=i[r++],e.fail||!h(e.P))return!1;return!0}function c(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),u(e,!0))}function l(t){var e,n=this;if(!n.d){n.d=!0,n=n.r||n;try{(e=a(t))?N.call(m,function(){var i={r:n,d:!1};try{e.call(t,g(l,i,1),g(c,i,1))}catch(t){c.call(i,t)}}):(n.v=t,n.s=1,u(n,!1))}catch(t){c.call({r:n,d:!1},t)}}}var f,p=t("./$"),d=t("./$.library"),m=t("./$.global"),g=t("./$.ctx"),_=t("./$.classof"),y=t("./$.def"),v=t("./$.is-object"),b=t("./$.an-object"),w=t("./$.a-function"),T=t("./$.strict-new"),E=t("./$.for-of"),S=t("./$.set-proto").set,x=t("./$.same"),O=t("./$.species"),C=t("./$.wks")("species"),$=t("./$.uid")("record"),R="Promise",I=m.process,A="process"==_(I),N=I&&I.nextTick||t("./$.task").set,M=m[R],L=function(){function e(t){var n=new M(t);return S(n,e.prototype),n}var n=!1;try{if(n=M&&M.resolve&&i(),S(e,M),e.prototype=p.create(M.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(n=!1),n&&t("./$.support-desc")){var r=!1;M.resolve(p.setDesc({},"then",{get:function(){r=!0}})),n=r}}catch(t){n=!1}return n}();L||(M=function(t){w(t);var e={p:T(this,M,R),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};this[$]=e;try{t(g(l,e,1),g(c,e,1))}catch(t){c.call(e,t)}},t("./$.mix")(M.prototype,{then:function(t,e){var n=b(b(this).constructor)[C],i={ok:"function"==typeof t?t:!0,fail:"function"==typeof e?e:!1},r=i.P=new(void 0!=n?n:M)(function(t,e){i.res=w(t),i.rej=w(e)}),o=this[$];return o.c.push(i),o.a&&o.a.push(i),o.s&&u(o,!1),r},catch:function(t){return this.then(void 0,t)}})),y(y.G+y.W+y.F*!L,{Promise:M}),t("./$.tag")(M,R),O(M),O(f=t("./$.core")[R]),y(y.S+y.F*!L,R,{reject:function(t){return new this(function(e,n){n(t)})}}),y(y.S+y.F*(!L||i(!0)),R,{resolve:function(t){return r(t)&&o(t.constructor,this)?t:new this(function(e){e(t)})}}),y(y.S+y.F*!(L&&t("./$.iter-detect")(function(t){M.all(t).catch(function(){})})),R,{all:function(t){var e=s(this),n=[];return new e(function(i,r){E(t,!1,n.push,n);var o=n.length,s=Array(o);o?p.each.call(n,function(t,n){e.resolve(t).then(function(t){s[n]=t,--o||i(s)},r)}):i(s)})},race:function(t){var e=s(this);return new e(function(n,i){E(t,!1,function(t){e.resolve(t).then(n,i)})})}})},{"./$":40,"./$.a-function":2,"./$.an-object":3,"./$.classof":7,"./$.core":13,"./$.ctx":14,"./$.def":15,"./$.for-of":23,"./$.global":25,"./$.is-object":32,"./$.iter-detect":37,"./$.library":42,"./$.mix":43,"./$.same":51,"./$.set-proto":52,"./$.species":55,"./$.strict-new":56,"./$.support-desc":61,"./$.tag":62,"./$.task":63,"./$.uid":69,"./$.wks":71}],118:[function(t,e,n){var i=t("./$.def"),r=Function.apply;i(i.S,"Reflect",{apply:function(t,e,n){return r.call(t,e,n)}})},{"./$.def":15}],119:[function(t,e,n){var i=t("./$"),r=t("./$.def"),o=t("./$.a-function"),s=t("./$.is-object"),a=Function.apply,u=Function.bind||t("./$.core").Function.prototype.bind;r(r.S,"Reflect",{construct:function(t,e){if(arguments.length<3)return new(u.apply(t,[null].concat(e)));var n=o(arguments[2]).prototype,r=i.create(s(n)?n:Object.prototype),h=a.call(t,r,e);return s(h)?h:r}})},{"./$":40,"./$.a-function":2,"./$.core":13,"./$.def":15,"./$.is-object":32}],120:[function(t,e,n){var i=t("./$"),r=t("./$.def"),o=t("./$.an-object");r(r.S+r.F*t("./$.throws")(function(){Reflect.defineProperty(i.setDesc({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t);try{return i.setDesc(t,e,n),!0}catch(t){return!1}}})},{"./$":40,"./$.an-object":3,"./$.def":15,"./$.throws":64}],121:[function(t,e,n){var i=t("./$.def"),r=t("./$").getDesc,o=t("./$.an-object");i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return n&&!n.configurable?!1:delete t[e]}})},{"./$":40,"./$.an-object":3,"./$.def":15}],122:[function(t,e,n){function i(t){this._t=o(t),this._k=void 0,this._i=0}var r=t("./$.def"),o=t("./$.an-object");t("./$.iter-create")(i,"Object",function(){var t,e=this,n=e._k;if(void 0==n){e._k=n=[];for(t in e._t)n.push(t)}do if(e._i>=n.length)return{value:void 0,done:!0};while(!((t=n[e._i++])in e._t));return{value:t,done:!1}}),r(r.S,"Reflect",{enumerate:function(t){return new i(t)}})},{"./$.an-object":3,"./$.def":15,"./$.iter-create":35}],123:[function(t,e,n){var i=t("./$"),r=t("./$.def"),o=t("./$.an-object");r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.getDesc(o(t),e)}})},{"./$":40,"./$.an-object":3,"./$.def":15}],124:[function(t,e,n){var i=t("./$.def"),r=t("./$").getProto,o=t("./$.an-object");i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},{"./$":40,"./$.an-object":3,"./$.def":15}],125:[function(t,e,n){function i(t,e){var n,s,h=arguments.length<3?t:arguments[2];return u(t)===h?t[e]:(n=r.getDesc(t,e))?o(n,"value")?n.value:void 0!==n.get?n.get.call(h):void 0:a(s=r.getProto(t))?i(s,e,h):void 0}var r=t("./$"),o=t("./$.has"),s=t("./$.def"),a=t("./$.is-object"),u=t("./$.an-object");s(s.S,"Reflect",{get:i})},{"./$":40,"./$.an-object":3,"./$.def":15,"./$.has":26,"./$.is-object":32}],126:[function(t,e,n){var i=t("./$.def");i(i.S,"Reflect",{has:function(t,e){return e in t}})},{"./$.def":15}],127:[function(t,e,n){var i=t("./$.def"),r=t("./$.an-object"),o=Object.isExtensible||t("./$.is-object");i(i.S,"Reflect",{isExtensible:function(t){return o(r(t))}})},{"./$.an-object":3,"./$.def":15,"./$.is-object":32}],128:[function(t,e,n){var i=t("./$.def");i(i.S,"Reflect",{ownKeys:t("./$.own-keys")})},{"./$.def":15,"./$.own-keys":45}],129:[function(t,e,n){var i=t("./$.def"),r=t("./$.an-object"),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(t){return!1}}})},{"./$.an-object":3,"./$.def":15}],130:[function(t,e,n){var i=t("./$.def"),r=t("./$.set-proto");r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(t){return!1}}})},{"./$.def":15,"./$.set-proto":52}],131:[function(t,e,n){function i(t,e,n){var s,c,l=arguments.length<4?t:arguments[3],f=r.getDesc(u(t),e);if(!f){if(h(c=r.getProto(t)))return i(c,e,n,l);f=a(0)}return o(f,"value")?f.writable!==!1&&h(l)?(s=r.getDesc(l,e)||a(0),s.value=n,r.setDesc(l,e,s),!0):!1:void 0===f.set?!1:(f.set.call(l,n),!0)}var r=t("./$"),o=t("./$.has"),s=t("./$.def"),a=t("./$.property-desc"),u=t("./$.an-object"),h=t("./$.is-object");s(s.S,"Reflect",{set:i})},{"./$":40,"./$.an-object":3,"./$.def":15,"./$.has":26,"./$.is-object":32,"./$.property-desc":48}],132:[function(t,e,n){var i=t("./$"),r=t("./$.global"),o=t("./$.cof"),s=t("./$.flags"),a=r.RegExp,u=a,h=a.prototype,c=/a/g,l=new a(c)!==c,f=function(){try{return"/a/i"==a(c,"i")}catch(t){}}();t("./$.support-desc")&&(l&&f||(a=function(t,e){var n="RegExp"==o(t),i=void 0===e;return this instanceof a||!n||!i?l?new u(n&&!i?t.source:t,e):new u(n?t.source:t,n&&i?s.call(t):e):t},i.each.call(i.getNames(u),function(t){t in a||i.setDesc(a,t,{configurable:!0,get:function(){return u[t]},set:function(e){u[t]=e}})}),h.constructor=a,a.prototype=h,t("./$.redef")(r,"RegExp",a))),t("./$.species")(a)},{"./$":40,"./$.cof":8,"./$.flags":22,"./$.global":25,"./$.redef":49,"./$.species":55,"./$.support-desc":61}],133:[function(t,e,n){var i=t("./$");t("./$.support-desc")&&"g"!=/./g.flags&&i.setDesc(RegExp.prototype,"flags",{configurable:!0,get:t("./$.flags")})},{"./$":40,"./$.flags":22,"./$.support-desc":61}],134:[function(t,e,n){t("./$.fix-re-wks")("match",1,function(t){return function(e){"use strict";var n=String(this),i=void 0==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](n)}})},{"./$.fix-re-wks":21}],135:[function(t,e,n){t("./$.fix-re-wks")("replace",2,function(t,e){return function(n,i){"use strict";var r=String(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r,i):e.call(r,n,i)}})},{"./$.fix-re-wks":21}],136:[function(t,e,n){t("./$.fix-re-wks")("search",1,function(t){return function(e){"use strict";var n=String(this),i=void 0==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](n)}})},{"./$.fix-re-wks":21}],137:[function(t,e,n){t("./$.fix-re-wks")("split",2,function(t,e){return function(n,i){"use strict";var r=String(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r,i):e.call(r,n,i)}})},{"./$.fix-re-wks":21}],138:[function(t,e,n){"use strict";var i=t("./$.collection-strong");t("./$.collection")("Set",function(t){return function(){return t(this,arguments[0])}},{add:function(t){return i.def(this,t=0===t?0:t,t)}},i)},{"./$.collection":12,"./$.collection-strong":9}],139:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.string-at")(!1);i(i.P,"String",{codePointAt:function(t){return r(this,t)}})},{"./$.def":15,"./$.string-at":57}],140:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.to-length"),o=t("./$.string-context");i(i.P+i.F*!t("./$.throws")(function(){"q".endsWith(/./)}),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments[1],i=r(e.length),s=void 0===n?i:Math.min(r(n),i),a=String(t);return e.slice(s-a.length,s)===a}})},{"./$.def":15,"./$.string-context":58,"./$.throws":64,"./$.to-length":67}],141:[function(t,e,n){var i=t("./$.def"),r=t("./$.to-index"),o=String.fromCharCode,s=String.fromCodePoint;i(i.S+i.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,s=0;i>s;){if(e=+arguments[s++],r(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(65536>e?o(e):o(((e-=65536)>>10)+55296,e%1024+56320))}return n.join("")}})},{"./$.def":15,"./$.to-index":65}],142:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.string-context");i(i.P,"String",{includes:function(t){return!!~r(this,t,"includes").indexOf(t,arguments[1])}})},{"./$.def":15,"./$.string-context":58}],143:[function(t,e,n){var i=t("./$.string-at")(!0);t("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":36,"./$.string-at":57}],144:[function(t,e,n){var i=t("./$.def"),r=t("./$.to-object"),o=t("./$.to-length");i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),i>a&&s.push(String(arguments[a]));return s.join("")}})},{"./$.def":15,"./$.to-length":67,"./$.to-object":68}],145:[function(t,e,n){var i=t("./$.def");i(i.P,"String",{repeat:t("./$.string-repeat")})},{"./$.def":15,"./$.string-repeat":60}],146:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.to-length"),o=t("./$.string-context");i(i.P+i.F*!t("./$.throws")(function(){"q".startsWith(/./)}),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=r(Math.min(arguments[1],e.length)),i=String(t);return e.slice(n,n+i.length)===i}})},{"./$.def":15,"./$.string-context":58,"./$.throws":64,"./$.to-length":67}],147:[function(t,e,n){"use strict";function i(t){var e=P[t]=R(A.prototype);return e._k=t,d&&N&&F(U,t,{configurable:!0,set:function(e){p(this,M)&&p(this[M],t)&&(this[M][t]=!1),F(this,t,O(1,e))}}),e}function r(t,e,n){return n&&p(P,e)?(n.enumerable?(p(t,M)&&t[M][e]&&(t[M][e]=!1),n=R(n,{enumerable:O(0,!1)})):(p(t,M)||$(t,M,O(1,{})),t[M][e]=!0),F(t,e,n)):$(t,e,n)}function o(t,e){S(t);for(var n,i=E(e=x(e)),o=0,s=i.length;s>o;)r(t,n=i[o++],e[n]);return t}function s(t,e){return void 0===e?R(t):o(R(t),e)}function a(t){var e=L.call(this,t);return e||!p(this,t)||!p(P,t)||p(this,M)&&this[M][t]?e:!0}function u(t,e){var n=C(t=x(t),e);return!n||!p(P,e)||p(t,M)&&t[M][e]||(n.enumerable=!0),n}function h(t){for(var e,n=I(x(t)),i=[],r=0;n.length>r;)p(P,e=n[r++])||e==M||i.push(e);return i}function c(t){for(var e,n=I(x(t)),i=[],r=0;n.length>r;)p(P,e=n[r++])&&i.push(P[e]);return i}var l=t("./$"),f=t("./$.global"),p=t("./$.has"),d=t("./$.support-desc"),m=t("./$.def"),g=t("./$.redef"),_=t("./$.shared"),y=t("./$.tag"),v=t("./$.uid"),b=t("./$.wks"),w=t("./$.keyof"),T=t("./$.get-names"),E=t("./$.enum-keys"),S=t("./$.an-object"),x=t("./$.to-object"),O=t("./$.property-desc"),C=l.getDesc,$=l.setDesc,R=l.create,I=T.get,A=f.Symbol,N=!1,M=b("_hidden"),L=l.isEnum,z=_("symbol-registry"),P=_("symbols"),D="function"==typeof A,U=Object.prototype,F=d?function(){try{return R($({},M,{get:function(){return $(this,M,{value:!1})[M]}}))[M]||$}catch(t){return function(t,e,n){var i=C(U,e);i&&delete U[e],$(t,e,n),i&&t!==U&&$(U,e,i)}}}():$;D||(A=function(){if(this instanceof A)throw TypeError("Symbol is not a constructor");return i(v(arguments[0]))},g(A.prototype,"toString",function(){return this._k}),l.create=s,l.isEnum=a,l.getDesc=u,l.setDesc=r,l.setDescs=o,l.getNames=T.get=h,l.getSymbols=c,d&&!t("./$.library")&&g(U,"propertyIsEnumerable",a,!0));var k={for:function(t){return p(z,t+="")?z[t]:z[t]=A(t)},keyFor:function(t){return w(z,t)},useSetter:function(){N=!0},useSimple:function(){N=!1}};l.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var e=b(t);k[t]=D?e:i(e)}),N=!0,m(m.G+m.W,{Symbol:A}),m(m.S,"Symbol",k),m(m.S+m.F*!D,"Object",{create:s,defineProperty:r,defineProperties:o,getOwnPropertyDescriptor:u,getOwnPropertyNames:h,getOwnPropertySymbols:c}),y(A,"Symbol"),y(Math,"Math",!0),y(f.JSON,"JSON",!0)},{"./$":40,"./$.an-object":3,"./$.def":15,"./$.enum-keys":18,"./$.get-names":24,"./$.global":25,"./$.has":26,"./$.keyof":41,"./$.library":42,"./$.property-desc":48,"./$.redef":49,"./$.shared":53,"./$.support-desc":61,"./$.tag":62,"./$.to-object":68,"./$.uid":69,"./$.wks":71}],148:[function(t,e,n){"use strict";var i=t("./$"),r=t("./$.collection-weak"),o=t("./$.is-object"),s=t("./$.has"),a=r.frozenStore,u=r.WEAK,h=Object.isExtensible||o,c={},l=t("./$.collection")("WeakMap",function(t){return function(){return t(this,arguments[0])}},{get:function(t){if(o(t)){if(!h(t))return a(this).get(t);if(s(t,u))return t[u][this._i]}},set:function(t,e){return r.def(this,t,e)}},r,!0,!0);7!=(new l).set((Object.freeze||Object)(c),7).get(c)&&i.each.call(["delete","has","get","set"],function(e){var n=l.prototype,i=n[e];t("./$.redef")(n,e,function(t,n){if(o(t)&&!h(t)){var r=a(this)[e](t,n);return"set"==e?this:r}return i.call(this,t,n)})})},{"./$":40,"./$.collection":12,"./$.collection-weak":11,"./$.has":26,"./$.is-object":32,"./$.redef":49}],149:[function(t,e,n){"use strict";var i=t("./$.collection-weak");t("./$.collection")("WeakSet",function(t){return function(){return t(this,arguments[0])}},{add:function(t){return i.def(this,t,!0)}},i,!1,!0)},{"./$.collection":12,"./$.collection-weak":11}],150:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.array-includes")(!0);i(i.P,"Array",{includes:function(t){return r(this,t,arguments[1])}}),t("./$.unscope")("includes")},{"./$.array-includes":4,"./$.def":15,"./$.unscope":70}],151:[function(t,e,n){var i=t("./$.def");i(i.P,"Map",{toJSON:t("./$.collection-to-json")("Map")})},{"./$.collection-to-json":10,"./$.def":15}],152:[function(t,e,n){var i=t("./$.def"),r=t("./$.object-to-array")(!0);i(i.S,"Object",{entries:function(t){return r(t)}})},{"./$.def":15,"./$.object-to-array":44}],153:[function(t,e,n){var i=t("./$"),r=t("./$.def"),o=t("./$.own-keys"),s=t("./$.to-object"),a=t("./$.property-desc");r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=s(t),u=i.setDesc,h=i.getDesc,c=o(r),l={},f=0;c.length>f;)n=h(r,e=c[f++]),e in l?u(l,e,a(0,n)):l[e]=n;return l}})},{"./$":40,"./$.def":15,"./$.own-keys":45,"./$.property-desc":48,"./$.to-object":68}],154:[function(t,e,n){var i=t("./$.def"),r=t("./$.object-to-array")(!1);i(i.S,"Object",{values:function(t){return r(t)}})},{"./$.def":15,"./$.object-to-array":44}],155:[function(t,e,n){var i=t("./$.def"),r=t("./$.replacer")(/[\\^$*+?.()|[\]{}]/g,"\\$&");i(i.S,"RegExp",{escape:function(t){return r(t)}})},{"./$.def":15,"./$.replacer":50}],156:[function(t,e,n){var i=t("./$.def");i(i.P,"Set",{toJSON:t("./$.collection-to-json")("Set")})},{"./$.collection-to-json":10,"./$.def":15}],157:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.string-at")(!0);i(i.P,"String",{at:function(t){return r(this,t)}})},{"./$.def":15,"./$.string-at":57}],158:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.string-pad");i(i.P,"String",{lpad:function(t){return r(this,t,arguments[1],!0)}})},{"./$.def":15,"./$.string-pad":59}],159:[function(t,e,n){"use strict";var i=t("./$.def"),r=t("./$.string-pad");i(i.P,"String",{rpad:function(t){return r(this,t,arguments[1],!1)}})},{"./$.def":15,"./$.string-pad":59}],160:[function(t,e,n){function i(e,n){r.each.call(e.split(","),function(e){void 0==n&&e in s?a[e]=s[e]:e in[]&&(a[e]=t("./$.ctx")(Function.call,[][e],n))})}var r=t("./$"),o=t("./$.def"),s=t("./$.core").Array||Array,a={};i("pop,reverse,shift,keys,values,entries",1),i("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),i("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",a)},{"./$":40,"./$.core":13,"./$.ctx":14,"./$.def":15}],161:[function(t,e,n){t("./es6.array.iterator");var i=t("./$.global"),r=t("./$.hide"),o=t("./$.iterators"),s=t("./$.wks")("iterator"),a=i.NodeList,u=i.HTMLCollection,h=a&&a.prototype,c=u&&u.prototype,l=o.NodeList=o.HTMLCollection=o.Array;!a||s in h||r(h,s,l),!u||s in c||r(c,s,l)},{"./$.global":25,"./$.hide":27,"./$.iterators":39,"./$.wks":71,"./es6.array.iterator":79}],162:[function(t,e,n){var i=t("./$.def"),r=t("./$.task");i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},{"./$.def":15,"./$.task":63}],163:[function(t,e,n){function i(t){return h?function(e,n){return t(s(a,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),n)}:t}var r=t("./$.global"),o=t("./$.def"),s=t("./$.invoke"),a=t("./$.partial"),u=r.navigator,h=!!u&&/MSIE .\./.test(u.userAgent);o(o.G+o.B+o.F*h,{setTimeout:i(r.setTimeout),setInterval:i(r.setInterval)})},{"./$.def":15,"./$.global":25,"./$.invoke":29,"./$.partial":46}],164:[function(t,e,n){t("./modules/es5"),t("./modules/es6.symbol"),t("./modules/es6.object.assign"),t("./modules/es6.object.is"),t("./modules/es6.object.set-prototype-of"),t("./modules/es6.object.to-string"),t("./modules/es6.object.statics-accept-primitives"),t("./modules/es6.function.name"),t("./modules/es6.function.has-instance"),t("./modules/es6.number.constructor"),t("./modules/es6.number.epsilon"),t("./modules/es6.number.is-finite"),t("./modules/es6.number.is-integer"),t("./modules/es6.number.is-nan"),t("./modules/es6.number.is-safe-integer"),t("./modules/es6.number.max-safe-integer"),t("./modules/es6.number.min-safe-integer"),t("./modules/es6.number.parse-float"),t("./modules/es6.number.parse-int"),t("./modules/es6.math.acosh"),t("./modules/es6.math.asinh"),t("./modules/es6.math.atanh"),t("./modules/es6.math.cbrt"),t("./modules/es6.math.clz32"),t("./modules/es6.math.cosh"),t("./modules/es6.math.expm1"),t("./modules/es6.math.fround"),t("./modules/es6.math.hypot"),t("./modules/es6.math.imul"),t("./modules/es6.math.log10"),t("./modules/es6.math.log1p"),t("./modules/es6.math.log2"),t("./modules/es6.math.sign"),t("./modules/es6.math.sinh"),t("./modules/es6.math.tanh"),t("./modules/es6.math.trunc"),t("./modules/es6.string.from-code-point"),t("./modules/es6.string.raw"),t("./modules/es6.string.iterator"),t("./modules/es6.string.code-point-at"),t("./modules/es6.string.ends-with"),t("./modules/es6.string.includes"),t("./modules/es6.string.repeat"),t("./modules/es6.string.starts-with"),t("./modules/es6.array.from"),t("./modules/es6.array.of"),t("./modules/es6.array.iterator"),t("./modules/es6.array.species"),t("./modules/es6.array.copy-within"),t("./modules/es6.array.fill"),t("./modules/es6.array.find"),t("./modules/es6.array.find-index"),t("./modules/es6.regexp.constructor"),t("./modules/es6.regexp.flags"),t("./modules/es6.regexp.match"),t("./modules/es6.regexp.replace"),t("./modules/es6.regexp.search"),t("./modules/es6.regexp.split"),t("./modules/es6.promise"),t("./modules/es6.map"),t("./modules/es6.set"),t("./modules/es6.weak-map"),t("./modules/es6.weak-set"),t("./modules/es6.reflect.apply"),t("./modules/es6.reflect.construct"),t("./modules/es6.reflect.define-property"),t("./modules/es6.reflect.delete-property"),t("./modules/es6.reflect.enumerate"),t("./modules/es6.reflect.get"),t("./modules/es6.reflect.get-own-property-descriptor"),t("./modules/es6.reflect.get-prototype-of"),t("./modules/es6.reflect.has"),t("./modules/es6.reflect.is-extensible"),t("./modules/es6.reflect.own-keys"),t("./modules/es6.reflect.prevent-extensions"),t("./modules/es6.reflect.set"),t("./modules/es6.reflect.set-prototype-of"),t("./modules/es7.array.includes"),t("./modules/es7.string.at"),t("./modules/es7.string.lpad"),t("./modules/es7.string.rpad"),t("./modules/es7.regexp.escape"),t("./modules/es7.object.get-own-property-descriptors"),t("./modules/es7.object.values"),t("./modules/es7.object.entries"),t("./modules/es7.map.to-json"),t("./modules/es7.set.to-json"),t("./modules/js.array.statics"),t("./modules/web.timers"),t("./modules/web.immediate"),t("./modules/web.dom.iterable"),e.exports=t("./modules/$.core")},{"./modules/$.core":13,"./modules/es5":73,"./modules/es6.array.copy-within":74,"./modules/es6.array.fill":75,"./modules/es6.array.find":77,"./modules/es6.array.find-index":76,"./modules/es6.array.from":78,"./modules/es6.array.iterator":79,"./modules/es6.array.of":80,"./modules/es6.array.species":81,"./modules/es6.function.has-instance":82,"./modules/es6.function.name":83,"./modules/es6.map":84,"./modules/es6.math.acosh":85,"./modules/es6.math.asinh":86,"./modules/es6.math.atanh":87,"./modules/es6.math.cbrt":88,"./modules/es6.math.clz32":89,"./modules/es6.math.cosh":90,"./modules/es6.math.expm1":91,"./modules/es6.math.fround":92,"./modules/es6.math.hypot":93,"./modules/es6.math.imul":94,"./modules/es6.math.log10":95,"./modules/es6.math.log1p":96,"./modules/es6.math.log2":97,"./modules/es6.math.sign":98,"./modules/es6.math.sinh":99,"./modules/es6.math.tanh":100,"./modules/es6.math.trunc":101,"./modules/es6.number.constructor":102,"./modules/es6.number.epsilon":103,"./modules/es6.number.is-finite":104,"./modules/es6.number.is-integer":105,"./modules/es6.number.is-nan":106,"./modules/es6.number.is-safe-integer":107,"./modules/es6.number.max-safe-integer":108,"./modules/es6.number.min-safe-integer":109,"./modules/es6.number.parse-float":110,"./modules/es6.number.parse-int":111,"./modules/es6.object.assign":112,"./modules/es6.object.is":113,"./modules/es6.object.set-prototype-of":114,"./modules/es6.object.statics-accept-primitives":115,"./modules/es6.object.to-string":116,"./modules/es6.promise":117,"./modules/es6.reflect.apply":118,"./modules/es6.reflect.construct":119,"./modules/es6.reflect.define-property":120,"./modules/es6.reflect.delete-property":121,"./modules/es6.reflect.enumerate":122,"./modules/es6.reflect.get":125,"./modules/es6.reflect.get-own-property-descriptor":123,"./modules/es6.reflect.get-prototype-of":124,"./modules/es6.reflect.has":126,"./modules/es6.reflect.is-extensible":127,"./modules/es6.reflect.own-keys":128,"./modules/es6.reflect.prevent-extensions":129,"./modules/es6.reflect.set":131,"./modules/es6.reflect.set-prototype-of":130,"./modules/es6.regexp.constructor":132,"./modules/es6.regexp.flags":133,"./modules/es6.regexp.match":134,"./modules/es6.regexp.replace":135,"./modules/es6.regexp.search":136,"./modules/es6.regexp.split":137,"./modules/es6.set":138,"./modules/es6.string.code-point-at":139,"./modules/es6.string.ends-with":140,"./modules/es6.string.from-code-point":141,"./modules/es6.string.includes":142,"./modules/es6.string.iterator":143,"./modules/es6.string.raw":144,"./modules/es6.string.repeat":145,"./modules/es6.string.starts-with":146,"./modules/es6.symbol":147,"./modules/es6.weak-map":148,"./modules/es6.weak-set":149,"./modules/es7.array.includes":150,"./modules/es7.map.to-json":151,"./modules/es7.object.entries":152,"./modules/es7.object.get-own-property-descriptors":153,"./modules/es7.object.values":154,"./modules/es7.regexp.escape":155,"./modules/es7.set.to-json":156,"./modules/es7.string.at":157,"./modules/es7.string.lpad":158,"./modules/es7.string.rpad":159,"./modules/js.array.statics":160,"./modules/web.dom.iterable":161,"./modules/web.immediate":162,"./modules/web.timers":163}],165:[function(t,e,n){(function(t,n){!function(n){"use strict";function i(t,e,n,i){var r=Object.create((e||o).prototype);return r._invoke=l(t,n||null,new d(i||[])),r}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function s(){}function a(){}function u(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function h(t){this.arg=t}function c(e){function n(t,n){var i=e[t](n),r=i.value;return r instanceof h?Promise.resolve(r.arg).then(o,s):Promise.resolve(r).then(function(t){return i.value=t,i})}function i(t,e){var i=r?r.then(function(){return n(t,e)}):new Promise(function(i){i(n(t,e))});return r=i.catch(function(t){}),i}"object"==typeof t&&t.domain&&(n=t.domain.bind(n));var r,o=n.bind(e,"next"),s=n.bind(e,"throw");n.bind(e,"return"),this._invoke=i}function l(t,e,n){var i=T;return function(o,s){if(i===S)throw new Error("Generator is already running");if(i===x){if("throw"===o)throw s;return g()}for(;;){var a=n.delegate;if(a){if("return"===o||"throw"===o&&a.iterator[o]===_){n.delegate=null;var u=a.iterator.return;if(u){var h=r(u,a.iterator,s);if("throw"===h.type){o="throw",s=h.arg;continue}}if("return"===o)continue}var h=r(a.iterator[o],a.iterator,s);if("throw"===h.type){n.delegate=null,o="throw",s=h.arg;continue}o="next",s=_;var c=h.arg;if(!c.done)return i=E,c;n[a.resultName]=c.value,n.next=a.nextLoc,n.delegate=null}if("next"===o)i===E?n.sent=s:n.sent=_;else if("throw"===o){if(i===T)throw i=x,s;n.dispatchException(s)&&(o="next",s=_)}else"return"===o&&n.abrupt("return",s);i=S;var h=r(t,e,n);if("normal"===h.type){i=n.done?x:E;var c={value:h.arg,done:n.done};if(h.arg!==O)return c;n.delegate&&"next"===o&&(s=_);
}else"throw"===h.type&&(i=x,o="throw",s=h.arg)}}}function f(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(f,this),this.reset(!0)}function m(t){if(t){var e=t[v];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=_,e.done=!0,e};return i.next=i}}return{next:g}}function g(){return{value:_,done:!0}}var _,y=Object.prototype.hasOwnProperty,v="function"==typeof Symbol&&Symbol.iterator||"@@iterator",b="object"==typeof e,w=n.regeneratorRuntime;if(w)return void(b&&(e.exports=w));w=n.regeneratorRuntime=b?e.exports:{},w.wrap=i;var T="suspendedStart",E="suspendedYield",S="executing",x="completed",O={},C=a.prototype=o.prototype;s.prototype=C.constructor=a,a.constructor=s,s.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return e?e===s||"GeneratorFunction"===(e.displayName||e.name):!1},w.mark=function(t){return t.__proto__=a,t.prototype=Object.create(C),t},w.awrap=function(t){return new h(t)},u(c.prototype),w.async=function(t,e,n,r){var o=new c(i(t,e,n,r));return w.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},u(C),C[v]=function(){return this},C.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},w.values=m,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=_,this.done=!1,this.delegate=null,this.tryEntries.forEach(p),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=_)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,i){return o.type="throw",o.arg=t,n.next=e,!!i}if(this.done)throw t;for(var n=this,i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],o=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=y.call(r,"catchLoc"),a=y.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&y.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?this.next=r.finallyLoc:this.complete(o),O},complete:function(t,e){if("throw"===t.type)throw t.arg;"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=t.arg,this.next="end"):"normal"===t.type&&e&&(this.next=e)},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),O}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;p(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:m(t),resultName:e,nextLoc:n},O}}}("object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:168}],166:[function(t,e,n){e.exports=t("./lib/polyfill")},{"./lib/polyfill":1}],167:[function(t,e,n){e.exports=t("babel-core/polyfill")},{"babel-core/polyfill":166}],168:[function(t,e,n){function i(){c=!1,a.length?h=a.concat(h):l=-1,h.length&&r()}function r(){if(!c){var t=setTimeout(i);c=!0;for(var e=h.length;e;){for(a=h,h=[];++l<e;)a[l].run();l=-1,e=h.length}a=null,c=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function s(){}var a,u=e.exports={},h=[],c=!1,l=-1;u.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new o(t,e)),1!==h.length||c||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(t){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],169:[function(t,e,n){"use strict";function i(t){r.call(this,t);var e=t.getAlign();this._x.set(e[0]),this._y.set(e[1]),this._z.set(e[2])}var r=t("./Position");i.prototype.toString=function(){return"Align"},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.update=function(){this._node.setAlign(this._x.get(),this._y.get(),this._z.get()),this._checkUpdate()},i.prototype.onUpdate=i.prototype.update,e.exports=i},{"./Position":173}],170:[function(t,e,n){"use strict";function i(t){this._node=t,this._projectionType=i.ORTHOGRAPHIC_PROJECTION,this._focalDepth=0,this._near=0,this._far=0,this._requestingUpdate=!1,this._id=t.addComponent(this),this._viewTransform=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this._viewDirty=!1,this._perspectiveDirty=!1,this.setFlat()}var r=t("../core/Commands");i.FRUSTUM_PROJECTION=0,i.PINHOLE_PROJECTION=1,i.ORTHOGRAPHIC_PROJECTION=2,i.prototype.toString=function(){return"Camera"},i.prototype.getValue=function(){return{component:this.toString(),projectionType:this._projectionType,focalDepth:this._focalDepth,near:this._near,far:this._far}},i.prototype.setValue=function(t){return this.toString()===t.component?(this.set(t.projectionType,t.focalDepth,t.near,t.far),!0):!1},i.prototype.set=function(t,e,n,i){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._projectionType=t,this._focalDepth=e,this._near=n,this._far=i},i.prototype.setDepth=function(t){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._perspectiveDirty=!0,this._projectionType=i.PINHOLE_PROJECTION,this._focalDepth=t,this._near=0,this._far=0,this},i.prototype.setFrustum=function(t,e){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._perspectiveDirty=!0,this._projectionType=i.FRUSTUM_PROJECTION,this._focalDepth=0,this._near=t,this._far=e,this},i.prototype.setFlat=function(){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._perspectiveDirty=!0,this._projectionType=i.ORTHOGRAPHIC_PROJECTION,this._focalDepth=0,this._near=0,this._far=0,this},i.prototype.onUpdate=function(){this._requestingUpdate=!1;var t=this._node.getLocation();if(this._node.sendDrawCommand(r.WITH).sendDrawCommand(t),this._perspectiveDirty)switch(this._perspectiveDirty=!1,this._projectionType){case i.FRUSTUM_PROJECTION:this._node.sendDrawCommand(r.FRUSTRUM_PROJECTION),this._node.sendDrawCommand(this._near),this._node.sendDrawCommand(this._far);break;case i.PINHOLE_PROJECTION:this._node.sendDrawCommand(r.PINHOLE_PROJECTION),this._node.sendDrawCommand(this._focalDepth);break;case i.ORTHOGRAPHIC_PROJECTION:this._node.sendDrawCommand(r.ORTHOGRAPHIC_PROJECTION)}this._viewDirty&&(this._viewDirty=!1,this._node.sendDrawCommand(r.CHANGE_VIEW_TRANSFORM),this._node.sendDrawCommand(this._viewTransform[0]),this._node.sendDrawCommand(this._viewTransform[1]),this._node.sendDrawCommand(this._viewTransform[2]),this._node.sendDrawCommand(this._viewTransform[3]),this._node.sendDrawCommand(this._viewTransform[4]),this._node.sendDrawCommand(this._viewTransform[5]),this._node.sendDrawCommand(this._viewTransform[6]),this._node.sendDrawCommand(this._viewTransform[7]),this._node.sendDrawCommand(this._viewTransform[8]),this._node.sendDrawCommand(this._viewTransform[9]),this._node.sendDrawCommand(this._viewTransform[10]),this._node.sendDrawCommand(this._viewTransform[11]),this._node.sendDrawCommand(this._viewTransform[12]),this._node.sendDrawCommand(this._viewTransform[13]),this._node.sendDrawCommand(this._viewTransform[14]),this._node.sendDrawCommand(this._viewTransform[15]))},i.prototype.onTransformChange=function(t){var e=t;this._viewDirty=!0,this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0);var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],_=e[15],y=n*a-i*s,v=n*u-r*s,b=n*h-o*s,w=i*u-r*a,T=i*h-o*a,E=r*h-o*u,S=c*m-l*d,x=c*g-f*d,O=c*_-p*d,C=l*g-f*m,$=l*_-p*m,R=f*_-p*g,I=1/(y*R-v*$+b*C+w*O-T*x+E*S);this._viewTransform[0]=(a*R-u*$+h*C)*I,this._viewTransform[1]=(r*$-i*R-o*C)*I,this._viewTransform[2]=(m*E-g*T+_*w)*I,this._viewTransform[3]=(f*T-l*E-p*w)*I,this._viewTransform[4]=(u*O-s*R-h*x)*I,this._viewTransform[5]=(n*R-r*O+o*x)*I,this._viewTransform[6]=(g*b-d*E-_*v)*I,this._viewTransform[7]=(c*E-f*b+p*v)*I,this._viewTransform[8]=(s*$-a*O+h*S)*I,this._viewTransform[9]=(i*O-n*$-o*S)*I,this._viewTransform[10]=(d*T-m*b+_*y)*I,this._viewTransform[11]=(l*b-c*T-p*y)*I,this._viewTransform[12]=(a*x-s*C-u*S)*I,this._viewTransform[13]=(n*C-i*x+r*S)*I,this._viewTransform[14]=(m*v-d*w-g*y)*I,this._viewTransform[15]=(c*w-l*v+f*y)*I},e.exports=i},{"../core/Commands":179}],171:[function(t,e,n){"use strict";function i(t){r.call(this,t);var e=t.getMountPoint();this._x.set(e[0]),this._y.set(e[1]),this._z.set(e[2])}var r=t("./Position");i.prototype.toString=function(){return"MountPoint"},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.update=function(){this._node.setMountPoint(this._x.get(),this._y.get(),this._z.get()),this._checkUpdate()},i.prototype.onUpdate=i.prototype.update,e.exports=i},{"./Position":173}],172:[function(t,e,n){"use strict";function i(t){r.call(this,t);var e=t.getOrigin();this._x.set(e[0]),this._y.set(e[1]),this._z.set(e[2])}var r=t("./Position");i.prototype.toString=function(){return"Origin"},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.update=function(){this._node.setOrigin(this._x.get(),this._y.get(),this._z.get()),this._checkUpdate()},i.prototype.onUpdate=i.prototype.update,e.exports=i},{"./Position":173}],173:[function(t,e,n){"use strict";function i(t){this._node=t,this._id=t.addComponent(this),this._requestingUpdate=!1;var e=t.getPosition();this._x=new r(e[0]),this._y=new r(e[1]),this._z=new r(e[2])}var r=t("../transitions/Transitionable");i.prototype.toString=function(){return"Position"},i.prototype.getValue=function(){return{component:this.toString(),x:this._x.get(),y:this._y.get(),z:this._z.get()}},i.prototype.setValue=function(t){return this.toString()===t.component?(this.set(t.x,t.y,t.z),!0):!1},i.prototype.getX=function(){return this._x.get()},i.prototype.getY=function(){return this._y.get()},i.prototype.getZ=function(){return this._z.get()},i.prototype.isActive=function(){return this._x.isActive()||this._y.isActive()||this._z.isActive()},i.prototype._checkUpdate=function(){this.isActive()?this._node.requestUpdateOnNextTick(this._id):this._requestingUpdate=!1},i.prototype.update=function(){this._node.setPosition(this._x.get(),this._y.get(),this._z.get()),this._checkUpdate()},i.prototype.onUpdate=i.prototype.update,i.prototype.setX=function(t,e,n){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._x.set(t,e,n),this},i.prototype.setY=function(t,e,n){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._y.set(t,e,n),this},i.prototype.setZ=function(t,e,n){return this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._z.set(t,e,n),this},i.prototype.set=function(t,e,n,i,r){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0);var o,s,a;return null!=n?a=r:null!=e?s=r:null!=t&&(o=r),null!=t&&this._x.set(t,i,o),null!=e&&this._y.set(e,i,s),null!=n&&this._z.set(n,i,a),this},i.prototype.halt=function(){return this._x.halt(),this._y.halt(),this._z.halt(),this},e.exports=i},{"../transitions/Transitionable":217}],174:[function(t,e,n){"use strict";function i(t){r.call(this,t);var e=t.getRotation(),n=e[0],i=e[1],o=e[2],s=e[3],a=n*n,u=i*i,h=o*o,c=2*(n*o+i*s);c=-1>c?-1:c>1?1:c;var l=Math.atan2(2*(n*s-i*o),1-2*(a+u)),f=Math.asin(c),p=Math.atan2(2*(o*s-n*i),1-2*(u+h));this._x.set(l),this._y.set(f),this._z.set(p)}var r=t("./Position");i.prototype.toString=function(){return"Rotation"},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.update=function(){this._node.setRotation(this._x.get(),this._y.get(),this._z.get()),this._checkUpdate()},i.prototype.onUpdate=i.prototype.update,e.exports=i},{"./Position":173}],175:[function(t,e,n){"use strict";function i(t){this._node=t,this._id=t.addComponent(this),this._requestingUpdate=!1;var e=t.getProportionalSize(),n=t.getDifferentialSize(),i=t.getAbsoluteSize();this._proportional={x:new r(e[0]),y:new r(e[1]),z:new r(e[2])},this._differential={x:new r(n[0]),y:new r(n[1]),z:new r(n[2])},this._absolute={x:new r(i[0]),y:new r(i[1]),z:new r(i[2])}}var r=t("../transitions/Transitionable");i.RELATIVE=0,i.ABSOLUTE=1,i.RENDER=2,i.DEFAULT=i.RELATIVE,i.prototype.setMode=function(t,e,n){return this._node.setSizeMode(t,e,n),this},i.prototype.toString=function(){return"Size"},i.prototype.getValue=function(){return{sizeMode:this._node.value.sizeMode,absolute:{x:this._absolute.x.get(),y:this._absolute.y.get(),z:this._absolute.z.get()},differential:{x:this._differential.x.get(),y:this._differential.y.get(),z:this._differential.z.get()},proportional:{x:this._proportional.x.get(),y:this._proportional.y.get(),z:this._proportional.z.get()}}},i.prototype.setValue=function(t){return this.toString()===t.component&&(this.setMode.apply(this,t.sizeMode),t.absolute&&this.setAbsolute(t.absolute.x,t.absolute.y,t.absolute.z),t.differential&&this.setAbsolute(t.differential.x,t.differential.y,t.differential.z),t.proportional&&this.setAbsolute(t.proportional.x,t.proportional.y,t.proportional.z)),!1},i.prototype._isActive=function(t){return t.x.isActive()||t.y.isActive()||t.z.isActive()},i.prototype.isActive=function(){return this._isActive(this._absolute)||this._isActive(this._proportional)||this._isActive(this._differential)},i.prototype.onUpdate=function(){var t=this._absolute;this._node.setAbsoluteSize(t.x.get(),t.y.get(),t.z.get());var e=this._proportional,n=this._differential;this._node.setProportionalSize(e.x.get(),e.y.get(),e.z.get()),this._node.setDifferentialSize(n.x.get(),n.y.get(),n.z.get()),this.isActive()?this._node.requestUpdateOnNextTick(this._id):this._requestingUpdate=!1},i.prototype.setAbsolute=function(t,e,n,i,r){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0);var o,s,a;null!=n?a=r:null!=e?s=r:null!=t&&(o=r);var u=this._absolute;null!=t&&u.x.set(t,i,o),null!=e&&u.y.set(e,i,s),null!=n&&u.z.set(n,i,a)},i.prototype.setProportional=function(t,e,n,i,r){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0);var o,s,a;null!=n?a=r:null!=e?s=r:null!=t&&(o=r);var u=this._proportional;return null!=t&&u.x.set(t,i,o),null!=e&&u.y.set(e,i,s),null!=n&&u.z.set(n,i,a),this},i.prototype.setDifferential=function(t,e,n,i,r){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0);var o,s,a;null!=n?a=r:null!=e?s=r:null!=t&&(o=r);var u=this._differential;return null!=t&&u.x.set(t,i,o),null!=e&&u.y.set(e,i,s),null!=n&&u.z.set(n,i,a),this},i.prototype.get=function(){return this._node.getSize()},i.prototype.halt=function(){return this._proportional.x.halt(),this._proportional.y.halt(),this._proportional.z.halt(),this._differential.x.halt(),this._differential.y.halt(),this._differential.z.halt(),this._absolute.x.halt(),this._absolute.y.halt(),this._absolute.z.halt(),this},e.exports=i},{"../transitions/Transitionable":217}],176:[function(t,e,n){"use strict";function i(t,e,n,i){this._transform=i,this._dirty=!1,this.x=new s(t),this.y=new s(e),this.z=new s(n),this._values={x:t,y:e,z:n}}function r(t,e,n,i,r){this._transform=r,this._dirty=!1,this._t=new s([t,e,n,i])}function o(t){this._node=t,this._id=t.addComponent(this),this.origin=null,this.mountPoint=null,this.align=null,this.scale=null,this.position=null,this.rotation=null,this._dirty=!1}var s=t("../transitions/Transitionable"),a=t("../math/Quaternion"),u=new a,h=new a;i.prototype.get=function(){return this._values.x=this.x.get(),this._values.y=this.y.get(),this._values.z=this.z.get(),this._values},i.prototype.set=function(t,e,n,i,r){this._transform._dirty||(this._transform._node.requestUpdate(this._transform._id),this._transform._dirty=!0),this._dirty=!0;var o=null,s=null,a=null;return null!=n?a=r:null!=e?s=r:null!=t&&(o=r),null!=t&&this.x.set(t,i,o),null!=e&&this.y.set(e,i,s),null!=n&&this.z.set(n,i,a),this},i.prototype.isActive=function(){return this.x.isActive()||this.y.isActive()||this.z.isActive()},i.prototype.pause=function(){return this.x.pause(),this.y.pause(),this.z.pause(),this},i.prototype.resume=function(){return this.x.resume(),this.y.resume(),this.z.resume(),this},i.prototype.halt=function(){return this.x.halt(),this.y.halt(),this.z.halt(),this},r.prototype.get=function(){return this._t.get()},r.prototype.set=function(t,e,n,i,r,o){this._transform._dirty||(this._transform._node.requestUpdate(this._transform._id),this._transform._dirty=!0),this._dirty=!0,r.method="slerp",this._t.set([t,e,n,i],r,o)},r.prototype.isActive=function(){return this._t.isActive()},r.prototype.pause=function(){return this._t.pause(),this},r.prototype.resume=function(){return this._t.resume(),this},r.prototype.halt=function(){return this._dirty=!1,this._t.halt(),this},o.prototype.toString=function(){return"Transform"},o.prototype.getValue=function(){return{component:this.toString(),origin:this.origin&&this.origin.get(),mountPoint:this.mountPoint&&this.mountPoint.get(),align:this.align&&this.align.get(),scale:this.scale&&this.scale.get(),position:this.position&&this.position.get(),rotation:this.rotation&&this.rotation.get()}},o.prototype.setState=function(t){return this.toString()===t.component?(t.origin&&this.setOrigin(t.origin.x,t.origin.y,t.origin.z),t.mountPoint&&this.setMountPoint(t.mountPoint.x,t.mountPoint.y,t.mountPoint.z),t.align&&this.setAlign(t.align.x,t.align.y,t.align.z),t.scale&&this.setScale(t.scale.x,t.scale.y,t.scale.z),t.position&&this.setPosition(t.position.x,t.position.y,t.position.z),t.rotation&&this.setRotation(t.rotation.x,t.rotation.y,t.rotation.z,t.rotation.w),!0):!1},o.prototype.setOrigin=function(t,e,n,r,o){if(!this.origin){var s=this._node.getOrigin();this.origin=new i(s[0],s[1],s[2],this)}return this.origin.set(t,e,n,r,o),this},o.prototype.setMountPoint=function(t,e,n,r,o){if(!this.mountPoint){var s=this._node.getMountPoint();this.mountPoint=new i(s[0],s[1],s[2],this)}return this.mountPoint.set(t,e,n,r,o),this},o.prototype.setAlign=function(t,e,n,r,o){if(!this.align){var s=this._node.getAlign();this.align=new i(s[0],s[1],s[2],this)}return this.align.set(t,e,n,r,o),this},o.prototype.setScale=function(t,e,n,r,o){if(!this.scale){var s=this._node.getScale();this.scale=new i(s[0],s[1],s[2],this)}return this.scale.set(t,e,n,r,o),this},o.prototype.setPosition=function(t,e,n,r,o){if(!this.position){var s=this._node.getPosition();this.position=new i(s[0],s[1],s[2],this)}return this.position.set(t,e,n,r,o),this},o.prototype.translate=function(t,e,n,r,o){if(!this.position){var s=this._node.getPosition();this.position=new i(s[0],s[1],s[2],this)}var a=this.position,u=a.x._queue,h=a.y._queue,c=a.z._queue,l=null==t?null:t+(u.length>0?u[u.length-5]:a.x._state),f=null==e?null:e+(h.length>0?h[h.length-5]:a.y._state),p=null==n?null:n+(c.length>0?c[c.length-5]:a.z._state);return this.position.set(l,f,p,r,o),this},o.prototype.setRotation=function(t,e,n,i,o,s){if(!this.rotation){var a=this._node.getRotation();this.rotation=new r(a[0],a[1],a[2],a[3],this)}var h=u;return"number"==typeof i?h.set(i,t,e,n):(h.fromEuler(t,e,n),s=o,o=i),this.rotation.set(h.x,h.y,h.z,h.w,o,s),this},o.prototype.rotate=function(t,e,n,i,o,s){if(!this.rotation){var a=this._node.getRotation();this.rotation=new r(a[0],a[1],a[2],a[3],this)}var c,l,f=this.rotation._t._queue,p=f.length;l=0!==p?f[p-5]:this.rotation._t._state,c=h.set(l[3],l[0],l[1],l[2]);var d=u;"number"==typeof i?d.set(i,t,e,n):(d.fromEuler(t,e,n),s=o,o=i);var m=c.multiply(d);return this.rotation.set(m.x,m.y,m.z,m.w,o,s),this},o.prototype.clean=function(){var t,e=this._node,n=!1;if((t=this.origin)&&t._dirty&&(e.setOrigin(t.x.get(),t.y.get(),t.z.get()),t._dirty=t.isActive(),n=n||t._dirty),(t=this.mountPoint)&&t._dirty&&(e.setMountPoint(t.x.get(),t.y.get(),t.z.get()),t._dirty=t.isActive(),n=n||t._dirty),(t=this.align)&&t._dirty&&(e.setAlign(t.x.get(),t.y.get(),t.z.get()),t._dirty=t.isActive(),n=n||t._dirty),(t=this.scale)&&t._dirty&&(e.setScale(t.x.get(),t.y.get(),t.z.get()),t._dirty=t.isActive(),n=n||t._dirty),(t=this.position)&&t._dirty&&(e.setPosition(t.x.get(),t.y.get(),t.z.get()),t._dirty=t.isActive(),n=n||t._dirty),(t=this.rotation)&&t._dirty){var i=t.get();e.setRotation(i[0],i[1],i[2],i[3]),t._dirty=t.isActive(),n=n||t._dirty}n?this._node.requestUpdateOnNextTick(this._id):this._dirty=!1},o.prototype.onUpdate=o.prototype.clean,e.exports=o},{"../math/Quaternion":206,"../transitions/Transitionable":217}],177:[function(t,e,n){"use strict";function i(){"undefined"!=typeof self&&self.window!==self&&this._enterWorkerMode()}i.prototype._enterWorkerMode=function(){this._workerMode=!0;var t=this;self.addEventListener("message",function(e){t.onMessage(e.data)})},i.prototype.onMessage=null,i.prototype.sendMessage=function(t){this._workerMode?self.postMessage(t):this.onmessage(t)},i.prototype.onmessage=null,i.prototype.postMessage=function(t){return this.onMessage(t)},e.exports=i},{}],178:[function(t,e,n){"use strict";function i(){this._time=0,this._frame=0,this._timerQueue=[],this._updatingIndex=0,this._scale=1,this._scaledTime=this._time}i.prototype.setScale=function(t){return this._scale=t,this},i.prototype.getScale=function(){return this._scale},i.prototype.step=function(t){this._frame++,this._scaledTime=this._scaledTime+(t-this._time)*this._scale,this._time=t;for(var e=0;e<this._timerQueue.length;e++)this._timerQueue[e](this._scaledTime)&&this._timerQueue.splice(e,1);return this},i.prototype.now=function(){return this._scaledTime},i.prototype.getTime=i.prototype.now,i.prototype.getFrame=function(){return this._frame},i.prototype.setTimeout=function(t,e){var n=Array.prototype.slice.call(arguments,2),i=this._time,r=function(r){return r-i>=e?(t.apply(null,n),!0):!1};return this._timerQueue.push(r),r},i.prototype.setInterval=function(t,e){var n=Array.prototype.slice.call(arguments,2),i=this._time,r=function(r){return r-i>=e&&(t.apply(null,n),i=r),!1};return this._timerQueue.push(r),r},i.prototype.clearTimer=function(t){var e=this._timerQueue.indexOf(t);return-1!==e&&this._timerQueue.splice(e,1),this},e.exports=i},{}],179:[function(t,e,n){"use strict";var i={INIT_DOM:0,DOM_RENDER_SIZE:1,CHANGE_TRANSFORM:2,CHANGE_SIZE:3,CHANGE_PROPERTY:4,CHANGE_CONTENT:5,CHANGE_ATTRIBUTE:6,ADD_CLASS:7,REMOVE_CLASS:8,SUBSCRIBE:9,GL_SET_DRAW_OPTIONS:10,GL_AMBIENT_LIGHT:11,GL_LIGHT_POSITION:12,GL_LIGHT_COLOR:13,MATERIAL_INPUT:14,GL_SET_GEOMETRY:15,GL_UNIFORMS:16,GL_BUFFER_DATA:17,GL_CUTOUT_STATE:18,GL_MESH_VISIBILITY:19,GL_REMOVE_MESH:20,PINHOLE_PROJECTION:21,ORTHOGRAPHIC_PROJECTION:22,CHANGE_VIEW_TRANSFORM:23,WITH:24,FRAME:25,ENGINE:26,START:27,STOP:28,TIME:29,TRIGGER:30,NEED_SIZE_FOR:31,DOM:32,READY:33,ALLOW_DEFAULT:34,PREVENT_DEFAULT:35};e.exports=i},{}],180:[function(t,e,n){"use strict";function i(){this._nodes={},this._queue=[]}function r(t,e){e.length=0;var n,i=0,r=t.length;for(n=0;r>n;n++)"/"===t[n]&&(e.push(t.substring(i,n)),i=n+1);return n-i>0&&e.push(t.substring(i,n)),e}var o=t("./Event"),s=t("./Path");i.prototype._setUpdater=function(t){this._updater=t;for(var e in this._nodes)this._nodes[e]._setUpdater(t)},i.prototype.addChildrenToQueue=function(t){for(var e,n=t.getChildren(),i=0,r=n.length;r>i;i++)e=n[i],e&&this._queue.push(e)},i.prototype.next=function(){return this._queue.shift()},i.prototype.breadthFirstNext=function(){var t=this._queue.shift();return t?(this.addChildrenToQueue(t),t):void 0},i.prototype.mount=function(t,e){if(!e)throw new Error("Dispatch: no node passed to mount at: "+t);if(this._nodes[t])throw new Error("Dispatch: there is a node already registered at: "+t);e._setUpdater(this._updater),this._nodes[t]=e;var n=s.parent(t),i=n?this._nodes[n]:e;if(!i)throw new Error("Parent to path: "+t+" doesn't exist at expected path: "+n);var r,o,a=e.getChildren(),u=e.getComponents();if(i.isMounted()&&e._setMounted(!0,t),i.isShown()&&e._setShown(!0),i.isMounted()){for(e._setParent(i),e.onMount&&e.onMount(t),r=0,o=u.length;o>r;r++)u[r]&&u[r].onMount&&u[r].onMount(e,r);for(r=0,o=a.length;o>r;r++)a[r]&&a[r].mount?a[r].mount(t+"/"+r):a[r]&&this.mount(t+"/"+r,a[r])}if(i.isShown())for(e.onShow&&e.onShow(),r=0,o=u.length;o>r;r++)u[r]&&u[r].onShow&&u[r].onShow()},i.prototype.dismount=function(t){var e=this._nodes[t];if(!e)throw new Error("No node registered to path: "+t);var n,i,r=e.getChildren(),o=e.getComponents();if(e.isShown())for(e._setShown(!1),e.onHide&&e.onHide(),n=0,i=o.length;i>n;n++)o[n]&&o[n].onHide&&o[n].onHide();if(e.isMounted()){for(e.onDismount&&e.onDismount(t),n=0,i=r.length;i>n;n++)r[n]&&r[n].dismount?r[n].dismount():r[n]&&this.dismount(t+"/"+n);for(n=0,i=o.length;i>n;n++)o[n]&&o[n].onDismount&&o[n].onDismount();e._setMounted(!1),e._setParent(null)}this._nodes[t]=null},i.prototype.getNode=function(t){return this._nodes[t]},i.prototype.show=function(t){var e=this._nodes[t];if(!e)throw new Error("No node registered to path: "+t);e.onShow&&e.onShow(),this.addChildrenToQueue(e);for(var n;n=this.breadthFirstNext();)this.show(n.getLocation())},i.prototype.hide=function(t){var e=this._nodes[t];if(!e)throw new Error("No node registered to path: "+t);e.onHide&&e.onHide(),this.addChildrenToQueue(e);for(var n;n=this.breadthFirstNext();)this.hide(n.getLocation())},i.prototype.lookupNode=function(t){if(!t)throw new Error("lookupNode must be called with a path");this._queue.length=0;var e=this._queue;r(t,e);for(var n=0,i=e.length;i>n;n++)e[n]=this._nodes[e[n]];return e[e.length-1]},i.prototype.dispatch=function(t,e,n){if(!t)throw new Error("dispatch requires a path as it's first argument");if(!e)throw new Error("dispatch requires an event name as it's second argument");var i=this._nodes[t];if(!i)throw new Error("No node registered at path: "+t);this.addChildrenToQueue(i);for(var r;r=this.breadthFirstNext();)r.onReceive&&r.onReceive(e,n)},i.prototype.dispatchUIEvent=function(t,e,n){if(!t)throw new Error("dispatchUIEvent needs a valid path to dispatch to");if(!e)throw new Error("dispatchUIEvent needs an event name as its second argument");var i;if(o.call(n),i=this.getNode(t)){var r,s,a,u;for(n.node=i;i;){for(i.onReceive&&i.onReceive(e,n),s=i.getComponents(),a=0,u=s.length;u>a;a++)s[a]&&s[a].onReceive&&s[a].onReceive(e,n);if(n.propagationStopped)break;if(r=i.getParent(),r===i)return;i=r}}},e.exports=new i},{"./Event":181,"./Path":184}],181:[function(t,e,n){"use strict";function i(){this.propagationStopped=!1,this.stopPropagation=r}function r(){this.propagationStopped=!0}e.exports=i},{}],182:[function(t,e,n){"use strict";function i(){var t=this;a._setUpdater(this),this._updateQueue=[],this._nextUpdateQueue=[],this._scenes={},this._messages=g,this._inUpdate=!1,this._clock=new r,this._channel=new s,this._channel.onMessage=function(e){t.handleMessage(e)}}var r=t("./Clock"),o=t("./Scene"),s=t("./Channel"),a=t("./Dispatch"),u=t("../renderers/UIManager"),h=t("../renderers/Compositor"),c=t("../render-loops/RequestAnimationFrameLoop"),l=t("./TransformSystem"),f=t("./SizeSystem"),p=t("./Commands"),d=[p.ENGINE,p.START],m=[p.ENGINE,p.STOP],g=[p.TIME,null];i.prototype.init=function(t){return this.compositor=t&&t.compositor||new h,this.renderLoop=t&&t.renderLoop||new c,this.uiManager=new u(this.getChannel(),this.compositor,this.renderLoop),this},i.prototype.setChannel=function(t){return this._channel=t,this},i.prototype.getChannel=function(){return this._channel},i.prototype._update=function(){this._inUpdate=!0;var t,e=this._clock.now(),n=this._nextUpdateQueue,i=this._updateQueue;for(this._messages[1]=e,f.update(),l.onUpdate();n.length;)i.unshift(n.pop());for(;i.length;)t=i.shift(),t&&t.update&&t.update(e),t&&t.onUpdate&&t.onUpdate(e);this._inUpdate=!1},i.prototype.requestUpdate=function(t){if(!t)throw new Error("requestUpdate must be called with a class to be updated");this._inUpdate?this.requestUpdateOnNextTick(t):this._updateQueue.push(t)},i.prototype.requestUpdateOnNextTick=function(t){this._nextUpdateQueue.push(t)},i.prototype.handleMessage=function(t){if(!t)throw new Error("onMessage must be called with an array of messages");for(var e;t.length>0;)switch(e=t.shift()){case p.WITH:this.handleWith(t);break;case p.FRAME:this.handleFrame(t);break;default:throw new Error("received unknown command: "+e)}return this},i.prototype.handleWith=function(t){var e=t.shift(),n=t.shift();switch(n){case p.TRIGGER:var i=t.shift(),r=t.shift();a.dispatchUIEvent(e,i,r);break;default:throw new Error("received unknown command: "+n)}return this},i.prototype.handleFrame=function(t){if(!t)throw new Error("handleFrame must be called with an array of messages");if(!t.length)throw new Error("FRAME must be sent with a time");return this.step(t.shift()),this},i.prototype.step=function(t){if(null==t)throw new Error("step must be called with a time");if(this._clock.step(t),this._update(),this._messages.length)for(this._channel.sendMessage(this._messages);this._messages.length>2;)this._messages.pop();return this},i.prototype.getContext=function(t){if(!t)throw new Error("getContext must be called with a selector");var e=t.indexOf("/");return t=-1===e?t:t.substring(0,e),this._scenes[t]},i.prototype.getClock=function(){return this._clock},i.prototype.message=function(t){return this._messages.push(t),this},i.prototype.createScene=function(t){return t=t||"body",this._scenes[t]&&this._scenes[t].dismount(),this._scenes[t]=new o(t,this),this._scenes[t]},i.prototype.addScene=function(t){var e=t._selector,n=this._scenes[e];return n&&n!==t&&n.dismount(),t.isMounted()||t.mount(),this._scenes[e]=t,this},i.prototype.removeScene=function(t){var e=t._selector,n=this._scenes[e];return n&&n===t&&(t.isMounted()&&t.dismount(),delete this._scenes[e]),this},i.prototype.startRenderLoop=function(){return this._channel.sendMessage(d),this},i.prototype.stopRenderLoop=function(){return this._channel.sendMessage(m),this},i.prototype.startEngine=function(){return console.warn("FamousEngine.startEngine is deprecated! Use FamousEngine.startRenderLoop instead!"),this.startRenderLoop()},i.prototype.stopEngine=function(){return console.warn("FamousEngine.stopEngine is deprecated! Use FamousEngine.stopRenderLoop instead!"),this.stopRenderLoop()},e.exports=new i},{"../render-loops/RequestAnimationFrameLoop":211,"../renderers/Compositor":212,"../renderers/UIManager":214,"./Channel":177,"./Clock":178,"./Commands":179,"./Dispatch":180,"./Scene":186,"./SizeSystem":188,"./TransformSystem":190}],183:[function(t,e,n){"use strict";function i(){this._requestingUpdate=!1,this._inUpdate=!1,this._mounted=!1,this._shown=!1,this._updater=null,this._opacity=1,this._UIEvents=[],this._updateQueue=[],this._nextUpdateQueue=[],this._freedComponentIndicies=[],
this._components=[],this._freedChildIndicies=[],this._children=[],this._parent=null,this._id=null,this._transformID=null,this._sizeID=null,this.constructor.INIT_DEFAULT_COMPONENTS&&this._init()}var r=t("./SizeSystem"),o=t("./Dispatch"),s=t("./TransformSystem"),a=t("./Size"),u=t("./Transform");i.RELATIVE_SIZE=0,i.ABSOLUTE_SIZE=1,i.RENDER_SIZE=2,i.DEFAULT_SIZE=0,i.INIT_DEFAULT_COMPONENTS=!0,i.prototype._init=function(){this._transformID=this.addComponent(new u),this._sizeID=this.addComponent(new a)},i.prototype._setParent=function(t){this._parent&&-1!==this._parent.getChildren().indexOf(this)&&this._parent.removeChild(this),this._parent=t},i.prototype._setMounted=function(t,e){this._mounted=t,this._id=e?e:null},i.prototype._setShown=function(t){this._shown=t},i.prototype._setUpdater=function(t){this._updater=t,this._requestingUpdate&&this._updater.requestUpdate(this)},i.prototype.getLocation=function(){return this._id},i.prototype.getId=i.prototype.getLocation,i.prototype.emit=function(t,e){return o.dispatch(this.getLocation(),t,e),this},i.prototype.sendDrawCommand=function(t){return this._updater.message(t),this},i.prototype.getValue=function(){var t=this._children.length,e=this._components.length,n=0,i={location:this.getId(),spec:{location:this.getId(),showState:{mounted:this.isMounted(),shown:this.isShown(),opacity:this.getOpacity()||null},offsets:{mountPoint:[0,0,0],align:[0,0,0],origin:[0,0,0]},vectors:{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]},size:{sizeMode:[0,0,0],proportional:[1,1,1],differential:[0,0,0],absolute:[0,0,0],render:[0,0,0]}},UIEvents:this._UIEvents,components:[],children:[]};if(i.location){var o=s.get(this.getId()),a=r.get(this.getId());for(n=0;3>n;n++)i.spec.offsets.mountPoint[n]=o.offsets.mountPoint[n],i.spec.offsets.align[n]=o.offsets.align[n],i.spec.offsets.origin[n]=o.offsets.origin[n],i.spec.vectors.position[n]=o.vectors.position[n],i.spec.vectors.rotation[n]=o.vectors.rotation[n],i.spec.vectors.scale[n]=o.vectors.scale[n],i.spec.size.sizeMode[n]=a.sizeMode[n],i.spec.size.proportional[n]=a.proportionalSize[n],i.spec.size.differential[n]=a.differentialSize[n],i.spec.size.absolute[n]=a.absoluteSize[n],i.spec.size.render[n]=a.renderSize[n];i.spec.vectors.rotation[3]=o.vectors.rotation[3]}for(n=0;t>n;n++)this._children[n]&&this._children[n].getValue&&i.children.push(this._children[n].getValue());for(n=0;e>n;n++)this._components[n]&&this._components[n].getValue&&i.components.push(this._components[n].getValue());return i},i.prototype.getComputedValue=function(){console.warn("Node.getComputedValue is depricated. Use Node.getValue instead");for(var t=this._children.length,e={location:this.getId(),computedValues:{transform:this.isMounted()?s.get(this.getLocation()).getLocalTransform():null,size:this.isMounted()?r.get(this.getLocation()).get():null},children:[]},n=0;t>n;n++)this._children[n]&&this._children[n].getComputedValue&&e.children.push(this._children[n].getComputedValue());return e},i.prototype.getChildren=function(){return this._children},i.prototype.getParent=function(){return this._parent},i.prototype.requestUpdate=function(t){return this._inUpdate||!this.isMounted()?this.requestUpdateOnNextTick(t):(this._updateQueue.push(t),this._requestingUpdate||this._requestUpdate(),this)},i.prototype.requestUpdateOnNextTick=function(t){return this._nextUpdateQueue.push(t),this},i.prototype.isMounted=function(){return this._mounted},i.prototype.isShown=function(){return this._shown},i.prototype.getOpacity=function(){return this._opacity},i.prototype.getMountPoint=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getMountPoint();if(this.isMounted())return s.get(this.getLocation()).getMountPoint();throw new Error("This node does not have access to a transform component")},i.prototype.getAlign=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getAlign();if(this.isMounted())return s.get(this.getLocation()).getAlign();throw new Error("This node does not have access to a transform component")},i.prototype.getOrigin=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getOrigin();if(this.isMounted())return s.get(this.getLocation()).getOrigin();throw new Error("This node does not have access to a transform component")},i.prototype.getPosition=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getPosition();if(this.isMounted())return s.get(this.getLocation()).getPosition();throw new Error("This node does not have access to a transform component")},i.prototype.getRotation=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getRotation();if(this.isMounted())return s.get(this.getLocation()).getRotation();throw new Error("This node does not have access to a transform component")},i.prototype.getScale=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._transformID).getScale();if(this.isMounted())return s.get(this.getLocation()).getScale();throw new Error("This node does not have access to a transform component")},i.prototype.getSizeMode=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).getSizeMode();if(this.isMounted())return r.get(this.getLocation()).getSizeMode();throw new Error("This node does not have access to a size component")},i.prototype.getProportionalSize=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).getProportional();if(this.isMounted())return r.get(this.getLocation()).getProportional();throw new Error("This node does not have access to a size component")},i.prototype.getDifferentialSize=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).getDifferential();if(this.isMounted())return r.get(this.getLocation()).getDifferential();throw new Error("This node does not have access to a size component")},i.prototype.getAbsoluteSize=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).getAbsolute();if(this.isMounted())return r.get(this.getLocation()).getAbsolute();throw new Error("This node does not have access to a size component")},i.prototype.getRenderSize=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).getRender();if(this.isMounted())return r.get(this.getLocation()).getRender();throw new Error("This node does not have access to a size component")},i.prototype.getSize=function(){if(this.constructor.INIT_DEFAULT_COMPONENTS)return this.getComponent(this._sizeID).get();if(this.isMounted())return r.get(this.getLocation()).get();throw new Error("This node does not have access to a size component")},i.prototype.getTransform=function(){return s.get(this.getLocation())},i.prototype.getUIEvents=function(){return this._UIEvents},i.prototype.addChild=function(t){var e=t?this._children.indexOf(t):-1;return t=t?t:new i,-1===e&&(e=this._freedChildIndicies.length?this._freedChildIndicies.pop():this._children.length,this._children[e]=t),this.isMounted()&&t.mount(this.getLocation()+"/"+e),t},i.prototype.removeChild=function(t){var e=this._children.indexOf(t);if(e>-1)return this._freedChildIndicies.push(e),this._children[e]=null,t.isMounted()&&t.dismount(),!0;throw new Error("Node is not a child of this node")},i.prototype.addComponent=function(t){var e=this._components.indexOf(t);return-1===e&&(e=this._freedComponentIndicies.length?this._freedComponentIndicies.pop():this._components.length,this._components[e]=t,this.isMounted()&&t.onMount&&t.onMount(this,e),this.isShown()&&t.onShow&&t.onShow()),e},i.prototype.getComponent=function(t){return this._components[t]},i.prototype.removeComponent=function(t){var e=this._components.indexOf(t);return-1!==e&&(this._freedComponentIndicies.push(e),this.isShown()&&t.onHide&&t.onHide(),this.isMounted()&&t.onDismount&&t.onDismount(),this._components[e]=null),t},i.prototype.removeUIEvent=function(t){var e,n=this.getUIEvents(),i=this._components,r=n.indexOf(t);if(-1!==r){n.splice(r,1);for(var o=0,s=i.length;s>o;o++)e=i[o],e&&e.onRemoveUIEvent&&e.onRemoveUIEvent(t)}},i.prototype.addUIEvent=function(t){var e,n=this.getUIEvents(),i=this._components,r=-1!==n.indexOf(t);if(!r){n.push(t);for(var o=0,s=i.length;s>o;o++)e=i[o],e&&e.onAddUIEvent&&e.onAddUIEvent(t)}},i.prototype._requestUpdate=function(t){(t||!this._requestingUpdate)&&(this._updater&&this._updater.requestUpdate(this),this._requestingUpdate=!0)},i.prototype._vecOptionalSet=function(t,e,n){return null!=n&&t[e]!==n?(t[e]=n,this._requestingUpdate||this._requestUpdate(),!0):!1},i.prototype.show=function(){return o.show(this.getLocation()),this._shown=!0,this},i.prototype.hide=function(){return o.hide(this.getLocation()),this._shown=!1,this},i.prototype.setAlign=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setAlign(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setAlign(t,e,n)}return this},i.prototype.setMountPoint=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setMountPoint(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setMountPoint(t,e,n)}return this},i.prototype.setOrigin=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setOrigin(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setOrigin(t,e,n)}return this},i.prototype.setPosition=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setPosition(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setPosition(t,e,n)}return this},i.prototype.setRotation=function(t,e,n,i){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setRotation(t,e,n,i);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setRotation(t,e,n,i)}return this},i.prototype.setScale=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._transformID).setScale(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a transform component");s.get(this.getLocation()).setScale(t,e,n)}return this},i.prototype.setOpacity=function(t){if(t!==this._opacity){this._opacity=t,this._requestingUpdate||this._requestUpdate();for(var e,n=0,i=this._components,r=i.length;r>n;n++)e=i[n],e&&e.onOpacityChange&&e.onOpacityChange(t)}return this},i.prototype.setSizeMode=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._sizeID).setSizeMode(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a size component");r.get(this.getLocation()).setSizeMode(t,e,n)}return this},i.prototype.setProportionalSize=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._sizeID).setProportional(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a size component");r.get(this.getLocation()).setProportional(t,e,n)}return this},i.prototype.setDifferentialSize=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._sizeID).setDifferential(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a size component");r.get(this.getLocation()).setDifferential(t,e,n)}return this},i.prototype.setAbsoluteSize=function(t,e,n){if(this.constructor.INIT_DEFAULT_COMPONENTS)this.getComponent(this._sizeID).setAbsolute(t,e,n);else{if(!this.isMounted())throw new Error("This node does not have access to a size component");r.get(this.getLocation()).setAbsolute(t,e,n)}return this},i.prototype.getFrame=function(){return this._updater.getFrame()},i.prototype.getComponents=function(){return this._components},i.prototype.update=function(t){this._inUpdate=!0;var e,n=this._nextUpdateQueue,i=this._updateQueue;for(this.onUpdate&&this.onUpdate();n.length;)i.unshift(n.pop());for(;i.length;)e=this._components[i.shift()],e&&e.onUpdate&&e.onUpdate(t);return this._inUpdate=!1,this._requestingUpdate=!1,this.isMounted()?this._nextUpdateQueue.length&&(this._updater.requestUpdateOnNextTick(this),this._requestingUpdate=!0):(this._parent=null,this._id=null),this},i.prototype.mount=function(t){if(this.isMounted())throw new Error("Node is already mounted at: "+this.getLocation());return this.constructor.INIT_DEFAULT_COMPONENTS?(s.registerTransformAtPath(t,this.getComponent(this._transformID)),r.registerSizeAtPath(t,this.getComponent(this._sizeID))):(s.registerTransformAtPath(t),r.registerSizeAtPath(t)),o.mount(t,this),this._requestingUpdate||this._requestUpdate(),this},i.prototype.dismount=function(){if(!this.isMounted())throw new Error("Node is not mounted");var t=this.getLocation();s.deregisterTransformAtPath(t),r.deregisterSizeAtPath(t),o.dismount(t),this._requestingUpdate||this._requestUpdate()},e.exports=i},{"./Dispatch":180,"./Size":187,"./SizeSystem":188,"./Transform":189,"./TransformSystem":190}],184:[function(t,e,n){"use strict";function i(){}i.prototype.hasTrailingSlash=function(t){return"/"===t[t.length-1]},i.prototype.depth=function(t){for(var e=0,n=t.length,i=this.hasTrailingSlash(t)?n-1:n,r=0;i>r;r++)e+="/"===t[r]?1:0;return e},i.prototype.index=function(t){for(var e=t.length,n=this.hasTrailingSlash(t)?e-1:e;n--&&"/"!==t[n];);var i=parseInt(t.substring(n+1));return isNaN(i)?0:i},i.prototype.indexAtDepth=function(t,e){for(var n=0,i=t.length,r=0;i>n;n++)if("/"===t[n]&&r++,r===e)return t=t.substring(n?n+1:n),r=t.indexOf("/"),t=-1===r?t:t.substring(0,r),r=parseInt(t),isNaN(r)?t:r},i.prototype.parent=function(t){return t.substring(0,t.lastIndexOf("/",t.length-2))},i.prototype.isChildOf=function(t,e){return this.isDescendentOf(t,e)&&this.depth(t)===this.depth(e)+1},i.prototype.isDescendentOf=function(t,e){return t===e?!1:(t=this.hasTrailingSlash(t)?t:t+"/",e=this.hasTrailingSlash(e)?e:e+"/",this.depth(e)<this.depth(t)&&0===t.indexOf(e))},i.prototype.getSelector=function(t){var e=t.indexOf("/");return-1===e?t:t.substring(0,e)},e.exports=new i},{}],185:[function(t,e,n){"use strict";function i(){this.items=[],this.paths=[],this.memo={}}var r=t("./Path");i.prototype.insert=function(t,e){var n=this.paths,i=n.indexOf(t);if(-1!==i)throw new Error("item already exists at path: "+t);for(var o=0,s=r.depth(t),a=r.index(t);n[o]&&s>=r.depth(n[o]);)o++;for(;n[o]&&s===r.depth(n[o])&&a<r.index(n[o]);)o++;n.splice(o,0,t),this.items.splice(o,0,e),this.memo[t]=o;for(var u=this.paths.length;u>o;o++)this.memo[this.paths[o]]=null},i.prototype.remove=function(t){var e=this.paths,n=this.memo[t]?this.memo[t]:e.indexOf(t);if(-1===n)throw new Error("Cannot remove. No item exists at path: "+t);e.splice(n,1),this.items.splice(n,1),this.memo[t]=null;for(var i=this.paths.length;i>n;n++)this.memo[this.paths[n]]=null},i.prototype.get=function(t){if(this.memo[t])return this.items[this.memo[t]];var e=this.paths.indexOf(t);return-1===e?void 0:(this.memo[t]=e,this.items[e])},i.prototype.getItems=function(){return this.items},i.prototype.getPaths=function(){return this.paths},e.exports=i},{"./Path":184}],186:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("Scene needs to be created with a DOM selector");if(!e)throw new Error("Scene needs to be created with a class like Famous");r.call(this),this._globalUpdater=e,this._selector=t,this.mount(t),this._globalUpdater.message(s.NEED_SIZE_FOR).message(t),this.show()}var r=t("./Node"),o=t("./Dispatch"),s=t("./Commands"),a=t("./TransformSystem"),u=t("./SizeSystem");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.getUpdater=function(){return this._updater},i.prototype.getSelector=function(){return this._selector},i.prototype.getDispatch=function(){return console.warn("Scene#getDispatch is deprecated, require the dispatch directly"),o},i.prototype.onReceive=function(t,e){if("CONTEXT_RESIZE"===t){if(e.length<2)throw new Error("CONTEXT_RESIZE's payload needs to be at least a pair of pixel sizes");this.setSizeMode("absolute","absolute","absolute"),this.setAbsoluteSize(e[0],e[1],e[2]?e[2]:0),this._updater.message(s.WITH).message(this._selector).message(s.READY)}},i.prototype.mount=function(t){if(this.isMounted())throw new Error("Scene is already mounted at: "+this.getLocation());o.mount(t,this),this._id=t,this._mounted=!0,this._parent=this,a.registerTransformAtPath(t),u.registerSizeAtPath(t)},e.exports=i},{"./Commands":179,"./Dispatch":180,"./Node":183,"./SizeSystem":188,"./TransformSystem":190}],187:[function(t,e,n){"use strict";function i(t){this.finalSize=new Float32Array(3),this.sizeChanged=!1,this.sizeMode=new Uint8Array(3),this.sizeModeChanged=!1,this.absoluteSize=new Float32Array(3),this.absoluteSizeChanged=!1,this.proportionalSize=new Float32Array(a),this.proportionalSizeChanged=!1,this.differentialSize=new Float32Array(3),this.differentialSizeChanged=!1,this.renderSize=new Float32Array(3),this.renderSizeChanged=!1,this.parent=null!=t?t:null}function r(t,e,n){return null!=n&&t[e]!==n?(t[e]=n,!0):!1}function o(t,e,n,i){var o=!1;return o=r(t,0,e)||o,o=r(t,1,n)||o,o=r(t,2,i)||o}function s(t){if(t.constructor===String)switch(t.toLowerCase()){case"relative":case"default":return i.RELATIVE;case"absolute":return i.ABSOLUTE;case"render":return i.RENDER;default:throw new Error("unknown size mode: "+t)}else if(0>t||t>i.RENDER)throw new Error("unknown size mode: "+t);return t}var a=[1,1,1],u=[0,0,0];i.RELATIVE=0,i.ABSOLUTE=1,i.RENDER=2,i.DEFAULT=i.RELATIVE,i.prototype.setParent=function(t){return this.parent=t,this},i.prototype.getParent=function(){return this.parent},i.prototype.setSizeMode=function(t,e,n){return null!=t&&(t=s(t)),null!=e&&(e=s(e)),null!=n&&(n=s(n)),this.sizeModeChanged=o(this.sizeMode,t,e,n),this},i.prototype.getSizeMode=function(){return this.sizeMode},i.prototype.setAbsolute=function(t,e,n){return this.absoluteSizeChanged=o(this.absoluteSize,t,e,n),this},i.prototype.getAbsolute=function(){return this.absoluteSize},i.prototype.setProportional=function(t,e,n){return this.proportionalSizeChanged=o(this.proportionalSize,t,e,n),this},i.prototype.getProportional=function(){return this.proportionalSize},i.prototype.setDifferential=function(t,e,n){return this.differentialSizeChanged=o(this.differentialSize,t,e,n),this},i.prototype.getDifferential=function(){return this.differentialSize},i.prototype.get=function(){return this.finalSize},i.prototype.fromComponents=function(t){for(var e,n,r=this.sizeMode,o=this.finalSize,s=this.parent?this.parent.get():u,a=!1,h=t.length,c=0;3>c;c++){switch(e=o[c],r[c]){case i.RELATIVE:o[c]=s[c]*this.proportionalSize[c]+this.differentialSize[c];break;case i.ABSOLUTE:o[c]=this.absoluteSize[c];break;case i.RENDER:var l,f;for(n=0;h>n;n++)f=t[n],f&&f.getRenderSize&&(l=f.getRenderSize()[c],o[c]=o[c]<l||0===o[c]?l:o[c])}a=a||e!==o[c]}return this.sizeChanged=a,a},e.exports=i},{}],188:[function(t,e,n){"use strict";function i(){this.pathStore=new c}function r(t,e,n){var i=n.getSizeMode(),r=i[0],o=i[1],s=i[2];t.onSizeModeChange&&t.onSizeModeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onSizeModeChange&&e[a].onSizeModeChange(r,o,s);n.sizeModeChanged=!1}function o(t,e,n){var i=n.getAbsolute(),r=i[0],o=i[1],s=i[2];t.onAbsoluteSizeChange&&t.onAbsoluteSizeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onAbsoluteSizeChange&&e[a].onAbsoluteSizeChange(r,o,s);n.absoluteSizeChanged=!1}function s(t,e,n){var i=n.getProportional(),r=i[0],o=i[1],s=i[2];t.onProportionalSizeChange&&t.onProportionalSizeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onProportionalSizeChange&&e[a].onProportionalSizeChange(r,o,s);n.proportionalSizeChanged=!1}function a(t,e,n){var i=n.getDifferential(),r=i[0],o=i[1],s=i[2];t.onDifferentialSizeChange&&t.onDifferentialSizeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onDifferentialSizeChange&&e[a].onDifferentialSizeChange(r,o,s);n.differentialSizeChanged=!1}function u(t,e,n){var i=n.getRenderSize(),r=i[0],o=i[1],s=i[2];t.onRenderSizeChange&&t.onRenderSizeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onRenderSizeChange&&e[a].onRenderSizeChange(r,o,s);n.renderSizeChanged=!1}function h(t,e,n){var i=n.get(),r=i[0],o=i[1],s=i[2];t.onSizeChange&&t.onSizeChange(r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onSizeChange&&e[a].onSizeChange(r,o,s);n.sizeChanged=!1}var c=t("./PathStore"),l=t("./Size"),f=t("./Dispatch"),p=t("./Path");i.prototype.registerSizeAtPath=function(t,e){if(!p.depth(t))return this.pathStore.insert(t,e?e:new l);var n=this.pathStore.get(p.parent(t));if(!n)throw new Error("No parent size registered at expected path: "+p.parent(t));e&&e.setParent(n),this.pathStore.insert(t,e?e:new l(n))},i.prototype.deregisterSizeAtPath=function(t){this.pathStore.remove(t)},i.prototype.get=function(t){return this.pathStore.get(t)},i.prototype.update=function(){var t,e,n,i,c,l=this.pathStore.getItems(),p=this.pathStore.getPaths();for(n=0,i=l.length;i>n;n++)t=f.getNode(p[n]),c=t.getComponents(),t&&(e=l[n],e.sizeModeChanged&&r(t,c,e),e.absoluteSizeChanged&&o(t,c,e),e.proportionalSizeChanged&&s(t,c,e),e.differentialSizeChanged&&a(t,c,e),e.renderSizeChanged&&u(t,c,e),e.fromComponents(c)&&h(t,c,e))},e.exports=new i},{"./Dispatch":180,"./Path":184,"./PathStore":185,"./Size":187}],189:[function(t,e,n){"use strict";function i(t){this.local=new Float32Array(i.IDENT),this.global=new Float32Array(i.IDENT),this.offsets={align:new Float32Array(3),alignChanged:!1,mountPoint:new Float32Array(3),mountPointChanged:!1,origin:new Float32Array(3),originChanged:!1},this.vectors={position:new Float32Array(3),positionChanged:!1,rotation:new Float32Array(h),rotationChanged:!1,scale:new Float32Array(c),scaleChanged:!1},this._lastEulerVals=[0,0,0],this._lastEuler=!1,this.parent=t?t:null,this.breakPoint=!1}function r(t,e,n){return null!=n&&t[e]!==n?(t[e]=n,!0):!1}function o(t,e,n,i,o){var s=!1;return s=r(t,0,e)||s,s=r(t,1,n)||s,s=r(t,2,i)||s,null!=o&&(s=r(t,3,o)||s),s}function s(t,e){var n=e.getLocalTransform(),r=t.getSize(),o=e.vectors,s=e.offsets,a=t.getParent().getSize(),u=0,h=n[0],c=n[1],l=n[2],f=n[4],p=n[5],d=n[6],m=n[8],g=n[9],_=n[10],y=n[12],v=n[13],b=n[14],w=o.position[0],T=o.position[1],E=o.position[2],S=o.rotation[0],x=o.rotation[1],O=o.rotation[2],C=o.rotation[3],$=o.scale[0],R=o.scale[1],I=o.scale[2],A=s.align[0]*a[0],N=s.align[1]*a[1],M=s.align[2]*a[2],L=s.mountPoint[0]*r[0],z=s.mountPoint[1]*r[1],P=s.mountPoint[2]*r[2],D=s.origin[0]*r[0],U=s.origin[1]*r[1],F=s.origin[2]*r[2],k=C*S,G=C*x,H=C*O,j=S*S,q=x*x,B=O*O,V=S*x,W=S*O,Y=x*O;return n[0]=(1-2*(q+B))*$,n[1]=2*(V+H)*$,n[2]=2*(W-G)*$,n[3]=0,n[4]=2*(V-H)*R,n[5]=(1-2*(j+B))*R,n[6]=2*(Y+k)*R,n[7]=0,n[8]=2*(W+G)*I,n[9]=2*(Y-k)*I,n[10]=(1-2*(j+q))*I,n[11]=0,n[12]=A+w-L+D-(n[0]*D+n[4]*U+n[8]*F),n[13]=N+T-z+U-(n[1]*D+n[5]*U+n[9]*F),n[14]=M+E-P+F-(n[2]*D+n[6]*U+n[10]*F),n[15]=1,e.isBreakPoint()&&e.calculateWorldMatrix()&&(u|=i.WORLD_CHANGED),(h!==n[0]||c!==n[1]||l!==n[2]||f!==n[4]||p!==n[5]||d!==n[6]||m!==n[8]||g!==n[9]||_!==n[10]||y!==n[12]||v!==n[13]||b!==n[14])&&(u|=i.LOCAL_CHANGED),u}function a(t,e){var n=e.getLocalTransform(),r=e.parent.getLocalTransform(),o=t.getSize(),s=e.vectors,a=e.offsets,u=t.getParent().getSize(),h=!1,c=n[0],l=n[1],f=n[2],p=n[4],d=n[5],m=n[6],g=n[8],_=n[9],y=n[10],v=n[12],b=n[13],w=n[14],T=r[0],E=r[1],S=r[2],x=r[4],O=r[5],C=r[6],$=r[8],R=r[9],I=r[10],A=r[12],N=r[13],M=r[14],L=s.position[0],z=s.position[1],P=s.position[2],D=s.rotation[0],U=s.rotation[1],F=s.rotation[2],k=s.rotation[3],G=s.scale[0],H=s.scale[1],j=s.scale[2],q=a.align[0]*u[0],B=a.align[1]*u[1],V=a.align[2]*u[2],W=a.mountPoint[0]*o[0],Y=a.mountPoint[1]*o[1],Q=a.mountPoint[2]*o[2],K=a.origin[0]*o[0],X=a.origin[1]*o[1],Z=a.origin[2]*o[2],J=k*D,tt=k*U,et=k*F,nt=D*D,it=U*U,rt=F*F,ot=D*U,st=D*F,at=U*F,ut=(1-2*(it+rt))*G,ht=2*(ot+et)*G,ct=2*(st-tt)*G,lt=2*(ot-et)*H,ft=(1-2*(nt+rt))*H,pt=2*(at+J)*H,dt=2*(st+tt)*j,mt=2*(at-J)*j,gt=(1-2*(nt+it))*j,_t=q+L-W+K-(ut*K+lt*X+dt*Z),yt=B+z-Y+X-(ht*K+ft*X+mt*Z),vt=V+P-Q+Z-(ct*K+pt*X+gt*Z);return n[0]=T*ut+x*ht+$*ct,n[1]=E*ut+O*ht+R*ct,n[2]=S*ut+C*ht+I*ct,n[3]=0,n[4]=T*lt+x*ft+$*pt,n[5]=E*lt+O*ft+R*pt,n[6]=S*lt+C*ft+I*pt,n[7]=0,n[8]=T*dt+x*mt+$*gt,n[9]=E*dt+O*mt+R*gt,n[10]=S*dt+C*mt+I*gt,n[11]=0,n[12]=T*_t+x*yt+$*vt+A,n[13]=E*_t+O*yt+R*vt+N,n[14]=S*_t+C*yt+I*vt+M,n[15]=1,e.isBreakPoint()&&e.calculateWorldMatrix()&&(h|=i.WORLD_CHANGED),(c!==n[0]||l!==n[1]||f!==n[2]||p!==n[4]||d!==n[5]||m!==n[6]||g!==n[8]||_!==n[9]||y!==n[10]||v!==n[12]||b!==n[13]||w!==n[14])&&(h|=i.LOCAL_CHANGED),h}function u(t,e,n){var i,r=e[0],o=e[1],s=e[2],a=e[4],u=e[5],h=e[6],c=e[8],l=e[9],f=e[10],p=e[12],d=e[13],m=e[14],g=!1,_=n[0],y=n[1],v=n[2],b=n[3];return i=_*r+y*a+v*c+b*p,g=g?g:t[0]===i,t[0]=i,i=_*o+y*u+v*l+b*d,g=g?g:t[1]===i,t[1]=i,i=_*s+y*h+v*f+b*m,g=g?g:t[2]===i,t[2]=i,t[3]=0,_=n[4],y=n[5],v=n[6],b=n[7],i=_*r+y*a+v*c+b*p,g=g?g:t[4]===i,t[4]=i,i=_*o+y*u+v*l+b*d,g=g?g:t[5]===i,t[5]=i,i=_*s+y*h+v*f+b*m,g=g?g:t[6]===i,t[6]=i,t[7]=0,_=n[8],y=n[9],v=n[10],b=n[11],i=_*r+y*a+v*c+b*p,g=g?g:t[8]===i,t[8]=i,i=_*o+y*u+v*l+b*d,g=g?g:t[9]===i,t[9]=i,i=_*s+y*h+v*f+b*m,g=g?g:t[10]===i,t[10]=i,t[11]=0,_=n[12],y=n[13],v=n[14],b=n[15],i=_*r+y*a+v*c+b*p,g=g?g:t[12]===i,t[12]=i,i=_*o+y*u+v*l+b*d,g=g?g:t[13]===i,t[13]=i,i=_*s+y*h+v*f+b*m,g=g?g:t[14]===i,t[14]=i,t[15]=1,g}var h=[0,0,0,1],c=[1,1,1];i.IDENT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i.WORLD_CHANGED=1,i.LOCAL_CHANGED=2,i.prototype.reset=function(){this.parent=null,this.breakPoint=!1},i.prototype.setParent=function(t){this.parent=t},i.prototype.getParent=function(){return this.parent},i.prototype.setBreakPoint=function(){this.breakPoint=!0},i.prototype.isBreakPoint=function(){return this.breakPoint},i.prototype.getLocalTransform=function(){return this.local},i.prototype.getWorldTransform=function(){if(!this.isBreakPoint())throw new Error("This transform is not calculating world transforms");return this.global},i.prototype.calculate=function(t){return!this.parent||this.parent.isBreakPoint()?s(t,this):a(t,this)},i.prototype.getPosition=function(){return this.vectors.position},i.prototype.setPosition=function(t,e,n){this.vectors.positionChanged=o(this.vectors.position,t,e,n)},i.prototype.getRotation=function(){return this.vectors.rotation},i.prototype.setRotation=function(t,e,n,i){var r,s,a,u,h=this.vectors.rotation;if(null!=i)r=t,s=e,a=n,u=i,this._lastEulerVals[0]=null,this._lastEulerVals[1]=null,this._lastEulerVals[2]=null,this._lastEuler=!1;else{if(null==t||null==e||null==n)if(this._lastEuler)t=null==t?this._lastEulerVals[0]:t,e=null==e?this._lastEulerVals[1]:e,n=null==n?this._lastEulerVals[2]:n;else{var c=-2*(h[1]*h[2]-h[3]*h[0]);Math.abs(c)>.99999?(e=null==e?.5*Math.PI*c:e,t=null==t?Math.atan2(-h[0]*h[2]+h[3]*h[1],.5-h[1]*h[1]-h[2]*h[2]):t,n=null==n?0:n):(e=null==e?Math.asin(c):e,t=null==t?Math.atan2(h[0]*h[2]+h[3]*h[1],.5-h[0]*h[0]-h[1]*h[1]):t,n=null==n?Math.atan2(h[0]*h[1]+h[3]*h[2],.5-h[0]*h[0]-h[2]*h[2]):n)}var l=.5*t,f=.5*e,p=.5*n,d=Math.sin(l),m=Math.sin(f),g=Math.sin(p),_=Math.cos(l),y=Math.cos(f),v=Math.cos(p),b=m*g,w=y*g,T=m*v,E=y*v;r=d*E+_*b,s=_*T-d*w,a=_*w+d*T,u=_*E-d*b,this._lastEuler=!0,this._lastEulerVals[0]=t,this._lastEulerVals[1]=e,this._lastEulerVals[2]=n}this.vectors.rotationChanged=o(h,r,s,a,u)},i.prototype.getScale=function(){return this.vectors.scale},i.prototype.setScale=function(t,e,n){this.vectors.scaleChanged=o(this.vectors.scale,t,e,n)},i.prototype.getAlign=function(){return this.offsets.align},i.prototype.setAlign=function(t,e,n){this.offsets.alignChanged=o(this.offsets.align,t,e,null!=n?n-.5:n)},i.prototype.getMountPoint=function(){return this.offsets.mountPoint},i.prototype.setMountPoint=function(t,e,n){this.offsets.mountPointChanged=o(this.offsets.mountPoint,t,e,null!=n?n-.5:n)},i.prototype.getOrigin=function(){return this.offsets.origin},i.prototype.setOrigin=function(t,e,n){this.offsets.originChanged=o(this.offsets.origin,t,e,null!=n?n-.5:n)},i.prototype.calculateWorldMatrix=function(){for(var t=this.parent;t&&!t.isBreakPoint();)t=t.parent;if(t)return u(this.global,t.getWorldTransform(),this.local);for(var e=0;16>e;e++)this.global[e]=this.local[e];return!1},e.exports=i},{}],190:[function(t,e,n){"use strict";function i(){this.pathStore=new g}function r(t,e,n){var i=n.align[0],r=n.align[1],o=n.align[2];t.onAlignChange&&t.onAlignChange(i,r,o);for(var s=0,a=e.length;a>s;s++)e[s]&&e[s].onAlignChange&&e[s].onAlignChange(i,r,o);n.alignChanged=!1}function o(t,e,n){var i=n.mountPoint[0],r=n.mountPoint[1],o=n.mountPoint[2];t.onMountPointChange&&t.onMountPointChange(i,r,o);for(var s=0,a=e.length;a>s;s++)e[s]&&e[s].onMountPointChange&&e[s].onMountPointChange(i,r,o);n.mountPointChanged=!1}function s(t,e,n){var i=n.origin[0],r=n.origin[1],o=n.origin[2];t.onOriginChange&&t.onOriginChange(i,r,o);for(var s=0,a=e.length;a>s;s++)e[s]&&e[s].onOriginChange&&e[s].onOriginChange(i,r,o);n.originChanged=!1}function a(t,e,n){var i=n.position[0],r=n.position[1],o=n.position[2];t.onPositionChange&&t.onPositionChange(i,r,o);for(var s=0,a=e.length;a>s;s++)e[s]&&e[s].onPositionChange&&e[s].onPositionChange(i,r,o);n.positionChanged=!1}function u(t,e,n){var i=n.rotation[0],r=n.rotation[1],o=n.rotation[2],s=n.rotation[3];t.onRotationChange&&t.onRotationChange(i,r,o,s);for(var a=0,u=e.length;u>a;a++)e[a]&&e[a].onRotationChange&&e[a].onRotationChange(i,r,o,s);n.rotationChanged=!1}function h(t,e,n){var i=n.scale[0],r=n.scale[1],o=n.scale[2];t.onScaleChange&&t.onScaleChange(i,r,o);for(var s=0,a=e.length;a>s;s++)e[s]&&e[s].onScaleChange&&e[s].onScaleChange(i,r,o);n.scaleChanged=!1}function c(t,e,n){t.onTransformChange&&t.onTransformChange(n);for(var i=0,r=e.length;r>i;i++)e[i]&&e[i].onTransformChange&&e[i].onTransformChange(n)}function l(t,e,n){t.onLocalTransformChange&&t.onLocalTransformChange(n);for(var i=0,r=e.length;r>i;i++)e[i]&&e[i].onLocalTransformChange&&e[i].onLocalTransformChange(n)}function f(t,e,n){t.onWorldTransformChange&&t.onWorldTransformChange(n);for(var i=0,r=e.length;r>i;i++)e[i]&&e[i].onWorldTransformChange&&e[i].onWorldTransformChange(n)}var p=t("./Path"),d=t("./Transform"),m=t("./Dispatch"),g=t("./PathStore");i.prototype.registerTransformAtPath=function(t,e){if(!p.depth(t))return this.pathStore.insert(t,e?e:new d);var n=this.pathStore.get(p.parent(t));if(!n)throw new Error("No parent transform registered at expected path: "+p.parent(t));e&&e.setParent(n),this.pathStore.insert(t,e?e:new d(n))},i.prototype.deregisterTransformAtPath=function(t){this.pathStore.remove(t)},i.prototype.makeBreakPointAt=function(t){var e=this.pathStore.get(t);if(!e)throw new Error("No transform Registered at path: "+t);e.setBreakPoint()},i.prototype.get=function(t){return this.pathStore.get(t)},i.prototype.onUpdate=function(){for(var t,e,n,i,p,g,_=this.pathStore.getItems(),y=this.pathStore.getPaths(),v=0,b=_.length;b>v;v++)n=m.getNode(y[v]),n&&(g=n.getComponents(),t=_[v],i=t.vectors,p=t.offsets,p.alignChanged&&r(n,g,p),p.mountPointChanged&&o(n,g,p),p.originChanged&&s(n,g,p),i.positionChanged&&a(n,g,i),i.rotationChanged&&u(n,g,i),i.scaleChanged&&h(n,g,i),(e=t.calculate(n))&&(c(n,g,t),e&d.LOCAL_CHANGED&&l(n,g,t.getLocalTransform()),e&d.WORLD_CHANGED&&f(n,g,t.getWorldTransform())))},e.exports=new i},{"./Dispatch":180,"./Path":184,"./PathStore":185,"./Transform":189}],191:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("DOMElement must be instantiated on a node");if(this._changeQueue=[],this._requestingUpdate=!1,this._renderSized=!1,this._requestRenderSize=!1,this._UIEvents=t.getUIEvents().slice(0),this._classes=["famous-dom-element"],this._requestingEventListeners=[],this._styles={},this._attributes={},this._content="",this._tagName=e&&e.tagName?e.tagName:"div",
this._renderSize=[0,0,0],this._id=t?t.addComponent(this):null,this._node=t,this.onSizeModeChange.apply(this,t.getSizeMode()),this._callbacks=new r,this.setProperty("display",t.isShown()?"block":"none"),this.onOpacityChange(t.getOpacity()),e){var n,i;if(e.classes)for(n=0;n<e.classes.length;n++)this.addClass(e.classes[n]);if(e.attributes)for(i in e.attributes)this.setAttribute(i,e.attributes[i]);if(e.properties)for(i in e.properties)this.setProperty(i,e.properties[i]);e.id&&this.setId(e.id),e.content&&this.setContent(e.content),e.cutout===!1&&this.setCutoutState(e.cutout)}}var r=t("../utilities/CallbackStore"),o=t("../core/TransformSystem"),s=t("../core/Commands"),a=2;i.prototype.getValue=function(){return{classes:this._classes,styles:this._styles,attributes:this._attributes,content:this._content,id:this._attributes.id,tagName:this._tagName}},i.prototype.onUpdate=function(){var t=this._node,e=this._changeQueue,n=e.length;if(n&&t){for(t.sendDrawCommand(s.WITH),t.sendDrawCommand(t.getLocation());n--;)t.sendDrawCommand(e.shift());this._requestRenderSize&&(t.sendDrawCommand(s.DOM_RENDER_SIZE),t.sendDrawCommand(t.getLocation()),this._requestRenderSize=!1)}this._requestingUpdate=!1},i.prototype.onMount=function(t,e){this._node=t,this._id=e,this._UIEvents=t.getUIEvents().slice(0),o.makeBreakPointAt(t.getLocation()),this.draw(),this.setAttribute("data-fa-path",t.getLocation())},i.prototype.onDismount=function(){this.setProperty("display","none"),this.setAttribute("data-fa-path",""),this.setCutoutState(!1),this.onUpdate(),this._initialized=!1},i.prototype.onShow=function(){this.setProperty("display","block")},i.prototype.onHide=function(){this.setProperty("display","none")},i.prototype.setCutoutState=function(t){return this._initialized&&this._changeQueue.push(s.GL_CUTOUT_STATE,t),this._requestingUpdate||this._requestUpdate(),this},i.prototype.onTransformChange=function(t){this._changeQueue.push(s.CHANGE_TRANSFORM),t=t.getLocalTransform();for(var e=0,n=t.length;n>e;e++)this._changeQueue.push(t[e]);this._requestingUpdate||this._requestUpdate()},i.prototype.onSizeChange=function(t,e){var n=this._node.getSizeMode(),i=n[0]!==a,r=n[1]!==a;return this._initialized&&this._changeQueue.push(s.CHANGE_SIZE,i?t:i,r?e:r),this._requestingUpdate||this._requestUpdate(),this},i.prototype.onOpacityChange=function(t){return this.setProperty("opacity",t)},i.prototype.onAddUIEvent=function(t){return-1===this._UIEvents.indexOf(t)?(this._subscribe(t),this._UIEvents.push(t)):this._inDraw&&this._subscribe(t),this},i.prototype.onRemoveUIEvent=function(t){var e=this._UIEvents.indexOf(t);return-1!==e?(this._unsubscribe(t),this._UIEvents.splice(e,1)):this._inDraw&&this._unsubscribe(t),this},i.prototype._subscribe=function(t){this._initialized&&this._changeQueue.push(s.SUBSCRIBE,t),this._requestingUpdate||this._requestUpdate()},i.prototype.preventDefault=function(t){this._initialized&&this._changeQueue.push(s.PREVENT_DEFAULT,t),this._requestingUpdate||this._requestUpdate()},i.prototype.allowDefault=function(t){this._initialized&&this._changeQueue.push(s.ALLOW_DEFAULT,t),this._requestingUpdate||this._requestUpdate()},i.prototype._unsubscribe=function(t){this._initialized&&this._changeQueue.push("UNSUBSCRIBE",t),this._requestingUpdate||this._requestUpdate()},i.prototype.onSizeModeChange=function(t,e,n){(t===a||e===a||n===a)&&(this._renderSized=!0,this._requestRenderSize=!0);var i=this._node.getSize();this.onSizeChange(i[0],i[1])},i.prototype.getRenderSize=function(){return this._renderSize},i.prototype._requestUpdate=function(){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0)},i.prototype.init=function(){this._changeQueue.push(s.INIT_DOM,this._tagName),this._initialized=!0,this.onTransformChange(o.get(this._node.getLocation()));var t=this._node.getSize();this.onSizeChange(t[0],t[1]),this._requestingUpdate||this._requestUpdate()},i.prototype.setId=function(t){return this.setAttribute("id",t),this},i.prototype.addClass=function(t){return this._classes.indexOf(t)<0?(this._initialized&&this._changeQueue.push(s.ADD_CLASS,t),this._classes.push(t),this._requestingUpdate||this._requestUpdate(),this._renderSized&&(this._requestRenderSize=!0),this):(this._inDraw&&(this._initialized&&this._changeQueue.push(s.ADD_CLASS,t),this._requestingUpdate||this._requestUpdate()),this)},i.prototype.removeClass=function(t){var e=this._classes.indexOf(t);return 0>e?this:(this._changeQueue.push(s.REMOVE_CLASS,t),this._classes.splice(e,1),this._requestingUpdate||this._requestUpdate(),this)},i.prototype.hasClass=function(t){return-1!==this._classes.indexOf(t)},i.prototype.setAttribute=function(t,e){return(this._attributes[t]!==e||this._inDraw)&&(this._attributes[t]=e,this._initialized&&this._changeQueue.push(s.CHANGE_ATTRIBUTE,t,e),this._requestUpdate||this._requestUpdate()),this},i.prototype.setProperty=function(t,e){return(this._styles[t]!==e||this._inDraw)&&(this._styles[t]=e,this._initialized&&this._changeQueue.push(s.CHANGE_PROPERTY,t,e),this._requestingUpdate||this._requestUpdate(),this._renderSized&&(this._requestRenderSize=!0)),this},i.prototype.setContent=function(t){return(this._content!==t||this._inDraw)&&(this._content=t,this._initialized&&this._changeQueue.push(s.CHANGE_CONTENT,t),this._requestingUpdate||this._requestUpdate(),this._renderSized&&(this._requestRenderSize=!0)),this},i.prototype.on=function(t,e){return this._callbacks.on(t,e)},i.prototype.onReceive=function(t,e){"resize"===t&&(this._renderSize[0]=e.val[0],this._renderSize[1]=e.val[1],this._requestingUpdate||this._requestUpdate()),this._callbacks.trigger(t,e)},i.prototype.draw=function(){var t,e,n;for(this._inDraw=!0,this.init(),e=0,n=this._classes.length;n>e;e++)this.addClass(this._classes[e]);this._content&&this.setContent(this._content);for(t in this._styles)null!=this._styles[t]&&this.setProperty(t,this._styles[t]);for(t in this._attributes)null!=this._attributes[t]&&this.setAttribute(t,this._attributes[t]);for(e=0,n=this._UIEvents.length;n>e;e++)this.onAddUIEvent(this._UIEvents[e]);this._inDraw=!1},e.exports=i},{"../core/Commands":179,"../core/TransformSystem":190,"../utilities/CallbackStore":218}],192:[function(t,e,n){"use strict";function i(t,e,n){var i=this;t.classList.add("famous-dom-renderer"),c=c||u("transform"),this._compositor=n,this._target=null,this._parent=null,this._path=null,this._children=[],this._root=new o(t,e),this._boundTriggerEvent=function(t){return i._triggerEvent(t)},this._selector=e,this._elements={},this._elements[e]=this._root,this.perspectiveTransform=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this._VPtransform=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this._lastEv=null}function r(t){for(var e=[],n=t.target;n!==document.body;)e.push(n),n=n.parentNode;return e}var o=t("./ElementCache"),s=t("./Math"),a=t("../core/Path"),u=t("../utilities/vendorPrefix"),h=t("./events/EventMap"),c=null;i.prototype.subscribe=function(t){this._assertTargetLoaded(),this._listen(t),this._target.subscribe[t]=!0},i.prototype.unsubscribe=function(t){this._assertTargetLoaded(),this._listen(t),this._target.subscribe[t]=!1},i.prototype.preventDefault=function(t){this._assertTargetLoaded(),this._listen(t),this._target.preventDefault[t]=!0},i.prototype.allowDefault=function(t){this._assertTargetLoaded(),this._listen(t),this._target.preventDefault[t]=!1},i.prototype._listen=function(t){if(this._assertTargetLoaded(),!this._target.listeners[t]&&!this._root.listeners[t]){var e=h[t][1]?this._root:this._target;e.listeners[t]=this._boundTriggerEvent,e.element.addEventListener(t,this._boundTriggerEvent)}},i.prototype.unsubscribe=function(t){this._assertTargetLoaded(),this._target.subscribe[t]=!1},i.prototype._triggerEvent=function(t){if(this._lastEv!==t)for(var e=t.path?t.path:r(t),n=0;n<e.length;n++)if(e[n].dataset){var i=e[n].dataset.faPath;if(i&&(this._elements[i].preventDefault[t.type]&&t.preventDefault(),this._elements[i]&&this._elements[i].subscribe[t.type])){this._lastEv=t;var o=h[t.type][0];this._compositor.sendEvent(i,t.type,new o(t));break}}},i.prototype.getSizeOf=function(t){var e=this._elements[t];if(!e)return null;var n={val:e.size};return this._compositor.sendEvent(t,"resize",n),n},i.prototype.draw=function(t){t.perspectiveDirty&&(this.perspectiveDirty=!0,this.perspectiveTransform[0]=t.perspectiveTransform[0],this.perspectiveTransform[1]=t.perspectiveTransform[1],this.perspectiveTransform[2]=t.perspectiveTransform[2],this.perspectiveTransform[3]=t.perspectiveTransform[3],this.perspectiveTransform[4]=t.perspectiveTransform[4],this.perspectiveTransform[5]=t.perspectiveTransform[5],this.perspectiveTransform[6]=t.perspectiveTransform[6],this.perspectiveTransform[7]=t.perspectiveTransform[7],this.perspectiveTransform[8]=t.perspectiveTransform[8],this.perspectiveTransform[9]=t.perspectiveTransform[9],this.perspectiveTransform[10]=t.perspectiveTransform[10],this.perspectiveTransform[11]=t.perspectiveTransform[11],this.perspectiveTransform[12]=t.perspectiveTransform[12],this.perspectiveTransform[13]=t.perspectiveTransform[13],this.perspectiveTransform[14]=t.perspectiveTransform[14],this.perspectiveTransform[15]=t.perspectiveTransform[15]),(t.viewDirty||t.perspectiveDirty)&&(s.multiply(this._VPtransform,this.perspectiveTransform,t.viewTransform),this._root.element.style[c]=this._stringifyMatrix(this._VPtransform))},i.prototype._assertPathLoaded=function(){if(!this._path)throw new Error("path not loaded")},i.prototype._assertParentLoaded=function(){if(!this._parent)throw new Error("parent not loaded")},i.prototype._assertChildrenLoaded=function(){if(!this._children)throw new Error("children not loaded")},i.prototype._assertTargetLoaded=function(){if(!this._target)throw new Error("No target loaded")},i.prototype.findParent=function(){this._assertPathLoaded();for(var t,e=this._path;!t&&e.length;)e=e.substring(0,e.lastIndexOf("/")),t=this._elements[e];return this._parent=t,t},i.prototype.findTarget=function(){return this._target=this._elements[this._path],this._target},i.prototype.loadPath=function(t){return this._path=t,this._path},i.prototype.resolveChildren=function(t,e){for(var n,i,r=0,o=this._path;n=e.childNodes[r];)n.dataset?(i=n.dataset.faPath,i&&a.isDescendentOf(i,o)?t.appendChild(n):r++):r++},i.prototype.insertEl=function(t){if(!this._target||this._target.element.tagName.toLowerCase()!==t.toLowerCase()){if(this.findParent(),this._assertParentLoaded(),this._parent.void)throw new Error(this._parent.path+" is a void element. Void elements are not allowed to have children.");this._target&&this._parent.element.removeChild(this._target.element),this._target=new o(document.createElement(t),this._path);var e=this._target.element,n=this._parent.element;this.resolveChildren(e,n),this._parent.element.appendChild(this._target.element),this._elements[this._path]=this._target}},i.prototype.setProperty=function(t,e){this._assertTargetLoaded(),this._target.element.style[t]=e},i.prototype.setSize=function(t,e){this._assertTargetLoaded(),this.setWidth(t),this.setHeight(e)},i.prototype.setWidth=function(t){this._assertTargetLoaded();var e=this._target.content;t===!1?(this._target.explicitWidth=!0,e&&(e.style.width=""),t=e?e.offsetWidth:0,this._target.element.style.width=t+"px"):(this._target.explicitWidth=!1,e&&(e.style.width=t+"px"),this._target.element.style.width=t+"px"),this._target.size[0]=t},i.prototype.setHeight=function(t){this._assertTargetLoaded();var e=this._target.content;t===!1?(this._target.explicitHeight=!0,e&&(e.style.height=""),t=e?e.offsetHeight:0,this._target.element.style.height=t+"px"):(this._target.explicitHeight=!1,e&&(e.style.height=t+"px"),this._target.element.style.height=t+"px"),this._target.size[1]=t},i.prototype.setAttribute=function(t,e){this._assertTargetLoaded(),this._target.element.setAttribute(t,e)},i.prototype.setContent=function(t){this._assertTargetLoaded(),this._target.formElement?this._target.element.value=t:(this._target.content||(this._target.content=document.createElement("div"),this._target.content.classList.add("famous-dom-element-content"),this._target.element.insertBefore(this._target.content,this._target.element.firstChild)),this._target.content.innerHTML=t),this.setSize(this._target.explicitWidth?!1:this._target.size[0],this._target.explicitHeight?!1:this._target.size[1])},i.prototype.setMatrix=function(t){this._assertTargetLoaded(),this._target.element.style[c]=this._stringifyMatrix(t)},i.prototype.addClass=function(t){this._assertTargetLoaded(),this._target.element.classList.add(t)},i.prototype.removeClass=function(t){this._assertTargetLoaded(),this._target.element.classList.remove(t)},i.prototype._stringifyMatrix=function(t){var e="matrix3d(";return e+=t[0]<1e-6&&t[0]>-1e-6?"0,":t[0]+",",e+=t[1]<1e-6&&t[1]>-1e-6?"0,":t[1]+",",e+=t[2]<1e-6&&t[2]>-1e-6?"0,":t[2]+",",e+=t[3]<1e-6&&t[3]>-1e-6?"0,":t[3]+",",e+=t[4]<1e-6&&t[4]>-1e-6?"0,":t[4]+",",e+=t[5]<1e-6&&t[5]>-1e-6?"0,":t[5]+",",e+=t[6]<1e-6&&t[6]>-1e-6?"0,":t[6]+",",e+=t[7]<1e-6&&t[7]>-1e-6?"0,":t[7]+",",e+=t[8]<1e-6&&t[8]>-1e-6?"0,":t[8]+",",e+=t[9]<1e-6&&t[9]>-1e-6?"0,":t[9]+",",e+=t[10]<1e-6&&t[10]>-1e-6?"0,":t[10]+",",e+=t[11]<1e-6&&t[11]>-1e-6?"0,":t[11]+",",e+=t[12]<1e-6&&t[12]>-1e-6?"0,":t[12]+",",e+=t[13]<1e-6&&t[13]>-1e-6?"0,":t[13]+",",e+=t[14]<1e-6&&t[14]>-1e-6?"0,":t[14]+",",e+=t[15]+")"},e.exports=i},{"../core/Path":184,"../utilities/vendorPrefix":223,"./ElementCache":193,"./Math":194,"./events/EventMap":198}],193:[function(t,e,n){"use strict";function i(t,e){this.tagName=t.tagName.toLowerCase(),this.void=r[this.tagName];var n=t.constructor;this.formElement=n===HTMLInputElement||n===HTMLTextAreaElement||n===HTMLSelectElement,this.element=t,this.path=e,this.content=null,this.size=new Int16Array(3),this.explicitHeight=!1,this.explicitWidth=!1,this.postRenderSize=new Float32Array(2),this.listeners={},this.preventDefault={},this.subscribe={}}var r=t("./VoidElements");e.exports=i},{"./VoidElements":195}],194:[function(t,e,n){"use strict";function i(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],_=e[15],y=n*a-i*s,v=n*u-r*s,b=n*h-o*s,w=i*u-r*a,T=i*h-o*a,E=r*h-o*u,S=c*m-l*d,x=c*g-f*d,O=c*_-p*d,C=l*g-f*m,$=l*_-p*m,R=f*_-p*g,I=y*R-v*$+b*C+w*O-T*x+E*S;return I?(I=1/I,t[0]=(a*R-u*$+h*C)*I,t[1]=(r*$-i*R-o*C)*I,t[2]=(m*E-g*T+_*w)*I,t[3]=(f*T-l*E-p*w)*I,t[4]=(u*O-s*R-h*x)*I,t[5]=(n*R-r*O+o*x)*I,t[6]=(g*b-d*E-_*v)*I,t[7]=(c*E-f*b+p*v)*I,t[8]=(s*$-a*O+h*S)*I,t[9]=(i*O-n*$-o*S)*I,t[10]=(d*T-m*b+_*y)*I,t[11]=(l*b-c*T-p*y)*I,t[12]=(a*x-s*C-u*S)*I,t[13]=(n*C-i*x+r*S)*I,t[14]=(m*v-d*w-g*y)*I,t[15]=(c*w-l*v+f*y)*I,t):null}function r(t,e,n){var i,r,o,s,a=e[0],u=e[1],h=e[2],c=e[3],l=e[4],f=e[5],p=e[6],d=e[7],m=e[8],g=e[9],_=e[10],y=e[11],v=e[12],b=e[13],w=e[14],T=e[15],E=n[0],S=n[1],x=n[2],O=n[3],C=n[4],$=n[5],R=n[6],I=n[7],A=n[8],N=n[9],M=n[10],L=n[11],z=n[12],P=n[13],D=n[14],U=n[15],F=!1;return i=E*a+S*l+x*m+O*v,r=E*u+S*f+x*g+O*b,o=E*h+S*p+x*_+O*w,s=E*c+S*d+x*y+O*T,F=F?F:i===t[0]||r===t[1]||o===t[2]||s===t[3],t[0]=i,t[1]=r,t[2]=o,t[3]=s,E=C,S=$,x=R,O=I,i=E*a+S*l+x*m+O*v,r=E*u+S*f+x*g+O*b,o=E*h+S*p+x*_+O*w,s=E*c+S*d+x*y+O*T,F=F?F:i===t[4]||r===t[5]||o===t[6]||s===t[7],t[4]=i,t[5]=r,t[6]=o,t[7]=s,E=A,S=N,x=M,O=L,i=E*a+S*l+x*m+O*v,r=E*u+S*f+x*g+O*b,o=E*h+S*p+x*_+O*w,s=E*c+S*d+x*y+O*T,F=F?F:i===t[8]||r===t[9]||o===t[10]||s===t[11],t[8]=i,t[9]=r,t[10]=o,t[11]=s,E=z,S=P,x=D,O=U,i=E*a+S*l+x*m+O*v,r=E*u+S*f+x*g+O*b,o=E*h+S*p+x*_+O*w,s=E*c+S*d+x*y+O*T,F=F?F:i===t[12]||r===t[13]||o===t[14]||s===t[15],t[12]=i,t[13]=r,t[14]=o,t[15]=s,t}e.exports={multiply:r,invert:i}},{}],195:[function(t,e,n){"use strict";var i={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};e.exports=i},{}],196:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.data=t.data}var r=t("./UIEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"CompositionEvent"},e.exports=i},{"./UIEvent":204}],197:[function(t,e,n){"use strict";function i(t){this.type=t.type,this.defaultPrevented=t.defaultPrevented,this.timeStamp=t.timeStamp;var e=t.target.constructor;(e===HTMLInputElement||e===HTMLTextAreaElement||e===HTMLSelectElement)&&(this.value=t.target.value)}i.prototype.toString=function(){return"Event"},e.exports=i},{}],198:[function(t,e,n){"use strict";var i=t("./CompositionEvent"),r=t("./Event"),o=t("./FocusEvent"),s=t("./InputEvent"),a=t("./KeyboardEvent"),u=t("./MouseEvent"),h=t("./TouchEvent"),c=t("./UIEvent"),l=t("./WheelEvent"),f={change:[r,!0],submit:[r,!0],abort:[r,!1],beforeinput:[s,!0],blur:[o,!1],click:[u,!0],compositionend:[i,!0],compositionstart:[i,!0],compositionupdate:[i,!0],dblclick:[u,!0],focus:[o,!1],focusin:[o,!0],focusout:[o,!0],input:[s,!0],keydown:[a,!0],keyup:[a,!0],load:[r,!1],mousedown:[u,!0],mouseenter:[u,!1],mouseleave:[u,!1],mousemove:[u,!1],mouseout:[u,!0],mouseover:[u,!0],mouseup:[u,!0],resize:[c,!1],scroll:[c,!1],select:[r,!0],unload:[r,!1],wheel:[l,!0],touchcancel:[h,!0],touchend:[h,!0],touchmove:[h,!0],touchstart:[h,!0]};e.exports=f},{"./CompositionEvent":196,"./Event":197,"./FocusEvent":199,"./InputEvent":200,"./KeyboardEvent":201,"./MouseEvent":202,"./TouchEvent":203,"./UIEvent":204,"./WheelEvent":205}],199:[function(t,e,n){"use strict";function i(t){r.call(this,t)}var r=t("./UIEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"FocusEvent"},e.exports=i},{"./UIEvent":204}],200:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.inputType=t.inputType,this.data=t.data,this.isComposing=t.isComposing,this.targetRange=t.targetRange}var r=t("./UIEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"InputEvent"},e.exports=i},{"./UIEvent":204}],201:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.DOM_KEY_LOCATION_STANDARD=0,this.DOM_KEY_LOCATION_LEFT=1,this.DOM_KEY_LOCATION_RIGHT=2,this.DOM_KEY_LOCATION_NUMPAD=3,this.key=t.key,this.code=t.code,this.location=t.location,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.repeat=t.repeat,this.isComposing=t.isComposing,this.keyCode=t.keyCode}var r=t("./UIEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"KeyboardEvent"},e.exports=i},{"./UIEvent":204}],202:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.screenX=t.screenX,this.screenY=t.screenY,this.clientX=t.clientX,this.clientY=t.clientY,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.button=t.button,this.buttons=t.buttons,this.pageX=t.pageX,this.pageY=t.pageY,this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY}var r=t("./UIEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"MouseEvent"},e.exports=i},{"./UIEvent":204}],203:[function(t,e,n){"use strict";function i(t){this.identifier=t.identifier,this.screenX=t.screenX,this.screenY=t.screenY,this.clientX=t.clientX,this.clientY=t.clientY,this.pageX=t.pageX,this.pageY=t.pageY}function r(t){if(!t)return a;for(var e=[],n=0;n<t.length;n++)e[n]=new i(t[n]);return e}function o(t){s.call(this,t),this.touches=r(t.touches),this.targetTouches=r(t.targetTouches),this.changedTouches=r(t.changedTouches),this.altKey=t.altKey,this.metaKey=t.metaKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey}var s=t("./UIEvent"),a=[];o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.prototype.toString=function(){return"TouchEvent"},e.exports=o},{"./UIEvent":204}],204:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.detail=t.detail}var r=t("./Event");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"UIEvent"},e.exports=i},{"./Event":197}],205:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2,this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.deltaMode=t.deltaMode}var r=t("./MouseEvent");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return"WheelEvent"},e.exports=i},{"./MouseEvent":202}],206:[function(t,e,n){"use strict";function i(t,e,n,i){this.w=t||1,this.x=e||0,this.y=n||0,this.z=i||0}var r=Math.sin,o=Math.cos,s=Math.asin,a=Math.acos,u=Math.atan2,h=Math.sqrt;i.prototype.multiply=function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.x,s=t.y,a=t.z,u=t.w||0;return this.w=r*u-e*o-n*s-i*a,this.x=e*u+o*r+s*i-n*a,this.y=n*u+s*r+e*a-o*i,this.z=i*u+a*r+o*n-e*s,this},i.prototype.leftMultiply=function(t){var e=t.x,n=t.y,i=t.z,r=t.w||0,o=this.x,s=this.y,a=this.z,u=this.w;return this.w=r*u-e*o-n*s-i*a,this.x=e*u+o*r+s*i-n*a,this.y=n*u+s*r+e*a-o*i,this.z=i*u+a*r+o*n-e*s,this},i.prototype.rotateVector=function(t,e){var n=this.w,i=-this.x,r=-this.y,o=-this.z,s=t.x,a=t.y,u=t.z,h=-i*s-r*a-o*u,c=s*n+a*o-r*u,l=a*n+i*u-s*o,f=u*n+s*r-i*a,p=n,d=-i,m=-r,g=-o;return e.x=c*p+d*h+m*f-l*g,e.y=l*p+m*h+c*g-d*f,e.z=f*p+g*h+d*l-c*m,e},i.prototype.invert=function(){return this.w=-this.w,this.x=-this.x,this.y=-this.y,this.z=-this.z,this},i.prototype.conjugate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},i.prototype.length=function(){var t=this.w,e=this.x,n=this.y,i=this.z;return h(t*t+e*e+n*n+i*i)},i.prototype.normalize=function(){var t=this.w,e=this.x,n=this.y,i=this.z,r=h(t*t+e*e+n*n+i*i);return 0===r?this:(r=1/r,this.w*=r,this.x*=r,this.y*=r,this.z*=r,this)},i.prototype.set=function(t,e,n,i){return null!=t&&(this.w=t),null!=e&&(this.x=e),null!=n&&(this.y=n),null!=i&&(this.z=i),this},i.prototype.copy=function(t){return this.w=t.w,this.x=t.x,this.y=t.y,this.z=t.z,this},i.prototype.clear=function(){return this.w=1,this.x=0,this.y=0,this.z=0,this},i.prototype.dot=function(t){return this.w*t.w+this.x*t.x+this.y*t.y+this.z*t.z},i.prototype.slerp=function(t,e,n){var i,o,s,u,h,c=this.w,l=this.x,f=this.y,p=this.z,d=t.w,m=t.x,g=t.y,_=t.z;return o=c*d+l*m+f*g+p*_,1-o>1e-5?(i=a(o),s=r(i),u=r((1-e)*i)/s,h=r(e*i)/s):(u=1-e,h=e),n.w=c*u+d*h,n.x=l*u+m*h,n.y=f*u+g*h,n.z=p*u+_*h,n},i.prototype.toMatrix=function(t){var e=this.w,n=this.x,i=this.y,r=this.z,o=n*n,s=i*i,a=r*r,u=n*i,h=n*r,c=i*r;return t.set([1-2*(s+a),2*(u-e*r),2*(h+e*i),2*(u+e*r),1-2*(o+a),2*(c-e*n),2*(h-e*i),2*(c+e*n),1-2*(o+s)])},i.prototype.toEuler=function(t){var e=this.w,n=this.x,i=this.y,r=this.z,o=n*n,a=i*i,h=r*r,c=2*(n*r+i*e);return c=-1>c?-1:c>1?1:c,t.x=u(2*(n*e-i*r),1-2*(o+a)),t.y=s(c),t.z=u(2*(r*e-n*i),1-2*(a+h)),t},i.prototype.fromEuler=function(t,e,n){var i=.5*t,s=.5*e,a=.5*n,u=r(i),h=r(s),c=r(a),l=o(i),f=o(s),p=o(a);return this.w=l*f*p-u*h*c,this.x=u*f*p+l*h*c,this.y=l*h*p-u*f*c,this.z=l*f*c+u*h*p,this},i.prototype.fromAngleAxis=function(t,e,n,i){var s=h(e*e+n*n+i*i);if(0===s)this.w=1,this.x=this.y=this.z=0;else{s=1/s;var a=.5*t,u=r(a);this.w=o(a),this.x=u*e*s,this.y=u*n*s,this.z=u*i*s}return this},i.multiply=function(t,e,n){var i=t.w||0,r=t.x,o=t.y,s=t.z,a=e.w||0,u=e.x,h=e.y,c=e.z;return n.w=i*a-r*u-o*h-s*c,n.x=r*a+u*i+h*s-o*c,n.y=o*a+h*i+r*c-u*s,n.z=s*a+c*i+u*o-r*h,n},i.normalize=function(t,e){var n=t.w,i=t.x,r=t.y,o=t.z,s=h(n*n+i*i+r*r+o*o);return 0===s?this:(s=1/s,e.w*=s,e.x*=s,e.y*=s,e.z*=s,e)},i.conjugate=function(t,e){return e.w=t.w,e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.clone=function(t){return new i(t.w,t.x,t.y,t.z)},i.dot=function(t,e){return t.w*e.w+t.x*e.x+t.y*e.y+t.z*e.z},e.exports=i},{}],207:[function(t,e,n){"use strict";var i=function(t,e){t instanceof Array||t instanceof Float32Array?(this.x=t[0]||0,this.y=t[1]||0):(this.x=t||0,this.y=e||0)};i.prototype.set=function(t,e){return null!=t&&(this.x=t),null!=e&&(this.y=e),this},i.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},i.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},i.prototype.scale=function(t){return t instanceof i?(this.x*=t.x,this.y*=t.y):(this.x*=t,this.y*=t),this},i.prototype.rotate=function(t){var e=this.x,n=this.y,i=Math.cos(t),r=Math.sin(t);return this.x=e*i-n*r,this.y=e*r+n*i,this},i.prototype.dot=function(t){return this.x*t.x+this.y*t.y},i.prototype.cross=function(t){return this.x*t.y-this.y*t.x},i.prototype.invert=function(){return this.x*=-1,this.y*=-1,this},i.prototype.map=function(t){return this.x=t(this.x),this.y=t(this.y),this},i.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},i.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},i.prototype.clear=function(){return this.x=0,this.y=0,this},i.prototype.isZero=function(){return 0!==this.x||0!==this.y?!1:!0},i.prototype.toArray=function(){return[this.x,this.y]},i.normalize=function(t,e){var n=t.x,i=t.y,r=Math.sqrt(n*n+i*i)||1;return r=1/r,e.x=t.x*r,e.y=t.y*r,e},i.clone=function(t){return new i(t.x,t.y)},i.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},i.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},i.scale=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},e.exports=i},{}],208:[function(t,e,n){"use strict";var i=function(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0};i.prototype.set=function(t,e,n){return null!=t&&(this.x=t),null!=e&&(this.y=e),null!=n&&(this.z=n),this},i.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},i.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},i.prototype.rotateX=function(t){var e=this.y,n=this.z,i=Math.cos(t),r=Math.sin(t);return this.y=e*i-n*r,this.z=e*r+n*i,this},i.prototype.rotateY=function(t){var e=this.x,n=this.z,i=Math.cos(t),r=Math.sin(t);return this.x=n*r+e*i,this.z=n*i-e*r,this},i.prototype.rotateZ=function(t){var e=this.x,n=this.y,i=Math.cos(t),r=Math.sin(t);return this.x=e*i-n*r,this.y=e*r+n*i,this},i.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},i.prototype.cross=function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,s=t.z;return this.x=n*s-i*o,this.y=i*r-e*s,this.z=e*o-n*r,this},i.prototype.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},i.prototype.invert=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},i.prototype.map=function(t){return this.x=t(this.x),this.y=t(this.y),this.z=t(this.z),this},i.prototype.length=function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},i.prototype.lengthSq=function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},i.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},i.prototype.clear=function(){return this.x=0,this.y=0,this.z=0,this},i.prototype.isZero=function(){return 0===this.x&&0===this.y&&0===this.z},i.prototype.toArray=function(){return[this.x,this.y,this.z]},i.prototype.normalize=function(){var t=this.x,e=this.y,n=this.z,i=Math.sqrt(t*t+e*e+n*n)||1;return i=1/i,this.x*=i,this.y*=i,this.z*=i,this},i.prototype.applyRotation=function(t){var e=t.w,n=-t.x,i=-t.y,r=-t.z,o=this.x,s=this.y,a=this.z,u=-n*o-i*s-r*a,h=o*e+s*r-i*a,c=s*e+n*a-o*r,l=a*e+o*i-n*s,f=e,p=-n,d=-i,m=-r;return this.x=h*f+p*u+d*l-c*m,this.y=c*f+d*u+h*m-p*l,this.z=l*f+m*u+p*c-h*d,this},i.prototype.applyMatrix=function(t){var e=t.get(),n=this.x,i=this.y,r=this.z;return this.x=e[0]*n+e[1]*i+e[2]*r,this.y=e[3]*n+e[4]*i+e[5]*r,this.z=e[6]*n+e[7]*i+e[8]*r,this},i.normalize=function(t,e){var n=t.x,i=t.y,r=t.z,o=Math.sqrt(n*n+i*i+r*r)||1;return o=1/o,e.x=n*o,e.y=i*o,e.z=r*o,e},i.applyRotation=function(t,e,n){var i=e.w,r=-e.x,o=-e.y,s=-e.z,a=t.x,u=t.y,h=t.z,c=-r*a-o*u-s*h,l=a*i+u*s-o*h,f=u*i+r*h-a*s,p=h*i+a*o-r*u,d=i,m=-r,g=-o,_=-s;return n.x=l*d+m*c+g*p-f*_,n.y=f*d+g*c+l*_-m*p,n.z=p*d+_*c+m*f-l*g,n},i.clone=function(t){return new i(t.x,t.y,t.z)},i.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},i.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},i.scale=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.cross=function(t,e,n){var i=t.x,r=t.y,o=t.z,s=e.x,a=e.y,u=e.z;return n.x=r*u-o*a,n.y=o*s-i*u,n.z=i*a-r*s,n},i.project=function(t,e,n){var i=t.x,r=t.y,o=t.z,s=e.x,a=e.y,u=e.z,h=i*s+r*a+o*u;return h/=s*s+a*a+u*u,n.x=s*h,n.y=a*h,n.z=u*h,n},e.exports=i},{}],209:[function(t,e,n){"use strict";var i,r,o=0,s=["ms","moz","webkit","o"];if("object"==typeof window){i=window.requestAnimationFrame,r=window.cancelAnimationFrame||window.cancelRequestAnimationFrame;for(var a=0;a<s.length&&!i;++a)i=window[s[a]+"RequestAnimationFrame"],r=window[s[a]+"CancelRequestAnimationFrame"]||window[s[a]+"CancelAnimationFrame"];i&&!r&&(i=null)}if(!i){var u=Date.now?Date.now:function(){return(new Date).getTime()};i=function(t){var e=u(),n=Math.max(0,16-(e-o)),i=setTimeout(function(){t(e+n)},n);return o=e+n,i},r=function(t){clearTimeout(t)}}var h={requestAnimationFrame:i,cancelAnimationFrame:r};e.exports=h},{}],210:[function(t,e,n){"use strict";e.exports={requestAnimationFrame:t("./animationFrame").requestAnimationFrame,cancelAnimationFrame:t("./animationFrame").cancelAnimationFrame}},{"./animationFrame":209}],211:[function(t,e,n){"use strict";function i(){var t=this;this._updates=[],this._looper=function(e){t.loop(e)},this._time=0,this._stoppedAt=0,this._sleep=0,this._startOnVisibilityChange=!0,this._rAF=null,this._sleepDiff=!0,this.start(),a&&document.addEventListener(h,function(){t._onVisibilityChange()})}var r=t("../polyfills"),o=r.requestAnimationFrame,s=r.cancelAnimationFrame,a="undefined"!=typeof document;if(a){var u,h;"undefined"!=typeof document.hidden?(u="hidden",h="visibilitychange"):"undefined"!=typeof document.mozHidden?(u="mozHidden",h="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(u="msHidden",h="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(u="webkitHidden",h="webkitvisibilitychange")}i.prototype._onVisibilityChange=function(){document[u]?this._onUnfocus():this._onFocus()},i.prototype._onFocus=function(){this._startOnVisibilityChange&&this._start()},i.prototype._onUnfocus=function(){this._stop()},i.prototype.start=function(){return this._running||(this._startOnVisibilityChange=!0,this._start()),this},i.prototype._start=function(){this._running=!0,this._sleepDiff=!0,this._rAF=o(this._looper)},i.prototype.stop=function(){return this._running&&(this._startOnVisibilityChange=!1,this._stop()),this},i.prototype._stop=function(){this._running=!1,this._stoppedAt=this._time,s(this._rAF)},i.prototype.isRunning=function(){return this._running},i.prototype.step=function(t){this._time=t,this._sleepDiff&&(this._sleep+=t-this._stoppedAt,this._sleepDiff=!1);for(var e=t-this._sleep,n=0,i=this._updates.length;i>n;n++)this._updates[n].update(e);return this},i.prototype.loop=function(t){return this.step(t),this._rAF=o(this._looper),this},i.prototype.update=function(t){return-1===this._updates.indexOf(t)&&this._updates.push(t),this},i.prototype.noLongerUpdate=function(t){var e=this._updates.indexOf(t);return e>-1&&this._updates.splice(e,1),this},e.exports=i},{"../polyfills":210}],212:[function(t,e,n){"use strict";function i(){o(),this._contexts={},this._outCommands=[],this._inCommands=[],this._time=null,this._resized=!1;var t=this;window.addEventListener("resize",function(){t.onResize()})}var r=t("./Context"),o=t("./inject-css"),s=t("../core/Commands");i.prototype.onResize=function(){this._resized=!0;for(var t in this._contexts)this._contexts[t].updateSize()},i.prototype.getTime=function(){return this._time},i.prototype.sendEvent=function(t,e,n){this._outCommands.push(s.WITH,t,s.TRIGGER,e,n)},i.prototype.sendResize=function(t,e){this.sendEvent(t,"CONTEXT_RESIZE",e)},i.prototype.handleWith=function(t,e){var n=e[t],i=n.split("/"),r=this.getOrSetContext(i.shift());return r.receive(n,e,t)},i.prototype.getOrSetContext=function(t){if(this._contexts[t])return this._contexts[t];var e=new r(t,this);return this._contexts[t]=e,e},i.prototype.getContext=function(t){return this._contexts[t]?this._contexts[t]:void 0},i.prototype.drawCommands=function(){
for(var t=this._inCommands,e=0,n=t[e];n;){switch(n){case s.TIME:this._time=t[++e];break;case s.WITH:e=this.handleWith(++e,t);break;case s.NEED_SIZE_FOR:this.giveSizeFor(++e,t)}n=t[++e]}for(var i in this._contexts)this._contexts[i].draw();return this._resized&&this.updateSize(),this._outCommands},i.prototype.updateSize=function(){for(var t in this._contexts)this._contexts[t].updateSize()},i.prototype.receiveCommands=function(t){for(var e=t.length,n=0;e>n;n++)this._inCommands.push(t[n]);for(var i in this._contexts)this._contexts[i].checkInit()},i.prototype.giveSizeFor=function(t,e){var n=e[t],i=this.getOrSetContext(n).getRootSize();this.sendResize(n,i)},i.prototype.clearCommands=function(){this._inCommands.length=0,this._outCommands.length=0,this._resized=!1},e.exports=i},{"../core/Commands":179,"./Context":213,"./inject-css":215}],213:[function(t,e,n){"use strict";function i(t,e){if(this._compositor=e,this._rootEl=document.querySelector(t),this._selector=t,null===this._rootEl)throw new Error('Failed to create Context: No matches for "'+t+'" found.');this._selector=t,this._initDOMRenderer(),this._webGLRenderer=null,this._domRenderer=new M(this._domRendererRootEl,t,e),this._canvasEl=null,this._renderState={projectionType:N.ORTHOGRAPHIC_PROJECTION,perspectiveTransform:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),viewTransform:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),viewDirty:!1,perspectiveDirty:!1},this._size=[],this._meshTransform=new Float32Array(16),this._meshSize=[0,0,0],this._initDOM=!1,this._commandCallbacks=[],this.initCommandCallbacks(),this.updateSize()}function r(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.preventDefault(n[++i]),i}function o(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.allowDefault(n[++i]),i}function s(t,e,n,i){return t._initDOM=!0,i}function a(t,e,n,i){return t._domRenderer.insertEl(n[++i]),i}function u(t,e,n,i){return t._domRenderer.getSizeOf(n[++i]),i}function h(t,e,n,i){var r=t._meshTransform;return r[0]=n[++i],r[1]=n[++i],r[2]=n[++i],r[3]=n[++i],r[4]=n[++i],r[5]=n[++i],r[6]=n[++i],r[7]=n[++i],r[8]=n[++i],r[9]=n[++i],r[10]=n[++i],r[11]=n[++i],r[12]=n[++i],r[13]=n[++i],r[14]=n[++i],r[15]=n[++i],t._domRenderer.setMatrix(r),t._webGLRenderer&&t._webGLRenderer.setCutoutUniform(e,"u_transform",r),i}function c(t,e,n,i){var r=n[++i],o=n[++i];return t._domRenderer.setSize(r,o),t._webGLRenderer&&(t._meshSize[0]=r,t._meshSize[1]=o,t._webGLRenderer.setCutoutUniform(e,"u_size",t._meshSize)),i}function l(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.setProperty(n[++i],n[++i]),i}function f(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.setContent(n[++i]),i}function p(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.setAttribute(n[++i],n[++i]),i}function d(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.addClass(n[++i]),i}function m(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.removeClass(n[++i]),i}function g(t,e,n,i){return t._webGLRenderer&&t._webGLRenderer.getOrSetCutout(e),t._domRenderer.subscribe(n[++i]),i}function _(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setMeshOptions(e,n[++i]),i}function y(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setAmbientLightColor(e,n[++i],n[++i],n[++i]),i}function v(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setLightPosition(e,n[++i],n[++i],n[++i]),i}function b(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setLightColor(e,n[++i],n[++i],n[++i]),i}function w(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.handleMaterialInput(e,n[++i],n[++i]),i}function T(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setGeometry(e,n[++i],n[++i],n[++i]),i}function E(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setMeshUniform(e,n[++i],n[++i]),i}function S(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.bufferData(e,n[++i],n[++i],n[++i],n[++i],n[++i]),i}function x(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setCutoutState(e,n[++i]),i}function O(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.setMeshVisibility(e,n[++i]),i}function C(t,e,n,i){return t._webGLRenderer||t._initWebGLRenderer(),t._webGLRenderer.removeMesh(e),i}function $(t,e,n,i){return t._renderState.projectionType=N.PINHOLE_PROJECTION,t._renderState.perspectiveTransform[11]=-1/n[++i],t._renderState.perspectiveDirty=!0,i}function R(t,e,n,i){return t._renderState.projectionType=N.ORTHOGRAPHIC_PROJECTION,t._renderState.perspectiveTransform[11]=0,t._renderState.perspectiveDirty=!0,i}function I(t,e,n,i){return t._renderState.viewTransform[0]=n[++i],t._renderState.viewTransform[1]=n[++i],t._renderState.viewTransform[2]=n[++i],t._renderState.viewTransform[3]=n[++i],t._renderState.viewTransform[4]=n[++i],t._renderState.viewTransform[5]=n[++i],t._renderState.viewTransform[6]=n[++i],t._renderState.viewTransform[7]=n[++i],t._renderState.viewTransform[8]=n[++i],t._renderState.viewTransform[9]=n[++i],t._renderState.viewTransform[10]=n[++i],t._renderState.viewTransform[11]=n[++i],t._renderState.viewTransform[12]=n[++i],t._renderState.viewTransform[13]=n[++i],t._renderState.viewTransform[14]=n[++i],t._renderState.viewTransform[15]=n[++i],t._renderState.viewDirty=!0,i}var A=t("../webgl-renderers/WebGLRenderer"),N=t("../components/Camera"),M=t("../dom-renderers/DOMRenderer"),L=t("../core/Commands");i.prototype.updateSize=function(){var t=this._rootEl.offsetWidth,e=this._rootEl.offsetHeight;return this._size[0]=t,this._size[1]=e,this._size[2]=t>e?t:e,this._compositor.sendResize(this._selector,this._size),this._webGLRenderer&&this._webGLRenderer.updateSize(this._size),this},i.prototype.draw=function(){this._domRenderer.draw(this._renderState),this._webGLRenderer&&this._webGLRenderer.draw(this._renderState),this._renderState.perspectiveDirty&&(this._renderState.perspectiveDirty=!1),this._renderState.viewDirty&&(this._renderState.viewDirty=!1)},i.prototype._initDOMRenderer=function(){this._domRendererRootEl=document.createElement("div"),this._rootEl.appendChild(this._domRendererRootEl),this._domRendererRootEl.style.display="none",this._domRenderer=new M(this._domRendererRootEl,this._selector,this._compositor)},i.prototype.getRootSize=function(){return[this._rootEl.offsetWidth,this._rootEl.offsetHeight]},i.prototype.initCommandCallbacks=function(){this._commandCallbacks[L.INIT_DOM]=a,this._commandCallbacks[L.DOM_RENDER_SIZE]=u,this._commandCallbacks[L.CHANGE_TRANSFORM]=h,this._commandCallbacks[L.CHANGE_SIZE]=c,this._commandCallbacks[L.CHANGE_PROPERTY]=l,this._commandCallbacks[L.CHANGE_CONTENT]=f,this._commandCallbacks[L.CHANGE_ATTRIBUTE]=p,this._commandCallbacks[L.ADD_CLASS]=d,this._commandCallbacks[L.REMOVE_CLASS]=m,this._commandCallbacks[L.SUBSCRIBE]=g,this._commandCallbacks[L.GL_SET_DRAW_OPTIONS]=_,this._commandCallbacks[L.GL_AMBIENT_LIGHT]=y,this._commandCallbacks[L.GL_LIGHT_POSITION]=v,this._commandCallbacks[L.GL_LIGHT_COLOR]=b,this._commandCallbacks[L.MATERIAL_INPUT]=w,this._commandCallbacks[L.GL_SET_GEOMETRY]=T,this._commandCallbacks[L.GL_UNIFORMS]=E,this._commandCallbacks[L.GL_BUFFER_DATA]=S,this._commandCallbacks[L.GL_CUTOUT_STATE]=x,this._commandCallbacks[L.GL_MESH_VISIBILITY]=O,this._commandCallbacks[L.GL_REMOVE_MESH]=C,this._commandCallbacks[L.PINHOLE_PROJECTION]=$,this._commandCallbacks[L.ORTHOGRAPHIC_PROJECTION]=R,this._commandCallbacks[L.CHANGE_VIEW_TRANSFORM]=I,this._commandCallbacks[L.PREVENT_DEFAULT]=r,this._commandCallbacks[L.ALLOW_DEFAULT]=o,this._commandCallbacks[L.READY]=s},i.prototype._initWebGLRenderer=function(){this._webGLRendererRootEl=document.createElement("canvas"),this._rootEl.appendChild(this._webGLRendererRootEl),this._webGLRenderer=new A(this._webGLRendererRootEl,this._compositor),this._webGLRenderer.updateSize(this._size)},i.prototype.getRootSize=function(){return[this._rootEl.offsetWidth,this._rootEl.offsetHeight]},i.prototype.checkInit=function(){this._initDOM&&(this._domRendererRootEl.style.display="block",this._initDOM=!1)},i.prototype.receive=function(t,e,n){var i=n,r=e[++i];for(this._domRenderer.loadPath(t),this._domRenderer.findTarget();null!=r;){if(r===L.WITH||r===L.TIME)return i-1;i=this._commandCallbacks[r](this,t,e,i)+1,r=e[i]}return i},i.prototype.getDOMRenderer=function(){return this._domRenderer},i.prototype.getWebGLRenderer=function(){return this._webGLRenderer},e.exports=i},{"../components/Camera":170,"../core/Commands":179,"../dom-renderers/DOMRenderer":192,"../webgl-renderers/WebGLRenderer":249}],214:[function(t,e,n){"use strict";function i(t,e,n){this._thread=t,this._compositor=e,this._renderLoop=n,this._renderLoop.update(this);var i=this;this._thread.onmessage=function(t){var e=t.data?t.data:t;if(e[0]===r.ENGINE)switch(e[1]){case r.START:i._engine.start();break;case r.STOP:i._engine.stop();break;default:console.error('Unknown ENGINE command "'+e[1]+'"')}else i._compositor.receiveCommands(e)},this._thread.onerror=function(t){console.error(t)}}var r=t("../core/Commands");i.prototype.getThread=function(){return this._thread},i.prototype.getCompositor=function(){return this._compositor},i.prototype.getEngine=function(){return this._renderLoop},i.prototype.getRenderLoop=function(){return this._renderLoop},i.prototype.update=function(t){this._thread.postMessage([r.FRAME,t]);var e=this._compositor.drawCommands();this._thread.postMessage(e),this._compositor.clearCommands()},e.exports=i},{"../core/Commands":179}],215:[function(t,e,n){"use strict";function i(){if(!o)if(o=!0,document.createStyleSheet){var t=document.createStyleSheet();t.cssText=r}else{var e=document.getElementsByTagName("head")[0],n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),(e?e:document.documentElement).appendChild(n)}}var r=".famous-dom-renderer {width:100%;height:100%;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;}.famous-dom-element {-webkit-transform-origin:0% 0%;transform-origin:0% 0%;-webkit-backface-visibility:visible;backface-visibility:visible;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-tap-highlight-color:transparent;pointer-events:auto;z-index:1;}.famous-dom-element-content,.famous-dom-element {position:absolute;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;}.famous-webgl-renderer {-webkit-transform:translateZ(1000000px);transform:translateZ(1000000px);pointer-events:none;position:absolute;z-index:1;top:0;width:100%;height:100%;}",o="undefined"==typeof document;e.exports=i},{}],216:[function(t,e,n){"use strict";var i={linear:function(t){return t},easeIn:function(t){return t*t},easeOut:function(t){return t*(2-t)},easeInOut:function(t){return.5>=t?2*t*t:-2*t*t+4*t-1},easeOutBounce:function(t){return t*(3-2*t)},spring:function(t){return(1-t)*Math.sin(6*Math.PI*t)+t},inQuad:function(t){return t*t},outQuad:function(t){return-(t-=1)*t+1},inOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},inQuart:function(t){return t*t*t*t},outQuart:function(t){return-(--t*t*t*t-1)},inOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return--t*t*t*t*t+1},inOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},inSine:function(t){return-1*Math.cos(t*(Math.PI/2))+1},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},inExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},outExpo:function(t){return 1===t?1:-Math.pow(2,-10*t)+1},inOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},inCirc:function(t){return-(Math.sqrt(1-t*t)-1)},outCirc:function(t){return Math.sqrt(1- --t*t)},inOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},inElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},outElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},inOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2===(t/=.5)?1:(n||(n=.3*1.5),e=n/(2*Math.PI)*Math.asin(1/i),1>t?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},inBack:function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)},outBack:function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1},inOutBack:function(t,e){return void 0===e&&(e=1.70158),(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},inBounce:function(t){return 1-i.outBounce(1-t)},outBounce:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},inOutBounce:function(t){return.5>t?.5*i.inBounce(2*t):.5*i.outBounce(2*t-1)+.5},flat:function(){return 0}};e.exports=i},{}],217:[function(t,e,n){"use strict";function i(t){this._queue=[],this._from=null,this._state=null,this._startedAt=null,this._pausedAt=null,null!=t&&this.from(t)}var r=t("./Curves"),o=t("../core/FamousEngine");i.Clock=o.getClock(),i.prototype.to=function(t,e,n,i,o){return e=null!=e&&e.constructor===String?r[e]:e,0===this._queue.length&&(this._startedAt=this.constructor.Clock.now(),this._pausedAt=null),this._queue.push(t,null!=e?e:r.linear,null!=n?n:100,i,o),this},i.prototype.from=function(t){return this._state=t,this._from=this._sync(null,this._state),this._queue.length=0,this._startedAt=this.constructor.Clock.now(),this._pausedAt=null,this},i.prototype.delay=function(t,e){var n=this._queue.length>0?this._queue[this._queue.length-5]:this._state;return this.to(n,r.flat,t,e)},i.prototype.override=function(t,e,n,i,o){return this._queue.length>0&&(null!=t&&(this._queue[0]=t),null!=e&&(this._queue[1]=e.constructor===String?r[e]:e),null!=n&&(this._queue[2]=n),null!=i&&(this._queue[3]=i),null!=o&&(this._queue[4]=o)),this},i.prototype._interpolate=function(t,e,n,i,r){if(n instanceof Object)if("slerp"===r){var o,s,a,u,h,c,l,f,p,d,m,g,_;if(o=e[0],s=e[1],a=e[2],u=e[3],h=n[0],c=n[1],l=n[2],f=n[3],1===i)return t[0]=h,t[1]=c,t[2]=l,t[3]=f,t;d=u*f+o*h+s*c+a*l,1-d>1e-5?(p=Math.acos(d),m=Math.sin(p),g=Math.sin((1-i)*p)/m,_=Math.sin(i*p)/m):(g=1-i,_=i),t[0]=o*g+h*_,t[1]=s*g+c*_,t[2]=a*g+l*_,t[3]=u*g+f*_}else if(n instanceof Array)for(var y=0,v=n.length;v>y;y++)t[y]=this._interpolate(t[y],e[y],n[y],i,r);else for(var b in n)t[b]=this._interpolate(t[b],e[b],n[b],i,r);else t=e+i*(n-e);return t},i.prototype._sync=function t(e,n){if("number"==typeof n)e=n;else if(n instanceof Array){null==e&&(e=[]);for(var i=0,r=n.length;r>i;i++)e[i]=t(e[i],n[i])}else if(n instanceof Object){null==e&&(e={});for(var o in n)e[o]=t(e[o],n[o])}return e},i.prototype.get=function(t){if(0===this._queue.length)return this._state;t=this._pausedAt?this._pausedAt:t,t=t?t:this.constructor.Clock.now();var e=(t-this._startedAt)/this._queue[2];this._state=this._interpolate(this._state,this._from,this._queue[0],this._queue[1](e>1?1:e),this._queue[4]);var n=this._state;if(e>=1){this._startedAt=this._startedAt+this._queue[2],this._from=this._sync(this._from,this._state),this._queue.shift(),this._queue.shift(),this._queue.shift();var i=this._queue.shift();this._queue.shift(),i&&i()}return e>1?this.get():n},i.prototype.isActive=function(){return this._queue.length>0},i.prototype.halt=function(){return this.from(this.get())},i.prototype.pause=function(){return this._pausedAt=this.constructor.Clock.now(),this},i.prototype.isPaused=function(){return!!this._pausedAt},i.prototype.resume=function(){var t=this._pausedAt-this._startedAt;return this._startedAt=this.constructor.Clock.now()-t,this._pausedAt=null,this},i.prototype.reset=function(t){return this.from(t)},i.prototype.set=function(t,e,n){return null==e?(this.from(t),n&&n()):this.to(t,e.curve,e.duration,n,e.method),this},e.exports=i},{"../core/FamousEngine":182,"./Curves":216}],218:[function(t,e,n){"use strict";function i(){this._events={}}i.prototype.on=function(t,e){this._events[t]||(this._events[t]=[]);var n=this._events[t];return n.push(e),function(){n.splice(n.indexOf(e),1)}},i.prototype.off=function(t,e){var n=this._events[t];return n&&n.splice(n.indexOf(e),1),this},i.prototype.trigger=function(t,e){var n=this._events[t];if(n)for(var i=0,r=n.length;r>i;i++)n[i](e);return this},e.exports=i},{}],219:[function(t,e,n){"use strict";function i(t,e,n){this._r=new r(0),this._g=new r(0),this._b=new r(0),this._opacity=new r(1),t&&this.set(t,e,n)}var r=t("../transitions/Transitionable");i.prototype.toString=function(){return"Color"},i.prototype.set=function(t,e,n){switch(i.determineType(t)){case"hex":return this.setHex(t,e,n);case"colorName":return this.setColor(t,e,n);case"instance":return this.changeTo(t,e,n);case"rgb":return this.setRGB(t[0],t[1],t[2],e,n)}return this},i.prototype.isActive=function(){return this._r.isActive()||this._g.isActive()||this._b.isActive()||this._opacity.isActive()},i.prototype.halt=function(){return this._r.halt(),this._g.halt(),this._b.halt(),this._opacity.halt(),this},i.prototype.changeTo=function(t,e,n){if(i.isColorInstance(t)){var r=t.getRGB();this.setRGB(r[0],r[1],r[2],e,n)}return this},i.prototype.setColor=function(t,e,n){return o[t]&&this.setHex(o[t],e,n),this},i.prototype.getColor=function(t){return i.isString(t)&&(t=t.toLowerCase()),"hex"===t?this.getHex():this.getRGB()},i.prototype.setR=function(t,e,n){return this._r.set(t,e,n),this},i.prototype.setG=function(t,e,n){return this._g.set(t,e,n),this},i.prototype.setB=function(t,e,n){return this._b.set(t,e,n),this},i.prototype.setOpacity=function(t,e,n){return this._opacity.set(t,e,n),this},i.prototype.setRGB=function(t,e,n,i,r){return this.setR(t,i),this.setG(e,i),this.setB(n,i,r),this},i.prototype.getR=function(){return this._r.get()},i.prototype.getG=function(){return this._g.get()},i.prototype.getB=function(){return this._b.get()},i.prototype.getOpacity=function(){return this._opacity.get()},i.prototype.getRGB=function(){return[this.getR(),this.getG(),this.getB()]},i.prototype.getNormalizedRGB=function(){var t=this.getR()/255,e=this.getG()/255,n=this.getB()/255;return[t,e,n]},i.prototype.getNormalizedRGBA=function(){var t=this.getR()/255,e=this.getG()/255,n=this.getB()/255,i=this.getOpacity();return[t,e,n,i]},i.prototype.getHex=function(){var t=i.toHex(this.getR()),e=i.toHex(this.getG()),n=i.toHex(this.getB());return"#"+t+e+n},i.prototype.setHex=function(t,e,n){if(t="#"===t.charAt(0)?t.substring(1,t.length):t,3===t.length){var i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(i,function(t,e,n,i){return e+e+n+n+i+i})}var r=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16);return this.setRGB(r,o,s,e,n),this},i.toHex=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},i.determineType=function(t){return i.isColorInstance(t)?"instance":o[t]?"colorName":i.isHex(t)?"hex":Array.isArray(t)?"rgb":void 0},i.isString=function(t){return"string"==typeof t},i.isHex=function(t){return i.isString(t)?"#"===t[0]:!1},i.isColorInstance=function(t){return!!t.getColor};var o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};e.exports=i},{"../transitions/Transitionable":217}],220:[function(t,e,n){"use strict";var i=function t(e){var n;if("object"==typeof e){n=e instanceof Array?[]:{};for(var i in e)if("object"==typeof e[i]&&null!==e[i])if(e[i]instanceof Array){n[i]=new Array(e[i].length);for(var r=0;r<e[i].length;r++)n[i][r]=t(e[i][r])}else n[i]=t(e[i]);else n[i]=e[i]}else n=e;return n};e.exports=i},{}],221:[function(t,e,n){"use strict";e.exports=function(t){var e=[],n=[],i=0;for(var r in t)t.hasOwnProperty(r)&&(e[i]=r,n[i]=t[r],i++);return{keys:e,values:n}}},{}],222:[function(t,e,n){"use strict";var i=function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===this.readyState&&e&&e(this.responseText)},n.open("GET",t),n.send()};e.exports=i},{}],223:[function(t,e,n){"use strict";function i(t){for(var e=0;e<r.length;e++){var n=r[e]+t;if(""===document.documentElement.style[n])return n}return t}var r=["","-ms-","-webkit-","-moz-","-o-"];e.exports=i},{}],224:[function(t,e,n){"use strict";function i(t){r.call(this,t),this.spec.dynamic=!0}var r=t("./Geometry");i.prototype.getLength=function(){return this.getVertexPositions().length},i.prototype.getVertexBuffer=function(t){if(!t)throw"getVertexBuffer requires a name";var e=this.spec.bufferNames.indexOf(t);if(~e)return this.spec.bufferValues[e];throw"buffer does not exist"},i.prototype.setVertexBuffer=function(t,e,n){var i=this.spec.bufferNames.indexOf(t);return-1===i&&(i=this.spec.bufferNames.push(t)-1),this.spec.bufferValues[i]=e||[],this.spec.bufferSpacings[i]=n||this.DEFAULT_BUFFER_SIZE,-1===this.spec.invalidations.indexOf(i)&&this.spec.invalidations.push(i),this},i.prototype.fromGeometry=function(t){for(var e=t.spec.bufferNames.length,n=0;e>n;n++)this.setVertexBuffer(t.spec.bufferNames[n],t.spec.bufferValues[n],t.spec.bufferSpacings[n]);return this},i.prototype.setVertexPositions=function(t){return this.setVertexBuffer("a_pos",t,3)},i.prototype.setNormals=function(t){return this.setVertexBuffer("a_normals",t,3)},i.prototype.setTextureCoords=function(t){return this.setVertexBuffer("a_texCoord",t,2)},i.prototype.setIndices=function(t){return this.setVertexBuffer("indices",t,1)},i.prototype.setDrawType=function(t){return this.spec.type=t.toUpperCase(),this},i.prototype.getVertexPositions=function(){return this.getVertexBuffer("a_pos")},i.prototype.getNormals=function(){return this.getVertexBuffer("a_normals")},i.prototype.getTextureCoords=function(){return this.getVertexBuffer("a_texCoord")},e.exports=i},{"./Geometry":225}],225:[function(t,e,n){"use strict";function i(t){if(this.options=t||{},this.DEFAULT_BUFFER_SIZE=3,this.spec={id:r++,dynamic:!1,type:this.options.type||"TRIANGLES",bufferNames:[],bufferValues:[],bufferSpacings:[],invalidations:[]},this.options.buffers)for(var e=this.options.buffers.length,n=0;e>n;)this.spec.bufferNames.push(this.options.buffers[n].name),this.spec.bufferValues.push(this.options.buffers[n].data),this.spec.bufferSpacings.push(this.options.buffers[n].size||this.DEFAULT_BUFFER_SIZE),this.spec.invalidations.push(n++)}var r=0;e.exports=i},{}],226:[function(t,e,n){"use strict";function i(t,e){return-(e+(t-e)/2)}function r(t,e){return 1/((t-e)/2)}var o=t("../math/Vec3"),s=t("../math/Vec2"),a=[new o,new o,new o,new s,new s],u={};u.generateParametric=function(t,e,n,i){var r,o,s,a,u=[],h=Math.PI/(t-1),c=i?Math.PI+h:Math.PI,l=[];for(r=0;t+1>r;r++)for(o=(0===r?1e-4:r)*Math.PI/t,a=0;e>a;a++)s=2*a*c/e,n(o,s,l),u.push(l[0],l[1],l[2]);var f,p=[],d=0;for(r=0;t>r;r++){for(a=0;e>a;a++)f=(a+1)%e,p.push(d+a,d+a+e,d+f),p.push(d+f,d+a+e,d+f+e);d+=e}return{vertices:u,indices:p}},u.computeNormals=function(t,e,n){var i,r,o,s,u,h,c,l,f,p,d=n||[],m=e.length/3;for(h=0;m>h;h++)r=3*e[3*h+0],i=3*e[3*h+1],o=3*e[3*h+2],a[0].set(t[i],t[i+1],t[i+2]),a[1].set(t[r],t[r+1],t[r+2]),a[2].set(t[o],t[o+1],t[o+2]),s=a[2].subtract(a[0]).cross(a[1].subtract(a[0])).normalize(),d[i+0]=(d[i+0]||0)+s.x,d[i+1]=(d[i+1]||0)+s.y,d[i+2]=(d[i+2]||0)+s.z,d[r+0]=(d[r+0]||0)+s.x,d[r+1]=(d[r+1]||0)+s.y,d[r+2]=(d[r+2]||0)+s.z,d[o+0]=(d[o+0]||0)+s.x,d[o+1]=(d[o+1]||0)+s.y,d[o+2]=(d[o+2]||0)+s.z;for(h=0;h<d.length;h+=3)for(c=d[h],l=d[h+1],f=d[h+2],p=Math.sqrt(c*c+l*l+f*f),u=0;3>u;u++)d[h+u]/=p;return d},u.subdivide=function(t,e,n){for(var i,r,u,h,c,l,f=t.length/3;f--;)i=t.slice(3*f,3*f+3),c=i.map(function(t){return new o(e[3*t],e[3*t+1],e[3*t+2])}),e.push.apply(e,o.scale(o.add(c[0],c[1],a[0]),.5,a[1]).toArray()),e.push.apply(e,o.scale(o.add(c[1],c[2],a[0]),.5,a[1]).toArray()),e.push.apply(e,o.scale(o.add(c[0],c[2],a[0]),.5,a[1]).toArray()),n&&(l=i.map(function(t){return new s(n[2*t],n[2*t+1])}),n.push.apply(n,s.scale(s.add(l[0],l[1],a[3]),.5,a[4]).toArray()),n.push.apply(n,s.scale(s.add(l[1],l[2],a[3]),.5,a[4]).toArray()),n.push.apply(n,s.scale(s.add(l[0],l[2],a[3]),.5,a[4]).toArray())),r=e.length-3,u=r+1,h=r+2,t.push(r,u,h),t.push(i[0],r,h),t.push(r,i[1],u),t[f]=h,t[f+1]=u,t[f+2]=i[2]},u.getUniqueFaces=function(t,e){for(var n,i=e.length/3,r=[];i--;)for(var o=0;3>o;o++)n=e[3*i+o],r[n]?(t.push(t[3*n],t[3*n+1],t[3*n+2]),e[3*i+o]=t.length/3-1):r[n]=!0},u.subdivideSpheroid=function(t,e){for(var n,i,r,s,u,h=e.length/3;h--;)i=e.slice(3*h,3*h+3),n=i.map(function(e){return new o(t[3*e],t[3*e+1],t[3*e+2])}),t.push.apply(t,o.normalize(o.add(n[0],n[1],a[0]),a[1]).toArray()),t.push.apply(t,o.normalize(o.add(n[1],n[2],a[0]),a[1]).toArray()),t.push.apply(t,o.normalize(o.add(n[0],n[2],a[0]),a[1]).toArray()),r=t.length/3-3,s=r+1,u=r+2,e.push(r,s,u),e.push(i[0],r,u),e.push(r,i[1],s),e[3*h]=u,e[3*h+1]=s,e[3*h+2]=i[2]},u.getSpheroidNormals=function(t,e){e=e||[];for(var n,i=t.length/3,r=0;i>r;r++)n=new o(t[3*r+0],t[3*r+1],t[3*r+2]).normalize().toArray(),e[3*r+0]=n[0],e[3*r+1]=n[1],e[3*r+2]=n[2];return e},u.getSpheroidUV=function(t,e){e=e||[];for(var n,i=t.length/3,r=[],o=0;i>o;o++){n=a[0].set(t[3*o],t[3*o+1],t[3*o+2]).normalize().toArray();var s=this.getAzimuth(n),u=this.getAltitude(n);r[0]=.5*s/Math.PI+.5,r[1]=u/Math.PI+.5,e.push.apply(e,r)}return e},u.normalizeAll=function(t,e){e=e||[];for(var n=t.length/3,i=0;n>i;i++)Array.prototype.push.apply(e,new o(t[3*i],t[3*i+1],t[3*i+2]).normalize().toArray());return e},u.normalizeVertices=function(t,e){e=e||[];var n,s,a,u,h,c,l,f,p=t.length/3,d=[];for(f=0;p>f;f++)l=d[f]=new o(t[3*f],t[3*f+1],t[3*f+2]),(null==n||l.x<n)&&(n=l.x),(null==s||l.x>s)&&(s=l.x),(null==a||l.y<a)&&(a=l.y),(null==u||l.y>u)&&(u=l.y),(null==h||l.z<h)&&(h=l.z),(null==c||l.z>c)&&(c=l.z);var m=new o(i(s,n),i(u,a),i(c,h)),g=Math.min(r(s+m.x,n+m.x),r(u+m.y,a+m.y),r(c+m.z,h+m.z));for(f=0;f<d.length;f++)e.push.apply(e,d[f].add(m).scale(g).toArray());return e},u.getAzimuth=function(t){return Math.atan2(t[2],-t[0])},u.getAltitude=function(t){return Math.atan2(-t[1],Math.sqrt(t[0]*t[0]+t[2]*t[2]))},u.trianglesToLines=function(t,e){var n=t.length/3;e=e||[];var i;for(i=0;n>i;i++)e.push(t[3*i+0],t[3*i+1]),e.push(t[3*i+1],t[3*i+2]),e.push(t[3*i+2],t[3*i+0]);return e},u.addBackfaceTriangles=function(t,e){for(var n=e.length/3,i=0,r=e.length;r--;)e[r]>i&&(i=e[r]);for(i++,r=0;n>r;r++){var o=e[3*r],s=e[3*r+1],a=e[3*r+2];e.push(o+i,a+i,s+i)}var u=t.length;for(r=0;u>r;r++)t.push(t[r])},e.exports=u},{"../math/Vec2":207,"../math/Vec3":208}],227:[function(t,e,n){"use strict";function i(t,e){t=o(t);var n=t.split("\n"),i=[];e=e||{};for(var s,a,u,h,c,l,f=[],p=[],d=[],m=[],g=[],_=[],y=n.length,v=0;y>v;v++)l=n[v],c=n[v].trim().split(" "),-1!==l.indexOf("v ")?_.push([parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3])]):-1!==l.indexOf("vt ")?g.push([parseFloat(c[1]),parseFloat(c[2])]):-1!==l.indexOf("vn ")?m.push([parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3])]):-1!==l.indexOf("f ")?-1!==c[1].indexOf("//")?(s=c[1].split("//"),a=c[2].split("//"),u=c[3].split("//"),p.push([parseFloat(s[0])-1,parseFloat(a[0])-1,parseFloat(u[0])-1]),d.push([parseFloat(s[1])-1,parseFloat(a[1])-1,parseFloat(u[1])-1]),c[4]&&(h=c[4].split("//"),p.push([parseFloat(s[0])-1,parseFloat(u[0])-1,parseFloat(h[0])-1]),d.push([parseFloat(s[2])-1,parseFloat(u[2])-1,parseFloat(h[2])-1]))):-1!==c[1].indexOf("/")?(s=c[1].split("/"),a=c[2].split("/"),u=c[3].split("/"),p.push([parseFloat(s[0])-1,parseFloat(a[0])-1,parseFloat(u[0])-1]),f.push([parseFloat(s[1])-1,parseFloat(a[1])-1,parseFloat(u[1])-1]),d.push([parseFloat(s[2])-1,parseFloat(a[2])-1,parseFloat(u[2])-1]),c[4]&&(h=c[4].split("/"),p.push([parseFloat(s[0])-1,parseFloat(u[0])-1,parseFloat(h[0])-1]),f.push([parseFloat(s[1])-1,parseFloat(u[1])-1,parseFloat(h[1])-1]),d.push([parseFloat(s[2])-1,parseFloat(u[2])-1,parseFloat(h[2])-1]))):(p.push([parseFloat(c[1])-1,parseFloat(c[2])-1,parseFloat(c[3])-1]),f.push([parseFloat(c[1])-1,parseFloat(c[2])-1,parseFloat(c[3])-1]),d.push([parseFloat(c[1])-1,parseFloat(c[2])-1,parseFloat(c[3])-1]),c[4]&&(p.push([parseFloat(c[1])-1,parseFloat(c[3])-1,parseFloat(c[4])-1]),f.push([parseFloat(c[1])-1,parseFloat(c[3])-1,parseFloat(c[4])-1]),d.push([parseFloat(c[1])-1,parseFloat(c[3])-1,parseFloat(c[4])-1]))):-1!==l.indexOf("g ")&&(p.length&&i.push(r(_,m,g,p,d,f,e)),p.length=0,f.length=0,d.length=0);return i.push(r(_,m,g,p,d,f,e)),i}function r(t,e,n,i,r,o,u){var c=s(t,e,n,i,r,o);return c.vertices=a(c.vertices),c.normals=a(c.normals),c.texCoords=a(c.texCoords),c.indices=a(c.indices),u.normalize&&(c.vertices=h.normalizeVertices(c.vertices)),u.computeNormals&&(c.normals=h.computeNormals(c.vertices,c.indices)),{vertices:c.vertices,normals:c.normals,textureCoords:c.texCoords,
indices:c.indices}}function o(t){return t.replace(/ +(?= )/g,"").replace(/\s+$/g,"")}function s(t,e,n,i,r,o){for(var s,a,u,h,c,l=[],f=[],p=[],d=[],m={},g=0,_=i.length,y=r.length,v=o.length,b=0;_>b;b++){d[b]=[],h=i[b].length;for(var w=0;h>w;w++)v&&(u=o[b][w]),y&&(a=r[b][w]),s=i[b][w],c=m[s+","+a+","+u],void 0===c&&(c=g++,f.push(t[s]),y&&l.push(e[a]),v&&p.push(n[u]),m[s+","+a+","+u]=c),d[b].push(c)}return{vertices:f,normals:l,texCoords:p,indices:d}}function a(t){for(var e=t.length,n=[],i=0;e>i;i++)n.push.apply(n,t[i]);return n}var u=t("../utilities/loadURL"),h=t("./GeometryHelper"),c={cached:{},requests:{},formatText:i};c.load=function(t,e,n){this.cached[t]?e(this.cached[t]):this.requests[t]?this.requests[t].push(e):(this.requests[t]=[e],u(t,this._onsuccess.bind(this,t,n)))},c._onsuccess=function(t,e,n){var r=i.call(this,n,e||{});this.cached[t]=r;for(var o=0;o<this.requests[t].length;o++)this.requests[t][o](r);this.requests[t]=null},e.exports=c},{"../utilities/loadURL":222,"./GeometryHelper":226}],228:[function(t,e,n){"use strict";e.exports={Box:t("./primitives/Box"),Circle:t("./primitives/Circle"),Cylinder:t("./primitives/Cylinder"),GeodesicSphere:t("./primitives/GeodesicSphere"),Icosahedron:t("./primitives/Icosahedron"),ParametricCone:t("./primitives/ParametricCone"),Plane:t("./primitives/Plane"),Sphere:t("./primitives/Sphere"),Tetrahedron:t("./primitives/Tetrahedron"),Torus:t("./primitives/Torus"),Triangle:t("./primitives/Triangle"),GeometryHelper:t("./GeometryHelper"),DynamicGeometry:t("./DynamicGeometry"),Geometry:t("./Geometry"),OBJLoader:t("./OBJLoader")}},{"./DynamicGeometry":224,"./Geometry":225,"./GeometryHelper":226,"./OBJLoader":227,"./primitives/Box":229,"./primitives/Circle":230,"./primitives/Cylinder":231,"./primitives/GeodesicSphere":232,"./primitives/Icosahedron":233,"./primitives/ParametricCone":234,"./primitives/Plane":235,"./primitives/Sphere":236,"./primitives/Tetrahedron":237,"./primitives/Torus":238,"./primitives/Triangle":239}],229:[function(t,e,n){"use strict";function i(t){return[2*(1&t)-1,(2&t)-1,(4&t)/2-1]}function r(t){t=t||{};var e,n,r,a,u,h=[],c=[],l=[],f=[];for(a=0;a<s.length;a++){for(e=s[a],r=4*a,u=0;4>u;u++){n=e[u];var p=i(n);h.push(p[0],p[1],p[2]),c.push(1&u,(2&u)/2),l.push(e[4],e[5],e[6])}f.push(r,r+1,r+2),f.push(r+2,r+1,r+3)}return new o({buffers:[{name:"a_pos",data:h},{name:"a_texCoord",data:c,size:2},{name:"a_normals",data:l},{name:"indices",data:f,size:1}]})}var o=t("../Geometry"),s=[[0,4,2,6,-1,0,0],[1,3,5,7,1,0,0],[0,1,4,5,0,-1,0],[2,6,3,7,0,1,0],[0,2,1,3,0,0,-1],[4,5,6,7,0,0,1]];e.exports=r},{"../Geometry":225}],230:[function(t,e,n){"use strict";function i(t){t=t||{};var e=t.detail||30,n=o(e,!0);t.backface!==!1&&a.addBackfaceTriangles(n.vertices,n.indices);var i=r(n.vertices),u=a.computeNormals(n.vertices,n.indices);return new s({buffers:[{name:"a_pos",data:n.vertices},{name:"a_texCoord",data:i,size:2},{name:"a_normals",data:u},{name:"indices",data:n.indices,size:1}]})}function r(t){for(var e=[],n=t.length/3,i=0;n>i;i++){var r=t[3*i],o=t[3*i+1];e.push(.5+.5*r,.5+.5*-o)}return e}function o(t){for(var e,n,i,r=[0,0,0],o=[],s=1,a=0;t+1>a;a++)e=a/t*Math.PI*2,n=Math.cos(e),i=Math.sin(e),r.push(n,i,0),a>0&&o.push(0,s,++s);return{vertices:r,indices:o}}var s=t("../Geometry"),a=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],231:[function(t,e,n){"use strict";function i(t){t=t||{};var e,n=t.radius||1,s=t.detail||15;return e=o.generateParametric(s,s,i.generator.bind(null,n)),t.backface!==!1&&o.addBackfaceTriangles(e.vertices,e.indices),new r({buffers:[{name:"a_pos",data:e.vertices},{name:"a_texCoord",data:o.getSpheroidUV(e.vertices),size:2},{name:"a_normals",data:o.computeNormals(e.vertices,e.indices)},{name:"indices",data:e.indices,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");i.generator=function(t,e,n,i){i[1]=t*Math.sin(n),i[0]=t*Math.cos(n),i[2]=t*(-1+e/Math.PI*2)},e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],232:[function(t,e,n){"use strict";function i(t){var e=.5*(1+Math.sqrt(5)),n=[-1,e,0,1,e,0,-1,-e,0,1,-e,0,0,-1,-e,0,1,-e,0,-1,e,0,1,e,e,0,1,e,0,-1,-e,0,1,-e,0,-1],i=[0,5,11,0,1,5,0,7,1,0,10,7,0,11,10,1,9,5,5,4,11,11,2,10,10,6,7,7,8,1,3,4,9,3,2,4,3,6,2,3,8,6,3,9,8,4,5,9,2,11,4,6,10,2,8,7,6,9,1,8];n=o.normalizeAll(n),t=t||{};for(var s=t.detail||3;--s;)o.subdivideSpheroid(n,i);o.getUniqueFaces(n,i);var a=o.computeNormals(n,i),u=o.getSpheroidUV(n);return new r({buffers:[{name:"a_pos",data:n},{name:"a_texCoord",data:u,size:2},{name:"a_normals",data:a},{name:"indices",data:i,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],233:[function(t,e,n){"use strict";function i(){var t=(1+Math.sqrt(5))/2,e=[-1,t,0,1,t,0,-1,-t,0,1,-t,0,0,-1,-t,0,1,-t,0,-1,t,0,1,t,t,0,1,t,0,-1,-t,0,1,-t,0,-1],n=[0,5,11,0,1,5,0,7,1,0,10,7,0,11,10,1,9,5,5,4,11,11,2,10,10,6,7,7,8,1,3,4,9,3,2,4,3,6,2,3,8,6,3,9,8,4,5,9,2,11,4,6,10,2,8,7,6,9,1,8];o.getUniqueFaces(e,n);var i=o.computeNormals(e,n),s=o.getSpheroidUV(e);return e=o.normalizeAll(e),new r({buffers:[{name:"a_pos",data:e},{name:"a_texCoord",data:s,size:2},{name:"a_normals",data:i},{name:"indices",data:n,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],234:[function(t,e,n){"use strict";function i(t){t=t||{};var e=t.detail||15,n=t.radius||1/Math.PI,s=o.generateParametric(e,e,i.generator.bind(null,n));return t.backface!==!1&&o.addBackfaceTriangles(s.vertices,s.indices),new r({buffers:[{name:"a_pos",data:s.vertices},{name:"a_texCoord",data:o.getSpheroidUV(s.vertices),size:2},{name:"a_normals",data:o.computeNormals(s.vertices,s.indices)},{name:"indices",data:s.indices,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");i.generator=function(t,e,n,i){i[0]=-t*e*Math.cos(n),i[1]=t*e*Math.sin(n),i[2]=-e/(Math.PI/2)+1},e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],235:[function(t,e,n){"use strict";function i(t){t=t||{};for(var e,n=t.detailX||t.detail||1,i=t.detailY||t.detail||1,s=[],a=[],u=[],h=[],c=0;i>=c;c++)for(var l=c/i,f=0;n>=f;f++){var p=f/n;s.push(2*(p-.5),2*(l-.5),0),a.push(p,1-l),n>f&&i>c&&(e=f+c*(n+1),h.push(e,e+1,e+n+1),h.push(e+n+1,e+1,e+n+2))}if(t.backface!==!1){o.addBackfaceTriangles(s,h);var d=a.length;for(e=0;d>e;e++)a.push(a[e])}return u=o.computeNormals(s,h),new r({buffers:[{name:"a_pos",data:s},{name:"a_texCoord",data:a,size:2},{name:"a_normals",data:u},{name:"indices",data:h,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],236:[function(t,e,n){"use strict";function i(t){t=t||{};var e=t.detail||10,n=t.detailX||e,s=t.detailY||e,a=o.generateParametric(n,s,i.generator,!0);return new r({buffers:[{name:"a_pos",data:a.vertices},{name:"a_texCoord",data:o.getSpheroidUV(a.vertices),size:2},{name:"a_normals",data:o.getSpheroidNormals(a.vertices)},{name:"indices",data:a.indices,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");i.generator=function(t,e,n){var i=Math.sin(t)*Math.cos(e),r=Math.cos(t),o=-Math.sin(t)*Math.sin(e);n[0]=i,n[1]=r,n[2]=o},e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],237:[function(t,e,n){"use strict";function i(t){var e,n,i=[],s=[],a=Math.sqrt(3),u=[1,-1,-1/a,-1,-1,-1/a,0,1,0,0,1,0,0,-1,a-1/a,1,-1,-1/a,0,1,0,-1,-1,-1/a,0,-1,a-1/a,0,-1,a-1/a,-1,-1,-1/a,1,-1,-1/a],h=[0,1,2,3,4,5,6,7,8,9,10,11];for(n=0;4>n;n++)i.push(0,0,.5,1,1,0);for(t=t||{};--e;)o.subdivide(h,u,i);return s=o.computeNormals(u,h),new r({buffers:[{name:"a_pos",data:u},{name:"a_texCoord",data:i,size:2},{name:"a_normals",data:s},{name:"indices",data:h,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],238:[function(t,e,n){"use strict";function i(t){t=t||{};var e=t.detail||30,n=t.holeRadius||.8,s=t.tubeRadius||.2,a=o.generateParametric(e,e,i.generator.bind(null,n,s));return new r({buffers:[{name:"a_pos",data:a.vertices},{name:"a_texCoord",data:o.getSpheroidUV(a.vertices),size:2},{name:"a_normals",data:o.computeNormals(a.vertices,a.indices)},{name:"indices",data:a.indices,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");i.generator=function(t,e,n,i,r){r[0]=(t+e*Math.cos(2*i))*Math.sin(2*n),r[1]=-(t+e*Math.cos(2*i))*Math.cos(2*n),r[2]=e*Math.sin(2*i)},e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],239:[function(t,e,n){"use strict";function i(t){t=t||{};for(var e=t.detail||1,n=[],i=[0,0,.5,1,1,0],s=[0,1,2],a=[-1,-1,0,0,1,0,1,-1,0];--e;)o.subdivide(s,a,i);return t.backface!==!1&&o.addBackfaceTriangles(a,s),n=o.computeNormals(a,s),new r({buffers:[{name:"a_pos",data:a},{name:"a_texCoord",data:i,size:2},{name:"a_normals",data:n},{name:"indices",data:s,size:1}]})}var r=t("../Geometry"),o=t("../GeometryHelper");e.exports=i},{"../Geometry":225,"../GeometryHelper":226}],240:[function(t,e,n){"use strict";function i(t,e){this._node=t,this._changeQueue=[],this._initialized=!1,this._requestingUpdate=!1,this._inDraw=!1,this.value={geometry:a,drawOptions:null,color:null,expressions:{},flatShading:null,glossiness:null,positionOffset:null,normals:null},e&&this.setDrawOptions(e),this._id=t.addComponent(this)}var r=t("../webgl-geometries"),o=t("../core/Commands"),s=t("../core/TransformSystem"),a=new r.Plane;i.prototype.setDrawOptions=function(t){return this._changeQueue.push(o.GL_SET_DRAW_OPTIONS),this._changeQueue.push(t),this.value.drawOptions=t,this},i.prototype.getDrawOptions=function(){return this.value.drawOptions},i.prototype.setGeometry=function(t,e){if("string"==typeof t){if(!r[t])throw'Invalid geometry: "'+t+'".';t=new r[t](e)}if((this.value.geometry!==t||this._inDraw)&&(this._initialized&&(this._changeQueue.push(o.GL_SET_GEOMETRY),this._changeQueue.push(t.spec.id),this._changeQueue.push(t.spec.type),this._changeQueue.push(t.spec.dynamic)),this._requestUpdate(),this.value.geometry=t),this._initialized&&this._node){for(var n=this.value.geometry.spec.invalidations.length;n--;)this.value.geometry.spec.invalidations.pop(),this._changeQueue.push(o.GL_BUFFER_DATA),this._changeQueue.push(this.value.geometry.spec.id),this._changeQueue.push(this.value.geometry.spec.bufferNames[n]),this._changeQueue.push(this.value.geometry.spec.bufferValues[n]),this._changeQueue.push(this.value.geometry.spec.bufferSpacings[n]),this._changeQueue.push(this.value.geometry.spec.dynamic);n&&this._requestUpdate()}return this},i.prototype.getGeometry=function(){return this.value.geometry},i.prototype.setBaseColor=function(t){var e,n=t.__isAMaterial__,i=!!t.getNormalizedRGBA;return n?(this.value.color=null,this.value.expressions.baseColor=t,e=t):i&&(this.value.expressions.baseColor=null,this.value.color=t,e=t.getNormalizedRGBA()),this._initialized&&(t.__isAMaterial__?this._changeQueue.push(o.MATERIAL_INPUT):t.getNormalizedRGB&&this._changeQueue.push(o.GL_UNIFORMS),this._changeQueue.push("u_baseColor"),this._changeQueue.push(e)),this._requestUpdate(),this},i.prototype.getBaseColor=function(){return this.value.expressions.baseColor||this.value.color},i.prototype.setFlatShading=function(t){return(this._inDraw||this.value.flatShading!==t)&&(this.value.flatShading=t,this._initialized&&(this._changeQueue.push(o.GL_UNIFORMS),this._changeQueue.push("u_flatShading"),this._changeQueue.push(t?1:0)),this._requestUpdate()),this},i.prototype.getFlatShading=function(){return this.value.flatShading},i.prototype.setNormals=function(t){var e=t.__isAMaterial__;return e&&(this.value.expressions.normals=t),this._initialized&&(this._changeQueue.push(t.__isAMaterial__?o.MATERIAL_INPUT:o.GL_UNIFORMS),this._changeQueue.push("u_normals"),this._changeQueue.push(t)),this._requestUpdate(),this},i.prototype.getNormals=function(t){return this.value.expressions.normals},i.prototype.setGlossiness=function(t,e){var n=t.__isAMaterial__,i=!!t.getNormalizedRGB;return n?(this.value.glossiness=[null,null],this.value.expressions.glossiness=t):i&&(this.value.expressions.glossiness=null,this.value.glossiness=[t,e||20],t=t?t.getNormalizedRGB():[0,0,0],t.push(e||20)),this._initialized&&(this._changeQueue.push(t.__isAMaterial__?o.MATERIAL_INPUT:o.GL_UNIFORMS),this._changeQueue.push("u_glossiness"),this._changeQueue.push(t)),this._requestUpdate(),this},i.prototype.getGlossiness=function(){return this.value.expressions.glossiness||this.value.glossiness},i.prototype.setPositionOffset=function(t){var e,n=t.__isAMaterial__;return n?(this.value.expressions.positionOffset=t,e=t):(this.value.expressions.positionOffset=null,this.value.positionOffset=t,e=this.value.positionOffset),this._initialized&&(this._changeQueue.push(t.__isAMaterial__?o.MATERIAL_INPUT:o.GL_UNIFORMS),this._changeQueue.push("u_positionOffset"),this._changeQueue.push(e)),this._requestUpdate(),this},i.prototype.getPositionOffset=function(){return this.value.expressions.positionOffset||this.value.positionOffset},i.prototype.getMaterialExpressions=function(){return this.value.expressions},i.prototype.getValue=function(){return this.value},i.prototype._pushInvalidations=function(t){var e,n=this.value.expressions[t];if(n)for(var i=n.invalidations.length;i--;)e=n.invalidations.pop(),this._node.sendDrawCommand(o.GL_UNIFORMS),this._node.sendDrawCommand(e),this._node.sendDrawCommand(n.uniforms[e]);return this},i.prototype.onUpdate=function(){var t=this._node,e=this._changeQueue;if(t){if(t.sendDrawCommand(o.WITH),t.sendDrawCommand(t.getLocation()),this.value.color&&this.value.color.isActive()&&(this._node.sendDrawCommand(o.GL_UNIFORMS),this._node.sendDrawCommand("u_baseColor"),this._node.sendDrawCommand(this.value.color.getNormalizedRGBA()),this._node.requestUpdateOnNextTick(this._id)),this.value.glossiness&&this.value.glossiness[0]&&this.value.glossiness[0].isActive()){this._node.sendDrawCommand(o.GL_UNIFORMS),this._node.sendDrawCommand("u_glossiness");var n=this.value.glossiness[0].getNormalizedRGB();n.push(this.value.glossiness[1]),this._node.sendDrawCommand(n),this._node.requestUpdateOnNextTick(this._id)}else this._requestingUpdate=!1;this._pushInvalidations("baseColor"),this._pushInvalidations("positionOffset");for(var i=0;i<e.length;i++)t.sendDrawCommand(e[i]);e.length=0}},i.prototype.onMount=function(t,e){this._node=t,this._id=e,s.makeBreakPointAt(t.getLocation()),this.draw()},i.prototype.onDismount=function(){this._initialized=!1,this._changeQueue.push(o.GL_REMOVE_MESH),this._requestUpdate()},i.prototype.onShow=function(){this._changeQueue.push(o.GL_MESH_VISIBILITY,!0),this._requestUpdate()},i.prototype.onHide=function(){this._changeQueue.push(o.GL_MESH_VISIBILITY,!1),this._requestUpdate()},i.prototype.onTransformChange=function(t){this._initialized&&(this._changeQueue.push(o.GL_UNIFORMS),this._changeQueue.push("u_transform"),this._changeQueue.push(t.getWorldTransform())),this._requestUpdate()},i.prototype.onSizeChange=function(t,e,n){this._initialized&&(this._changeQueue.push(o.GL_UNIFORMS),this._changeQueue.push("u_size"),this._changeQueue.push([t,e,n])),this._requestUpdate()},i.prototype.onOpacityChange=function(t){this._initialized&&(this._changeQueue.push(o.GL_UNIFORMS),this._changeQueue.push("u_opacity"),this._changeQueue.push(t)),this._requestUpdate()},i.prototype.onAddUIEvent=function(t){},i.prototype._requestUpdate=function(){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0)},i.prototype.init=function(){this._initialized=!0,this.onTransformChange(s.get(this._node.getLocation()));var t=this._node.getSize();this.onSizeChange(t[0],t[1],t[2]),this.onOpacityChange(this._node.getOpacity()),this._requestUpdate()},i.prototype.draw=function(){this._inDraw=!0,this.init();var t=this.getValue();null!=t.geometry&&this.setGeometry(t.geometry),null!=t.color&&this.setBaseColor(t.color),null!=t.glossiness&&this.setGlossiness.apply(this,t.glossiness),null!=t.drawOptions&&this.setDrawOptions(t.drawOptions),null!=t.flatShading&&this.setFlatShading(t.flatShading),null!=t.expressions.normals&&this.setNormals(t.expressions.normals),null!=t.expressions.baseColor&&this.setBaseColor(t.expressions.baseColor),null!=t.expressions.glossiness&&this.setGlossiness(t.expressions.glossiness),null!=t.expressions.positionOffset&&this.setPositionOffset(t.expressions.positionOffset),this._inDraw=!1},e.exports=i},{"../core/Commands":179,"../core/TransformSystem":190,"../webgl-geometries":228}],241:[function(t,e,n){"use strict";function i(t){this._node=t,this._requestingUpdate=!1,this._color=null,this.queue=[],this.commands={color:r.GL_LIGHT_COLOR,position:r.GL_LIGHT_POSITION},this._id=t.addComponent(this)}var r=t("../../core/Commands");i.prototype.setColor=function(t){if(!t.getNormalizedRGB)return!1;this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),this._color=t,this.queue.push(this.commands.color);var e=this._color.getNormalizedRGB();return this.queue.push(e[0]),this.queue.push(e[1]),this.queue.push(e[2]),this},i.prototype.getColor=function(){return this._color},i.prototype.onUpdate=function(){var t=this._node.getLocation();this._node.sendDrawCommand(r.WITH).sendDrawCommand(t);for(var e=this.queue.length;e--;)this._node.sendDrawCommand(this.queue.shift());if(this._color&&this._color.isActive()){this._node.sendDrawCommand(this.commands.color);var n=this._color.getNormalizedRGB();this._node.sendDrawCommand(n[0]),this._node.sendDrawCommand(n[1]),this._node.sendDrawCommand(n[2]),this._node.requestUpdateOnNextTick(this._id)}else this._requestingUpdate=!1},e.exports=i},{"../../core/Commands":179}],242:[function(t,e,n){"use strict";function i(t){r.call(this,t)}var r=t("./Light"),o=t("../../core/TransformSystem");i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.prototype.onMount=function(t,e){this._id=e,o.makeBreakPointAt(this._node.getLocation()),this.onTransformChange(o.get(this._node.getLocation()))},i.prototype.onTransformChange=function(t){this._requestingUpdate||(this._node.requestUpdate(this._id),this._requestingUpdate=!0),t=t.getWorldTransform(),this.queue.push(this.commands.position),this.queue.push(t[12]),this.queue.push(t[13]),this.queue.push(t[14])},e.exports=i},{"../../core/TransformSystem":190,"./Light":241}],243:[function(t,e,n){"use strict";function i(t,e,n){this.buffer=null,this.target=t,this.type=e,this.data=[],this.gl=n}i.prototype.subData=function(){for(var t=this.gl,e=[],n=0,i=1e4;n<this.data.length;n+=i)e=Array.prototype.concat.apply(e,this.data.slice(n,n+i));this.buffer=this.buffer||t.createBuffer(),t.bindBuffer(this.target,this.buffer),t.bufferData(this.target,new this.type(e),t.STATIC_DRAW)},e.exports=i},{}],244:[function(t,e,n){"use strict";function i(t){this.gl=t,this.registry={},this._dynamicBuffers=[],this._staticBuffers=[],this._arrayBufferMax=3e4,this._elementBufferMax=3e4}var r="indices",o=t("./Buffer");i.prototype.allocate=function(t,e,n,i,s){var a,u,h,c,l=this.registry[t]||(this.registry[t]={keys:[],values:[],spacing:[],offset:[],length:[]}),f=l.keys.indexOf(e),p=e===r,d=!1,m=0;if(-1===f){if(f=l.keys.length,u=p?n.length:Math.floor(n.length/i),s)h=new o(p?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,p?Uint16Array:Float32Array,this.gl),this._dynamicBuffers.push({buffer:h,offset:n.length,isIndex:p});else{for(c=0;c<this._staticBuffers.length;c++)if(p===this._staticBuffers[c].isIndex&&(a=this._staticBuffers[c].offset+n.length,!p&&a<this._arrayBufferMax||p&&a<this._elementBufferMax)){h=this._staticBuffers[c].buffer,m=this._staticBuffers[c].offset,this._staticBuffers[c].offset+=n.length,d=!0;break}d||(h=new o(p?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,p?Uint16Array:Float32Array,this.gl),this._staticBuffers.push({buffer:h,offset:n.length,isIndex:p}))}l.keys.push(e),l.values.push(h),l.spacing.push(i),l.offset.push(m),l.length.push(u)}var g=n.length;for(c=0;g>c;c++)l.values[f].data[m+c]=n[c];l.values[f].subData()},e.exports=i},{"./Buffer":243}],245:[function(t,e,n){"use strict";function i(t,e){return function(){var n=t.apply(this,arguments);return e.apply(this,arguments),n}}function r(t,e){var n="body,html{background:#e3e3e3;font-family:monaco,monospace;font-size:14px;line-height:1.7em}#shaderReport{left:0;top:0;right:0;box-sizing:border-box;position:absolute;z-index:1000;color:#222;padding:15px;white-space:normal;list-style-type:none;margin:50px auto;max-width:1200px}#shaderReport li{background-color:#fff;margin:13px 0;box-shadow:0 1px 2px rgba(0,0,0,.15);padding:20px 30px;border-radius:2px;border-left:20px solid #e01111}span{color:#e01111;text-decoration:underline;font-weight:700}#shaderReport li p{padding:0;margin:0}#shaderReport li:nth-child(even){background-color:#f4f4f4}#shaderReport li p:first-child{margin-bottom:10px;color:#666}",i=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(i),i.textContent=n;var r=document.createElement("ul");r.setAttribute("id","shaderReport"),document.body.appendChild(r);for(var o,s=/ERROR: [\d]+:([\d]+): (.+)/gim,a=e.split("\n");null!=(o=s.exec(t));){o.index===s.lastIndex&&s.lastIndex++;var u=document.createElement("li"),h='<p><span>ERROR</span> "'+o[2]+'" in line '+o[1]+"</p>";h+="<p><b>"+a[o[1]-1].replace(/^[ \t]+/g,"")+"</b></p>",u.innerHTML=h,r.appendChild(u)}}e.exports=function(){return i(this.gl.compileShader,function(t){if(!this.getShaderParameter(t,this.COMPILE_STATUS)){var e=this.getShaderInfoLog(t),n=this.getShaderSource(t);r(e,n)}})}},{}],246:[function(t,e,n){"use strict";function i(t,e){this.gl=t,this.textureSlots=1,this.options=e||{},this.registeredMaterials={},this.flaggedUniforms=[],this.cachedUniforms={},this.uniformTypes=[],this.definitionVec4=[],this.definitionVec3=[],this.definitionFloat=[],this.applicationVec3=[],this.applicationVec4=[],this.applicationFloat=[],this.applicationVert=[],this.definitionVert=[],this.resetProgram()}var r=t("../utilities/clone"),o=t("../utilities/keyValueToArrays"),s=t("../webgl-shaders").vertex,a=t("../webgl-shaders").fragment,u=t("./Debug"),h=35633,c=35632,l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f="precision mediump float;\n",p={undefined:"float ",1:"float ",2:"vec2 ",3:"vec3 ",4:"vec4 ",16:"mat4 "},d={u_baseColor:"vec4",u_normals:"vert",u_glossiness:"vec4",u_positionOffset:"vert"},m={vert:1,vec3:2,vec4:4,float:8},g=o({u_perspective:l,u_view:l,u_resolution:[0,0,0],u_transform:l,u_size:[1,1,1],u_time:0,u_opacity:1,u_metalness:0,u_glossiness:[0,0,0,0],u_baseColor:[1,1,1,1],u_normals:[1,1,1],u_positionOffset:[0,0,0],u_lightPosition:l,u_lightColor:l,u_ambientLight:[0,0,0],u_flatShading:0,u_numLights:0}),_=o({a_pos:[0,0,0],a_texCoord:[0,0],a_normals:[0,0,0]}),y=o({v_textureCoordinate:[0,0],v_normal:[0,0,0],v_position:[0,0,0],v_eyeVector:[0,0,0]});i.prototype.registerMaterial=function(t,e){var n=e,i=d[t],r=m[i];if((this.registeredMaterials[e._id]&r)===r)return this;var o;for(o in n.uniforms)-1===g.keys.indexOf(o)&&(g.keys.push(o),g.values.push(n.uniforms[o]));for(o in n.varyings)-1===y.keys.indexOf(o)&&(y.keys.push(o),y.values.push(n.varyings[o]));for(o in n.attributes)-1===_.keys.indexOf(o)&&(_.keys.push(o),_.values.push(n.attributes[o]));return this.registeredMaterials[e._id]|=r,"float"===i&&(this.definitionFloat.push(e.defines),this.definitionFloat.push("float fa_"+e._id+"() {\n "+n.glsl+" \n}"),this.applicationFloat.push("if (int(abs(ID)) == "+e._id+") return fa_"+e._id+"();")),"vec3"===i&&(this.definitionVec3.push(e.defines),this.definitionVec3.push("vec3 fa_"+e._id+"() {\n "+n.glsl+" \n}"),this.applicationVec3.push("if (int(abs(ID.x)) == "+e._id+") return fa_"+e._id+"();")),"vec4"===i&&(this.definitionVec4.push(e.defines),this.definitionVec4.push("vec4 fa_"+e._id+"() {\n "+n.glsl+" \n}"),this.applicationVec4.push("if (int(abs(ID.x)) == "+e._id+") return fa_"+e._id+"();")),"vert"===i&&(this.definitionVert.push(e.defines),this.definitionVert.push("vec3 fa_"+e._id+"() {\n "+n.glsl+" \n}"),this.applicationVert.push("if (int(abs(ID.x)) == "+e._id+") return fa_"+e._id+"();")),this.resetProgram()},i.prototype.resetProgram=function(){var t,e,n,i,o,u,l=[f],d=[f];for(this.uniformLocations=[],this.attributeLocations={},this.uniformTypes={},this.attributeNames=r(_.keys),this.attributeValues=r(_.values),this.varyingNames=r(y.keys),this.varyingValues=r(y.values),this.uniformNames=r(g.keys),this.uniformValues=r(g.values),this.flaggedUniforms=[],this.cachedUniforms={},d.push("uniform sampler2D u_textures[7];\n"),this.applicationVert.length&&l.push("uniform sampler2D u_textures[7];\n"),u=0;u<this.uniformNames.length;u++)i=this.uniformNames[u],o=this.uniformValues[u],l.push("uniform "+p[o.length]+i+";\n"),d.push("uniform "+p[o.length]+i+";\n");for(u=0;u<this.attributeNames.length;u++)i=this.attributeNames[u],o=this.attributeValues[u],l.push("attribute "+p[o.length]+i+";\n");for(u=0;u<this.varyingNames.length;u++)i=this.varyingNames[u],o=this.varyingValues[u],l.push("varying "+p[o.length]+i+";\n"),d.push("varying "+p[o.length]+i+";\n");e=l.join("")+s.replace("#vert_definitions",this.definitionVert.join("\n")).replace("#vert_applications",this.applicationVert.join("\n")),t=d.join("")+a.replace("#vec3_definitions",this.definitionVec3.join("\n")).replace("#vec3_applications",this.applicationVec3.join("\n")).replace("#vec4_definitions",this.definitionVec4.join("\n")).replace("#vec4_applications",this.applicationVec4.join("\n")).replace("#float_definitions",this.definitionFloat.join("\n")).replace("#float_applications",this.applicationFloat.join("\n")),n=this.gl.createProgram(),this.gl.attachShader(n,this.compileShader(this.gl.createShader(h),e)),this.gl.attachShader(n,this.compileShader(this.gl.createShader(c),t)),this.gl.linkProgram(n),this.gl.getProgramParameter(n,this.gl.LINK_STATUS)?(this.program=n,this.gl.useProgram(this.program)):(console.error("link error: "+this.gl.getProgramInfoLog(n)),this.program=null),this.setUniforms(this.uniformNames,this.uniformValues);var m=this.gl.getUniformLocation(this.program,"u_textures[0]");return this.gl.uniform1iv(m,[0,1,2,3,4,5,6]),this},i.prototype.uniformIsCached=function(t,e){if(null==this.cachedUniforms[t])return e.length?this.cachedUniforms[t]=new Float32Array(e):this.cachedUniforms[t]=e,!1;if(e.length){for(var n=e.length;n--;)if(e[n]!==this.cachedUniforms[t][n]){for(n=e.length;n--;)this.cachedUniforms[t][n]=e[n];return!1}}else if(this.cachedUniforms[t]!==e)return this.cachedUniforms[t]=e,!1;return!0},i.prototype.setUniforms=function(t,e){var n,i,r,o,s,a=this.gl;if(!this.program)return this;for(o=t.length,s=0;o>s;s++)if(r=t[s],i=e[s],n=this.uniformLocations[r],null!==n&&(void 0===n&&(n=a.getUniformLocation(this.program,r),this.uniformLocations[r]=n),!this.uniformIsCached(r,i)))switch(this.uniformTypes[r]||(this.uniformTypes[r]=this.getUniformTypeFromValue(i)),this.uniformTypes[r]){case"uniform4fv":a.uniform4fv(n,i);break;case"uniform3fv":a.uniform3fv(n,i);break;case"uniform2fv":a.uniform2fv(n,i);break;case"uniform1fv":a.uniform1fv(n,i);break;case"uniform1f":a.uniform1f(n,i);break;case"uniformMatrix3fv":a.uniformMatrix3fv(n,!1,i);break;case"uniformMatrix4fv":a.uniformMatrix4fv(n,!1,i)}return this},i.prototype.getUniformTypeFromValue=function(t){if(Array.isArray(t)||t instanceof Float32Array)switch(t.length){case 1:return"uniform1fv";case 2:return"uniform2fv";case 3:return"uniform3fv";case 4:return"uniform4fv";case 9:return"uniformMatrix3fv";case 16:return"uniformMatrix4fv"}else if(!isNaN(parseFloat(t))&&isFinite(t))return"uniform1f";throw'cant load uniform "'+name+'" with value:'+JSON.stringify(t)},i.prototype.compileShader=function(t,e){var n=1;return this.options.debug&&(this.gl.compileShader=u.call(this)),this.gl.shaderSource(t,e),this.gl.compileShader(t),this.gl.getShaderParameter(t,this.gl.COMPILE_STATUS)||(console.error("compile error: "+this.gl.getShaderInfoLog(t)),console.error("1: "+e.replace(/\n/g,function(){return"\n"+(n+=1)+": "}))),t},e.exports=i},{"../utilities/clone":220,"../utilities/keyValueToArrays":221,"../webgl-shaders":253,"./Debug":245}],247:[function(t,e,n){"use strict";function i(t,e){e=e||{},this.id=t.createTexture(),this.width=e.width||0,this.height=e.height||0,this.mipmap=e.mipmap,this.format=e.format||"RGBA",this.type=e.type||"UNSIGNED_BYTE",this.gl=t,this.bind(),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipYWebgl||!1),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlphaWebgl||!1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t[e.magFilter]||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t[e.minFilter]||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t[e.wrapS]||t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t[e.wrapT]||t.CLAMP_TO_EDGE)}i.prototype.bind=function(){return this.gl.bindTexture(this.gl.TEXTURE_2D,this.id),this},i.prototype.unbind=function(){return this.gl.bindTexture(this.gl.TEXTURE_2D,null),this},i.prototype.setImage=function(t){return this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl[this.format],this.gl[this.format],this.gl[this.type],t),this.mipmap&&this.gl.generateMipmap(this.gl.TEXTURE_2D),this},i.prototype.setArray=function(t){return this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl[this.format],this.width,this.height,0,this.gl[this.format],this.gl[this.type],t),this},i.prototype.readBack=function(t,e,n,i){var r,o=this.gl;t=t||0,e=e||0,n=n||this.width,i=i||this.height;var s=o.createFramebuffer();return o.bindFramebuffer(o.FRAMEBUFFER,s),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,this.id,0),o.checkFramebufferStatus(o.FRAMEBUFFER)===o.FRAMEBUFFER_COMPLETE&&(r=new Uint8Array(n*i*4),o.readPixels(t,e,n,i,o.RGBA,o.UNSIGNED_BYTE,r)),r},e.exports=i},{}],248:[function(t,e,n){"use strict";function i(t){this.registry=[],this._needsResample=[],this._activeTexture=0,this._boundTexture=null,this._checkerboard=s(),this.gl=t}function r(t,e){var n=("string"==typeof t?new Image:t)||{};return n.crossOrigin="anonymous",n.src||(n.src=t),n.complete?e(n):n.onload=function(){e(n)},n}var o=t("./Texture"),s=t("./createCheckerboard");i.prototype.update=function(t){for(var e=this.registry.length,n=1;e>n;n++){var i=this.registry[n];i&&i.isLoaded&&i.resampleRate&&(!i.lastResample||t-i.lastResample>i.resampleRate)&&(this._needsResample[i.id]||(this._needsResample[i.id]=!0,i.lastResample=t))}},i.prototype.register=function(t,e){var n,i=this,s=t.data,a=t.id,u=t.options||{},h=this.registry[a];return h||(h=new o(this.gl,u),h.setImage(this._checkerboard),n=this.registry[a]={resampleRate:u.resampleRate||null,lastResample:null,isLoaded:!1,texture:h,source:s,id:a,slot:e},Array.isArray(s)||s instanceof Uint8Array||s instanceof Float32Array?(this.bindTexture(a),h.setArray(s),n.isLoaded=!0):s instanceof HTMLVideoElement?s.addEventListener("loadeddata",function(){i.bindTexture(a),h.setImage(s),n.isLoaded=!0,n.source=s}):"string"==typeof s&&r(s,function(t){i.bindTexture(a),h.setImage(t),n.isLoaded=!0,n.source=t})),a},i.prototype.bindTexture=function(t){var e=this.registry[t];this._activeTexture!==e.slot&&(this.gl.activeTexture(this.gl.TEXTURE0+e.slot),this._activeTexture=e.slot),this._boundTexture!==t&&(this._boundTexture=t,e.texture.bind()),this._needsResample[e.id]&&(e.texture.setImage(e.source),this._needsResample[e.id]=!1)},e.exports=i},{"./Texture":247,"./createCheckerboard":251}],249:[function(t,e,n){"use strict";function i(t,e){t.classList.add("famous-webgl-renderer"),this.canvas=t,this.compositor=e;var n=this.gl=this.getWebGLContext(this.canvas);n.clearColor(0,0,0,0),n.polygonOffset(.1,.1),n.enable(n.POLYGON_OFFSET_FILL),n.enable(n.DEPTH_TEST),n.enable(n.BLEND),n.depthFunc(n.LEQUAL),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),n.enable(n.CULL_FACE),n.cullFace(n.BACK),this.meshRegistry={},this.meshRegistryKeys=[],this.cutoutRegistry={},this.cutoutRegistryKeys=[],this.numLights=0,this.ambientLightColor=[0,0,0],this.lightRegistry={},this.lightRegistryKeys=[],this.lightPositions=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.lightColors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.textureManager=new u(n),this.texCache={},this.bufferRegistry=new o(n),this.program=new r(n,{debug:!0}),this.state={boundArrayBuffer:null,boundElementBuffer:null,lastDrawn:null,enabledAttributes:{},enabledAttributesKeys:[]
},this.resolutionName=["u_resolution"],this.resolutionValues=[[0,0,0]],this.cachedSize=[],this.projectionTransform=[1,0,0,0,0,1,0,0,0,0,-1e-6,0,-1,1,0,1];var i=this.cutoutGeometry={spec:{id:-1,bufferValues:[[-1,-1,0,1,-1,0,-1,1,0,1,1,0]],bufferNames:["a_pos"],type:"TRIANGLE_STRIP"}};this.bufferRegistry.allocate(this.cutoutGeometry.spec.id,i.spec.bufferNames[0],i.spec.bufferValues[0],3)}var r=t("./Program"),o=t("./BufferRegistry"),s=t("./radixSort"),a=t("../utilities/keyValueToArrays"),u=t("./TextureManager"),h=t("./compileMaterial"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=a({u_numLights:0,u_ambientLight:new Array(3),u_lightPosition:new Array(3),u_lightColor:new Array(3),u_perspective:new Array(16),u_time:0,u_view:new Array(16)});i.prototype.getWebGLContext=function(t){for(var e,n=["webgl","experimental-webgl","webkit-3d","moz-webgl"],i=0,r=n.length;r>i;i++){try{e=t.getContext(n[i])}catch(t){console.error("Error creating WebGL context: "+t.toString())}if(e)return e}return e?void 0:(console.error("Could not retrieve WebGL context. Please refer to https://www.khronos.org/webgl/ for requirements"),!1)},i.prototype.createLight=function(t){return this.numLights++,this.lightRegistryKeys.push(t),this.lightRegistry[t]={color:[0,0,0],position:[0,0,0]},this.lightRegistry[t]},i.prototype.createMesh=function(t){this.meshRegistryKeys.push(t);var e=a({u_opacity:1,u_transform:c,u_size:[0,0,0],u_baseColor:[.5,.5,.5,1],u_positionOffset:[0,0,0],u_normals:[0,0,0],u_flatShading:0,u_glossiness:[0,0,0,0]});return this.meshRegistry[t]={depth:null,uniformKeys:e.keys,uniformValues:e.values,buffers:{},geometry:null,drawType:null,textures:[],visible:!0},this.meshRegistry[t]},i.prototype.setCutoutState=function(t,e){var n=this.getOrSetCutout(t);n.visible=e},i.prototype.getOrSetCutout=function(t){if(this.cutoutRegistry[t])return this.cutoutRegistry[t];var e=a({u_opacity:0,u_transform:c.slice(),u_size:[0,0,0],u_origin:[0,0,0],u_baseColor:[0,0,0,1]});return this.cutoutRegistryKeys.push(t),this.cutoutRegistry[t]={uniformKeys:e.keys,uniformValues:e.values,geometry:this.cutoutGeometry.spec.id,drawType:this.cutoutGeometry.spec.type,visible:!0},this.cutoutRegistry[t]},i.prototype.setMeshVisibility=function(t,e){var n=this.meshRegistry[t]||this.createMesh(t);n.visible=e},i.prototype.removeMesh=function(t){var e=this.meshRegistryKeys.indexOf(t);this.meshRegistryKeys.splice(e,1),this.meshRegistry[t]=null},i.prototype.setCutoutUniform=function(t,e,n){var i=this.getOrSetCutout(t),r=i.uniformKeys.indexOf(e);if(n.length)for(var o=0,s=n.length;s>o;o++)i.uniformValues[r][o]=n[o];else i.uniformValues[r]=n},i.prototype.setMeshOptions=function(t,e){var n=this.meshRegistry[t]||this.createMesh(t);return n.options=e,this},i.prototype.setAmbientLightColor=function(t,e,n,i){return this.ambientLightColor[0]=e,this.ambientLightColor[1]=n,this.ambientLightColor[2]=i,this},i.prototype.setLightPosition=function(t,e,n,i){var r=this.lightRegistry[t]||this.createLight(t);return r.position[0]=e,r.position[1]=n,r.position[2]=i,this},i.prototype.setLightColor=function(t,e,n,i){var r=this.lightRegistry[t]||this.createLight(t);return r.color[0]=e,r.color[1]=n,r.color[2]=i,this},i.prototype.handleMaterialInput=function(t,e,n){var i=this.meshRegistry[t]||this.createMesh(t);n=h(n,i.textures.length),i.uniformValues[i.uniformKeys.indexOf(e)][0]=-n._id;for(var r=n.textures.length;r--;)i.textures.push(this.textureManager.register(n.textures[r],i.textures.length+r));return this.program.registerMaterial(e,n),this.updateSize()},i.prototype.setGeometry=function(t,e,n,i){var r=this.meshRegistry[t]||this.createMesh(t);return r.geometry=e,r.drawType=n,r.dynamic=i,this},i.prototype.setMeshUniform=function(t,e,n){var i=this.meshRegistry[t]||this.createMesh(t),r=i.uniformKeys.indexOf(e);-1===r?(i.uniformKeys.push(e),i.uniformValues.push(n)):i.uniformValues[r]=n},i.prototype.bufferData=function(t,e,n,i,r,o){return this.bufferRegistry.allocate(e,n,i,r,o),this},i.prototype.draw=function(t){var e=this.compositor.getTime();this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this.textureManager.update(e),this.meshRegistryKeys=s(this.meshRegistryKeys,this.meshRegistry),this.setGlobalUniforms(t),this.drawCutouts(),this.drawMeshes()},i.prototype.drawMeshes=function(){for(var t,e,n=this.gl,i=0;i<this.meshRegistryKeys.length;i++)if(e=this.meshRegistry[this.meshRegistryKeys[i]],t=this.bufferRegistry.registry[e.geometry],e.visible&&(e.uniformValues[0]<1?(n.depthMask(!1),n.enable(n.BLEND)):(n.depthMask(!0),n.disable(n.BLEND)),t)){for(var r=e.textures.length;r--;)this.textureManager.bindTexture(e.textures[r]);e.options&&this.handleOptions(e.options,e),this.program.setUniforms(e.uniformKeys,e.uniformValues),this.drawBuffers(t,e.drawType,e.geometry),e.options&&this.resetOptions(e.options)}},i.prototype.drawCutouts=function(){var t,e,n=this.cutoutRegistryKeys.length;if(n){this.gl.disable(this.gl.CULL_FACE),this.gl.enable(this.gl.BLEND),this.gl.depthMask(!0);for(var i=0;n>i;i++)t=this.cutoutRegistry[this.cutoutRegistryKeys[i]],e=this.bufferRegistry.registry[t.geometry],t.visible&&(this.program.setUniforms(t.uniformKeys,t.uniformValues),this.drawBuffers(e,t.drawType,t.geometry));this.gl.enable(this.gl.CULL_FACE)}},i.prototype.setGlobalUniforms=function(t){for(var e,n,i=0,r=this.lightRegistryKeys.length;r>i;i++)e=this.lightRegistry[this.lightRegistryKeys[i]],n=4*i,this.lightPositions[0+n]=e.position[0],this.lightPositions[1+n]=e.position[1],this.lightPositions[2+n]=e.position[2],this.lightColors[0+n]=e.color[0],this.lightColors[1+n]=e.color[1],this.lightColors[2+n]=e.color[2];l.values[0]=this.numLights,l.values[1]=this.ambientLightColor,l.values[2]=this.lightPositions,l.values[3]=this.lightColors,this.projectionTransform[0]=1/(.5*this.cachedSize[0]),this.projectionTransform[5]=-1/(.5*this.cachedSize[1]),this.projectionTransform[11]=t.perspectiveTransform[11],l.values[4]=this.projectionTransform,l.values[5]=.001*this.compositor.getTime(),l.values[6]=t.viewTransform,this.program.setUniforms(l.keys,l.values)},i.prototype.drawBuffers=function(t,e,n){var i,r,o,s,a,u,h,c,l=this.gl,f=0;for(u=t.keys.length,c=0;u>c;c++)i=t.keys[c],"indices"!==i?(r=this.program.attributeLocations[i],-1!==r&&(void 0!==r||(r=l.getAttribLocation(this.program.program,i),this.program.attributeLocations[i]=r,-1!==r))&&(this.state.enabledAttributes[i]||(l.enableVertexAttribArray(r),this.state.enabledAttributes[i]=!0,this.state.enabledAttributesKeys.push(i)),a=t.values[c],o=t.spacing[c],s=t.offset[c],f=t.length[c],this.state.boundArrayBuffer!==a&&(l.bindBuffer(a.target,a.buffer),this.state.boundArrayBuffer=a),this.state.lastDrawn!==n&&l.vertexAttribPointer(r,o,l.FLOAT,l.FALSE,0,4*s))):h=c;var p=this.state.enabledAttributesKeys.length;for(c=0;p>c;c++){var d=this.state.enabledAttributesKeys[c];this.state.enabledAttributes[d]&&-1===t.keys.indexOf(d)&&(l.disableVertexAttribArray(this.program.attributeLocations[d]),this.state.enabledAttributes[d]=!1)}f&&(void 0!==h?(a=t.values[h],s=t.offset[h],o=t.spacing[h],f=t.length[h],this.state.boundElementBuffer!==a&&(l.bindBuffer(a.target,a.buffer),this.state.boundElementBuffer=a),l.drawElements(l[e],f,l.UNSIGNED_SHORT,2*s)):l.drawArrays(l[e],0,f)),this.state.lastDrawn=n},i.prototype.updateSize=function(t){if(t){var e=window.devicePixelRatio||1,n=~~(t[0]*e),i=~~(t[1]*e);this.canvas.width=n,this.canvas.height=i,this.gl.viewport(0,0,n,i),this.cachedSize[0]=t[0],this.cachedSize[1]=t[1],this.cachedSize[2]=t[0]>t[1]?t[0]:t[1],this.resolutionValues[0]=this.cachedSize}return this.program.setUniforms(this.resolutionName,this.resolutionValues),this},i.prototype.handleOptions=function(t,e){var n=this.gl;t&&(t.blending&&n.enable(n.BLEND),"double"===t.side&&(this.gl.cullFace(this.gl.FRONT),this.drawBuffers(this.bufferRegistry.registry[e.geometry],e.drawType,e.geometry),this.gl.cullFace(this.gl.BACK)),"back"===t.side&&n.cullFace(n.FRONT))},i.prototype.resetOptions=function(t){var e=this.gl;t&&(t.blending&&e.disable(e.BLEND),"back"===t.side&&e.cullFace(e.BACK))},e.exports=i},{"../utilities/keyValueToArrays":221,"./BufferRegistry":244,"./Program":246,"./TextureManager":248,"./compileMaterial":250,"./radixSort":252}],250:[function(t,e,n){"use strict";function i(t,e){var n="",i={},h={},l={},f=[],p=[];return r(t,function(t,r){if(t.chunk){var d=c[o(t)],m=a(t),g=s(t.chunk.glsl,t.inputs,p.length+e);n+=d+m+" = "+g+"\n ",t.uniforms&&u(i,t.uniforms),t.varyings&&u(h,t.varyings),t.attributes&&u(l,t.attributes),t.chunk.defines&&f.push(t.chunk.defines),t.texture&&p.push(t.texture)}}),{_id:t._id,glsl:n+"return "+a(t)+";",defines:f.join("\n"),uniforms:i,varyings:h,attributes:l,textures:p}}function r(t,e){for(var n=t.inputs,i=n&&n.length,o=-1;++o<i;)r(n[o],e);return e(t),t}function o(t){if("number"==typeof t)return 1;if(Array.isArray(t))return t.length;var e=t.chunk.output;if("number"==typeof e)return e;var n=t.inputs.map(function(t){return o(t)}).join(",");return e[n]}function s(t,e,n){return t.replace(/%\d/g,function(t){return a(e[t[1]-1])}).replace(/\$TEXTURE/,"u_textures["+n+"]")}function a(t){return Array.isArray(t)?h(t):"object"==typeof t?"fa_"+t._id:t.toFixed(6)}function u(t,e){for(var n in e)t[n]=e[n]}function h(t){var e=t.length;return"vec"+e+"("+t.join(",")+")"}var c={1:"float ",2:"vec2 ",3:"vec3 ",4:"vec4 "};e.exports=i},{}],251:[function(t,e,n){"use strict";function i(){var t=document.createElement("canvas").getContext("2d");t.canvas.width=t.canvas.height=128;for(var e=0;e<t.canvas.height;e+=16)for(var n=0;n<t.canvas.width;n+=16)t.fillStyle=16&(n^e)?"#FFF":"#DDD",t.fillRect(n,e,16,16);return t.canvas}e.exports=i},{}],252:[function(t,e,n){"use strict";function i(t,e,n){var i=t[n],r=e[i];return(r.depth?r.depth:e[i].uniformValues[1][14])+_}function r(t,e,n,i){var r=t[n];return e[r].depth=a(i)-_,r}function o(t,e,n){e[t[n]].depth=null}function s(t){return v[0]=t,b[0]}function a(t){return b[0]=t,v[0]}function u(t,e){var n,a,u,p,_,y,v,b,w,T,E,S=0,x=[];for(m=32/h+.999999999999999|0,n=0,p=c*m;p>n;n++)f[n]=0;for(n=0,p=t.length;p>n;n++){for(_=s(i(t,e,n)),_^=_>>31|2147483648,a=0,u=0;g>a;a+=c,u+=h)f[a+(_>>>u&l)]++;f[a+(_>>>u&d)]++}for(a=0;g>=a;a+=c)for(b=a,w=0;a+c>b;b++)T=f[b]+w,f[b]=w-1,w=T;if(--m){for(n=0,p=t.length;p>n;n++)_=s(i(t,e,n)),x[++f[_&l]]=r(t,e,n,_^=_>>31|2147483648);for(v=x,x=t,t=v;++S<m;){for(n=0,p=t.length,y=S*c,E=S*h;p>n;n++)_=s(i(t,e,n)),x[++f[y+(_>>>E&l)]]=t[n];v=x,x=t,t=v}}for(n=0,p=t.length,y=S*c,E=S*h;p>n;n++)_=s(i(t,e,n)),x[++f[y+(_>>>E&d)]]=r(t,e,n,_^(~_>>31|2147483648)),o(t,e,n);return x}var h=11,c=1<<h,l=c-1,f=new Array(c*Math.ceil(64/h)),p=1<<31%h,d=(p<<1)-1,m=32/h+.999999999999999|0,g=c*(m-1),_=Math.pow(20,6),y=new ArrayBuffer(4),v=new Float32Array(y,0,1),b=new Int32Array(y,0,1);e.exports=u},{}],253:[function(t,e,n){"use strict";var i={vertex:'#define GLSLIFY 1\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Calculates transpose inverse matrix from transform\n * \n * @method random\n * @private\n *\n *\n */\n\n\nmat3 getNormalMatrix_1_0(in mat4 t) {\n   mat3 matNorm;\n   mat4 a = t;\n\n   float a00 = a[0][0], a01 = a[0][1], a02 = a[0][2], a03 = a[0][3],\n   a10 = a[1][0], a11 = a[1][1], a12 = a[1][2], a13 = a[1][3],\n   a20 = a[2][0], a21 = a[2][1], a22 = a[2][2], a23 = a[2][3],\n   a30 = a[3][0], a31 = a[3][1], a32 = a[3][2], a33 = a[3][3],\n   b00 = a00 * a11 - a01 * a10,\n   b01 = a00 * a12 - a02 * a10,\n   b02 = a00 * a13 - a03 * a10,\n   b03 = a01 * a12 - a02 * a11,\n   b04 = a01 * a13 - a03 * a11,\n   b05 = a02 * a13 - a03 * a12,\n   b06 = a20 * a31 - a21 * a30,\n   b07 = a20 * a32 - a22 * a30,\n   b08 = a20 * a33 - a23 * a30,\n   b09 = a21 * a32 - a22 * a31,\n   b10 = a21 * a33 - a23 * a31,\n   b11 = a22 * a33 - a23 * a32,\n\n   det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n   det = 1.0 / det;\n\n   matNorm[0][0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n   matNorm[0][1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n   matNorm[0][2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\n   matNorm[1][0] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n   matNorm[1][1] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n   matNorm[1][2] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\n   matNorm[2][0] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n   matNorm[2][1] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n   matNorm[2][2] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\n   return matNorm;\n}\n\n\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Calculates a matrix that creates the identity when multiplied by m\n * \n * @method inverse\n * @private\n *\n *\n */\n\n\nfloat inverse_2_1(float m) {\n    return 1.0 / m;\n}\n\nmat2 inverse_2_1(mat2 m) {\n    return mat2(m[1][1],-m[0][1],\n               -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse_2_1(mat3 m) {\n    float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n    float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n    float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n    float b01 =  a22 * a11 - a12 * a21;\n    float b11 = -a22 * a10 + a12 * a20;\n    float b21 =  a21 * a10 - a11 * a20;\n\n    float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n    return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n                b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n                b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse_2_1(mat4 m) {\n    float\n        a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n        a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n        a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n        a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n        b00 = a00 * a11 - a01 * a10,\n        b01 = a00 * a12 - a02 * a10,\n        b02 = a00 * a13 - a03 * a10,\n        b03 = a01 * a12 - a02 * a11,\n        b04 = a01 * a13 - a03 * a11,\n        b05 = a02 * a13 - a03 * a12,\n        b06 = a20 * a31 - a21 * a30,\n        b07 = a20 * a32 - a22 * a30,\n        b08 = a20 * a33 - a23 * a30,\n        b09 = a21 * a32 - a22 * a31,\n        b10 = a21 * a33 - a23 * a31,\n        b11 = a22 * a33 - a23 * a32,\n\n        det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n    return mat4(\n        a11 * b11 - a12 * b10 + a13 * b09,\n        a02 * b10 - a01 * b11 - a03 * b09,\n        a31 * b05 - a32 * b04 + a33 * b03,\n        a22 * b04 - a21 * b05 - a23 * b03,\n        a12 * b08 - a10 * b11 - a13 * b07,\n        a00 * b11 - a02 * b08 + a03 * b07,\n        a32 * b02 - a30 * b05 - a33 * b01,\n        a20 * b05 - a22 * b02 + a23 * b01,\n        a10 * b10 - a11 * b08 + a13 * b06,\n        a01 * b08 - a00 * b10 - a03 * b06,\n        a30 * b04 - a31 * b02 + a33 * b00,\n        a21 * b02 - a20 * b04 - a23 * b00,\n        a11 * b07 - a10 * b09 - a12 * b06,\n        a00 * b09 - a01 * b07 + a02 * b06,\n        a31 * b01 - a30 * b03 - a32 * b00,\n        a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Reflects a matrix over its main diagonal.\n * \n * @method transpose\n * @private\n *\n *\n */\n\n\nfloat transpose_3_2(float m) {\n    return m;\n}\n\nmat2 transpose_3_2(mat2 m) {\n    return mat2(m[0][0], m[1][0],\n                m[0][1], m[1][1]);\n}\n\nmat3 transpose_3_2(mat3 m) {\n    return mat3(m[0][0], m[1][0], m[2][0],\n                m[0][1], m[1][1], m[2][1],\n                m[0][2], m[1][2], m[2][2]);\n}\n\nmat4 transpose_3_2(mat4 m) {\n    return mat4(m[0][0], m[1][0], m[2][0], m[3][0],\n                m[0][1], m[1][1], m[2][1], m[3][1],\n                m[0][2], m[1][2], m[2][2], m[3][2],\n                m[0][3], m[1][3], m[2][3], m[3][3]);\n}\n\n\n\n\n/**\n * Converts vertex from modelspace to screenspace using transform\n * information from context.\n *\n * @method applyTransform\n * @private\n *\n *\n */\n\nvec4 applyTransform(vec4 pos) {\n    //TODO: move this multiplication to application code. \n\n    /**\n     * Currently multiplied in the vertex shader to avoid consuming the complexity of holding an additional\n     * transform as state on the mesh object in WebGLRenderer. Multiplies the object\'s transformation from object space\n     * to world space with its transformation from world space to eye space.\n     */\n    mat4 MVMatrix = u_view * u_transform;\n\n    //TODO: move the origin, sizeScale and y axis inversion to application code in order to amortize redundant per-vertex calculations.\n\n    /**\n     * The transform uniform should be changed to the result of the transformation chain:\n     *\n     * view * modelTransform * invertYAxis * sizeScale * origin\n     *\n     * which could be simplified to:\n     *\n     * view * modelTransform * convertToDOMSpace\n     *\n     * where convertToDOMSpace represents the transform matrix:\n     *\n     *                           size.x 0       0       size.x \n     *                           0      -size.y 0       size.y\n     *                           0      0       1       0\n     *                           0      0       0       1\n     *\n     */\n\n    /**\n     * Assuming a unit volume, moves the object space origin [0, 0, 0] to the "top left" [1, -1, 0], the DOM space origin.\n     * Later in the transformation chain, the projection transform negates the rigidbody translation.\n     * Equivalent to (but much faster than) multiplying a translation matrix "origin"\n     *\n     *                           1 0 0 1 \n     *                           0 1 0 -1\n     *                           0 0 1 0\n     *                           0 0 0 1\n     *\n     * in the transform chain: projection * view * modelTransform * invertYAxis * sizeScale * origin * positionVector.\n     */\n    pos.x += 1.0;\n    pos.y -= 1.0;\n\n    /**\n     * Assuming a unit volume, scales an object to the amount of pixels in the size uniform vector\'s specified dimensions.\n     * Later in the transformation chain, the projection transform transforms the point into clip space by scaling\n     * by the inverse of the canvas\' resolution.\n     * Equivalent to (but much faster than) multiplying a scale matrix "sizeScale"\n     *\n     *                           size.x 0      0      0 \n     *                           0      size.y 0      0\n     *                           0      0      size.z 0\n     *                           0      0      0      1\n     *\n     * in the transform chain: projection * view * modelTransform * invertYAxis * sizeScale * origin * positionVector.\n     */\n    pos.xyz *= u_size * 0.5;\n\n    /**\n     * Inverts the object space\'s y axis in order to match DOM space conventions. \n     * Later in the transformation chain, the projection transform reinverts the y axis to convert to clip space.\n     * Equivalent to (but much faster than) multiplying a scale matrix "invertYAxis"\n     *\n     *                           1 0 0 0 \n     *                           0 -1 0 0\n     *                           0 0 1 0\n     *                           0 0 0 1\n     *\n     * in the transform chain: projection * view * modelTransform * invertYAxis * sizeScale * origin * positionVector.\n     */\n    pos.y *= -1.0;\n\n    /**\n     * Exporting the vertex\'s position as a varying, in DOM space, to be used for lighting calculations. This has to be in DOM space\n     * since light position and direction is derived from the scene graph, calculated in DOM space.\n     */\n\n    v_position = (MVMatrix * pos).xyz;\n\n    /**\n    * Exporting the eye vector (a vector from the center of the screen) as a varying, to be used for lighting calculations.\n    * In clip space deriving the eye vector is a matter of simply taking the inverse of the position, as the position is a vector\n    * from the center of the screen. However, since our points are represented in DOM space,\n    * the position is a vector from the top left corner of the screen, so some additional math is needed (specifically, subtracting\n    * the position from the center of the screen, i.e. half the resolution of the canvas).\n    */\n\n    v_eyeVector = (u_resolution * 0.5) - v_position;\n\n    /**\n     * Transforming the position (currently represented in dom space) into view space (with our dom space view transform)\n     * and then projecting the point into raster both by applying a perspective transformation and converting to clip space\n     * (the perspective matrix is a combination of both transformations, therefore it\'s probably more apt to refer to it as a\n     * projection transform).\n     */\n\n    pos = u_perspective * MVMatrix * pos;\n\n    return pos;\n}\n\n/**\n * Placeholder for positionOffset chunks to be templated in.\n * Used for mesh deformation.\n *\n * @method calculateOffset\n * @private\n *\n *\n */\n#vert_definitions\nvec3 calculateOffset(vec3 ID) {\n    #vert_applications\n    return vec3(0.0);\n}\n\n/**\n * Writes the position of the vertex onto the screen.\n * Passes texture coordinate and normal attributes as varyings\n * and passes the position attribute through position pipeline.\n *\n * @method main\n * @private\n *\n *\n */\nvoid main() {\n    v_textureCoordinate = a_texCoord;\n    vec3 invertedNormals = a_normals + (u_normals.x < 0.0 ? calculateOffset(u_normals) * 2.0 - 1.0 : vec3(0.0));\n    invertedNormals.y *= -1.0;\n    v_normal = transpose_3_2(mat3(inverse_2_1(u_transform))) * invertedNormals;\n    vec3 offsetPos = a_pos + calculateOffset(u_positionOffset);\n    gl_Position = applyTransform(vec4(offsetPos, 1.0));\n}\n',fragment:'#define GLSLIFY 1\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Placeholder for fragmentShader  chunks to be templated in.\n * Used for normal mapping, gloss mapping and colors.\n * \n * @method applyMaterial\n * @private\n *\n *\n */\n\n#float_definitions\nfloat applyMaterial_1_0(float ID) {\n    #float_applications\n    return 1.;\n}\n\n#vec3_definitions\nvec3 applyMaterial_1_0(vec3 ID) {\n    #vec3_applications\n    return vec3(0);\n}\n\n#vec4_definitions\nvec4 applyMaterial_1_0(vec4 ID) {\n    #vec4_applications\n\n    return vec4(0);\n}\n\n\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2015 Famous Industries Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Calculates the intensity of light on a surface.\n *\n * @method applyLight\n * @private\n *\n */\nvec4 applyLight_2_1(in vec4 baseColor, in vec3 normal, in vec4 glossiness, int numLights, vec3 ambientColor, vec3 eyeVector, mat4 lightPosition, mat4 lightColor, vec3 v_position) {\n    vec3 diffuse = vec3(0.0);\n    bool hasGlossiness = glossiness.a > 0.0;\n    bool hasSpecularColor = length(glossiness.rgb) > 0.0;\n\n    for(int i = 0; i < 4; i++) {\n        if (i >= numLights) break;\n        vec3 lightDirection = normalize(lightPosition[i].xyz - v_position);\n        float lambertian = max(dot(lightDirection, normal), 0.0);\n\n        if (lambertian > 0.0) {\n            diffuse += lightColor[i].rgb * baseColor.rgb * lambertian;\n            if (hasGlossiness) {\n                vec3 halfVector = normalize(lightDirection + eyeVector);\n                float specularWeight = pow(max(dot(halfVector, normal), 0.0), glossiness.a);\n                vec3 specularColor = hasSpecularColor ? glossiness.rgb : lightColor[i].rgb;\n                diffuse += specularColor * specularWeight * lambertian;\n            }\n        }\n\n    }\n\n    return vec4(ambientColor + diffuse, baseColor.a);\n}\n\n\n\n\n\n/**\n * Writes the color of the pixel onto the screen\n *\n * @method main\n * @private\n *\n *\n */\nvoid main() {\n    vec4 material = u_baseColor.r >= 0.0 ? u_baseColor : applyMaterial_1_0(u_baseColor);\n\n    /**\n     * Apply lights only if flat shading is false\n     * and at least one light is added to the scene\n     */\n    bool lightsEnabled = (u_flatShading == 0.0) && (u_numLights > 0.0 || length(u_ambientLight) > 0.0);\n\n    vec3 normal = normalize(v_normal);\n    vec4 glossiness = u_glossiness.x < 0.0 ? applyMaterial_1_0(u_glossiness) : u_glossiness;\n\n    vec4 color = lightsEnabled ?\n    applyLight_2_1(material, normalize(v_normal), glossiness,\n               int(u_numLights),\n               u_ambientLight * u_baseColor.rgb,\n               normalize(v_eyeVector),\n               u_lightPosition,\n               u_lightColor,   \n               v_position)\n    : material;\n\n    gl_FragColor = color;\n    gl_FragColor.a *= u_opacity;   \n}\n'
};e.exports=i},{}],254:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var r=t("../config/faces"),o=i(r),s={drag:!0,autoRotate:!0,rotate:[]};s.rotate[o.default.FRONT]=[0,-180,0],s.rotate[o.default.LEFT]=[0,-90,0],s.rotate[o.default.BACK]=[0,0,0],s.rotate[o.default.RIGHT]=[0,90,0],s.rotate[o.default.TOP]=[0,180,-90],s.rotate[o.default.BOTTOM]=[0,180,90],s.rotate[o.default.GOBACK]=[0,100,8],n.default=s,e.exports=n.default},{"../config/faces":255}],255:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={FRONT:1,LEFT:2,BACK:3,RIGHT:4,BOTTOM:5,TOP:6,GOBACK:7};n.default=i,e.exports=n.default},{}],256:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("../config/faces"),a=i(s),u=function(){function t(e){r(this,t),this.cube=[],this._setCubeContent()}return o(t,[{key:"_setCubeContent",value:function(){var t=document.querySelector('[data-face="front"]').innerHTML,e=document.querySelector('[data-face="left"]').innerHTML,n=document.querySelector('[data-face="back"]').innerHTML,i=document.querySelector('[data-face="right"]').innerHTML,r=document.querySelector('[data-face="top"]').innerHTML,o=document.querySelector('[data-face="bottom"]').innerHTML;this.cube[0]={content:'<div class="plane-face-wrapper face-front-wrapper">'+t+"</div>",type:a.default.FRONT},this.cube[1]={content:'<div class="plane-face-wrapper face-left-wrapper">'+e+"</div>",type:a.default.LEFT},this.cube[2]={content:'<div class="plane-face-wrapper face-back-wrapper">'+n+"</div>",type:a.default.BACK},this.cube[3]={content:'<div class="plane-face-wrapper face-right-wrapper">'+i+"</div>",type:a.default.RIGHT},this.cube[4]={content:'<div class="plane-face-wrapper face-top-wrapper">'+r+"</div>",type:a.default.TOP},this.cube[5]={content:'<div class="plane-face-wrapper face-bottom-wrapper">'+o+"</div>",type:a.default.BOTTOM}}},{key:"getCubeContent",value:function(){return this.cube}}]),t}();n.default=u,e.exports=n.default},{"../config/faces":255}],257:[function(t,e,n){"use strict";t("babel/polyfill");var i=t("famous/core/FamousEngine"),r=i.createScene(".ad-wrapper");i.init();var o=t("./js/App");new o(r)},{"./js/App":258,"babel/polyfill":167,"famous/core/FamousEngine":182}],258:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("famous/webgl-renderables/lights/PointLight"),a=i(s),u=t("famous/core/FamousEngine"),h=(i(u),t("famous/components/Camera")),c=i(h),l=t("famous/utilities/Color"),f=i(l),p=t("famous/components/Position"),d=(i(p),t("famous/transitions/Transitionable")),m=i(d),g=t("./Cube"),_=i(g),y=t("../config/faces"),v=i(y),b=t("../config/config"),w=i(b),T=t("../lib/browser-name"),E=i(T);document.body.classList.add(E.default.toLowerCase());var S={WIDTH:window.CUBE_CONFIG.cube_size||300,HEIGHT:window.CUBE_CONFIG.cube_size||300,DEPTH:window.CUBE_CONFIG.camera_depth||3e3,DURATION:window.CUBE_CONFIG.transition_duration||1500,WAIT:window.CUBE_CONFIG.face_wait||2e3,ZOOMBACK:window.CUBE_CONFIG.scale_back||.9,ZOOMOUT:window.CUBE_CONFIG.transition_scale||.75},x=function(){function t(e){r(this,t),this.scene=e,this.body=document.querySelector("body"),this.sizeTransition=new m.default,this._handlerBtnClick=this._handleBtnClick.bind(this),this.rootNode=this.scene.addChild().setOrigin(.5,.5,0).setAlign(.5,.5,0).setMountPoint(.5,.5,.5).setSizeMode("absolute","absolute","absolute").setAbsoluteSize(S.WIDTH,S.HEIGHT,S.WIDTH),this._createCamera(),this._createLights(),this._cube=new _.default(this.rootNode,S),window.cube=this._cube;for(var n=[],i=0;i<window.FACE_STEP.length;i++)n.push(v.default[window.FACE_STEP[i]]);this._rotateToFace(n[0],0),n.shift();var o=S.WAIT,s=this.rootNode.addComponent({onUpdate:function(t){if(o-=10,n.length>0&&0>=o){var e=n[0];this._rotateToFace(e,S.DURATION),n.shift(),o=S.WAIT}this.rootNode.requestUpdateOnNextTick(s)}.bind(this)});this.rootNode.requestUpdate(s),this.rootNode.onReceive=function(t,e){"cube:rotateEnd"===t?this._bindFaceEvents():"cube:zoomOut"===t&&(this._cube.setGrab(!1),this._scaleCube(S.ZOOMBACK,1,S.DURATION,!1))}.bind(this)}return o(t,[{key:"_getCurrentFace",value:function(t){for(var e=0,n=document.querySelectorAll(".plane"),i=null,r=0;r<n.length;r++){var o=n[r];if("undefined"!=typeof o&&null!==o){var s=o.getBoundingClientRect().width+o.getBoundingClientRect().height;s>e&&(e=s,i=parseInt(o.getAttribute("data-face")))}}return i}},{key:"_scaleCube",value:function(t,e,n,i){i&&(n/=2),this.sizeTransition.from(t).set(e,{duration:n,curve:"outQuad",method:"slerp"},function(){i&&this.sizeTransition.from(e).set(t,{duration:n,curve:"outQuad",method:"slerp"},null)}.bind(this));var r=this.rootNode.addComponent({onUpdate:function(t){this.sizeTransition.isActive()&&(this.rootNode.setScale(this.sizeTransition.get(),this.sizeTransition.get(),this.sizeTransition.get()),this.rootNode.requestUpdateOnNextTick(r))}.bind(this)});this.rootNode.requestUpdate(r)}},{key:"_rotateToFace",value:function(t,e){var n=w.default.rotate[t].slice(0);this._cube.setGrab(!1),this._cube._rotate(n[0],n[1],n[2],e);var i=this.rootNode.getScale()[0];1>i?t!==v.default.GOBACK&&this._scaleCube(i,1,e,!1):t===v.default.GOBACK?(this._cube.setGrab(!0),this._scaleCube(i,S.ZOOMBACK,e,!1)):this._scaleCube(i,S.ZOOMOUT,e,!0)}},{key:"_handleBtnClick",value:function(t){var e=t.currentTarget.getAttribute("data-face"),n=v.default[e];w.default.rotate[n].slice(0),this._cube.setGrab(!1),n===v.default.GOBACK&&this._cube.setGrab(!0),this._rotateToFace(n,S.DURATION)}},{key:"_bindFaceEvents",value:function(){for(var t=this._getCurrentFace(),e=this.body.classList,n=e.length-1;n>=0;n--)e[n].indexOf("cube-face")>-1&&this.body.classList.remove(e[n]);this.body.classList.add("cube-face-"+t);for(var i=document.querySelectorAll("[data-rotate]"),n=i.length-1;n>=0;n--)i[n].removeEventListener("click",this._handlerBtnClick),i[n].removeEventListener("touchstart",this._handlerBtnClick),i[n].addEventListener("click",this._handlerBtnClick),i[n].addEventListener("touchstart",this._handlerBtnClick)}},{key:"_createCamera",value:function(){this.camera=new c.default(this.scene).setDepth(S.DEPTH),window.camera=this.camera}},{key:"_createLights",value:function(){this._createLight({align:[1,1,0],position:[S.WIDTH,S.WIDTH,10]})}},{key:"_createLight",value:function(t){var e={color:t&&t.color?t.color:new f.default("#3e3e3e"),align:t&&t.align&&null!==t.align[0]?t.align:[.5,.5,.5],position:t&&t.position&&null!==t.position[0]?t.position:[0,0,0]},n=this.scene.addChild().setAlign(e.align[0],e.align[1],e.align[2]).setPosition(e.position[0],e.position[1],e.position[2]);return new a.default(n).setColor(e.color),n}}]),t}();n.default=x,e.exports=n.default},{"../config/config":254,"../config/faces":255,"../lib/browser-name":261,"./Cube":259,"famous/components/Camera":170,"famous/components/Position":173,"famous/core/FamousEngine":182,"famous/transitions/Transitionable":217,"famous/utilities/Color":219,"famous/webgl-renderables/lights/PointLight":242}],259:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("famous/webgl-renderables/lights/PointLight"),a=(i(s),t("famous/core/FamousEngine")),u=i(a),h=t("famous/components/Camera"),c=(i(h),t("famous/utilities/Color")),l=i(c),f=t("famous/transitions/Transitionable"),p=i(f),d=t("famous/math/Quaternion"),m=i(d),g=t("famous/components/Position"),_=(i(g),t("./Plane")),y=i(_),v=t("../content/Template"),b=i(v),w=t("../config/faces"),T=i(w),E=t("../config/config"),S=i(E),x=function(){function t(e,n){r(this,t),this.canGrab=!1,this.conf=S.default,this.faces=T.default,this.config={WIDTH:n&&n.WIDTH?n.WIDTH:200,HEIGHT:n&&n.HEIGHT?n.HEIGHT:200,DEPTH:n&&n.DEPTH?n.DEPTH:500},this.rootNode=e,this.template=new b.default,this.trans=new p.default([1,0,0,0]);var i=(this.rootNode.getAbsoluteSize(),this.rootNode.getOrigin()),o=document.querySelector("body"),s={width:o.offsetWidth,height:o.offsetHeight},a={x:s.width*i[0],y:s.height*i[1]};this.boxCenter=[a.x,a.y],this.transitionX=new p.default,this.transitionY=new p.default,this.transitionZ=new p.default,this._createCubes(),S.default.drag&&this._rotateCube(),this.rotation=this.rootNode.getRotation(),this.oldRotationX=0,this.oldRotationY=0,this.oldRotationZ=0}return o(t,[{key:"_createCubes",value:function(){if(this.template&&this.template.getCubeContent()){var t=this.template.getCubeContent();this.planes=[];var e=!0,n=!1,i=void 0;try{for(var r,o=Object.keys(t)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var s=r.value;this.planes.push(this._createCube(t[s].type,{key:t[s].type,color:t[s].color,content:t[s].content,properties:t[s].properties}))}}catch(t){n=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(n)throw i}}}}},{key:"_createCube",value:function(t,e){var n=[0,0,Math.PI],i=[this.config.WIDTH,this.config.HEIGHT,this.config.WIDTH];switch(t){case T.default.FRONT:break;case T.default.LEFT:n[1]=1.5*Math.PI;break;case T.default.BACK:n[1]=Math.PI;break;case T.default.RIGHT:n[1]=Math.PI/2;break;case T.default.TOP:n[0]=Math.PI/2;break;case T.default.BOTTOM:n[0]=1.5*Math.PI}var r=new y.default(this.rootNode.addChild(),{color:e.properties&&e.properties["background-color"]?new l.default(e.properties["background-color"]):new l.default("red"),key:e.key,size:i,rotation:n,className:"face-"+t});return r.setDom(e.content),r}},{key:"setSize",value:function(t,e,n){var i=!0,r=!1,o=void 0;try{for(var s,a=Object.keys(this.planes)[Symbol.iterator]();!(i=(s=a.next()).done);i=!0){var u=s.value;this.planes[u].setSize(t,e,n)}}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}}},{key:"_rotate",value:function(t,e,n,i){var r=this.rootNode.getRotation(),o=new m.default(r.w,r.x,r.y,r.z),s=(new m.default).fromEuler(t*Math.PI/180,e*Math.PI/180,n*Math.PI/180),a=new m.default;m.default.multiply(o,s,a),this.trans.set([a.w,a.x,a.y,a.z],{duration:i,curve:"outQuad",method:"slerp"})}},{key:"_rotateCube",value:function(){var t=u.default.getClock(),e=!1;u.default.getClock().setInterval(function(){t.getTime(),this.trans.isActive()?(e||(e=!0),this.rootNode.setRotation(this.trans.get()[0],this.trans.get()[1],this.trans.get()[2],this.trans.get()[3])):e&&(e=!1,this.isDragging||this.rootNode.onReceive("cube:rotateEnd"))}.bind(this),16),this.grabing=!1,window.document.addEventListener("touchstart",function(t){this._mousedown(t.changedTouches[0])}.bind(this)),window.document.addEventListener("mousedown",function(t){this._mousedown(t)}.bind(this)),window.document.addEventListener("touchend",function(t){this._mouseup(t)}.bind(this)),window.document.addEventListener("mouseup",function(t){this._mouseup(t)}.bind(this)),window.document.addEventListener("touchmove",function(t){t.stopPropagation(),this._mousemove(t.changedTouches[0])}.bind(this)),window.document.addEventListener("mousemove",function(t){this._mousemove(t)}.bind(this))}},{key:"_getCurrentFace",value:function(t){for(var e=0,n=document.querySelectorAll(".plane"),i=null,r=0;r<n.length;r++){var o=n[r];if("undefined"!=typeof o&&null!==o){var s=o.getBoundingClientRect().width+o.getBoundingClientRect().height;s>e&&(e=s,i=parseInt(o.getAttribute("data-face")))}}return i}},{key:"_mousedown",value:function(t){this.canGrab&&(this.clickedOnFace=!0,this.isDragging=!0)}},{key:"_mouseup",value:function(t){if(this.isDragging)if(this.isDragging=!1,this.clickedOnFace){for(var e,n=t.target,i=null;n!==document.body;){var r=n.getAttribute("data-rotate");if("undefined"!=typeof r&&null!==r)break;i=n.getAttribute("data-face"),"undefined"!=typeof i&&null!==i&&(e=n.getAttribute("data-face")),n=n.parentNode}if("undefined"!=typeof e&&null!==e&&(6===parseInt(e)||5===parseInt(e))){var o=this.conf.rotate[e][0],s=this.conf.rotate[e][1],a=this.conf.rotate[e][2];this._rotate(o,s,a,1e3),this.rootNode.onReceive("cube:zoomOut")}}else this.canGrab&&this.rootNode.onReceive("cube:rotateEnd")}},{key:"_mousemove",value:function(t){if(this.isDragging){this.clickedOnFace=!1;var e=this._getMousePosition(t),n=Math.atan2(e.x-this.boxCenter[0],-(0-this.boxCenter[1]))*(180/Math.PI),i=Math.atan2(e.y-this.boxCenter[1],-(0-this.boxCenter[0]))*(180/Math.PI),r=this.rootNode.getRotation(),o=new m.default(r.w,r.x,r.y,r.z);this._toEulerRotation(o.x,-(4*n)+90,6*i,0)}}},{key:"_toEulerRotation",value:function(t,e,n,i){var r=this.rootNode.getRotation(),o=new m.default(r.w,r.x,r.y,r.z),s=(new m.default).fromEuler(t*Math.PI/180,e*Math.PI/180,n*Math.PI/180),a=new m.default;m.default.multiply(o,s,a),this.trans.set([a.w,a.x,a.y,a.z],{duration:i,curve:"outQuad",method:"slerp"})}},{key:"_getMousePosition",value:function(t){var e=new Number,n=new Number;return document.getElementById("canvas"),void 0!=t.x&&void 0!=t.y?(e=t.x,n=t.y):(e=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:e,y:n}}},{key:"getRotation",value:function(){return this.rootNode.getRotation()}},{key:"setGrab",value:function(t){this.canGrab=t,t?document.body.classList.add("drag"):document.body.classList.remove("drag")}}]),t}();n.default=x,e.exports=n.default},{"../config/config":254,"../config/faces":255,"../content/Template":256,"./Plane":260,"famous/components/Camera":170,"famous/components/Position":173,"famous/core/FamousEngine":182,"famous/math/Quaternion":206,"famous/transitions/Transitionable":217,"famous/utilities/Color":219,"famous/webgl-renderables/lights/PointLight":242}],260:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("famous/components/Origin"),a=i(s),u=t("famous/components/Rotation"),h=i(u),c=t("famous/components/Position"),l=i(c),f=t("famous/components/Transform"),p=i(f),d=t("famous/components/Align"),m=i(d),g=t("famous/components/MountPoint"),_=i(g),y=t("famous/components/Size"),v=i(y),b=t("famous/webgl-renderables/Mesh"),w=i(b),T=t("famous/webgl-geometries/primitives/Plane"),E=i(T),S=t("famous/utilities/Color"),x=i(S),O=t("famous/dom-renderables/DOMElement"),C=i(O),$=function(){function t(e,n){r(this,t);var i={key:n&&n.key?n.key:0,className:n&&n.className?n.className:"face-0",proportional:n&&n.proportional&&null!==n.proportional[0]?n.proportional:[.5,.5,.5],size:n&&n.size&&null!==n.size[0]?n.size:[100,100,100],mountPoint:n&&n.mountPoint&&null!==n.mountPoint[0]?n.mountPoint:[.5,.5,.5],align:n&&n.align&&null!==n.align[0]?n.align:[.5,.5,.5],origin:n&&n.origin&&null!==n.origin[0]?n.origin:[.5,.5,0],position:n&&n.position&&null!==n.position[0]?n.position:[0,0,0],rotation:n&&n.rotation&&null!==n.rotation[0]?n.rotation:[0,0,0]};this.dispatch=e,this.mesh=new w.default(this.dispatch),this.mesh.setGeometry(new E.default),this.mesh.setBaseColor(new x.default("red").setOpacity(0)),this.position=new l.default(this.dispatch),this.origin=new a.default(this.dispatch),this.size=new v.default(this.dispatch),this.mountPoint=new _.default(this.dispatch),this.align=new m.default(this.dispatch),this.transform=new p.default(this.dispatch),this.rotation=new h.default(this.dispatch),this.origin.set(i.origin[0],i.origin[1],i.origin[2]),this.size.setMode("absolute","absolute","absolute"),this.size.setAbsolute(i.size[0],i.size[1],i.size[2]),this.mountPoint.set(i.mountPoint[0],i.mountPoint[1],i.mountPoint[2]),this.align.set(i.align[0],i.align[1],i.align[2]),this.rotation.set(i.rotation[0],i.rotation[1],i.rotation[2]),this.dom=new C.default(this.dispatch,{classes:["plane",i.className],attributes:{"data-face":i.key}})}return o(t,[{key:"setDom",value:function(t){this.dom.setContent(t),this.dom.setProperty("background-color","white")}},{key:"getDom",value:function(){return this.dom}},{key:"getDispatcher",value:function(){return this.dispatch}},{key:"setSize",value:function(t,e,n){this.size.setAbsolute(t,e,n)}}]),t}();n.default=$,e.exports=n.default},{"famous/components/Align":169,"famous/components/MountPoint":171,"famous/components/Origin":172,"famous/components/Position":173,"famous/components/Rotation":174,"famous/components/Size":175,"famous/components/Transform":176,"famous/dom-renderables/DOMElement":191,"famous/utilities/Color":219,"famous/webgl-geometries/primitives/Plane":235,"famous/webgl-renderables/Mesh":240}],261:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s=(navigator.appVersion,navigator.userAgent),a=navigator.appName,u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10);-1!=(r=s.indexOf("OPR/"))?(a="Opera",u=s.substring(r+4)):-1!=(r=s.indexOf("Opera"))?(a="Opera",u=s.substring(r+6),-1!=(r=s.indexOf("Version"))&&(u=s.substring(r+8))):-1!=(r=s.indexOf("MSIE"))?(a="Microsoft Internet Explorer",u=s.substring(r+5)):-1!=(r=s.indexOf("Chrome"))?(a="Chrome",u=s.substring(r+7)):-1!=(r=s.indexOf("Safari"))?(a="Safari",u=s.substring(r+7),-1!=(r=s.indexOf("Version"))&&(u=s.substring(r+8))):-1!=(r=s.indexOf("Firefox"))?(a="Firefox",u=s.substring(r+8)):(i=s.lastIndexOf(" ")+1)<(r=s.lastIndexOf("/"))&&(a=s.substring(i,r),u=s.substring(r+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!=(o=u.indexOf(";"))&&(u=u.substring(0,o)),-1!=(o=u.indexOf(" "))&&(u=u.substring(0,o)),h=parseInt(""+u,10),isNaN(h)&&(u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10)),n.default=a,e.exports=n.default},{}]},{},[257]);
Rerun