@netless/slide 0.1.11 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Slide.js CHANGED
@@ -38,7 +38,7 @@ object-assign
38
38
  *
39
39
  * MIT License
40
40
  */
41
- function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,n){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof t?this._pos:(this._pos=[t,e,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,n,r,i,o){if(!this.ctx||!this.ctx.listener)return this;var s=this._orientation;return e="number"!=typeof e?s[1]:e,n="number"!=typeof n?s[2]:n,r="number"!=typeof r?s[3]:r,i="number"!=typeof i?s[4]:i,o="number"!=typeof o?s[5]:o,"number"!=typeof t?s:(this._orientation=[t,e,n,r,i,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,n,r,i,o),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(t,n)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return r._stereo;r._stereo=t,r._pos=[t,0,0]}for(var o=r._getSoundIds(n),s=0;s<o.length;s++){var a=r._soundById(o[s]);if(a){if("number"!=typeof t)return a._stereo;a._stereo=t,a._pos=[t,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||e(a,i),"spatial"===i?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(t,0,0):a._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),r._emit("stereo",a._id)}}return r},Howl.prototype.pos=function(t,n,r,i){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"pos",action:function(){o.pos(t,n,r,i)}}),o;if(n="number"!=typeof n?0:n,r="number"!=typeof r?-.5:r,void 0===i){if("number"!=typeof t)return o._pos;o._pos=[t,n,r]}for(var s=o._getSoundIds(i),a=0;a<s.length;a++){var u=o._soundById(s[a]);if(u){if("number"!=typeof t)return u._pos;u._pos=[t,n,r],u._node&&(u._panner&&!u._panner.pan||e(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(t,n,r)),o._emit("pos",u._id)}}return o},Howl.prototype.orientation=function(t,n,r,i){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"orientation",action:function(){o.orientation(t,n,r,i)}}),o;if(n="number"!=typeof n?o._orientation[1]:n,r="number"!=typeof r?o._orientation[2]:r,void 0===i){if("number"!=typeof t)return o._orientation;o._orientation=[t,n,r]}for(var s=o._getSoundIds(i),a=0;a<s.length;a++){var u=o._soundById(s[a]);if(u){if("number"!=typeof t)return u._orientation;u._orientation=[t,n,r],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(t,n,r)),o._emit("orientation",u._id)}}return o},Howl.prototype.pannerAttr=function(){var t,n,r,i=this,o=arguments;if(!i._webAudio)return i;if(0===o.length)return i._pannerAttr;if(1===o.length){if("object"!=typeof o[0])return(r=i._soundById(parseInt(o[0],10)))?r._pannerAttr:i._pannerAttr;t=o[0],void 0===n&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),i._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:i._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:i._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:i._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:i._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:i._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:i._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:i._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:i._panningModel})}else 2===o.length&&(t=o[0],n=parseInt(o[1],10));for(var s=i._getSoundIds(n),a=0;a<s.length;a++)if(r=i._soundById(s[a])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:u.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:u.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:u.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:u.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:u.panningModel};var l=r._panner;l?(l.coneInnerAngle=u.coneInnerAngle,l.coneOuterAngle=u.coneOuterAngle,l.coneOuterGain=u.coneOuterGain,l.distanceModel=u.distanceModel,l.maxDistance=u.maxDistance,l.refDistance=u.refDistance,l.rolloffFactor=u.rolloffFactor,l.panningModel=u.panningModel):(r._pos||(r._pos=i._pos||[0,0,-.5]),e(r,"spatial"))}return i},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,n(4))},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(23),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,s,a,u=1,l={},c=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return l[u]=i,r(u),u++},d.clearImmediate=f}function f(t){delete l[t]}function p(t){if(c)setTimeout(p,0,t);else{var e=l[t];if(e){c=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{f(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(4),n(24))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,l=[],c=!1,h=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&f())}function f(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h<e;)u&&u[h].run();h=-1,e=l.length}u=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}i.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];l.push(new p(t,e)),1!==l.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){(function(t,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,l=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(d[t])}function g(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function v(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+g((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function y(t){return g(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,n){var r=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;r+=36)t=f(t/35);return f(r+36*t/(t+38))}function w(t){var e,n,r,i,o,s,a,l,c,h,d,p=[],g=t.length,v=0,_=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&m("not-basic"),p.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=v,s=1,a=36;i>=g&&m("invalid-input"),((l=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-v)/s))&&m("overflow"),v+=l*s,!(l<(c=a<=x?1:a>=x+26?26:a-x));a+=36)s>f(u/(h=36-c))&&m("overflow"),s*=h;x=b(v-o,e=p.length+1,0==o),f(v/e)>u-_&&m("overflow"),_+=f(v/e),v%=e,p.splice(v++,0,_)}return y(p)}function S(t){var e,n,r,i,o,s,a,l,c,h,d,g,v,y,w,S=[];for(g=(t=_(t)).length,e=128,n=0,o=72,s=0;s<g;++s)(d=t[s])<128&&S.push(p(d));for(r=i=S.length,i&&S.push("-");r<g;){for(a=u,s=0;s<g;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((u-n)/(v=r+1))&&m("overflow"),n+=(a-e)*v,e=a,s=0;s<g;++s)if((d=t[s])<e&&++n>u&&m("overflow"),d==e){for(l=n,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,y=36-h,S.push(p(x(h+w%y,0))),l=f(w/y);S.push(p(x(l,0))),o=b(n,v,r==i),n=0,++r}++n,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:_,encode:y},decode:w,encode:S,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return l.test(t)?w(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return a}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(11)(t),n(4))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";e.decode=e.parse=n(28),e.encode=e.stringify=n(29)},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=t.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var h,d,f,p,m=t[c].replace(a,"%20"),g=m.indexOf(n);g>=0?(h=m.substr(0,g),d=m.substr(g+1)):(h=m,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(s,f)?i(s[f])?s[f].push(p):s[f]=[s[f],p]:s[f]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(r(s))+n;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(r(t))})).join(e):a+encodeURIComponent(r(t[s]))})).join(e):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var s=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},function(t,e){var n=function(){};n.prototype={fit:function(t){var e,n,r,i,o=t.length,s=o>0?t[0].width:0,a=o>0?t[0].height:0;for(this.root={x:0,y:0,width:s,height:a},e=0;e<o;e++)r=t[e],(n=this.findNode(this.root,r.width,r.height))?(i=this.splitNode(n,r.width,r.height),r.x=i.x,r.y=i.y):(i=this.growNode(r.width,r.height),r.x=i.x,r.y=i.y)},findNode:function(t,e,n){return t.used?this.findNode(t.right,e,n)||this.findNode(t.down,e,n):e<=t.width&&n<=t.height?t:null},splitNode:function(t,e,n){return t.used=!0,t.down={x:t.x,y:t.y+n,width:t.width,height:t.height-n},t.right={x:t.x+e,y:t.y,width:t.width-e,height:n},t},growNode:function(t,e){var n=t<=this.root.width,r=e<=this.root.height,i=r&&this.root.height>=this.root.width+t,o=n&&this.root.width>=this.root.height+e;return i?this.growRight(t,e):o?this.growDown(t,e):r?this.growRight(t,e):n?this.growDown(t,e):null},growRight:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null},growDown:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+e,down:{x:0,y:this.root.height,width:this.root.width,height:e},right:this.root},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null}},t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"SLIDE_EVENTS",(function(){return Kd})),n.d(e,"Slide",(function(){return $d}));var r={};n.r(r),n.d(r,"isMobile",(function(){return $})),n.d(r,"EventEmitter",(function(){return yt.a})),n.d(r,"earcut",(function(){return bt.a})),n.d(r,"BaseTextureCache",(function(){return te})),n.d(r,"CanvasRenderTarget",(function(){return re})),n.d(r,"DATA_URI",(function(){return se})),n.d(r,"ProgramCache",(function(){return $t})),n.d(r,"TextureCache",(function(){return Qt})),n.d(r,"clearTextureCache",(function(){return ne})),n.d(r,"correctBlendMode",(function(){return Nt})),n.d(r,"createIndicesForQuads",(function(){return kt})),n.d(r,"decomposeDataUri",(function(){return ae})),n.d(r,"deprecation",(function(){return Kt})),n.d(r,"destroyTextureCache",(function(){return ee})),n.d(r,"determineCrossOrigin",(function(){return ue})),n.d(r,"getBufferType",(function(){return Gt})),n.d(r,"getResolutionOfUrl",(function(){return le})),n.d(r,"hex2rgb",(function(){return Ct})),n.d(r,"hex2string",(function(){return It})),n.d(r,"interleaveTypedArrays",(function(){return zt})),n.d(r,"isPow2",(function(){return Vt})),n.d(r,"isWebGLSupported",(function(){return Pt})),n.d(r,"log2",(function(){return Wt})),n.d(r,"nextPow2",(function(){return jt})),n.d(r,"premultiplyBlendMode",(function(){return Dt})),n.d(r,"premultiplyRgba",(function(){return Ft})),n.d(r,"premultiplyTint",(function(){return Bt})),n.d(r,"premultiplyTintToRgba",(function(){return Ut})),n.d(r,"removeItems",(function(){return Xt})),n.d(r,"rgb2hex",(function(){return Ot})),n.d(r,"sayHello",(function(){return At})),n.d(r,"sign",(function(){return qt})),n.d(r,"skipHello",(function(){return Mt})),n.d(r,"string2hex",(function(){return Lt})),n.d(r,"trimCanvas",(function(){return ie})),n.d(r,"uid",(function(){return Zt})),n.d(r,"url",(function(){return St}));var i={};n.r(i),n.d(i,"utils",(function(){return r})),n.d(i,"AccessibilityManager",(function(){return Ge})),n.d(i,"accessibleTarget",(function(){return Ue})),n.d(i,"InteractionData",(function(){return Ve})),n.d(i,"InteractionEvent",(function(){return Xe})),n.d(i,"InteractionManager",(function(){return Ke})),n.d(i,"InteractionTrackingData",(function(){return qe})),n.d(i,"interactiveTarget",(function(){return Ze})),n.d(i,"Application",(function(){return vi})),n.d(i,"AbstractBatchRenderer",(function(){return oi})),n.d(i,"AbstractMultiResource",(function(){return un})),n.d(i,"AbstractRenderer",(function(){return Kr})),n.d(i,"ArrayResource",(function(){return ln})),n.d(i,"Attribute",(function(){return Pn})),n.d(i,"BaseImageResource",(function(){return cn})),n.d(i,"BaseRenderTexture",(function(){return bn})),n.d(i,"BaseTexture",(function(){return an})),n.d(i,"BatchDrawCall",(function(){return ni})),n.d(i,"BatchGeometry",(function(){return ai})),n.d(i,"BatchPluginFactory",(function(){return ci})),n.d(i,"BatchRenderer",(function(){return hi})),n.d(i,"BatchShaderGenerator",(function(){return si})),n.d(i,"BatchSystem",(function(){return Xn})),n.d(i,"BatchTextureArray",(function(){return ri})),n.d(i,"Buffer",(function(){return Cn})),n.d(i,"BufferResource",(function(){return on})),n.d(i,"CanvasResource",(function(){return hn})),n.d(i,"ContextSystem",(function(){return Yn})),n.d(i,"CubeResource",(function(){return dn})),n.d(i,"Filter",(function(){return Pr})),n.d(i,"FilterState",(function(){return Hn})),n.d(i,"FilterSystem",(function(){return Vn})),n.d(i,"Framebuffer",(function(){return xn})),n.d(i,"FramebufferSystem",(function(){return Kn})),n.d(i,"GLFramebuffer",(function(){return Zn})),n.d(i,"GLProgram",(function(){return Hr})),n.d(i,"GLTexture",(function(){return qr})),n.d(i,"Geometry",(function(){return Fn})),n.d(i,"GeometrySystem",(function(){return tr})),n.d(i,"IGLUniformData",(function(){return Gr})),n.d(i,"INSTALLED",(function(){return Qe})),n.d(i,"ImageBitmapResource",(function(){return gn})),n.d(i,"ImageResource",(function(){return fn})),n.d(i,"MaskData",(function(){return er})),n.d(i,"MaskSystem",(function(){return Lr})),n.d(i,"ObjectRenderer",(function(){return Wn})),n.d(i,"Program",(function(){return Er})),n.d(i,"ProjectionSystem",(function(){return Fr})),n.d(i,"Quad",(function(){return Bn})),n.d(i,"QuadUv",(function(){return Un})),n.d(i,"RenderTexture",(function(){return Mn})),n.d(i,"RenderTexturePool",(function(){return An})),n.d(i,"RenderTextureSystem",(function(){return kr})),n.d(i,"Renderer",(function(){return $r})),n.d(i,"Resource",(function(){return rn})),n.d(i,"SVGResource",(function(){return pn})),n.d(i,"ScissorSystem",(function(){return Dr})),n.d(i,"Shader",(function(){return Mr})),n.d(i,"ShaderSystem",(function(){return Vr})),n.d(i,"SpriteMaskFilter",(function(){return Ir})),n.d(i,"State",(function(){return Ar})),n.d(i,"StateSystem",(function(){return Wr})),n.d(i,"StencilSystem",(function(){return Nr})),n.d(i,"System",(function(){return _n})),n.d(i,"Texture",(function(){return Tn})),n.d(i,"TextureGCSystem",(function(){return Xr})),n.d(i,"TextureMatrix",(function(){return Cr})),n.d(i,"TextureSystem",(function(){return Yr})),n.d(i,"TextureUvs",(function(){return wn})),n.d(i,"UniformGroup",(function(){return Gn})),n.d(i,"VideoResource",(function(){return mn})),n.d(i,"ViewableBuffer",(function(){return ii})),n.d(i,"autoDetectRenderer",(function(){return Qr})),n.d(i,"autoDetectResource",(function(){return tn})),n.d(i,"checkMaxIfStatementsInShader",(function(){return wr})),n.d(i,"defaultFilterVertex",(function(){return ei})),n.d(i,"defaultVertex",(function(){return ti})),n.d(i,"resources",(function(){return di})),n.d(i,"systems",(function(){return mi})),n.d(i,"uniformParsers",(function(){return gr})),n.d(i,"Extract",(function(){return xi})),n.d(i,"AppLoaderPlugin",(function(){return qi})),n.d(i,"Loader",(function(){return Vi})),n.d(i,"LoaderResource",(function(){return Yi})),n.d(i,"TextureLoader",(function(){return ji})),n.d(i,"BlobResource",(function(){return eo})),n.d(i,"CompressedTextureLoader",(function(){return ro})),n.d(i,"CompressedTextureResource",(function(){return no})),n.d(i,"DDSLoader",(function(){return wo})),n.d(i,"FORMATS_TO_COMPONENTS",(function(){return Fo})),n.d(i,"INTERNAL_FORMATS",(function(){return Xi})),n.d(i,"INTERNAL_FORMAT_TO_BYTES_PER_PIXEL",(function(){return Zi})),n.d(i,"KTXLoader",(function(){return Uo})),n.d(i,"TYPES_TO_BYTES_PER_COMPONENT",(function(){return No})),n.d(i,"TYPES_TO_BYTES_PER_PIXEL",(function(){return Bo})),n.d(i,"ParticleContainer",(function(){return jo})),n.d(i,"ParticleRenderer",(function(){return Wo})),n.d(i,"BasePrepare",(function(){return qs})),n.d(i,"CountLimiter",(function(){return ks})),n.d(i,"Prepare",(function(){return Ks})),n.d(i,"TimeLimiter",(function(){return $s})),n.d(i,"Spritesheet",(function(){return Qs})),n.d(i,"SpritesheetLoader",(function(){return ta})),n.d(i,"TilingSprite",(function(){return ia})),n.d(i,"TilingSpriteRenderer",(function(){return aa})),n.d(i,"BitmapFont",(function(){return Ea})),n.d(i,"BitmapFontData",(function(){return va})),n.d(i,"BitmapFontLoader",(function(){return Ra})),n.d(i,"BitmapText",(function(){return Pa})),n.d(i,"Ticker",(function(){return ze})),n.d(i,"TickerPlugin",(function(){return je})),n.d(i,"UPDATE_PRIORITY",(function(){return ke})),n.d(i,"ALPHA_MODES",(function(){return ht})),n.d(i,"BLEND_MODES",(function(){return nt})),n.d(i,"BUFFER_BITS",(function(){return et})),n.d(i,"CLEAR_MODES",(function(){return dt})),n.d(i,"DRAW_MODES",(function(){return rt})),n.d(i,"ENV",(function(){return Q})),n.d(i,"FORMATS",(function(){return it})),n.d(i,"GC_MODES",(function(){return ft})),n.d(i,"MASK_TYPES",(function(){return mt})),n.d(i,"MIPMAP_MODES",(function(){return ct})),n.d(i,"MSAA_QUALITY",(function(){return gt})),n.d(i,"PRECISION",(function(){return pt})),n.d(i,"RENDERER_TYPE",(function(){return tt})),n.d(i,"SAMPLER_TYPES",(function(){return at})),n.d(i,"SCALE_MODES",(function(){return ut})),n.d(i,"TARGETS",(function(){return ot})),n.d(i,"TYPES",(function(){return st})),n.d(i,"WRAP_MODES",(function(){return lt})),n.d(i,"Bounds",(function(){return Ie})),n.d(i,"Container",(function(){return Be})),n.d(i,"DisplayObject",(function(){return De})),n.d(i,"TemporaryDisplayObject",(function(){return Ne})),n.d(i,"FillStyle",(function(){return qo})),n.d(i,"GRAPHICS_CURVES",(function(){return Xo})),n.d(i,"Graphics",(function(){return xs})),n.d(i,"GraphicsData",(function(){return fs})),n.d(i,"GraphicsGeometry",(function(){return gs})),n.d(i,"LINE_CAP",(function(){return zo})),n.d(i,"LINE_JOIN",(function(){return Ho})),n.d(i,"LineStyle",(function(){return vs})),n.d(i,"graphicsUtils",(function(){return bs})),n.d(i,"Circle",(function(){return me})),n.d(i,"DEG_TO_RAD",(function(){return fe})),n.d(i,"Ellipse",(function(){return ge})),n.d(i,"Matrix",(function(){return be})),n.d(i,"ObservablePoint",(function(){return xe})),n.d(i,"PI_2",(function(){return he})),n.d(i,"Point",(function(){return ye})),n.d(i,"Polygon",(function(){return ve})),n.d(i,"RAD_TO_DEG",(function(){return de})),n.d(i,"Rectangle",(function(){return pe})),n.d(i,"RoundedRectangle",(function(){return _e})),n.d(i,"SHAPES",(function(){return ce})),n.d(i,"Transform",(function(){return Ce})),n.d(i,"groupD8",(function(){return Re})),n.d(i,"Mesh",(function(){return fa})),n.d(i,"MeshBatchUvs",(function(){return ca})),n.d(i,"MeshGeometry",(function(){return ma})),n.d(i,"MeshMaterial",(function(){return pa})),n.d(i,"NineSlicePlane",(function(){return yu})),n.d(i,"PlaneGeometry",(function(){return pu})),n.d(i,"RopeGeometry",(function(){return mu})),n.d(i,"SimpleMesh",(function(){return _u})),n.d(i,"SimplePlane",(function(){return vu})),n.d(i,"SimpleRope",(function(){return gu})),n.d(i,"Runner",(function(){return $e})),n.d(i,"Sprite",(function(){return Ms})),n.d(i,"AnimatedSprite",(function(){return bu})),n.d(i,"TEXT_GRADIENT",(function(){return Ss})),n.d(i,"Text",(function(){return Bs})),n.d(i,"TextMetrics",(function(){return Ds})),n.d(i,"TextStyle",(function(){return Cs})),n.d(i,"isMobile",(function(){return $})),n.d(i,"settings",(function(){return vt})),n.d(i,"VERSION",(function(){return wu})),n.d(i,"filters",(function(){return Su}));var o=n(7),s=n(0),a=n.n(s),u=n(1),l=n(14),c=n(15),h=n(18),d=n.n(h);
41
+ function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,n){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof t?this._pos:(this._pos=[t,e,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,n,r,i,o){if(!this.ctx||!this.ctx.listener)return this;var s=this._orientation;return e="number"!=typeof e?s[1]:e,n="number"!=typeof n?s[2]:n,r="number"!=typeof r?s[3]:r,i="number"!=typeof i?s[4]:i,o="number"!=typeof o?s[5]:o,"number"!=typeof t?s:(this._orientation=[t,e,n,r,i,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,n,r,i,o),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(t,n)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return r._stereo;r._stereo=t,r._pos=[t,0,0]}for(var o=r._getSoundIds(n),s=0;s<o.length;s++){var a=r._soundById(o[s]);if(a){if("number"!=typeof t)return a._stereo;a._stereo=t,a._pos=[t,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||e(a,i),"spatial"===i?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(t,0,0):a._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),r._emit("stereo",a._id)}}return r},Howl.prototype.pos=function(t,n,r,i){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"pos",action:function(){o.pos(t,n,r,i)}}),o;if(n="number"!=typeof n?0:n,r="number"!=typeof r?-.5:r,void 0===i){if("number"!=typeof t)return o._pos;o._pos=[t,n,r]}for(var s=o._getSoundIds(i),a=0;a<s.length;a++){var u=o._soundById(s[a]);if(u){if("number"!=typeof t)return u._pos;u._pos=[t,n,r],u._node&&(u._panner&&!u._panner.pan||e(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(t,n,r)),o._emit("pos",u._id)}}return o},Howl.prototype.orientation=function(t,n,r,i){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"orientation",action:function(){o.orientation(t,n,r,i)}}),o;if(n="number"!=typeof n?o._orientation[1]:n,r="number"!=typeof r?o._orientation[2]:r,void 0===i){if("number"!=typeof t)return o._orientation;o._orientation=[t,n,r]}for(var s=o._getSoundIds(i),a=0;a<s.length;a++){var u=o._soundById(s[a]);if(u){if("number"!=typeof t)return u._orientation;u._orientation=[t,n,r],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(t,n,r)),o._emit("orientation",u._id)}}return o},Howl.prototype.pannerAttr=function(){var t,n,r,i=this,o=arguments;if(!i._webAudio)return i;if(0===o.length)return i._pannerAttr;if(1===o.length){if("object"!=typeof o[0])return(r=i._soundById(parseInt(o[0],10)))?r._pannerAttr:i._pannerAttr;t=o[0],void 0===n&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),i._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:i._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:i._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:i._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:i._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:i._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:i._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:i._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:i._panningModel})}else 2===o.length&&(t=o[0],n=parseInt(o[1],10));for(var s=i._getSoundIds(n),a=0;a<s.length;a++)if(r=i._soundById(s[a])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:u.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:u.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:u.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:u.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:u.panningModel};var l=r._panner;l?(l.coneInnerAngle=u.coneInnerAngle,l.coneOuterAngle=u.coneOuterAngle,l.coneOuterGain=u.coneOuterGain,l.distanceModel=u.distanceModel,l.maxDistance=u.maxDistance,l.refDistance=u.refDistance,l.rolloffFactor=u.rolloffFactor,l.panningModel=u.panningModel):(r._pos||(r._pos=i._pos||[0,0,-.5]),e(r,"spatial"))}return i},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,n(4))},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(23),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,s,a,u=1,l={},c=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return l[u]=i,r(u),u++},d.clearImmediate=f}function f(t){delete l[t]}function p(t){if(c)setTimeout(p,0,t);else{var e=l[t];if(e){c=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{f(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(4),n(24))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,l=[],c=!1,h=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&f())}function f(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h<e;)u&&u[h].run();h=-1,e=l.length}u=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}i.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];l.push(new p(t,e)),1!==l.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){(function(t,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,l=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(d[t])}function g(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function v(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+g((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function y(t){return g(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,n){var r=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;r+=36)t=f(t/35);return f(r+36*t/(t+38))}function w(t){var e,n,r,i,o,s,a,l,c,h,d,p=[],g=t.length,v=0,_=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&m("not-basic"),p.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=v,s=1,a=36;i>=g&&m("invalid-input"),((l=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-v)/s))&&m("overflow"),v+=l*s,!(l<(c=a<=x?1:a>=x+26?26:a-x));a+=36)s>f(u/(h=36-c))&&m("overflow"),s*=h;x=b(v-o,e=p.length+1,0==o),f(v/e)>u-_&&m("overflow"),_+=f(v/e),v%=e,p.splice(v++,0,_)}return y(p)}function S(t){var e,n,r,i,o,s,a,l,c,h,d,g,v,y,w,S=[];for(g=(t=_(t)).length,e=128,n=0,o=72,s=0;s<g;++s)(d=t[s])<128&&S.push(p(d));for(r=i=S.length,i&&S.push("-");r<g;){for(a=u,s=0;s<g;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((u-n)/(v=r+1))&&m("overflow"),n+=(a-e)*v,e=a,s=0;s<g;++s)if((d=t[s])<e&&++n>u&&m("overflow"),d==e){for(l=n,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,y=36-h,S.push(p(x(h+w%y,0))),l=f(w/y);S.push(p(x(l,0))),o=b(n,v,r==i),n=0,++r}++n,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:_,encode:y},decode:w,encode:S,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return l.test(t)?w(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return a}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(11)(t),n(4))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";e.decode=e.parse=n(28),e.encode=e.stringify=n(29)},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=t.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var h,d,f,p,m=t[c].replace(a,"%20"),g=m.indexOf(n);g>=0?(h=m.substr(0,g),d=m.substr(g+1)):(h=m,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(s,f)?i(s[f])?s[f].push(p):s[f]=[s[f],p]:s[f]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(r(s))+n;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(r(t))})).join(e):a+encodeURIComponent(r(t[s]))})).join(e):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var s=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},function(t,e){var n=function(){};n.prototype={fit:function(t){var e,n,r,i,o=t.length,s=o>0?t[0].width:0,a=o>0?t[0].height:0;for(this.root={x:0,y:0,width:s,height:a},e=0;e<o;e++)r=t[e],(n=this.findNode(this.root,r.width,r.height))?(i=this.splitNode(n,r.width,r.height),r.x=i.x,r.y=i.y):(i=this.growNode(r.width,r.height),r.x=i.x,r.y=i.y)},findNode:function(t,e,n){return t.used?this.findNode(t.right,e,n)||this.findNode(t.down,e,n):e<=t.width&&n<=t.height?t:null},splitNode:function(t,e,n){return t.used=!0,t.down={x:t.x,y:t.y+n,width:t.width,height:t.height-n},t.right={x:t.x+e,y:t.y,width:t.width-e,height:n},t},growNode:function(t,e){var n=t<=this.root.width,r=e<=this.root.height,i=r&&this.root.height>=this.root.width+t,o=n&&this.root.width>=this.root.height+e;return i?this.growRight(t,e):o?this.growDown(t,e):r?this.growRight(t,e):n?this.growDown(t,e):null},growRight:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null},growDown:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+e,down:{x:0,y:this.root.height,width:this.root.width,height:e},right:this.root},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null}},t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"SLIDE_EVENTS",(function(){return tf})),n.d(e,"Slide",(function(){return ef}));var r={};n.r(r),n.d(r,"isMobile",(function(){return $})),n.d(r,"EventEmitter",(function(){return yt.a})),n.d(r,"earcut",(function(){return bt.a})),n.d(r,"BaseTextureCache",(function(){return te})),n.d(r,"CanvasRenderTarget",(function(){return re})),n.d(r,"DATA_URI",(function(){return se})),n.d(r,"ProgramCache",(function(){return $t})),n.d(r,"TextureCache",(function(){return Qt})),n.d(r,"clearTextureCache",(function(){return ne})),n.d(r,"correctBlendMode",(function(){return Nt})),n.d(r,"createIndicesForQuads",(function(){return kt})),n.d(r,"decomposeDataUri",(function(){return ae})),n.d(r,"deprecation",(function(){return Kt})),n.d(r,"destroyTextureCache",(function(){return ee})),n.d(r,"determineCrossOrigin",(function(){return ue})),n.d(r,"getBufferType",(function(){return Gt})),n.d(r,"getResolutionOfUrl",(function(){return le})),n.d(r,"hex2rgb",(function(){return Ct})),n.d(r,"hex2string",(function(){return It})),n.d(r,"interleaveTypedArrays",(function(){return zt})),n.d(r,"isPow2",(function(){return Vt})),n.d(r,"isWebGLSupported",(function(){return Pt})),n.d(r,"log2",(function(){return Wt})),n.d(r,"nextPow2",(function(){return jt})),n.d(r,"premultiplyBlendMode",(function(){return Dt})),n.d(r,"premultiplyRgba",(function(){return Ft})),n.d(r,"premultiplyTint",(function(){return Bt})),n.d(r,"premultiplyTintToRgba",(function(){return Ut})),n.d(r,"removeItems",(function(){return Xt})),n.d(r,"rgb2hex",(function(){return Ot})),n.d(r,"sayHello",(function(){return At})),n.d(r,"sign",(function(){return qt})),n.d(r,"skipHello",(function(){return Mt})),n.d(r,"string2hex",(function(){return Lt})),n.d(r,"trimCanvas",(function(){return ie})),n.d(r,"uid",(function(){return Zt})),n.d(r,"url",(function(){return St}));var i={};n.r(i),n.d(i,"utils",(function(){return r})),n.d(i,"AccessibilityManager",(function(){return Ge})),n.d(i,"accessibleTarget",(function(){return Ue})),n.d(i,"InteractionData",(function(){return Ve})),n.d(i,"InteractionEvent",(function(){return Xe})),n.d(i,"InteractionManager",(function(){return Ke})),n.d(i,"InteractionTrackingData",(function(){return qe})),n.d(i,"interactiveTarget",(function(){return Ze})),n.d(i,"Application",(function(){return vi})),n.d(i,"AbstractBatchRenderer",(function(){return oi})),n.d(i,"AbstractMultiResource",(function(){return un})),n.d(i,"AbstractRenderer",(function(){return Kr})),n.d(i,"ArrayResource",(function(){return ln})),n.d(i,"Attribute",(function(){return Pn})),n.d(i,"BaseImageResource",(function(){return cn})),n.d(i,"BaseRenderTexture",(function(){return bn})),n.d(i,"BaseTexture",(function(){return an})),n.d(i,"BatchDrawCall",(function(){return ni})),n.d(i,"BatchGeometry",(function(){return ai})),n.d(i,"BatchPluginFactory",(function(){return ci})),n.d(i,"BatchRenderer",(function(){return hi})),n.d(i,"BatchShaderGenerator",(function(){return si})),n.d(i,"BatchSystem",(function(){return Xn})),n.d(i,"BatchTextureArray",(function(){return ri})),n.d(i,"Buffer",(function(){return Cn})),n.d(i,"BufferResource",(function(){return on})),n.d(i,"CanvasResource",(function(){return hn})),n.d(i,"ContextSystem",(function(){return Yn})),n.d(i,"CubeResource",(function(){return dn})),n.d(i,"Filter",(function(){return Pr})),n.d(i,"FilterState",(function(){return Hn})),n.d(i,"FilterSystem",(function(){return Vn})),n.d(i,"Framebuffer",(function(){return xn})),n.d(i,"FramebufferSystem",(function(){return Kn})),n.d(i,"GLFramebuffer",(function(){return Zn})),n.d(i,"GLProgram",(function(){return Hr})),n.d(i,"GLTexture",(function(){return qr})),n.d(i,"Geometry",(function(){return Fn})),n.d(i,"GeometrySystem",(function(){return tr})),n.d(i,"IGLUniformData",(function(){return Gr})),n.d(i,"INSTALLED",(function(){return Qe})),n.d(i,"ImageBitmapResource",(function(){return gn})),n.d(i,"ImageResource",(function(){return fn})),n.d(i,"MaskData",(function(){return er})),n.d(i,"MaskSystem",(function(){return Lr})),n.d(i,"ObjectRenderer",(function(){return Wn})),n.d(i,"Program",(function(){return Er})),n.d(i,"ProjectionSystem",(function(){return Fr})),n.d(i,"Quad",(function(){return Bn})),n.d(i,"QuadUv",(function(){return Un})),n.d(i,"RenderTexture",(function(){return Mn})),n.d(i,"RenderTexturePool",(function(){return An})),n.d(i,"RenderTextureSystem",(function(){return kr})),n.d(i,"Renderer",(function(){return $r})),n.d(i,"Resource",(function(){return rn})),n.d(i,"SVGResource",(function(){return pn})),n.d(i,"ScissorSystem",(function(){return Dr})),n.d(i,"Shader",(function(){return Mr})),n.d(i,"ShaderSystem",(function(){return Vr})),n.d(i,"SpriteMaskFilter",(function(){return Ir})),n.d(i,"State",(function(){return Ar})),n.d(i,"StateSystem",(function(){return Wr})),n.d(i,"StencilSystem",(function(){return Nr})),n.d(i,"System",(function(){return _n})),n.d(i,"Texture",(function(){return Tn})),n.d(i,"TextureGCSystem",(function(){return Xr})),n.d(i,"TextureMatrix",(function(){return Cr})),n.d(i,"TextureSystem",(function(){return Yr})),n.d(i,"TextureUvs",(function(){return wn})),n.d(i,"UniformGroup",(function(){return Gn})),n.d(i,"VideoResource",(function(){return mn})),n.d(i,"ViewableBuffer",(function(){return ii})),n.d(i,"autoDetectRenderer",(function(){return Qr})),n.d(i,"autoDetectResource",(function(){return tn})),n.d(i,"checkMaxIfStatementsInShader",(function(){return wr})),n.d(i,"defaultFilterVertex",(function(){return ei})),n.d(i,"defaultVertex",(function(){return ti})),n.d(i,"resources",(function(){return di})),n.d(i,"systems",(function(){return mi})),n.d(i,"uniformParsers",(function(){return gr})),n.d(i,"Extract",(function(){return xi})),n.d(i,"AppLoaderPlugin",(function(){return qi})),n.d(i,"Loader",(function(){return Vi})),n.d(i,"LoaderResource",(function(){return Yi})),n.d(i,"TextureLoader",(function(){return ji})),n.d(i,"BlobResource",(function(){return eo})),n.d(i,"CompressedTextureLoader",(function(){return ro})),n.d(i,"CompressedTextureResource",(function(){return no})),n.d(i,"DDSLoader",(function(){return wo})),n.d(i,"FORMATS_TO_COMPONENTS",(function(){return Fo})),n.d(i,"INTERNAL_FORMATS",(function(){return Xi})),n.d(i,"INTERNAL_FORMAT_TO_BYTES_PER_PIXEL",(function(){return Zi})),n.d(i,"KTXLoader",(function(){return Uo})),n.d(i,"TYPES_TO_BYTES_PER_COMPONENT",(function(){return No})),n.d(i,"TYPES_TO_BYTES_PER_PIXEL",(function(){return Bo})),n.d(i,"ParticleContainer",(function(){return jo})),n.d(i,"ParticleRenderer",(function(){return Wo})),n.d(i,"BasePrepare",(function(){return qs})),n.d(i,"CountLimiter",(function(){return ks})),n.d(i,"Prepare",(function(){return Ks})),n.d(i,"TimeLimiter",(function(){return $s})),n.d(i,"Spritesheet",(function(){return Qs})),n.d(i,"SpritesheetLoader",(function(){return ta})),n.d(i,"TilingSprite",(function(){return ia})),n.d(i,"TilingSpriteRenderer",(function(){return aa})),n.d(i,"BitmapFont",(function(){return Ea})),n.d(i,"BitmapFontData",(function(){return va})),n.d(i,"BitmapFontLoader",(function(){return Ra})),n.d(i,"BitmapText",(function(){return Pa})),n.d(i,"Ticker",(function(){return ze})),n.d(i,"TickerPlugin",(function(){return je})),n.d(i,"UPDATE_PRIORITY",(function(){return ke})),n.d(i,"ALPHA_MODES",(function(){return ht})),n.d(i,"BLEND_MODES",(function(){return nt})),n.d(i,"BUFFER_BITS",(function(){return et})),n.d(i,"CLEAR_MODES",(function(){return dt})),n.d(i,"DRAW_MODES",(function(){return rt})),n.d(i,"ENV",(function(){return Q})),n.d(i,"FORMATS",(function(){return it})),n.d(i,"GC_MODES",(function(){return ft})),n.d(i,"MASK_TYPES",(function(){return mt})),n.d(i,"MIPMAP_MODES",(function(){return ct})),n.d(i,"MSAA_QUALITY",(function(){return gt})),n.d(i,"PRECISION",(function(){return pt})),n.d(i,"RENDERER_TYPE",(function(){return tt})),n.d(i,"SAMPLER_TYPES",(function(){return at})),n.d(i,"SCALE_MODES",(function(){return ut})),n.d(i,"TARGETS",(function(){return ot})),n.d(i,"TYPES",(function(){return st})),n.d(i,"WRAP_MODES",(function(){return lt})),n.d(i,"Bounds",(function(){return Ie})),n.d(i,"Container",(function(){return Be})),n.d(i,"DisplayObject",(function(){return De})),n.d(i,"TemporaryDisplayObject",(function(){return Ne})),n.d(i,"FillStyle",(function(){return qo})),n.d(i,"GRAPHICS_CURVES",(function(){return Xo})),n.d(i,"Graphics",(function(){return xs})),n.d(i,"GraphicsData",(function(){return fs})),n.d(i,"GraphicsGeometry",(function(){return gs})),n.d(i,"LINE_CAP",(function(){return zo})),n.d(i,"LINE_JOIN",(function(){return Ho})),n.d(i,"LineStyle",(function(){return vs})),n.d(i,"graphicsUtils",(function(){return bs})),n.d(i,"Circle",(function(){return me})),n.d(i,"DEG_TO_RAD",(function(){return fe})),n.d(i,"Ellipse",(function(){return ge})),n.d(i,"Matrix",(function(){return be})),n.d(i,"ObservablePoint",(function(){return xe})),n.d(i,"PI_2",(function(){return he})),n.d(i,"Point",(function(){return ye})),n.d(i,"Polygon",(function(){return ve})),n.d(i,"RAD_TO_DEG",(function(){return de})),n.d(i,"Rectangle",(function(){return pe})),n.d(i,"RoundedRectangle",(function(){return _e})),n.d(i,"SHAPES",(function(){return ce})),n.d(i,"Transform",(function(){return Ce})),n.d(i,"groupD8",(function(){return Re})),n.d(i,"Mesh",(function(){return fa})),n.d(i,"MeshBatchUvs",(function(){return ca})),n.d(i,"MeshGeometry",(function(){return ma})),n.d(i,"MeshMaterial",(function(){return pa})),n.d(i,"NineSlicePlane",(function(){return yu})),n.d(i,"PlaneGeometry",(function(){return pu})),n.d(i,"RopeGeometry",(function(){return mu})),n.d(i,"SimpleMesh",(function(){return _u})),n.d(i,"SimplePlane",(function(){return vu})),n.d(i,"SimpleRope",(function(){return gu})),n.d(i,"Runner",(function(){return $e})),n.d(i,"Sprite",(function(){return Ms})),n.d(i,"AnimatedSprite",(function(){return bu})),n.d(i,"TEXT_GRADIENT",(function(){return Ss})),n.d(i,"Text",(function(){return Bs})),n.d(i,"TextMetrics",(function(){return Ds})),n.d(i,"TextStyle",(function(){return Cs})),n.d(i,"isMobile",(function(){return $})),n.d(i,"settings",(function(){return vt})),n.d(i,"VERSION",(function(){return wu})),n.d(i,"filters",(function(){return Su}));var o=n(7),s=n(0),a=n.n(s),u=n(1),l=n(14),c=n(15),h=n(18),d=n.n(h);
42
42
  /*!
43
43
  * @pixi/polyfill - v6.0.4
44
44
  * Compiled Tue, 11 May 2021 18:00:23 UTC
@@ -279,4 +279,4 @@ var du=function(t,e){return(du=Object.setPrototypeOf||{__proto__:[]}instanceof A
279
279
  *
280
280
  * pixi.js is licensed under the MIT License.
281
281
  * http://www.opensource.org/licenses/mit-license
282
- */$r.registerPlugin("accessibility",Ge),$r.registerPlugin("extract",xi),$r.registerPlugin("interaction",Ke),$r.registerPlugin("particle",Wo),$r.registerPlugin("prepare",Ks),$r.registerPlugin("batch",hi),$r.registerPlugin("tilingSprite",aa),Vi.registerPlugin(Ra),Vi.registerPlugin(ro),Vi.registerPlugin(wo),Vi.registerPlugin(Uo),Vi.registerPlugin(ta),vi.registerPlugin(je),vi.registerPlugin(qi);var wu="6.0.4",Su={AlphaFilter:Ia,BlurFilter:eu,BlurFilterPass:tu,ColorMatrixFilter:ru,DisplacementFilter:ou,FXAAFilter:au,NoiseFilter:lu};class Tu{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive="true"===t}}class Eu{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class Mu{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillColorFilter.color=t}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive="true"===t}}class Au{constructor(t,e){this.hardHidden=!1,this.target=t,!0===e&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible="visible"===t)}}class Pu{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),"click"===e?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):"hover"===e&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([t,e])=>{var n,r;"click"===e?null===(n=this.proxy)||void 0===n||n.addListener("click",e=>this.handleProxyAction(e,t)):"hover"===e&&(null===(r=this.proxy)||void 0===r||r.addListener("mouseover",e=>this.handleProxyAction(e,t)))})}handleProxyAction(t,e){var n;const r=t.data.global,i=this.object.getGlobalPosition(),o=r.x-i.x+this.object.pivot.x,s=r.y-i.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,s))&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new _e(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(jc.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if("ppaction://hlinksldjump"===t.action){const n=(null!==(e=null==t?void 0:t.target)&&void 0!==e?e:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(zc.goto,Number(n[1]))}else"ppaction://hlinkshowjump?jump=nextslide"===t.action?this.ctx.eventHub.emit(zc.next):"ppaction://hlinkshowjump?jump=previousslide"===t.action&&this.ctx.eventHub.emit(zc.prev)}}class Ru{constructor(t,e,n){var r,i,o,s,a,u;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new pe(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Be,this.ctx=e,this.style=new Au(this.container,t.hardHidden),this.designGlobalPosition={x:n.x+(null!==(i=null===(r=t.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0),y:n.y+(null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new Pu(this.container,this.ctx),t.hlinkHover&&(null===(a=this.hyperlink)||void 0===a||a.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkClick,"click")))}updateScale(){this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y}updateTransform(t){var e,n,r,i,o,s,a,u;this.designWidth=t.width,this.designHeight=t.height,this.designX=null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,this.designY=null!==(i=null===(r=t.position)||void 0===r?void 0:r.y)&&void 0!==i?i:0;const l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;const h=null!==(s=null===(o=t.position)||void 0===o?void 0:o.x)&&void 0!==s?s:0,d=null!==(u=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const f=new xs;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d}get scale(){return this.container.scale}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return this.designWidth/this.ctx.stageWidth}get design_ppt_h(){return this.designHeight/this.ctx.stageHeight}get design_ppt_x(){return this.designX/this.ctx.stageWidth}get design_ppt_y(){return this.designY/this.ctx.stageHeight}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale()}get ppt_h(){return this.scaleExt.y*this.scaleOrigin.y*this.designHeight/this.ctx.stageHeight}set ppt_h(t){this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale()}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}}class Cu{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,n,r,i]=Ou(t);let o=0,s=0,a=0;const u=Math.max(e,n,r),l=Math.min(e,n,r),c=u-l;a=(u+l)/2,0===c?o=0:u===e?o=(n-r)/c%6*60:u===n?o=60*((r-e)/c+2):u===r&&(o=60*((e-n)/c+4)),s=0===c?0:c/(1-Math.abs(2*a-1)),this.h=o,this.s=s,this.l=a,this.a=i}interpolationFrom(t,e,n){const r=t.h+(this.h-t.h)*e,i=t.s+(this.s-t.s)*e,o=t.l+(this.l-t.l)*e,s=t.a+(this.a-t.a)*e;n.h=Math.max(Math.min(r,359),0),n.s=Math.max(Math.min(i,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(s,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:n,l:r}=this;if(e<360&&e>=0&&n<=1&&n>=0&&r<=1&&r>=0){let i,o,s;const a=(1-Math.abs(2*r-1))*n,u=a*(1-Math.abs(e/60%2-1)),l=r-a/2;[i,o,s]=e>=0&&e<60?[a,u,0]:e>=60&&e<120?[u,a,0]:e>=120&&e<180?[0,a,u]:e>=180&&e<240?[0,u,a]:e>=240&&e<300?[u,0,a]:[a,0,u],t=[i+l,o+l,s+l,this.a]}return Du(t)}}class Iu{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,n,r,i]=Ou(t);this.r=e,this.g=n,this.b=r,this.a=i}isInit(){return this._isInit}interpolationFrom(t,e,n){n.r=t.r+(this.r-t.r)*e,n.g=t.g+(this.g-t.g)*e,n.b=t.b+(this.b-t.b)*e,n.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return Du([this.r,this.g,this.b,this.a])}}function Lu(t){const e=t.substring(1);return[parseInt(e.substring(0,6),16),parseInt(e.substring(6,8),16)/255]}function Ou(t){return 0===(t=t.replace(/^#/,"")).substring(6,8).length&&(t+="FF"),[parseInt(t.substring(0,2).padStart(8,"0"),16)/255,parseInt(t.substring(2,4).padStart(8,"0"),16)/255,parseInt(t.substring(4,6).padStart(8,"0"),16)/255,parseInt(t.substring(6,8).padStart(8,"0"),16)/255]}function Du(t){return"#"+Math.round(255*t[0]).toString(16).padStart(2,"0")+Math.round(255*t[1]).toString(16).padStart(2,"0")+Math.round(255*t[2]).toString(16).padStart(2,"0")+Math.round(255*t[3]).toString(16).padStart(2,"0")}function Nu(t,e,n){const r=Ou(t),i=Ou(e),o=Math.round(255*(r[0]+(i[0]-r[0])*n)),s=Math.round(255*(r[1]+(i[1]-r[1])*n)),a=Math.round(255*(r[2]+(i[2]-r[2])*n)),u=Math.round(255*(r[3]+(i[3]-r[3])*n));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}class Fu extends Pr{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0}),this.currentColor="#FFFFFFFF"}set color(t){this.currentColor=t;const e=Ou(t);this.uniforms.color=Float32Array.from(e)}get color(){return this.currentColor}}const Bu=new Su.ColorMatrixFilter;Bu.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];const Uu=new Su.ColorMatrixFilter;Uu.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];const ku=new Su.ColorMatrixFilter;ku.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];const Gu=new Su.ColorMatrixFilter;Gu.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];const Hu={darken:Bu,darkenLess:Uu,lightenLess:Gu,lighten:ku};var zu=n(3),ju=n.n(zu);class Vu{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"arrow":case"stealth":case"triangle":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+ju()(this.path),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Wu extends Ru{constructor(t,e,n){super({position:{x:t.x,y:t.y},width:t.width,height:t.height},e,n),this.json=t,this.ctx=e,this.parentGlobalPos=n,this.global={x:n.x+t.x,y:n.y+t.y},this.updateTransform({position:{x:t.x,y:t.y},width:t.width,height:t.height})}get renderContainer(){return this.container}get interactiveContainer(){return this.container}getTextElement(){return null}getBgElement(){return null}get ppt_x(){return this.global.x/this.ctx.stageWidth}set ppt_x(t){const e=t*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+e+this.container.pivot.x*n}get ppt_y(){return this.global.y/this.ctx.stageHeight}set ppt_y(t){const e=t*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+e+this.container.pivot.y*n}get design_ppt_x(){return this.global.x/this.ctx.stageWidth}get design_ppt_y(){return this.global.y/this.ctx.stageHeight}}var Xu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class qu extends Wu{constructor(t,e,n,r,i){super(t,e,n),this.lineWidth=r,this.lineHeight=i}getIterateEntry(){return null}getBgElement(){return null}preRender(){const{fill:t}=this.json;this.fillBgId=this.ctx.fillTexture.addFill(t.fill,this.lineWidth,this.lineHeight),this.fillTextureId=this.ctx.fillTexture.addFill({fillType:"blipFill",src:t.key,filters:[]},t.width,t.height)}render(){return Xu(this,void 0,void 0,(function*(){const t=new Be;if(this.json.highlightColor){const e=new xs,[n,r]=Lu(this.json.highlightColor);e.beginFill(n,r),e.drawRect(0,0,this.json.width,this.json.height),e.endFill(),t.addChild(e)}if(this.fillBgId&&this.fillTextureId){const e=this.ctx.fillTexture.getTexture(this.fillBgId),n=this.ctx.fillTexture.getTexture(this.fillTextureId);if(e&&n){const r=new Ms;r.texture=n,r.scale.x=.5,r.scale.y=.5;const i=new Ms;i.texture=e,i.mask=r,t.addChild(i),t.addChild(r)}}const e=Mn.create({width:this.json.width,height:this.json.height,resolution:2});this.ctx.renderer.render(t,{renderTexture:e});const n=new Ms;n.texture=e,this.container.addChild(n),this.container.name=this.json.content,t.destroy({children:!0})}))}destroy(){this.container.destroy({children:!0,texture:!0})}}var Yu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Zu extends Wu{constructor(){super(...arguments),this.units=[]}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){for(let t=0,e=this.json.textUnits.length;t<e;t++){const e=this.json.textUnits[t];if(e.fill.fill){const t=new qu(e,this.ctx,this.global,this.json.width,this.json.height);t.preRender(),this.units.push(t)}}}render(){return Yu(this,void 0,void 0,(function*(){for(const t of this.units.reverse())yield t.render(),this.container.addChild(t.container)}))}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var Ju=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Ku extends Wu{constructor(){super(...arguments),this.iterateElements=[],this.lines=[]}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((t,e)=>t=t.concat(e.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){for(let t=0,e=this.json.lines.length;t<e;t++){const e=this.json.lines[t],n=new Zu(e,this.ctx,this.global);n.container.name="line-"+t,n.preRender(),this.lines.push(n)}}render(){return Ju(this,void 0,void 0,(function*(){for(const t of this.lines)yield t.render(),this.container.addChild(t.container)}))}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var $u=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Qu{constructor(t,e,n,r){this.iterateElements=[],this.paragraphs=[],this.container=new Be,this.json=t,this.ctx=e,this.parentGlobalPos=r,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y;const i=new xs;i.drawRect(0,0,t.width,t.height),this.container.addChild(i)}updateScale(t){this.container.scale.x=t.x,this.container.scale.y=t.y}getTextElement(t,e){return"paragraph"===t?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}preRender(){for(let t=0,e=this.json.paragraphs.length;t<e;t++){const e=this.json.paragraphs[t],n=new Ku(e,this.ctx,this.global);n.preRender(),this.iterateElements=this.iterateElements.concat(n.getIterateElements()),n.container.name="段落-"+t,this.paragraphs.push(n)}}render(){return $u(this,void 0,void 0,(function*(){for(const t of this.paragraphs)yield t.render(),this.container.addChild(t.container);const{width:t}=this.container;this.container.scale.x<0&&(this.container.x+=-1*t)}))}}var tl=n(19),el=n.n(tl),nl=n(20),rl=n.n(nl);const il={Reflection:class extends Pr{constructor(t){super(el.a,rl.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uBlur:0}),this.json=t}}};var ol=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const sl={pivot:{x:0,y:0},width:0,height:0};class al extends Ru{constructor(t,e,n){var r,i,o,s;if(super(t,e,n),this.renderContainer=new Be,this.bgTextureId="",this.bgSprite=new Ms,this.backgroundMaskTextureId="",this.filterAreaJustifies=[],this.backgroundMask=new Ms,this.pathStrokeTextureId="",this.pathSprite=new Ms,this.pathMask=new Ms,this.pathMaskTextureId="",this.fillColorFilter=new Fu,this.strokeColorFilter=new Fu,this.id="",this.arrowList=[],this.fill=new Mu(this),this.stroke=new Tu(this),this.updateFilterArea=()=>{const t=this.renderContainer.getBounds(!1),e=this.filterAreaJustifies.map(e=>e(t)),n=e.map(t=>t.width),r=e.map(t=>t.height),i=new pe(t.x,t.y,Math.max(...n),Math.max(...r));this.renderContainer.filterArea=i,this.renderContainer.filters.forEach(t=>{t.uniforms.uShapeFilterArea=new Float32Array(4),t.uniforms.uShapeFilterArea[0]=i.x,t.uniforms.uShapeFilterArea[1]=i.y,t.uniforms.uShapeFilterArea[2]=i.width,t.uniforms.uShapeFilterArea[3]=i.height})},this.json=t,this.id=t.id,this.container.name=t.id,this.fillStyle=t.fillStyle,this.lineStyle=t.lineStyle,this.geometry=t.geometry,this.ctx.timingTargets.addTarget(this.id,this),"solidFill"===(null===(r=this.fillStyle)||void 0===r?void 0:r.fillType)&&(this.fillColorFilter.currentColor=this.fillStyle.color),"solidFill"===(null===(o=null===(i=this.lineStyle)||void 0===i?void 0:i.fill)||void 0===o?void 0:o.fillType)&&(this.strokeColorFilter.currentColor=this.lineStyle.fill.color),this.pathSprite.name="path-fill",this.pathMask.name="path-mask",this.bgSprite.name="bg-fill",this.backgroundMask.name="bg-mask",this.updateTransform(this.json),t.textBody){this.text=new Qu(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y});const e={x:1,y:1};(null===(s=this.json.scale)||void 0===s?void 0:s.x)&&this.json.scale.x<0&&(e.x=-1),this.text.updateScale(e)}}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e;return(null!==(e=null===(t=this.pathSprite.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set strokeActive(t){var e,n;t?(null!==(n=null===(e=this.pathSprite.filters)||void 0===e?void 0:e.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0&&(this.pathSprite.filters=[this.strokeColorFilter]):this.pathSprite.filters=[]}get fillActive(){var t,e;return(null!==(e=null===(t=this.bgSprite.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set fillActive(t){var e,n;t?(null!==(n=null===(e=this.bgSprite.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.bgSprite.filters=[this.fillColorFilter]):this.bgSprite.filters=[]}getTextElement(t,e){var n,r;return null!==(r=null===(n=this.text)||void 0===n?void 0:n.getTextElement(t,e))&&void 0!==r?r:null}getBgElement(){return this}getIterateEntry(t,e,n){return"el"===t||0===e?this:this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}createBackgroundMask(){return ol(this,void 0,void 0,(function*(){const t=this.ctx.graphicsTexture.getGraphicsData(this.backgroundMaskTextureId);t&&(this.backgroundMask.texture=t.texture,this.backgroundMask.pivot.x=t.pivot.x,this.backgroundMask.pivot.y=t.pivot.y)}))}createBackground(){var t,e,n,r,i,o,s;const{pivot:a,width:u,height:l}=(null===(t=this.geometry)||void 0===t?void 0:t.fillTransform)||sl;if("gifFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)){const t=this.ctx.fillTexture.getGifFrames(this.fillStyle.src);this.bgSprite=new bu(t,!0),this.bgSprite.play();const e=this.fillStyle.fps/60;let n=1;const r=this.fillStyle.loop;this.bgSprite.animationSpeed=e,this.bgSprite.onLoop=()=>{n+=1,r>0&&n>r&&this.bgSprite.gotoAndStop(t.length-1)},this.bgSprite.height=l||this.designHeight,this.bgSprite.width=u||this.designWidth,this.bgSprite.mask=this.backgroundMask,this.bgSprite.x=a.x,this.bgSprite.y=a.y,this.container.addChild(this.backgroundMask),this.container.addChild(this.bgSprite)}else if("groupFill"===(null===(n=this.fillStyle)||void 0===n?void 0:n.fillType)){if(this.groupFillTextureId){const t=this.ctx.fillTexture.getTexture(this.groupFillTextureId);t&&(this.bgSprite.texture=t,this.bgSprite.mask=this.backgroundMask,this.bgSprite.x=-1*(null!==(i=null===(r=this.json.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0),this.bgSprite.y=-1*(null!==(s=null===(o=this.json.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0),this.container.addChild(this.bgSprite),this.container.addChild(this.backgroundMask))}}else{const t=this.ctx.fillTexture.getTexture(this.bgTextureId);t&&(this.bgSprite.texture=t,this.bgSprite.mask=this.backgroundMask,this.container.addChild(this.backgroundMask),this.container.addChild(this.bgSprite),this.bgSprite.height=l||this.designHeight,this.bgSprite.width=u||this.designWidth,this.bgSprite.x=a.x,this.bgSprite.y=a.y)}}createPathFill(){const t=this.ctx.fillTexture.getTexture(this.pathStrokeTextureId);t&&(this.pathSprite.texture=t,this.pathSprite.pivot.x=this.pathMask.pivot.x,this.pathSprite.pivot.y=this.pathMask.pivot.y,this.pathMask.pivot.x=0,this.pathMask.pivot.y=0,this.pathSprite.mask=this.pathMask,this.pathSprite.addChild(this.pathMask),this.container.addChild(this.pathSprite))}createPathMask(){return ol(this,void 0,void 0,(function*(){const t=this.ctx.graphicsTexture.getGraphicsData(this.pathMaskTextureId);if(t){const{texture:e,pivot:n}=t;this.pathMask.texture=e,this.pathMask.pivot.x=n.x,this.pathMask.pivot.y=n.y,this.pathMask.texture=e}}))}createFilledPathMask(){var t,e;return ol(this,void 0,void 0,(function*(){const n=(null===(e=null===(t=this.geometry)||void 0===t?void 0:t.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of n){const e=this.ctx.graphicsTexture.getGraphicsData(t.id);if(e){const n=new Ms(e.texture);n.pivot.x=e.pivot.x,n.pivot.y=e.pivot.y;const r=new Ms(this.bgSprite.texture);r.pivot.x=this.bgSprite.pivot.x,r.pivot.y=this.bgSprite.pivot.y,r.mask=n,r.filters=[Hu[t.fill]],this.container.addChild(r),this.container.addChild(n)}}}))}createBackgroundTexture(){var t,e,n,r,i;if(this.fillStyle&&"gifFill"!==this.fillStyle.fillType&&"groupFill"!==this.fillStyle.fillType){const o=(null===(t=this.geometry)||void 0===t?void 0:t.fillTransform)||sl,s=(null==o?void 0:o.width)||this.designWidth,a=(null==o?void 0:o.height)||this.designHeight;this.bgTextureId=this.ctx.fillTexture.addFill(this.fillStyle,s+(null!==(n=null===(e=this.lineStyle)||void 0===e?void 0:e.width)&&void 0!==n?n:0),a+(null!==(i=null===(r=this.lineStyle)||void 0===r?void 0:r.width)&&void 0!==i?i:0))}}createPathFillTexture(){var t,e,n,r,i,o;if((null===(t=this.lineStyle)||void 0===t?void 0:t.fill)&&"gifFill"!==this.lineStyle.fill.fillType&&"groupFill"!==this.lineStyle.fill.fillType){const{width:t,height:s}=(null===(e=this.geometry)||void 0===e?void 0:e.lineTransform)||sl;this.pathStrokeTextureId=this.ctx.fillTexture.addFill(this.lineStyle.fill,(t||this.designWidth)+(null!==(r=null===(n=this.lineStyle)||void 0===n?void 0:n.width)&&void 0!==r?r:0),(s||this.designHeight)+(null!==(o=null===(i=this.lineStyle)||void 0===i?void 0:i.width)&&void 0!==o?o:0))}}createArrowFillTexture(){var t;null===(t=this.json.lineArrowList)||void 0===t||t.forEach(t=>{var e,n,r;const i=new Vu(Object.assign(Object.assign({},t),{fillStyle:null===(e=this.lineStyle)||void 0===e?void 0:e.fill,lineWidth:null===(n=this.lineStyle)||void 0===n?void 0:n.width}));i.graphicsId=this.ctx.graphicsTexture.addGraphics(null!==(r=i.paths)&&void 0!==r?r:[],i.hash,i.pivot||{x:0,y:0},i.width,i.height,void 0,!0),i.textureId=this.ctx.fillTexture.addFill(i.fillStyle,i.width,i.height),this.arrowList.push(i)})}createArrow(){this.arrowList.forEach(t=>{const e=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId),n=this.ctx.fillTexture.getTexture(t.textureId);if(e&&n){const{texture:r,pivot:i}=e,o=new Ms(r);o.pivot.x=i.x,o.pivot.y=i.y;const s=new Ms(n);s.addChild(o),s.mask=o,s.position.x=t.position.x,s.position.y=t.position.y,s.pivot.x=t.pivot.x,s.pivot.y=t.pivot.y,s.width=t.width,s.height=t.height,s.rotation=t.rotate/180*Math.PI,t.sprite=s,this.container.addChild(s)}})}preRender(){var t,e,n,r,i,o,s,a,u,l;this.createBackgroundTexture(),this.createPathFillTexture(),this.createArrowFillTexture();const{width:c,height:h,pivot:d}=(null===(t=this.geometry)||void 0===t?void 0:t.lineTransform)||sl,f=c||this.designWidth,p=h||this.designHeight;(null===(e=this.geometry)||void 0===e?void 0:e.paths)&&this.geometry.paths.length>0&&(this.pathMaskTextureId=this.ctx.graphicsTexture.addGraphics(null!==(r=null===(n=this.geometry)||void 0===n?void 0:n.paths)&&void 0!==r?r:[],this.geometry.hash,d||{x:0,y:0},f,p,this.lineStyle,!1),this.backgroundMaskTextureId=this.ctx.graphicsTexture.addGraphics(null!==(o=null===(i=this.geometry)||void 0===i?void 0:i.paths)&&void 0!==o?o:[],this.geometry.hash,d||{x:0,y:0},f,p,this.lineStyle,!0));const m=(null===(a=null===(s=this.geometry)||void 0===s?void 0:s.paths)||void 0===a?void 0:a.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of m)this.ctx.graphicsTexture.addGraphics([t],t.hash,((null===(u=this.geometry)||void 0===u?void 0:u.lineTransform)||sl).pivot,f,p,this.lineStyle,!0,t.id);null===(l=this.text)||void 0===l||l.preRender()}subClassRender(){return ol(this,void 0,void 0,(function*(){}))}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(t=>{"reflection"===t.type&&(this.filterAreaJustifies.push(t=>(t.height*=2,t)),e.push(new il.Reflection(t)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(){var t,e,n,r,i,o,s;return ol(this,void 0,void 0,(function*(){yield this.createBackgroundMask(),yield this.createBackground(),yield this.subClassRender(),yield this.createFilledPathMask(),yield this.createPathMask(),yield this.createPathFill(),yield this.createArrow(),this.text&&(yield this.text.render()),"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(e=this.json.textBody)||void 0===e?void 0:e.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(this.text.container.position.x=null!==(r=null===(n=this.json.position)||void 0===n?void 0:n.x)&&void 0!==r?r:0,this.text.container.position.y=null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0,this.renderContainer.addChild(this.text.container))):(this.text&&this.container.addChild(null===(s=this.text)||void 0===s?void 0:s.container),this.renderContainer.addChild(this.container)),this.json.cacheAsBitMap&&(this.renderContainer.cacheAsBitmap=!0)}))}destroy(){this.bgSprite.destroy(),this.backgroundMask.destroy(),this.pathSprite.destroy(),this.pathMask.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.arrowList.forEach(t=>{var e;null===(e=t.sprite)||void 0===e||e.destroy()})}}var ul=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};function ll(t,e){for(const n in e)t.style[n]=e[n]}class cl{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=t=>{t.stopPropagation();const e=t.offsetX/this.progress.clientWidth*this.duration;this.jumpToTime(e),this.ctx.eventHub.emit(jc.mediaSeek,{id:this.targetId,time:this.media.currentTime,isPlaying:this.media.isPlaying})},this.jumpToTime=(t=0)=>{const e=Math.floor(t)+this.start;this.media.currentTime!==e&&(this.media.currentTime=e,(this.media.paused||this.media.ended)&&setTimeout(()=>{this.media.play().then(()=>this.media.pause())}))},this.showController=t=>{t.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.end?this.start?this.duration=this.duration-this.end-this.start:this.duration-=this.end:this.start&&(this.duration-=this.start)),this.totalTime.innerText=cl.formatTime(this.duration)},this.playMedia=()=>ul(this,void 0,void 0,(function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.playCallBackList.forEach(t=>{t()})})),this.pauseMedia=()=>ul(this,void 0,void 0,(function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()})),this.onMouseOut=t=>{t.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>ul(this,void 0,void 0,(function*(){const t=this.media.currentTime-this.start;(t>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.jumpToTime()),this.currentTime.innerText=cl.formatTime(t),this.currentProgress.style.flex=(t/this.duration).toString()})),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(t=>{t()})},this.playMediaFromCtrl=()=>{this.ctx.eventHub.emit(jc.mediaPlay,{id:this.targetId,time:this.media.currentTime}),this.playMedia()},this.pauseMediaFromCtrl=()=>{this.ctx.eventHub.emit(jc.mediaPause,{id:this.targetId,time:this.media.currentTime}),this.pauseMedia()},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.position=t.position,this.media=t.media,this.info=t.info,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(e=this.info.cut.start)&&void 0!==e?e:0,this.end=null!==(n=this.info.cut.end)&&void 0!==n?n:0)}getMedianContainer(){let t=document.getElementById("median-container");t||(t=document.createElement("div"),t.id="median-container",this.canvasElement.parentElement.appendChild(t)),this.container=t}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),r=String(n<0?0:n).padStart(2,"0"),i=Math.floor(t%60);e=`${r}:${String(i<0?0:i).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};ll(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");ll(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),ll(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=document.createElement("img");ll(n,{height:"20px"}),n.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(n)}createTimer(){const t=document.createElement("div");ll(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){ll(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");ll(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),ll(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}createMediaController(){var t,e;const{position:n}=this,r=null!==(e=null===(t=this.canvasElement.parentElement)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0;n.x=n.x>r/2?n.x-300+this.width:n.x,n.y=n.y+this.height/2-25,ll(this.mediaController,{height:"50px",borderRadius:"50px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:n.x+"px",top:n.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc"}),this.createButton();const i=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,i,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",()=>this.playMedia(),!1),this.pauseButton.removeEventListener("click",()=>this.pauseMedia(),!1),this.media.removeListener("durationchange",this.getMediaDuration,!1),this.media.removeListener("timeupdate",this.mediaTimeUpdate,!1),this.media.removeListener("pause",this.onPauseMedia,!1),this.media.removeListener("play",this.onPlayMedia,!1)}show(){this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],null===(t=this.container)||void 0===t||t.removeChild(this.mediaController)}}var hl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class dl extends a.a{constructor(t){var e,n;super(),this.type="video",this.sprite=new Ms,this.isPlaying=!1,this.id=t.id,this.video=t.video,this.start=null===(e=t.video.cut)||void 0===e?void 0:e.start,this.end=null===(n=t.video.cut)||void 0===n?void 0:n.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this,this.videoResource=new mn(this.video.src,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});const{video:r,width:i,height:o,position:s}=t;this.controller=new cl({targetId:t.id,ctx:t.ctx,width:i,height:o,position:s,media:this,info:r,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=i,this.sprite.height=o,setTimeout(()=>{this.sprite.visible=!0},50)});const a=new an(null,{height:o,width:i});a.resource=this.videoResource,this.videoResource.bind(a),this.sprite=new Ms,this.sprite.visible=!1,this.sprite.texture=new Tn(a),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",t=>{t.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",t=>{t.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.videoResource.source.addEventListener(t,()=>{"timeupdate"!==t||this.isPlaying||this.pause(),this.emit(t)})})}get currentTime(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.currentTime)&&void 0!==e?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.paused)||void 0===e||e}get ended(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.ended)||void 0===e||e}get duration(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.duration)&&void 0!==e?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return hl(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.load(),yield null===(t=this.videoResource.source)||void 0===t?void 0:t.play()}))}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,null===(t=this.videoResource.source)||void 0===t||t.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(t=this.videoResource)||void 0===t||t.destroy(),this.controller.destroy()}}var fl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class pl extends a.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.id=t.id,this.audio=t.audio,this.container=t.container,this.container=t.container,this.audioEl=document.createElement("audio"),this.audioEl.src=this.audio.src,t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:e,height:n,position:r}=t;this.controller=new cl({targetId:t.id,ctx:t.ctx,height:n,width:e,position:r,media:this,info:this.audio,canvasElement:t.canvasElement}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.audioEl.addEventListener(t,()=>{this.emit(t)})})}get currentTime(){return this.audioEl.currentTime}set currentTime(t){this.audioEl.currentTime=t}get paused(){return this.audioEl.paused}get ended(){return this.audioEl.ended}get duration(){return this.audioEl.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return fl(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.audioEl.play()}))}pause(){this.isPlaying=!1,this.audioEl.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}destroy(){this.audioEl.pause(),this.controller.destroy()}}var ml=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class gl extends al{constructor(t,e,n){super(Object.assign(Object.assign({},t),{type:"Shape"}),e,n),this.picTextureId="",this.picSprite=new Ms,this.picMask=new Ms,this.cmd=new Eu(this),this.picFill=t.picFill,this.media=null==t?void 0:t.media}applyCommand(t,e){var n,r,i,o,s;if("call"===e)if(/playFrom\(([0-9.]+)\)/.test(t)){const e=t.match(/playFrom\(([0-9.]+)\)/),r=Number(e[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.play().then(()=>{var t;null===(t=this.mediaPlayer)||void 0===t||t.seek(r)})}else"custom-pause"===t?null===(r=this.mediaPlayer)||void 0===r||r.pause():"togglePause"===t?null===(i=this.mediaPlayer)||void 0===i||i.togglePause():"stop"===t&&(null===(o=this.mediaPlayer)||void 0===o||o.pause(),null===(s=this.mediaPlayer)||void 0===s||s.seek(0))}renderPic(){var t,e,n;return ml(this,void 0,void 0,(function*(){const r=this.ctx.fillTexture.getTexture(this.picTextureId);r&&(this.picSprite.texture=r),this.picMask.texture=this.backgroundMask.texture,this.picSprite.mask=this.picMask,this.picSprite.width=this.designWidth,this.picSprite.height=this.designHeight,this.container.addChild(this.picSprite),this.container.addChild(this.picMask),"video"===(null===(t=this.media)||void 0===t?void 0:t.type)?(this.mediaPlayer=new dl({id:this.json.id+"-video",ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,position:this.picSprite.getGlobalPosition(),container:this.container,canvasElement:this.ctx.view}),(null===(e=this.mediaPlayer)||void 0===e?void 0:e.sprite)&&(this.mediaPlayer.sprite.mask=this.picMask)):"audio"===(null===(n=this.media)||void 0===n?void 0:n.type)&&(this.mediaPlayer=new pl({id:this.json.id+"-audio",ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,position:this.picSprite.getGlobalPosition(),container:this.container,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.picSprite.interactive=!0,this.picSprite.on("mouseover",()=>{this.mediaPlayer.showController()}),this.picSprite.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}))}preRender(){if(super.preRender(),"gifFill"!==this.picFill.fillType)this.picTextureId=this.ctx.fillTexture.addFill(this.picFill,this.designWidth,this.designHeight);else{let t=1;const e=this.ctx.fillTexture.getGifFrames(this.picFill.src);this.picSprite=new bu(e,!0),this.picSprite.play();const n=this.picFill.fps/60,r=this.picFill.loop;this.picSprite.animationSpeed=n,this.picSprite.onLoop=()=>{t+=1,r>0&&t>r&&this.picSprite.gotoAndStop(e.length-1)}}}subClassRender(){return ml(this,void 0,void 0,(function*(){yield this.renderPic()}))}destroy(){this.mediaPlayer&&(this.picSprite.interactive=!1,this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picSprite.destroy(),this.picMask.destroy()}}var vl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class _l extends Ru{constructor(t,e,n){var r,i,o,s;super(t,e,n),this.children=[],this.cacheSprite=new Ms,this.json=t,this.container.name=t.id,this.ctx.timingTargets.addTarget(t.id,this);const a={x:null!==(i=null===(r=t.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0,y:null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0};t.children.forEach(t=>{let e=null;"Shape"===(null==t?void 0:t.type)?e=new al(t,this.ctx,a):"Picture"===(null==t?void 0:t.type)?e=new gl(t,this.ctx,a):"Container"===(null==t?void 0:t.type)&&(e=new _l(t,this.ctx,a)),e&&this.children.push(e)}),this.updateTransform(this.json)}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(){if(this.json.fillStyle)if("groupFill"===this.json.fillStyle.fillType)this.fillTextureId=this.groupFillTextureId;else{const{fillStyle:t,width:e,height:n}=this.json;this.fillTextureId=this.ctx.fillTexture.addFill(t,e,n)}for(const t of this.children)t.groupFillTextureId=this.fillTextureId,t.preRender()}getBgElement(){return null}getIterateEntry(){return null}getTextElement(){return null}render(){var t;return vl(this,void 0,void 0,(function*(){const e=new Be;for(const n of this.children)yield n.render(),n.renderContainer&&e.addChild(n.renderContainer),(n.json.hlinkHover||n.json.hlinkClick)&&(null===(t=n.hyperlink)||void 0===t||t.addProxy(this.container));if(this.container.addChild(e),this.json.cacheAsTexture){const t=e.getBounds(),n=Math.min(t.x,this.designX,t.x+t.width,this.designX+this.designWidth),r=Math.max(t.x,this.designX,t.x+t.width,this.designX+this.designWidth),i=Math.min(t.y,this.designY,t.y+t.height,this.designY+this.designHeight),o=r-n,s=Math.max(t.y,this.designY,t.y+t.height,this.designY+this.designHeight)-i,a=this.designX-t.x,u=this.designY-t.y,l=Mn.create({width:o,height:s});e.position.x=a,e.position.y=u,this.ctx.renderer.render(e,{renderTexture:l}),this.cacheSprite.texture=l,this.cacheSprite.position.x=-a,this.cacheSprite.position.y=-u,this.container.addChild(this.cacheSprite),e.position.x=0,e.position.y=0,e.visible=!1}}))}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy()}}class yl extends a.a{constructor(t,e,n,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=t=>{if(t)if(t.delay&&t.delay>0){const e=this.setTimeout(()=>{t.event&&(this.cond[t.event]=!0,this.detectTrigger())},t.delay);this.timeoutIds.push(e)}else this.cond[t.event]=!0,this.detectTrigger();else this.detectTrigger()},this.id=t,this.ctx=r,this.eventHubs=n,e.forEach(t=>{this.addCond(t)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=()=>this.condHandle(t);t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}setTimeout(t,e){let n=0;const r=i=>{const o=i/(vt.TARGET_FPMS||.06);n+=o,n>=e&&(t(),this.ctx.ticker.remove(r))};return this.ctx.ticker.add(r,void 0,-9),()=>{this.ctx.ticker.remove(r)}}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>"self"!==t).every(t=>!!this.cond[t])}detectTrigger(){if(Object.keys(this.cond).every(t=>!!this.cond[t])){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1});const t=this.triggerParams;this.triggerParams=void 0,this.emit("active",t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>t())}}class xl extends a.a{constructor(t){super(),this.runtimeNodeEventHub=new a.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=()=>{var t,e,n,r,i,o;this.hasPrev()||!this.isMainSeq?"idle"===this.currentSeqState?(this.decrSeqIndex(),null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.seekToStart(),null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"running"===this.currentSeqState?(null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"end"===this.currentSeqState&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToStart(),null===(o=this.commonTimeNode.children[this.currentSeqIndex])||void 0===o||o.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide")},this.handleNext=()=>{var t,e,n,r;this.hasNext()||!this.isMainSeq?"idle"===this.currentSeqState?null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.startTimeNodeForce():"running"===this.currentSeqState?(null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce()):"end"===this.currentSeqState&&(this.incrSeqIndex(),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide")};const{json:e,iterateType:n,isIterate:r,isSub:i,parent:o,ctx:s,eventHub:u,iterateIndex:l,iterateId:c}=t;this.isMainSeq="mainSeq"===e.ctn.nodeType,this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=s,this.globalEventHub=u,this.commonTimeNode=new Yl({json:e.ctn,isSub:i,eventHubs:{global:u,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:c}),this.bindShapeEvent(),this.nextConds=new yl("mainSeq",e.nextCondLst,{global:u,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new yl("mainSeq",e.preCondLst,{global:u,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(jc.mainSeqStepStart,e)}),this.commonTimeNode.on("childTimeNodeEnd",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="end",this.autoPlay&&setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(jc.mainSeqStepEnd,e)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.commonTimeNode.resetForRepeat(),setTimeout(()=>{this.currentSeqState="idle",this.currentSeqIndex=0})}),this.nextConds.on("active",this.handleNext),this.prevConds.on("active",this.handlePrev)}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq&&this.ctx.eventHub.emit(jc.mainSeqStepChange,t)}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq&&this.ctx.eventHub.emit(jc.mainSeqStateChange,t)}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}bindShapeEvent(){"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const t=this.ctx.timingTargets.getTargetById(e);t&&(t.interactiveContainer.interactive=!0,t.interactiveContainer.cursor="pointer",t.interactiveContainer.on("pointerdown",()=>{const t=`shape ${e} onClick`;"interactive"!==this.ctx.mode&&"sync"!==this.ctx.mode||this.ctx.eventHub.emit(jc.interactiveAnimTrigger,{action:t,seqId:this.json.ctn.id}),"sync"!==this.ctx.mode&&"local"!==this.ctx.mode||this.globalEventHub.emit(t)}))}}})}setCurrentStep(t,e){let n=t;this.commonTimeNode.seekToStart();const{length:r}=this.commonTimeNode.children;if(-1===n&&(n=r-1),n>=0&&n<r)for(let t=0;t<=n;t++){const r=this.commonTimeNode.children[t];t!==n?r.commonTimeNode.seekToEnd(!1,!0):"start"===e?r.commonTimeNode.seekToStart():"end"===e&&r.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=n,this.currentSeqState="start"===e?"idle":"end"}}function bl(t,e,n){const r=e.split(".");r.reduce((i,o,s)=>{if(i)return s!==r.length-1?i[o]:void(i[o]=n);console.warn(`${t} not support ${e}`)},t)}function wl(t,e){return e.split(".").reduce((n,r)=>{if(n)return n[r];console.warn(`${t} not support ${e}`)},t)}const Sl=new class{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,n){const r=`${e}_${t}`;this.runningTimeNodes[r]&&this.runningTimeNodes[r].dispose(!0),this.runningTimeNodes[r]=n}};class Tl{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new a.a,this.onTimeLineStart=()=>{if(this.isConflict){const{target:t}=this.json.cBhvr;if("next"===this.activeWhenConflict){let e=t.id;"shape"===t.type&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),Sl.addRunningTimeNode(e,this.modifyAttrKey,this.commonTimeNode)}else"prev"===this.activeWhenConflict&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:r,ctx:i,parent:o,eventHub:s,iterateType:u,iterateIndex:l,iterateId:c}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=i,this.globalEventHub=s,this.commonTimeNode=new Yl({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:s,runtime:this.runtimeNodeEventHub},ctx:i,parent:o,isIterate:e,iterateType:u,iterateIndex:l,iterateId:c}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:u,index:l,id:c}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.onTimeLineStart)}}class El extends Tl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=wl(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const t=this.json.cBhvr.attrList[0];null!==this.startVal&&this.timingTarget&&bl(this.timingTarget,t,this.startVal)},this.onSeekToEnd=()=>{const t=this.json.cBhvr.attrList[0],e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&bl(this.timingTarget,t,e)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:t,delta:e})=>{if(e/t>=1){const t=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&bl(this.timingTarget,t,e)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}class Ml{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:t=>t/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:t=>t/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replaceAll("#ppt_h",`(${this.timingTarget.design_ppt_h})`);return e=e.replaceAll("#ppt_w",`(${this.timingTarget.design_ppt_w})`),e=e.replaceAll("#ppt_x",`(${this.timingTarget.design_ppt_x})`),e=e.replaceAll("#ppt_y",`(${this.timingTarget.design_ppt_y})`),e=e.replaceAll("ppt_w","vars.ppt_w"),e=e.replaceAll("ppt_h","vars.ppt_h"),e=e.replaceAll("ppt_x","vars.ppt_x"),e=e.replaceAll("ppt_y","vars.ppt_y"),e=e.replaceAll("#","vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(t=>{e=e.replaceAll(t,"math."+t)}),new Function("vars","math","$","return "+e)}}class Al extends Ml{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const r=t.resolveValue(n),i=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(n,this.math,i):i}}class Pl extends Ml{constructor(t,e){var n;super(t,e),this.value=null===(n=t.val)||void 0===n?void 0:n.value}interpolationFrom(t,e,n){let r=t.resolveValue(n);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}class Rl extends Ml{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const r=t.resolveValue(n),i=r+(this.resolveValue(n)-r)*e;return t.fmla?t.fmla(n,this.math,i):i}}class Cl extends Tl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=wl(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var t,e,n,r;(null===(t=this.timingTarget)||void 0===t?void 0:t.ppt_h)&&(this.vars.ppt_h=this.timingTarget.ppt_h),(null===(e=this.timingTarget)||void 0===e?void 0:e.ppt_w)&&(this.vars.ppt_w=this.timingTarget.ppt_w),(null===(n=this.timingTarget)||void 0===n?void 0:n.ppt_x)&&(this.vars.ppt_x=this.timingTarget.ppt_x),(null===(r=this.timingTarget)||void 0===r?void 0:r.ppt_y)&&(this.vars.ppt_y=this.timingTarget.ppt_y)},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,r=this.keyFrames.findIndex(t=>n<=t[0]);if(r<0){const t=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&bl(this.timingTarget,this.json.cBhvr.attrList[0],t[1].resolveValue(this.vars)))}const i=r-1,o=this.keyFrames[r],s=this.keyFrames[i]||o,a=o[0]-s[0]==0?1:(n-s[0])/(o[0]-s[0]),u=o[1].interpolationFrom(s[1],a,this.vars);this.timingTarget&&bl(this.timingTarget,this.json.cBhvr.attrList[0],u)},this.onSeekToStart=()=>{null!==this.startVal&&this.timingTarget&&bl(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){const t={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===e&&this.timingTarget){const e=new Rl(t,this.timingTarget);this.keyFrames.push([t.time,e])}}const t={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===e&&this.timingTarget){const e=new Rl(t,this.timingTarget);this.keyFrames.push([t.time,e])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===e&&this.timingTarget){const t=new Rl(n,this.timingTarget);this.keyFrames.push([n.time,t])}const r={time:1,val:{type:"string",value:((null===(t=n.val)||void 0===t?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if("num"===e&&this.timingTarget){const t=new Rl(r,this.timingTarget);this.keyFrames.push([r.time,t])}}if(this.json.tavLst.length>0)for(const t of this.json.tavLst)if(t.val&&this.timingTarget){let n=null;"string"===t.val.type?"num"===e?n=new Rl(t,this.timingTarget):"str"===e&&(n=new Pl(t,this.timingTarget)):"number"===t.val.type?n=new Al(t,this.timingTarget):("color"===t.val.type||"boolean"===t.val.type)&&console.warn("not implements"),n&&this.keyFrames.push([t.time,n])}}}class Il extends Pr{constructor(t){super("\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord(vec2 aVertexPosition)\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n vTransition = transition;\n vDirection = direction;\n vPercent = percent;\n vVertexPosition = aVertexPosition;\n vec2 localVertexPosition = aVertexPosition;\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord(localVertexPosition);\n}\n","\n// 纹理坐标\nvarying vec2 vTextureCoord;\n// 顶点坐标\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 outputColor;\n\n float percent = vPercent;\n float direction = vDirection;\n \n if (vTransition < 0.0) {\n percent = 1.0 - percent;\n if (vDirection > 1.5 && vDirection < 2.5) {\n direction = 1.0;\n } else if (vDirection > 0.5 && vDirection < 1.5) {\n direction = 2.0;\n } else if (vDirection > 2.5 && vDirection < 3.5) {\n direction = 4.0;\n } else {\n direction = 3.0;\n }\n }\n\n if (direction > 1.5 && direction < 2.5) { // 从下至上显示\n if (vVertexPosition.y >= 1.0 - percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.y >= 1.0 - percent && vVertexPosition.y <= 1.0 - percent + 0.2 ) {\n outputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n }\n } else if (direction > 0.5 && direction < 1.5) { // 从上至下显示\n if (vVertexPosition.y <= percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.y <= percent && vVertexPosition.y >= percent - 0.2) {\n outputColor = outputColor * (1.0 - (vVertexPosition.y - (percent - 0.2)) / 0.2);\n }\n } else if (direction > 2.5 && direction < 3.5) { // 从左到右\n if (vVertexPosition.x <= percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.x <= percent && vVertexPosition.x >= percent - 0.2) {\n outputColor = outputColor * (1.0 - (vVertexPosition.x - (percent - 0.2)) / 0.2);\n }\n } else {\n if (vVertexPosition.x >= 1.0 - percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.x >= 1.0 - percent && vVertexPosition.x <= 1.0 - percent + 0.2) {\n outputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n }\n }\n\n gl_FragColor = outputColor;\n}\n",{percent:0,direction:1,transition:t})}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}class Ll extends Pr{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color1 = texture2D(uSampler, vTextureCoord);\n if (color1.a != 0.0 && percent < 1.0) {\n float alpha = percent;\n gl_FragColor = color1 * alpha;\n return;\n }\n gl_FragColor = color1;\n}\n",{percent:0})}set percent(t){this.uniforms.percent=t}}class Ol extends Tl{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;this.filter&&(this.filter.percent=n),n>=1&&this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;"out"===t.json.transition?n=-1:"in"===t.json.transition&&(n=1);const r=null===(e=t.json.filter)||void 0===e?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const t=r[1],e=r[3];if("wipe"===t){const r=new Il(n);"up"===e?r.direction=1:"down"===e?r.direction=2:"left"===e?r.direction=3:"right"===e&&(r.direction=4),this.filter=r,this.filterType=`${t}-${e}`}else if("fade"===t){const e=new Ll;this.filter=e,this.filterType=""+t}}}get modifyAttrKey(){return this.filterType}}var Dl=n(5);class Nl extends Tl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:e})=>{var n;const r=e/t,i=null===(n=this.path)||void 0===n?void 0:n.getPoint(r);this.timingTarget&&i&&(this.timingTarget.ppt_x=i.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=i.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{var t;const e=null===(t=this.path)||void 0===t?void 0:t.getPoint(0);this.timingTarget&&e&&(this.timingTarget.ppt_x=e.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=e.y+this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t;const e=null===(t=this.path)||void 0===t?void 0:t.getPoint(1);this.timingTarget&&e&&(this.timingTarget.ppt_x=e.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=e.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Dl.Path,n=null===(t=this.json.path)||void 0===t?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const t of n){const[n,...r]=t.trim().replace(/\s+/g," ").split(" ");if("M"===n){const[t,n]=r.map(t=>Number(t));e.moveTo(t,n)}else if("L"===n){const[t,n]=r.map(t=>Number(t));e.lineTo(t,n)}else if("C"===n){const[t,n,i,o,s,a]=r.map(t=>Number(t));e.bezierCurveTo(t,n,i,o,s,a)}else if("Z"===n)e.closePath();else if("E"===n)console.warn("not implements");else if("c"===n){const[t,n,i,o,s,a]=r.map(t=>Number(t)),u=e.currentPoint;e.bezierCurveTo(t+u.x,n+u.y,i+u.x,o+u.y,s+u.x,a+u.y)}else if("l"===n){const t=e.currentPoint,[n,i]=r.map(t=>Number(t));e.lineTo(n+t.x,i+t.y)}else if("m"===n){const t=e.currentPoint,[n,i]=r.map(t=>Number(t));e.moveTo(n+t.x,i+t.y)}}this.path=e}}class Fl extends Tl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,r={x:1,y:1};if(this.from&&this.to)r.x=this.from.x+(this.to.x-this.from.x)*n,r.y=this.from.y+(this.to.y-this.from.y)*n;else if(this.by){const t={x:this.by.x,y:this.by.y};r.x=1+(t.x-1)*n,r.y=1+(t.y-1)*n}this.timingTarget&&(this.timingTarget.scale=r)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class Bl extends Tl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to),t.isReverse||this.updateCurrentValue();const[e]=this.json.cBhvr.attrList[0].split(".");bl(this.timingTarget,e+".on","true")},this.onTimeNodeEnd=()=>{if("remove"===this.json.cBhvr.ctn.fill){const[t]=this.json.cBhvr.attrList[0].split(".");bl(this.timingTarget,t+".on","false")}},this.onSeekToStart=()=>{if(this.timingTarget){const[t]=this.json.cBhvr.attrList[0].split(".");bl(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=wl(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:e})=>{const n=t/e;this.to.interpolationFrom(this.from,n,this.target),this.timingTarget&&bl(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1})},"rgb"===this.json.clrSpc?(this.from=new Iu(this.json.from),this.to=new Iu(this.json.to),this.by=new Iu(this.json.by),this.target=new Iu):(this.from=new Cu(this.json.from),this.to=new Cu(this.json.to),this.by=new Cu(this.json.by),this.target=new Cu),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=wl(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class Ul extends Tl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;let r=0,i=0;if(void 0!==this.from&&void 0!==this.to){r=this.from,i=this.to;const t=r+(i-r)*n;this.timingTarget&&(this.timingTarget.r=t)}else if(void 0!==this.by){this.lastVal||(this.lastVal=0);const t=this.by*n-this.lastVal;this.lastVal=this.by*n,this.timingTarget&&(this.timingTarget.r+=t)}},this.onTimeNodeStart=()=>{var t;Object(u.isNumber)(null===(t=this.timingTarget)||void 0===t?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&null!==this.startVal&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=null===(t=this.timingTarget)||void 0===t?void 0:t.r}}class kl extends Tl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,e;const{cmd:n,cmdType:r}=this.json;!this.isApplied&&n&&r&&(this.isApplied=!0,null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand(n,r))},this.onSeekToStart=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){var t,e,n,r;return(null!==(e=null===(t=this.json)||void 0===t?void 0:t.cmd)&&void 0!==e?e:"")+(null!==(r=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==r?r:"")}}var Gl=n(21);class Hl{constructor(t){Hl.useRtc||(this.howl=new Gl.Howl({src:[t]}))}play(){var t;null===(t=this.howl)||void 0===t||t.play()}pause(){var t;null===(t=this.howl)||void 0===t||t.pause()}stop(){var t;null===(t=this.howl)||void 0===t||t.stop()}}Hl.useRtc=!1;class zl{constructor(t){this.runtimeNodeEventHub=new a.a,this.stopAudio=()=>{this.audio.stop()};const{json:e,isIterate:n,isSub:r,eventHub:i,ctx:o,parent:s,iterateType:u,iterateIndex:l,iterateId:c}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Yl({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:i,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:n,iterateType:u,iterateIndex:l,iterateId:c}),this.audio=new Hl(e.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.stopAudio)}}var jl=n(9),Vl=n.n(jl);function Wl(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}function Xl(t){const e=[],n=t.filter(t=>{const n=t.width<2048&&t.height<2048;return n||e.push(t),n}).sort((t,e)=>t.width*t.height-e.width*e.height);let r=n.length+1,i=2050,o=2050;const s=[];let a=null;for(;(i>2048||o>2048)&&n.length>0;)r-=1,a=Vl()(n.slice(0,r)),i=a.width,o=a.height;return a&&s.push(a),e.forEach(t=>{const e=Vl()([t]);s.push(e)}),r<n.length?s.concat(Xl(n.slice(r))):s}var ql=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Yl extends a.a{constructor(t){super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId=null,this.iterateShadows=[],this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.timeDelta=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.dispose())},this.handleActive=(t=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if("never"===this.json.restart)return;"whenNotActive"!==this.json.restart&&"always"!==this.json.restart||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(t))}else this.startTimeLine(t)},this.updateTimeLine=t=>{const e=t/(vt.TARGET_FPMS||.06);this.timeDelta+=e,this.duration-this.timeDelta<=e&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(t=!1)=>{(this.isTimeNodeEnd()||t)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:e,isIterate:n,ctx:r,eventHubs:i,parent:o,json:s,iterateType:a,iterateId:u,iterateIndex:l}=t;this.isSub=e,this.isIterate=n,this.parentTimeNode=o,this.json=s,this.ctx=r,this.iterateIndex=l,this.eventHubs=i,this.iterateType=a,this.iterateId=u;const c=Number(this.json.dur),h=this.json.spd||1;this.isNegativeSpeed=h<0,Number.isNaN(c)||(this.duration=c/Math.abs(h)),this.setPreStyle(),s.childTnLst&&this.createChildren(s.childTnLst),this.startConds=new yl(this.json.id||"",s.stCondLst,i,this.ctx),this.endConds=new yl(this.json.id||"",s.endCondLst,i,this.ctx),s.endSync&&(this.endSync=new yl(this.json.id||"",[s.endSync],i,this.ctx),this.endSync.on("active",()=>{var t;"interactiveSeq"===this.json.nodeType&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),null===(t=this.endSync)||void 0===t||t.reset())})),this.startConds.on("active",t=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(t))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(t=>t.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&"nextClick"===this.json.masterRel&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&!1===this.isIterate&&this.createIterateShadow()}createIterateShadow(){const t=Wl();let e=!0,n=0;const r=n=>{n===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const e=JSON.parse(JSON.stringify(this.json)),r=new Yl({json:e,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:e.iterate.type,iterateIndex:n,iterateId:t});this.iterateShadows[n]=r,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return"seq"===t.type?n=new xl(r):"par"===t.type?n=new Zl(r):"set"===t.type?n=new El(r):"anim"===t.type?n=new Cl(r):"animEffect"===t.type?n=new Ol(r):"animMotion"===t.type?n=new Nl(r):"animScale"===t.type?n=new Fl(r):"animClr"===t.type?n=new Bl(r):"animRot"===t.type?n=new Ul(r):"cmd"===t.type?n=new kl(r):"audio"===t.type&&(n=new zl(r)),n}createSubList(t){this.subList=[],t.forEach(t=>{const e=this.createTimeNode(t,!0);e&&this.subList.push(e)})}createChildren(t){t.forEach(t=>{const e=this.createTimeNode(t,!1);e&&(e.commonTimeNode.on("timeNodeStart",t=>{this.emit("childTimeNodeStart",t)}),e.commonTimeNode.on("timeNodeEnd",t=>{this.emit("childTimeNodeEnd",t),this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())}),this.children.push(e))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(jc.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(jc.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.onTimeLineEnd()):this.duration>e&&(this.ctx.eventHub.emit(jc.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}setTimeout(t,e){let n=0;const r=i=>{const o=i/(vt.TARGET_FPMS||.06);n+=o,n>=e&&(t(),this.ctx.ticker.remove(r))};return this.ctx.ticker.add(r),()=>{this.ctx.ticker.remove(r)}}tickerDelay(t){return new Promise(e=>{this.setTimeout(()=>{e()},t)})}startIterate(){return ql(this,void 0,void 0,(function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)return;t.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.tickerDelay(this.json.iterate.interval)}this.onTimeLineEnd()}}))}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}setPreStyle(){if(!this.json.presetClass)return;const t=[],e=n=>{n.forEach(n=>{var r,i,o;n.cBhvr&&n.cBhvr.target&&t.findIndex(t=>t.id===n.cBhvr.target.id)<0&&t.push(n.cBhvr.target),(null===(i=null===(r=null==n?void 0:n.cBhvr)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&e(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&e(n.ctn.childTnLst)})};e(this.json.childTnLst||[]),t.forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),n=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset&&("entr"===this.json.presetClass?(t.hasPreset=!0,t.style.visibility="hidden"):"exit"===this.json.presetClass&&(t.hasPreset=!0,t.style.visibility="visible"))}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(t=>/^self/.test(t.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(t=>/^self/.test(t.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isActive=!1,this.dispose(),this.timeDelta=0,this.isNegativeSpeed,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let t=this.subList.length-1;t>=0;t--){const e=this.subList[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}}dispose(t=!1){this.isConflictDispose=t,window.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(jc.animateEnd),this.ctx.ticker.remove(this.updateTimeLine),this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToEnd(n,e));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(t=>t.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(t=>t.commonTimeNode.seekToEnd(!1)))}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||(!(!this.isIterateEnd||!this.json.iterate)||t)}emitEndEvents(){this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy())}}class Zl extends a.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new a.a;const{json:e,iterateType:n,isIterate:r,isSub:i,parent:o,ctx:s,eventHub:u,iterateIndex:l,iterateId:c}=t;this.id=e.ctn.id,this.json=e,this.ctx=s,this.isIterate=r,this.globalEventHub=u,this.commonTimeNode=new Yl({json:e.ctn,isSub:i,eventHubs:{global:u,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:c}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),t.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}class Jl{constructor(t,e,n){this.json=t,this.ctx=n;const r=t.timeNodeList.find(t=>"par"===t.type&&"tmRoot"===t.ctn.nodeType);r&&(this.tmRoot=new Zl({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(t=>{var e,n,r;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"mainSeq"===(null===(r=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)}))}findSeq(t){var e;return null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.find(e=>{var n,r,i;return"seq"===(null===(n=e.json)||void 0===n?void 0:n.type)&&(null===(i=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.id)===t})}start(){var t;this.json.autoPlayMainSeq?setTimeout(()=>{var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()}):null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;-1===t&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(t,e)}destroy(){var t;null===(t=this.tmRoot)||void 0===t||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}}var Kl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class $l extends _l{constructor(t,e,n){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n),this.globalEventHub=new a.a,this.json=t,this.container.visible=!1,this.ctx=e,this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(zc.prev)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(zc.next)});const r=new xs;r.drawRect(0,0,t.width,t.height),this.container.addChild(r)}get interactiveContainer(){return this.container}render(){const t=Object.create(null,{render:{get:()=>super.render}});return Kl(this,void 0,void 0,(function*(){yield t.render.call(this),this.ctx.eventHub.emit("StageRenderEnd")}))}createTiming(){this.json.timing&&(this.timing=new Jl(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var t;null===(t=this.timing)||void 0===t||t.start()}setMainSeqApplied(){var t;null===(t=this.timing)||void 0===t||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;null===(t=this.timing)||void 0===t||t.collectMainSeqStartValue()}hasTiming(){return!!this.timing}destroy(){var t;super.destroy(),this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),this.ctx.fillTexture.destroy(),this.globalEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy()}mainSeqStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqStep())&&void 0!==e?e:0}mainSeqLength(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqLength())&&void 0!==e?e:0}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?this.globalEventHub.emit("shape slide onNext"):this.ctx.eventHub.emit(zc.next)}prevStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?this.globalEventHub.emit("shape slide onPrev"):this.ctx.eventHub.emit(zc.prev)}applyInteractiveAction(t){this.globalEventHub.emit(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.timing)||void 0===e||e.seekInteractiveSeqToEnd(t)}setMediaState(t,e){return Kl(this,void 0,void 0,(function*(){const n=this.ctx.medias[t];n&&(e?yield n.play():yield n.pause())}))}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}const Ql=134217729;function tc(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,d=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++d]);let f=0;if(h<t&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++d]),o=s,0!==a&&(i[f++]=a);h<t&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++d]),o=s,0!==a&&(i[f++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[f++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++d],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function ec(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function nc(t){return new Float64Array(t)}const rc=nc(4),ic=nc(8),oc=nc(12),sc=nc(16),ac=nc(4);function uc(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a;if(0===s||0===a||s>0!=a>0)return u;const l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){let a,u,l,c,h,d,f,p,m,g,v,_,y,x,b,w,S,T;const E=t-i,M=n-i,A=e-o,P=r-o;x=E*P,d=Ql*E,f=d-(d-E),p=E-f,d=Ql*P,m=d-(d-P),g=P-m,b=p*g-(x-f*m-p*m-f*g),w=A*M,d=Ql*A,f=d-(d-A),p=A-f,d=Ql*M,m=d-(d-M),g=M-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,rc[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,rc[1]=y-(v+h)+(h-w),T=_+v,h=T-_,rc[2]=_-(T-h)+(v-h),rc[3]=T;let R=ec(4,rc),C=22204460492503146e-32*s;if(R>=C||-R>=C)return R;if(h=t-E,a=t-(E+h)+(h-i),h=n-M,l=n-(M+h)+(h-i),h=e-A,u=e-(A+h)+(h-o),h=r-P,c=r-(P+h)+(h-o),0===a&&0===u&&0===l&&0===c)return R;if(C=11093356479670487e-47*s+33306690738754706e-32*Math.abs(R),R+=E*c+P*a-(A*l+M*u),R>=C||-R>=C)return R;x=a*P,d=Ql*a,f=d-(d-a),p=a-f,d=Ql*P,m=d-(d-P),g=P-m,b=p*g-(x-f*m-p*m-f*g),w=u*M,d=Ql*u,f=d-(d-u),p=u-f,d=Ql*M,m=d-(d-M),g=M-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,ac[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,ac[1]=y-(v+h)+(h-w),T=_+v,h=T-_,ac[2]=_-(T-h)+(v-h),ac[3]=T;const I=tc(4,rc,4,ac,ic);x=E*c,d=Ql*E,f=d-(d-E),p=E-f,d=Ql*c,m=d-(d-c),g=c-m,b=p*g-(x-f*m-p*m-f*g),w=A*l,d=Ql*A,f=d-(d-A),p=A-f,d=Ql*l,m=d-(d-l),g=l-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,ac[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,ac[1]=y-(v+h)+(h-w),T=_+v,h=T-_,ac[2]=_-(T-h)+(v-h),ac[3]=T;const L=tc(I,ic,4,ac,oc);x=a*c,d=Ql*a,f=d-(d-a),p=a-f,d=Ql*c,m=d-(d-c),g=c-m,b=p*g-(x-f*m-p*m-f*g),w=u*l,d=Ql*u,f=d-(d-u),p=u-f,d=Ql*l,m=d-(d-l),g=l-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,ac[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,ac[1]=y-(v+h)+(h-w),T=_+v,h=T-_,ac[2]=_-(T-h)+(v-h),ac[3]=T;const O=tc(L,oc,4,ac,sc);return sc[O-1]}(t,e,n,r,i,o,l)}nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(8),nc(8),nc(8),nc(4),nc(8),nc(8),nc(8),nc(12);nc(192),nc(192);nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(8),nc(8),nc(8),nc(8),nc(8),nc(8),nc(8),nc(8),nc(8),nc(4),nc(4),nc(4),nc(8),nc(16),nc(16),nc(16),nc(32),nc(32),nc(48),nc(64);nc(1152),nc(1152);nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(4),nc(24),nc(24),nc(24),nc(24),nc(24),nc(24),nc(24),nc(24),nc(24),nc(24),nc(1152),nc(1152),nc(1152),nc(1152),nc(1152),nc(2304),nc(2304),nc(3456),nc(5760),nc(8),nc(8),nc(8),nc(16),nc(24),nc(48),nc(48),nc(96),nc(192),nc(384),nc(384),nc(384),nc(768);nc(96),nc(96),nc(96),nc(1152);const lc=Math.pow(2,-52),cc=new Uint32Array(512);class hc{static from(t,e=vc,n=_c){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new hc(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[2*e],r=t[2*e+1];n<s&&(s=n),r<a&&(a=r),n>u&&(u=n),r>l&&(l=r),this._ids[e]=e}const c=(s+u)/2,h=(a+l)/2;let d,f,p,m=1/0;for(let e=0;e<o;e++){const n=dc(c,h,t[2*e],t[2*e+1]);n<m&&(d=e,m=n)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=dc(g,v,t[2*e],t[2*e+1]);n<m&&n>0&&(f=e,m=n)}let _=t[2*f],y=t[2*f+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===f)continue;const n=pc(g,v,_,y,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let b=t[2*p],w=t[2*p+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];mc(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(uc(g,v,_,y,b,w)<0){const t=f,e=_,n=y;f=p,_=b,y=w,p=t,b=e,w=n}const S=function(t,e,n,r,i,o){const s=n-t,a=r-e,u=i-t,l=o-e,c=s*s+a*a,h=u*u+l*l,d=.5/(s*l-a*u);return{x:t+(l*c-a*h)*d,y:e+(s*h-u*c)*d}}(g,v,_,y,b,w);this._cx=S.x,this._cy=S.y;for(let e=0;e<o;e++)this._dists[e]=dc(t[2*e],t[2*e+1],S.x,S.y);mc(this._ids,this._dists,0,o-1),this._hullStart=d;let T=3;n[d]=e[p]=f,n[f]=e[d]=p,n[p]=e[f]=d,r[d]=0,r[f]=1,r[p]=2,i.fill(-1),i[this._hashKey(g,v)]=d,i[this._hashKey(_,y)]=f,i[this._hashKey(b,w)]=p,this.trianglesLen=0,this._addTriangle(d,f,p,-1,-1,-1);for(let o,s,a=0;a<this._ids.length;a++){const u=this._ids[a],l=t[2*u],c=t[2*u+1];if(a>0&&Math.abs(l-o)<=lc&&Math.abs(c-s)<=lc)continue;if(o=l,s=c,u===d||u===f||u===p)continue;let h=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(h=i[(e+t)%this._hashSize],-1===h||h===n[h]);t++);h=e[h];let m,g=h;for(;m=n[g],uc(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===h){g=-1;break}if(-1===g)continue;let v=this._addTriangle(g,u,n[g],-1,-1,r[g]);r[u]=this._legalize(v+2),r[g]=v,T++;let _=n[g];for(;m=n[_],uc(l,c,t[2*_],t[2*_+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(_,u,m,r[u],-1,r[_]),r[u]=this._legalize(v+2),n[_]=_,T--,_=m;if(g===h)for(;m=e[g],uc(l,c,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,u,g,-1,r[g],r[m]),this._legalize(v+2),r[m]=v,n[g]=g,T--,g=m;this._hullStart=e[u]=g,n[g]=e[_]=u,n[u]=_,i[this._hashKey(l,c)]=u,i[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(T);for(let t=0,e=this._hullStart;t<T;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===i)break;t=cc[--i];continue}const u=s-s%3,l=a+(t+1)%3,c=u+(s+2)%3,h=e[o],d=e[t],f=e[l],p=e[c];if(fc(r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*p],r[2*p+1])){e[t]=p,e[s]=h;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(s,n[o]),this._link(o,c);const a=u+(s+1)%3;i<cc.length&&(cc[i++]=a)}else{if(0===i)break;t=cc[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=e,this._triangles[s+2]=n,this._link(s,r),this._link(s+1,i),this._link(s+2,o),this.trianglesLen+=3,s}}function dc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function fc(t,e,n,r,i,o,s,a){const u=t-s,l=e-a,c=n-s,h=r-a,d=i-s,f=o-a,p=c*c+h*h,m=d*d+f*f;return u*(h*m-p*f)-l*(c*m-p*d)+(u*u+l*l)*(c*f-h*d)<0}function pc(t,e,n,r,i,o){const s=n-t,a=r-e,u=i-t,l=o-e,c=s*s+a*a,h=u*u+l*l,d=.5/(s*l-a*u),f=(l*c-a*h)*d,p=(s*h-u*c)*d;return f*f+p*p}function mc(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let s=i-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=r}else{let i=n+1,o=r;gc(t,n+r>>1,i),e[t[n]]>e[t[r]]&&gc(t,n,r),e[t[i]]>e[t[r]]&&gc(t,i,r),e[t[n]]>e[t[i]]&&gc(t,n,i);const s=t[i],a=e[s];for(;;){do{i++}while(e[t[i]]<a);do{o--}while(e[t[o]]>a);if(o<i)break;gc(t,i,o)}t[n+1]=t[o],t[o]=s,r-i+1>=o-n?(mc(t,e,i,r),mc(t,e,n,o-1)):(mc(t,e,n,o-1),mc(t,e,i,r))}}function gc(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function vc(t){return t[0]}function _c(t){return t[1]}function yc(t,e,n=5){return Math.abs(t-e)<=Math.pow(10,-n)}class xc{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const n=new xc;return n.point=t,n.slope=e,n}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return yc(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=xc.fromPointSlope(t,e),r=this.crossPoint(n);return r?Math.ceil(Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))):0}crossPoint(t){if(yc(t.slope,this.slope))return null;let e=0,n=0;const r=Math.tan(t.slope),i=Math.tan(this.slope),{x:o,y:s}=this.point,{x:a,y:u}=t.point;return yc(this.slope,Math.PI/2)?(e=this.point.x,n=r*(e-a)+u):yc(t.slope,Math.PI/2)?(e=t.point.x,n=i*(e-o)+s):yc(this.slope,Math.PI)||yc(this.slope,0)?(n=this.point.y,e=(n-u)/r+a):yc(t.slope,Math.PI)||yc(t.slope,0)?(n=t.point.y,e=(n-s)/i+o):(e=(r*a-u+s-i*o)/(r-i),n=i*(e-o)+s),{x:e,y:n}}}function bc(t,e,n){return"solidFill"===t.fillType?function(t,e,n){const r=new xs,[i,o]=Lu(t.color);return r.beginFill(i,o),r.drawRect(0,0,e,n),r.endFill(),r}(t,e,n):"gradientFill"===t.fillType?function(t,e,n){let r=null;const i=new Be;if(t.stopList.sort((t,e)=>t.pos-e.pos),!t.stopList.find(t=>0===t.pos)){const e=t.stopList[0];t.stopList.unshift({pos:0,color:e.color})}if(!t.stopList.find(t=>1===t.pos)){const e=t.stopList[t.stopList.length-1];t.stopList.push({pos:1,color:e.color})}const o=t=>{const e=[];for(let n=0,r=t.length;n<r-1;n++){const r=t[n],i=t[n+1],o=r.pos+.5*(i.pos-r.pos),s=Nu(r.color,i.color,.5),a=2*n;e[a]=r,e[a+1]={color:s,pos:o},e[a+2]=i}return e};t.stopList=o(t.stopList),t.stopList=o(t.stopList),t.line?r=function(t,e,n){const r=e/2,i=n/2,o={x:-r,y:i},s={x:-r,y:-i},a={x:r,y:i},u={x:r,y:-i},l=xc.fromPointSlope({x:-r,y:0},Math.PI/2),c=xc.fromPointSlope({x:0,y:i},0),h=xc.fromPointSlope({x:r,y:0},Math.PI/2),d=xc.fromPointSlope({x:0,y:-i},0),f=[o,s,a,u],p=[l,c,h,d],m=[],g=t.stopList.slice(1,t.stopList.length-1).map(o=>{var s,a;const u=2*Math.PI;let l=null!==(a=null===(s=t.line)||void 0===s?void 0:s.ang)&&void 0!==a?a:0;for(;l>u;)l-=u;for(;l<0;)l+=u;const c={x:0,y:0};yc(l,Math.PI/2)?(c.x=0,c.y=n/2-o.pos*n):yc(l,0)?(c.x=o.pos*e-e/2,c.y=0):(c.x=o.pos*e-e/2,c.y=n/2-o.pos*n),l>Math.PI/2&&l<=Math.PI&&(c.x*=-1),l>Math.PI&&l<=2*Math.PI&&(c.y*=-1);const h=xc.fromPointSlope(c,Math.PI/2-t.line.ang),d=p.map(t=>h.crossPoint(t)).filter(t=>t&&t.x<=r&&t.x>=-r&&t.y<=i&&t.y>=-i).map(t=>({point:t,color:o.color})).sort((t,e)=>e.point.y-t.point.y);m.push(...d);let f=Math.abs(d[1].point.x-d[0].point.x)/10;for(let t=20;t--;){const e=t%2==0?1:-1,n=c.x+e*f,s=h.resolveY(n);n<=r&&n>=-r&&s<=i&&s>=-i&&m.push({point:{x:n,y:s},color:o.color}),f+=f}return h});let v=[],_=[];t:for(let e=0;e<f.length;e++){const n=f[e];for(let e=0;e<g.length-1;e++){const r=g[e],i=g[e+1],o=r.distanceToLinearEquation(i),s=r.distanceToPoint(n),a=i.distanceToPoint(n);if(s<o&&a<o){const r=t.stopList.slice(1,t.stopList.length-1)[e],i=t.stopList.slice(1,t.stopList.length-1)[e+1],a=Nu(r.color,i.color,s/o);m.splice(e+1,0,{point:n,color:a});continue t}}const r=g[0],i=g[g.length-1],o=r.distanceToPoint(n),s=i.distanceToPoint(n);o<=s?v.push({point:n,dis:o}):_.push({point:n,dis:s})}v=v.sort((t,e)=>e.dis-t.dis);const y=v.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[0].color};{const n=t.stopList[0].color,r=t.stopList[1].color;return{point:e.point,color:Nu(n,r,1-(0===v[0].dis?1:e.dis/v[0].dis))}}}).sort((t,e)=>e.point.y-t.point.y);_=_.sort((t,e)=>e.dis-t.dis);const x=_.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[t.stopList.length-1].color};{const n=t.stopList[t.stopList.length-2].color,r=t.stopList[t.stopList.length-1].color;return{point:e.point,color:Nu(n,r,0===_[0].dis?0:e.dis/_[0].dis)}}}).sort((t,e)=>e.point.y-t.point.y),b=y.concat(...m).concat(x);for(let t=0;t<b.length;t++)b[t].point.x+=r,b[t].point.y=-b[t].point.y+i;return{points:b,position:{x:0,y:0}}}(t,e,n):t.path&&(r=function(t,e,n){var r;const i=[],o={x:0,y:0};if("circle"===(null===(r=t.path)||void 0===r?void 0:r.path)){const r=e/2,s=n/2,a=Math.sqrt(r*r+s*s);t.stopList.forEach(t=>{if(0===t.pos)i.push({point:{x:0,y:0},color:t.color});else{const e=a*t.pos,n=new Dl.Path;n.absellipse(0,0,e,e,0,2*Math.PI,!1,0),n.getPoints(50).forEach(e=>{i.push({point:{x:e.x,y:e.y},color:t.color})})}o.x=r,o.y=s})}return{points:i,position:o}}(t,e,n));if(r){const t=[],o=[],{position:s,points:a}=r,u=hc.from(a,t=>t.point.x,t=>t.point.y);for(let e=0;e<u.triangles.length;e+=3)t.push(a[u.triangles[e]].point.x,a[u.triangles[e]].point.y),t.push(a[u.triangles[e+1]].point.x,a[u.triangles[e+1]].point.y),t.push(a[u.triangles[e+2]].point.x,a[u.triangles[e+2]].point.y),o.push(...Ou(a[u.triangles[e]].color)),o.push(...Ou(a[u.triangles[e+1]].color)),o.push(...Ou(a[u.triangles[e+2]].color));const l=new Fn;l.addAttribute("aVertexPosition",t,2),l.addAttribute("aColor",o,4);const c=Mr.from("\n precision mediump float;\n attribute vec2 aVertexPosition;\n attribute vec4 aColor;\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n varying vec4 vColor;\n void main() {\n vColor = aColor;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n }","precision mediump float; \n varying vec4 vColor;\n void main() {\n float alpha = vColor.a;\n vec4 color = vColor;\n color.a = 1.0;\n gl_FragColor = color * alpha;\n }\n "),h=new xs;h.drawRect(0,0,e+1,n+1),i.mask=h,i.addChild(h);const d=new fa(l,c);d.position.x=s.x,d.position.y=s.y,i.addChild(d)}return i}(t,e,n):null}const wc="\nvec3 rgb2hsl(vec3 rgb) {\n float cMax = max(max(rgb.r, rgb.g), rgb.b);\n float cMin = min(min(rgb.r, rgb.g), rgb.b);\n float delta = cMax - cMin;\n \n float h = 0.0;\n if (delta == 0.0) {\n h = 0.0;\n } else if (cMax == rgb.r) {\n h = 60.0 * mod(((rgb.g - rgb.b) / delta), 6.0);\n } else if (cMax == rgb.g ) {\n h = 60.0 * ((rgb.b - rgb.r) / delta + 2.0);\n } else if (cMax == rgb.b) {\n h = 60.0 * ((rgb.r - rgb.g) / delta + 4.0);\n }\n \n float l = (cMax + cMin) / 2.0;\n \n float s = 0.0;\n if (delta == 0.0) {\n s = 0.0;\n } else {\n s = delta / (1.0 - abs(2.0 * l - 1.0));\n }\n \n return vec3(h, s, l);\n}\n",Sc=[wc],Tc={biLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec3 hsl = rgb2hsl(texColor.rgb);\n mat3 rgb2yuv = mat3(\n 0.2126, 0.7152, 0.0722,\n -0.09991, -0.33609, 0.43600,\n 0.615, -0.5586, -0.05639\n );\n vec3 yuv = texColor.rgb * rgb2yuv;\n if (yuv.x >= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0);\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n}\n"};class Ec extends Pr{constructor(t,e){var n;super(void 0,(n=Tc[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n${Sc.map(t=>t+"\n").join("\n")}\n\n${n}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n`),{arg:e})}}const Mc=[wc],Ac={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n // float doReplace = step(colorDistance, epsilon);\n // texColor.a = 0.0;\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n"};class Pc extends Pr{constructor(t,e,n){var r;super(void 0,(r=Ac[t],`\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n${Mc.map(t=>t+"\n").join("\n")}\n\n${r}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:Float32Array.from(e),arg2:Float32Array.from(n)})}}class Rc{constructor(t,e){this.renderContainers=[],this.renderTextures=[],this.textures=Object.create(null),this.fillStyles=[],this.renderer=t,this.spriteTextures=e}addTexture(t,e){this.textures[t]=e}render(t){const{items:e,width:n,height:r}=t,i=new Be;e.forEach(t=>{if(t.item.blipFillObject)t.item.blipFillObject.position.x+=t.x+2,t.item.blipFillObject.position.y+=t.y+2,i.addChild(t.item.blipFillObject);else{const e=bc(t.item.fill,t.width-2,t.height-2);if(e)e.position.x+=t.x+2,e.position.y+=t.y+2,i.addChild(e);else{const e=new xs;e.drawRect(0,0,t.width-4,t.height-4),i.addChild(e)}}if(t.item.name){const e=new Bs(t.item.name,{fontFamily:"Arial",fontSize:12,fill:16715792,align:"center"});e.position.x=t.x+2,e.position.y=t.y+2,i.addChild(e)}});const o=new xs;o.drawRect(0,0,Math.ceil(n),Math.ceil(r)),i.addChild(o);const s=Mn.create({width:n,height:r});this.renderTextures.push(s),this.renderContainers.push(i),this.renderer.render(i,{renderTexture:s}),e.forEach(t=>{this.textures[t.item.id]=new Tn(s.baseTexture,new pe(t.x+2,t.y+2,t.width-4,t.height-4))})}getTexture(t){return this.textures[t]||this.spriteTextures.getTexture(t)||null}getGifFrames(t){return this.spriteTextures.getGifFrames(t)}addFill(t,e,n,r){const i=JSON.stringify(t)+e+n,o=ju()(i);if(this.textures[o])return o;if(this.fillStyles.findIndex(t=>t.id===o)>=0)return o;if("blipFill"!==t.fillType)this.fillStyles.push({fill:t,width:e,height:n,id:o,name:r});else{const e=this.spriteTextures.getTexture(t.src);if(e){const n=new Ms;n.texture=e,t.filters.length>0&&(n.filters=function(t){const e=[];return t.forEach(t=>{if("biLevel"===t.type)e.push(new Ec("biLevel",t.args[0]));else if("clrChange"===t.type){const n=Ou(t.args[0]),r=Ou(t.args[1]);e.push(new Pc("clrChange",n,r))}}),e}(t.filters)),this.fillStyles.push({fill:t,width:e.width,height:e.height,id:o,blipFillObject:n})}}return o}pack(){const t=this.fillStyles.filter(t=>!(!t.fill.fillType||"noFill"===t.fill.fillType||0===t.width||0===t.height)||(this.textures[t.id]=null,!1));t.forEach(t=>{t.width+=4,t.height+=4});const e=Xl(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];this.render(n)}}destroy(){this.textures=Object.create(null),this.fillStyles=[],this.renderTextures.forEach(t=>t.destroy(!0)),this.renderContainers.forEach(t=>t.destroy({children:!0})),this.spriteTextures.destroy()}}function Cc(t,e,n){let r,i,o=e,s=n;0===o&&(o=s/1e4),0===s&&(s=o/1e4);const a=t%360;if(a%180==0)r=Math.cos(a*(Math.PI/180))*o,i=0;else if(a%90==0)r=0,i=-Math.sin(a*(Math.PI/180))*s;else{const t=Math.tan(a*Math.PI/180);r=o*s/Math.sqrt(Math.pow(s,2)+Math.pow(o*t,2)),(a>90&&a<270||a<-90&&a>-270)&&(r=-r),i=-t*r}return{x:r,y:i}}function Ic(t,e,n,r,i,o,s){const a={x:0,y:0},u=-o,l=Cc((i=-i)/Math.PI*180,n,r),c=t.x-l.x,h=t.y-l.y;for(let t=0;t<51;t++){const o=Cc((i+t/50*u)/Math.PI*180,n,r);o.x+=c,o.y+=h,t/50==1&&(a.x=o.x,a.y=o.y),o.x=o.x/9525*e.x,o.y=o.y/9525*e.y,s.lineTo(o.x,o.y)}return a}class Lc{constructor(t){this.renderContainers=[],this.renderTextures=[],this.idTidMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.renderer=t}render(t){const{items:e,width:n,height:r}=t,i=Mn.create({width:n,height:r});this.renderTextures.push(i);const o=new Be;e.forEach(t=>{const e=new Ms;e.texture=t.item.texture,e.x=t.x+2,e.y=t.y+2,o.addChild(e)});const s=new xs;s.drawRect(0,0,n,r),o.addChild(s),this.renderer.render(o,{renderTexture:i}),this.renderContainers.push(o),e.forEach(t=>{const e=t.item.padding;this.textures[t.item.id]={texture:new Tn(i.baseTexture,new pe(t.x+2+e,t.y+2+e,t.width-4-2*e,t.height-4-2*e)),pivot:t.item.pivot}})}getGraphicsData(t){const e=this.idTidMap[t]||"";return this.textures[e]||null}addGraphics(t,e,n,r,i,o,s,a){const u=a||Wl(),l=ju()(e+((null==o?void 0:o.width)||1).toString()+s);if(this.idTidMap[u]=l,this.graphics.findIndex(t=>t.id===l)<0){const{texture:e,pivot:a,padding:u}=function(t,e,n,r,i,o=!0){var s,a,u,l,c,h,d;const f={x:Math.abs(i.x),y:Math.abs(i.y)},p=window.devicePixelRatio,m=document.createElement("canvas"),g=m.getContext("2d");if(!g)throw new Error("ctx");g.lineCap=(null==r?void 0:r.cap)||"butt",g.lineJoin=(null==r?void 0:r.join)||"miter";let v=0,_=0,y=0,x=0,b=0,w="none",S="none";return o?(v=e,_=n,b=0,S="#ffffff"):(w="#ff0000",b=null!==(s=null==r?void 0:r.width)&&void 0!==s?s:1,y=.5*(null!==(a=null==r?void 0:r.width)&&void 0!==a?a:1),x=.5*(null!==(u=null==r?void 0:r.width)&&void 0!==u?u:1),v=e+(null!==(l=null==r?void 0:r.width)&&void 0!==l?l:1),_=n+(null!==(c=null==r?void 0:r.width)&&void 0!==c?c:1),f.x+=.5*(null!==(h=null==r?void 0:r.width)&&void 0!==h?h:1),f.y+=.5*(null!==(d=null==r?void 0:r.width)&&void 0!==d?d:1)),v+=Math.abs(i.x),_+=Math.abs(i.y),y+=Math.abs(i.x),x+=Math.abs(i.y),v+=4,_+=4,y+=2,x+=2,y*=p,x*=p,v=Math.ceil(v*p),_=Math.ceil(_*p),m.width=v,m.height=_,g.transform(p,0,0,p,y,x),t.forEach(t=>{g.lineWidth=b,g.strokeStyle=w,"none"!==t.fill&&(g.fillStyle=S),(null==r?void 0:r.dash)&&g.setLineDash(r.dash.split(",").map(t=>Number(t.trim()))),g.beginPath();const{scale:e}=t,n=t.path.trim().split(" ");let i={x:0,y:0};for(let t=0;t<n.length;t+=2){const r=n[t],o=n[t+1];if("M"===r){let[t,n]=o.split(",").map(t=>Number(t));i={x:t,y:n},t=t/9525*e.x,n=n/9525*e.y,g.moveTo(t,n)}else if("A"===r){const[t,n,r,s]=o.split(",").map(t=>Number(t));i=Ic(i,e,t,n,r,s,g)}else if("L"===r){let[t,n]=o.split(",").map(t=>Number(t));i={x:t,y:n},t=t/9525*e.x,n=n/9525*e.y,g.lineTo(t,n)}else if("QB"===r){let[t,n,r,s]=o.split(",").map(t=>Number(t));i={x:r,y:s},t=t/9525*e.x,n=n/9525*e.y,r=r/9525*e.x,s=s/9525*e.y,g.quadraticCurveTo(t,n,r,s)}else if("CB"===r){let[t,n,r,s,a,u]=o.split(",").map(t=>Number(t));i={x:a,y:u},t=t/9525*e.x,n=n/9525*e.y,r=r/9525*e.x,s=s/9525*e.y,a=a/9525*e.x,u=u/9525*e.y,g.bezierCurveTo(t,n,r,s,a,u)}else"C"===r&&g.closePath()}t.hasStroke&&b>0&&g.stroke(),"none"!==t.fill&&o&&g.fill("nonzero")}),{texture:new Tn(new an(m,{width:m.width/2,height:m.height/2,resolution:p})),pivot:f,padding:2}}(t,r,i,o,n,s);this.graphics.push({id:l,texture:e,pivot:a,width:e.width,height:e.height,padding:u})}return u}pack(){this.graphics.forEach(t=>{t.width+=4,t.height+=4});Xl(this.graphics).forEach(t=>{this.render(t)}),this.graphics.forEach(t=>{t.texture.destroy(!0)}),this.graphics=[]}destroy(){Object.keys(this.textures).forEach(t=>{var e;null===(e=this.textures[t])||void 0===e||e.texture.destroy()}),this.textures=Object.create(null),this.graphics=[],this.renderContainers.forEach(t=>t.destroy({children:!0,baseTexture:!0,texture:!0})),this.renderTextures.forEach(t=>t.destroy(!0))}}var Oc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Dc{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.spriteSheets=[],this.isLoaded=!1,this.loader=t}getTexture(t){return this.textures[t]||null}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(t=>!!t):[]}loadSpriteSheetItem(t,e,n){return Oc(this,void 0,void 0,(function*(){const r=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${n}.json`),i=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${n}.png`),o=document.createElement("img");o.src=i,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()});const s=new an(o),a=new Qs(s,r);yield new Promise(t=>{a.parse(()=>t(""))}),this.spriteSheets.push(a),Object.keys(a.textures).forEach(t=>{const e=t.match(/^(.+)_gif_(\d+)$/);if(e&&e[1]&&e[2]){const n=e[1];this.gifs[n]||(this.gifs[n]=[]);const r=parseInt(e[2],10);this.gifs[n][r]=a.textures[t]}else this.textures[t]=a.textures[t]})}))}loadSpriteSheets(t,e,n){return this.isLoaded?Promise.resolve([]):(this.isLoaded=!0,Promise.all(t.map(t=>this.loadSpriteSheetItem(e,n,t))))}destroy(){this.isLoaded=!1,this.spriteSheets.forEach(t=>t.destroy(!0))}}class Nc{constructor(){this.prevTime=-1,this.times=10,this.dur=0,this.valeList=[],this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.dur+=e,this.times-=1,0===this.times&&(this.valeList.push(1e4/this.dur),this.times=10,this.dur=0,this.valeList.length>10&&(this.value=Math.round(this.valeList.reduce((t,e)=>t+e)/this.valeList.length),this.valeList=[])),this.prevTime=t,this.calcFps()})}}var Fc=n(10),Bc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Uc{constructor(t){this.useCache=!1,this.useCache=t}bindTask(t){this.taskId=t,this.useCache&&(this.cache=Fc.createInstance({name:"_slide_local_cache_",storeName:this.taskId,driver:Fc.INDEXEDDB,version:1}),this.cache.clear().catch(()=>{}))}fetchJson(t){var e,n;return Bc(this,void 0,void 0,(function*(){let r=yield null===(e=this.cache)||void 0===e?void 0:e.getItem(t);return r&&this.useCache||(r=yield(yield fetch(t)).json(),this.useCache&&(yield null===(n=this.cache)||void 0===n?void 0:n.setItem(t,r))),r}))}fetchPng(t){var e,n;return Bc(this,void 0,void 0,(function*(){let r=yield null===(e=this.cache)||void 0===e?void 0:e.getItem(t);if(r&&this.useCache)return r;if(r=yield fetch(t).then(t=>t.blob()).then(e=>new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=()=>{r(new Error(`fetch ${t} failed`))},i.readAsDataURL(e)})),this.useCache&&(yield null===(n=this.cache)||void 0===n?void 0:n.setItem(t,r)),!r)throw new Error(`fetch ${t} failed`);return r}))}destroy(){var t;null===(t=this.cache)||void 0===t||t.clear().catch(()=>{})}}var kc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};window.PIXI=i,r.skipHello();const Gc={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"};class Hc{constructor(t){this.eventHub=t,this.targets=Object.create(null)}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,n={type:"el",index:0,id:""}){var r,i;let o=this.targets[t.id];return"shape"!==t.type?o:("shape"===t.type&&t.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(t.txEl.type,t.txEl.range))&&void 0!==r?r:null),"shape"===t.type&&t.bg&&0===n.index&&(e=!1,o=null!==(i=null==o?void 0:o.getBgElement())&&void 0!==i?i:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),e&&o?o.getIterateEntry(n.type,n.index,n.id):o)}clearTargets(){this.targets=Object.create(null)}}const zc={prev:"gotoPrev",next:"gotoNext",goto:"gotoSlide"},jc={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",interactiveAnimTrigger:"interactiveAnimTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause"};class Vc extends a.a{constructor(t,e={}){super(),this.loader=new Uc(!1),this.transactionPlayer=new l.TransactionPlayer,this.transactionSprite=new Ms,this.isForward=!0,this.dynamicResolution=1,this.drawCall=0,this.fps=new Nc,this.width=0,this.height=0,this.currentIndex=0,this.slideCount=0,this.frameList=[],this.runtime={drawCall:0,fps:0},this.handlePrevSlide=()=>kc(this,void 0,void 0,(function*(){const t=this.currentIndex-1;t>=1&&(this.isForward=!1,yield this.renderSlide(t))})),this.handleNextSlide=()=>kc(this,void 0,void 0,(function*(){const t=this.currentIndex+1;t<=this.slideCount&&(this.isForward=!0,yield this.renderSlide(t))})),this.handleGotoSlide=t=>{t<=this.slideCount&&t>=1&&this.renderSlide(t)},this.mode=t,this.config={minFPS:Object(u.isUndefined)(e.minFPS)?45:e.minFPS,maxFPS:Object(u.isUndefined)(e.maxFPS)?50:e.maxFPS,resolution:Object(u.isUndefined)(e.resolution)?window.devicePixelRatio:e.resolution,autoResolution:!Object(u.isUndefined)(e.autoResolution)&&e.autoResolution,minResolution:Object(u.isUndefined)(e.minResolution)?1:e.minResolution,autoFPS:!Object(u.isUndefined)(e.autoFPS)&&e.autoFPS},this.app=new vi({antialias:!0,autoDensity:!0,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const n=this.app.renderer,{drawElements:r}=n.gl;n.gl.drawElements=(...t)=>{r.call(n.gl,...t),this.drawCall+=1},this.app.ticker.add(t=>{this.runtime.drawCall=this.drawCall,this.drawCall=0;const e=1e3/(t/(vt.TARGET_FPMS||.06));if(this.frameList.push(e),this.frameList.length>50){const t=this.frameList.reduce((t,e)=>t+e)/this.frameList.length;if(this.runtime.fps=Math.floor(t),this.fps.value<this.config.minFPS)this.dynamicResolution=this.app.renderer.resolution-.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution),this.dynamicResolution<=this.config.minResolution&&this.config.autoFPS&&(this.app.ticker.minFPS-=2,this.app.ticker.maxFPS-=2);else if(this.fps.value>1.08*this.config.minFPS&&this.fps.value<=this.config.maxFPS){const t=Math.min(this.app.ticker.minFPS+2,this.config.minFPS),e=Math.min(this.app.ticker.maxFPS+2,this.config.maxFPS);t<=this.config.minFPS&&(this.app.ticker.minFPS=t),e<=this.config.maxFPS&&(this.app.ticker.maxFPS=e),t>=this.config.minFPS&&e>=this.config.maxFPS&&(this.dynamicResolution+=.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution))}this.config.autoResolution&&this.dynamicResolution!==this.app.renderer.resolution&&this.app.ticker.addOnce(()=>{const t=Math.min(this.dynamicResolution,this.config.resolution);this.app.renderer.resolution=t,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},ke.HIGH),this.frameList=[]}},null,ke.LOW)}get view(){return this.app.view}clearForward(){this.isForward=!0}updateConfig(t){Object(u.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(u.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(u.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.app.ticker.addOnce(()=>{this.app.renderer.resolution=t.resolution||window.devicePixelRatio,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},ke.HIGH)),Object(u.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(u.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(u.isUndefined)(t.minResolution)||(this.config.minResolution=t.minResolution)}preload(t){return kc(this,void 0,void 0,(function*(){if(t<1||t>this.slideCount||!this.loader.cache)return;const e=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`),{sheets:n}=e;for(const t of n)yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/${t}.json`),yield this.loader.fetchPng(`${this.url}/${this.taskId}/jsonOutput/${t}.png`)}))}setResourceData(t,e){this.taskId=t,this.url=e,this.loader.bindTask(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}loadSlide(t){return kc(this,void 0,void 0,(function*(){const e=new Dc(this.loader),n=new a.a,r={mode:this.mode,renderer:this.app.renderer,graphicsTexture:new Lc(this.app.renderer),fillTexture:new Rc(this.app.renderer,e),stageWidth:0,stageHeight:0,ticker:this.app.ticker,timingTargets:new Hc(n),eventHub:n,view:this.app.view,medias:Object.create(null)},i=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`),{width:o,height:s,sheets:u}=i;yield e.loadSpriteSheets(u,this.url,this.taskId),r.stageWidth=o,r.stageHeight=s;const l=new $l(i,r,{x:0,y:0});return r.eventHub.on(zc.prev,this.handlePrevSlide),r.eventHub.on(zc.next,this.handleNextSlide),r.eventHub.on(zc.goto,this.handleGotoSlide),this.translateEvent(r.eventHub,[jc.mainSeqStepChange,jc.mainSeqStateChange,jc.hyperlinkTrigger,jc.interactiveAnimTrigger,jc.mainSeqStepStart,jc.mainSeqStepEnd,jc.animateStart,jc.animateEnd,jc.mediaPlay,jc.mediaPause,jc.mediaSeek]),l.preRender(),r.fillTexture.pack(),r.graphicsTexture.pack(),{stage:l,json:i}}))}translateEvent(t,e){e.forEach(e=>{t.on(e,(...t)=>{this.emit(e,...t)})})}renderSlide(t){return kc(this,void 0,void 0,(function*(){this.emit(jc.renderStart,t),this.currentIndex=Number(t);const e=yield this.loadSlide(t),{width:n,height:r,slideCount:i}=e.json;let o;this.slideCount=i,this.app.view.style.width=n+"px",this.app.view.style.height=r+"px",this.app.renderer.resize(n,r),this.width=n,this.height=r,this.currentStage&&(e.json.transition&&e.json.transition.type&&(o=this.getBase64(this.currentStage)),this.prevStage=this.currentStage),this.currentStage=e,yield e.stage.render(),e.stage.createTiming(),e.stage.container.visible=!0,e.stage.collectMainSeqStartValue(),this.isForward?e.stage.setMainSeqStep(0,"start"):e.stage.setMainSeqStep(-1,"end");const s=this.getBase64(this.currentStage);e.stage.container.visible=!1,this.app.stage.addChild(e.stage.container),o&&s&&e.json.transition&&e.json.transition.type&&(yield this.playTransaction(o,s,e.json.transition)),this.prevStage&&(this.app.stage.removeChild(this.prevStage.stage.container),this.prevStage.stage.destroy(),this.prevStage=void 0),this.isForward?e.stage.startTiming():e.stage.setMainSeqApplied(),e.stage.container.visible=!0,this.emit(jc.renderEnd,t),this.emit(jc.slideChange,t),this.preload(t+1).catch(()=>{}),this.preload(t-1).catch(()=>{})}))}getBase64(t){const{width:e,height:n}=t.json,r=Mn.create({width:e,height:n});this.app.renderer.render(t.stage.container,{renderTexture:r});return this.app.renderer.plugins.extract.base64(r,"image/jpeg")}playTransaction(t,e,n){return kc(this,void 0,void 0,(function*(){const r=this.app.view.parentElement;if(t&&e&&r&&Gc[n.type]){this.transactionSprite.zIndex=999,this.app.stage.addChild(this.transactionSprite);const r=this.transactionPlayer.renderer.domElement,i=Tn.from(r),o=()=>i.update();this.app.ticker.add(o),this.transactionSprite.texture=i;const{width:s,height:a}=this.currentStage.json;return new Promise(r=>{var i,u;this.transactionPlayer.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:s,textureHeight:a,presetType:Gc[n.type],stageWidth:s,stageHeight:a,duration:null===(u=null===(i=this.currentStage)||void 0===i?void 0:i.json.transition)||void 0===u?void 0:u.dur,delay:0,onTransactionEnd:()=>{r(),this.app.stage.removeChild(this.transactionSprite),this.app.ticker.remove(o)}})})}return Promise.resolve()}))}nextStep(){var t;null===(t=this.currentStage)||void 0===t||t.stage.nextStep()}prevStep(){var t;null===(t=this.currentStage)||void 0===t||t.stage.prevStep()}mainSeqLength(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqLength())&&void 0!==e?e:0}mainSeqStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqStep())&&void 0!==e?e:0}setMainSeqStep(t,e){var n;null===(n=this.currentStage)||void 0===n||n.stage.setMainSeqStep(t,e)}mainSeqState(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqState())&&void 0!==e?e:null}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqHasPrevStep())&&void 0!==e&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},ke.LOW)}applyInteractiveAction(t){var e;null===(e=this.currentStage)||void 0===e||e.stage.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.currentStage)||void 0===e||e.stage.seekInteractiveSeqToEnd(t)}setMediaState(t,e){var n;return kc(this,void 0,void 0,(function*(){yield null===(n=this.currentStage)||void 0===n?void 0:n.stage.setMediaState(t,e)}))}setMediaCurrentTime(t,e){var n;null===(n=this.currentStage)||void 0===n||n.stage.setMediaCurrentTime(t,e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}destroy(){this.prevStage&&this.prevStage.stage.destroy(),this.currentStage&&this.currentStage.stage.destroy(),this.loader.destroy()}}var Wc,Xc=[],qc="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Wc||(Wc={}));var Yc,Zc=function(t){return Object.freeze(t)},Jc=function(t,e){this.inlineSize=t,this.blockSize=e,Zc(this)},Kc=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Zc(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),$c=function(t){return t instanceof SVGElement&&"getBBox"in t},Qc=function(t){if($c(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},th=function(t){var e,n;if(t instanceof Element)return!0;var r=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&t instanceof r.Element)},eh="undefined"!=typeof window?window:{},nh=new WeakMap,rh=/auto|scroll/,ih=/^tb|vertical/,oh=/msie|trident/i.test(eh.navigator&&eh.navigator.userAgent),sh=function(t){return parseFloat(t||"0")},ah=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new Jc((n?e:t)||0,(n?t:e)||0)},uh=Zc({devicePixelContentBoxSize:ah(),borderBoxSize:ah(),contentBoxSize:ah(),contentRect:new Kc(0,0,0,0)}),lh=function(t,e){if(void 0===e&&(e=!1),nh.has(t)&&!e)return nh.get(t);if(Qc(t))return nh.set(t,uh),uh;var n=getComputedStyle(t),r=$c(t)&&t.ownerSVGElement&&t.getBBox(),i=!oh&&"border-box"===n.boxSizing,o=ih.test(n.writingMode||""),s=!r&&rh.test(n.overflowY||""),a=!r&&rh.test(n.overflowX||""),u=r?0:sh(n.paddingTop),l=r?0:sh(n.paddingRight),c=r?0:sh(n.paddingBottom),h=r?0:sh(n.paddingLeft),d=r?0:sh(n.borderTopWidth),f=r?0:sh(n.borderRightWidth),p=r?0:sh(n.borderBottomWidth),m=h+l,g=u+c,v=(r?0:sh(n.borderLeftWidth))+f,_=d+p,y=a?t.offsetHeight-_-t.clientHeight:0,x=s?t.offsetWidth-v-t.clientWidth:0,b=i?m+v:0,w=i?g+_:0,S=r?r.width:sh(n.width)-b-x,T=r?r.height:sh(n.height)-w-y,E=S+m+x+v,M=T+g+y+_,A=Zc({devicePixelContentBoxSize:ah(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:ah(E,M,o),contentBoxSize:ah(S,T,o),contentRect:new Kc(h,u,S,T)});return nh.set(t,A),A},ch=function(t,e,n){var r=lh(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case Wc.DEVICE_PIXEL_CONTENT_BOX:return s;case Wc.BORDER_BOX:return i;default:return o}},hh=function(t){var e=lh(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Zc([e.borderBoxSize]),this.contentBoxSize=Zc([e.contentBoxSize]),this.devicePixelContentBoxSize=Zc([e.devicePixelContentBoxSize])},dh=function(t){if(Qc(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},fh=function(){var t=1/0,e=[];Xc.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new hh(e.target),i=dh(e.target);r.push(n),e.lastReportedSize=ch(e.target,e.observedBox),i<t&&(t=i)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++){(0,r[n])()}return t},ph=function(t){Xc.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(dh(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},mh=function(){var t,e=0;for(ph(e);Xc.some((function(t){return t.activeTargets.length>0}));)e=fh(),ph(e);return Xc.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:qc}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=qc),window.dispatchEvent(t)),e>0},gh=[],vh=function(t){if(!Yc){var e=0,n=document.createTextNode("");new MutationObserver((function(){return gh.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),Yc=function(){n.textContent=""+(e?e--:e++)}}gh.push(t),Yc()},_h=0,yh={attributes:!0,characterData:!0,childList:!0,subtree:!0},xh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],bh=function(t){return void 0===t&&(t=0),Date.now()+t},wh=!1,Sh=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!wh){wh=!0;var n,r=bh(t);n=function(){var n=!1;try{n=mh()}finally{if(wh=!1,t=r-bh(),!_h)return;n?e.run(1e3):t>0?e.run(t):e.start()}},vh((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,yh)};document.body?e():eh.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),xh.forEach((function(e){return eh.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),xh.forEach((function(e){return eh.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Th=function(t){!_h&&t>0&&Sh.start(),!(_h+=t)&&Sh.stop()},Eh=function(){function t(t,e){this.target=t,this.observedBox=e||Wc.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ch(this.target,this.observedBox,!0);return t=this.target,$c(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),Mh=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Ah=new WeakMap,Ph=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Rh=function(){function t(){}return t.connect=function(t,e){var n=new Mh(t,e);Ah.set(t,n)},t.observe=function(t,e,n){var r=Ah.get(t),i=0===r.observationTargets.length;Ph(r.observationTargets,e)<0&&(i&&Xc.push(r),r.observationTargets.push(new Eh(e,n&&n.box)),Th(1),Sh.schedule())},t.unobserve=function(t,e){var n=Ah.get(t),r=Ph(n.observationTargets,e),i=1===n.observationTargets.length;r>=0&&(i&&Xc.splice(Xc.indexOf(n),1),n.observationTargets.splice(r,1),Th(-1))},t.disconnect=function(t){var e=this,n=Ah.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),Ch=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rh.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!th(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rh.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!th(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rh.unobserve(this,t)},t.prototype.disconnect=function(){Rh.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),Ih=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Lh=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Oh=function(){function t(t,e,n,r){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=t,this.slideIndex=e,this.eventHub=r}return t.prototype.apply=function(){return Ih(this,void 0,void 0,(function(){var t;return Lh(this,(function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}}))}))},t}(),Dh=function(){function t(){var t=this;this.eventHub=new a.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",(function(e){var n,r=t.tasks.findIndex((function(t){return t.index===e.index})),i=r+1;i>=0&&(null===(n=t.tasks[i])||void 0===n||n.apply()),r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask())})),this.eventHub.on("task-error",(function(e){var n=e.task,r=t.tasks.findIndex((function(t){return t.index===n.index}));r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask())}))}return t.prototype.replaceIdleTask=function(){for(var t,e=this,n=new Set,r=0,i=this.tasks.length;r<i;r++)"idle"===this.tasks[r].state&&"idle"===(null===(t=this.tasks[r+1])||void 0===t?void 0:t.state)&&n.add(r);Array.from(n).forEach((function(t){e.tasks.splice(t,1)}))},t.prototype.addTask=function(t,e){var n=new Oh(this.index++,e,t,this.eventHub);this.tasks.push(n),this.tasks.sort((function(t,e){return t.index-e.index})),this.replaceIdleTask(),1===this.tasks.length&&n.apply()},t.prototype.hasStartTask=function(){return this.tasks.some((function(t){return"start"===t.state}))},t}(),Nh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Fh=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function Bh(t,e){return Nh(this,void 0,void 0,(function(){var n;return Fh(this,(function(r){switch(r.label){case 0:n=Date.now(),r.label=1;case 1:return!t()&&Date.now()-n<e?[4,(i=50,new Promise((function(t){return setTimeout(t,i)})))]:[3,3];case 2:return r.sent(),[3,1];case 3:return[2]}var i}))}))}function Uh(t,e){var n=t.__state.conversionName.toString(),r=Math.round(t.r),i=Math.round(t.g),o=Math.round(t.b),s=t.a,a=Math.round(t.h),u=t.s.toFixed(1),l=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var c=t.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return"CSS_RGB"===n?"rgb("+r+","+i+","+o+")":"CSS_RGBA"===n?"rgba("+r+","+i+","+o+","+s+")":"HEX"===n?"0x"+t.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+i+","+o+"]":"RGBA_ARRAY"===n?"["+r+","+i+","+o+","+s+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+a+",s:"+u+",v:"+l+"}":"HSVA_OBJ"===n?"{h:"+a+",s:"+u+",v:"+l+",a:"+s+"}":"unknown format"}var kh=Array.prototype.forEach,Gh=Array.prototype.slice,Hh={BREAK:{},extend:function(t){return this.each(Gh.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(e[n])||(t[n]=e[n])}.bind(this))}),this),t},defaults:function(t){return this.each(Gh.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(t[n])&&(t[n]=e[n])}.bind(this))}),this),t},compose:function(){var t=Gh.call(arguments);return function(){for(var e=Gh.call(arguments),n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},each:function(t,e,n){if(t)if(kh&&t.forEach&&t.forEach===kh)t.forEach(e,n);else if(t.length===t.length+0){var r,i=void 0;for(i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===this.BREAK)return}else for(var o in t)if(e.call(n,t[o],o)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var r=void 0;return function(){var i=this,o=arguments;function s(){r=null,n||t.apply(i,o)}var a=n||!r;clearTimeout(r),r=setTimeout(s,e),a&&t.apply(i,o)}},toArray:function(t){return t.toArray?t.toArray():Gh.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return t instanceof Function}},zh=[{litmus:Hh.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:Uh},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:Uh},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:Uh},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:Uh}}},{litmus:Hh.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:Hh.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:Hh.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(Hh.isNumber(t.r)&&Hh.isNumber(t.g)&&Hh.isNumber(t.b)&&Hh.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(Hh.isNumber(t.r)&&Hh.isNumber(t.g)&&Hh.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(Hh.isNumber(t.h)&&Hh.isNumber(t.s)&&Hh.isNumber(t.v)&&Hh.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(Hh.isNumber(t.h)&&Hh.isNumber(t.s)&&Hh.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],jh=void 0,Vh=void 0,Wh=function(){Vh=!1;var t=arguments.length>1?Hh.toArray(arguments):arguments[0];return Hh.each(zh,(function(e){if(e.litmus(t))return Hh.each(e.conversions,(function(e,n){if(jh=e.read(t),!1===Vh&&!1!==jh)return Vh=jh,jh.conversionName=n,jh.conversion=e,Hh.BREAK})),Hh.BREAK})),Vh},Xh=void 0,qh={hsv_to_rgb:function(t,e,n){var r=Math.floor(t/60)%6,i=t/60-Math.floor(t/60),o=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),u=[[n,a,o],[s,n,o],[o,n,a],[o,s,n],[a,o,n],[n,o,s]][r];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(t,e,n){var r=Math.min(t,e,n),i=Math.max(t,e,n),o=i-r,s=void 0;return 0===i?{h:NaN,s:0,v:0}:(s=t===i?(e-n)/o:e===i?2+(n-t)/o:4+(t-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/i,v:i/255})},rgb_to_hex:function(t,e,n){var r=this.hex_with_component(0,2,t);return r=this.hex_with_component(r,1,e),r=this.hex_with_component(r,0,n)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,n){return n<<(Xh=8*e)|t&~(255<<Xh)}},Yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zh=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Jh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Kh=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},$h=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Qh=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},td=function(){function t(){if(Zh(this,t),this.__state=Wh.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Jh(t,[{key:"toString",value:function(){return Uh(this)}},{key:"toHexString",value:function(){return Uh(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),t}();function ed(t,e,n){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||td.recalculateRGB(this,e,n),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(td.recalculateRGB(this,e,n),this.__state.space="RGB"),this.__state[e]=t}})}function nd(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||td.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(td.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}td.recalculateRGB=function(t,e,n){if("HEX"===t.__state.space)t.__state[e]=qh.component_from_hex(t.__state.hex,n);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");Hh.extend(t.__state,qh.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},td.recalculateHSV=function(t){var e=qh.rgb_to_hsv(t.r,t.g,t.b);Hh.extend(t.__state,{s:e.s,v:e.v}),Hh.isNaN(e.h)?Hh.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},td.COMPONENTS=["r","g","b","h","s","v","hex","a"],ed(td.prototype,"r",2),ed(td.prototype,"g",1),ed(td.prototype,"b",0),nd(td.prototype,"h"),nd(td.prototype,"s"),nd(td.prototype,"v"),Object.defineProperty(td.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(td.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=qh.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var rd=function(){function t(e,n){Zh(this,t),this.initialValue=e[n],this.domElement=document.createElement("div"),this.object=e,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return Jh(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),id={};Hh.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){Hh.each(t,(function(t){id[t]=e}))}));var od=/(\d+(\.\d+)?)px/;function sd(t){if("0"===t||Hh.isUndefined(t))return 0;var e=t.match(od);return Hh.isNull(e)?0:parseFloat(e[1])}var ad={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,n){var r=n,i=e;Hh.isUndefined(i)&&(i=!0),Hh.isUndefined(r)&&(r=!0),t.style.position="absolute",i&&(t.style.left=0,t.style.right=0),r&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,n,r){var i=n||{},o=id[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=i.x||i.clientX||0,u=i.y||i.clientY||0;s.initMouseEvent(e,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,a,u,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var l=s.initKeyboardEvent||s.initKeyEvent;Hh.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),l(e,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:s.initEvent(e,i.bubbles||!1,i.cancelable||!0)}Hh.defaults(s,r),t.dispatchEvent(s)},bind:function(t,e,n,r){var i=r||!1;return t.addEventListener?t.addEventListener(e,n,i):t.attachEvent&&t.attachEvent("on"+e,n),ad},unbind:function(t,e,n,r){var i=r||!1;return t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent&&t.detachEvent("on"+e,n),ad},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var n=t.className.split(/ +/);-1===n.indexOf(e)&&(n.push(e),t.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return ad},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var n=t.className.split(/ +/),r=n.indexOf(e);-1!==r&&(n.splice(r,1),t.className=n.join(" "))}else t.className=void 0;return ad},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return sd(e["border-left-width"])+sd(e["border-right-width"])+sd(e["padding-left"])+sd(e["padding-right"])+sd(e.width)},getHeight:function(t){var e=getComputedStyle(t);return sd(e["border-top-width"])+sd(e["border-bottom-width"])+sd(e["padding-top"])+sd(e["padding-bottom"])+sd(e.height)},getOffset:function(t){var e=t,n={left:0,top:0};if(e.offsetParent)do{n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent}while(e);return n},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},ud=function(t){function e(t,n){Zh(this,e);var r=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),i=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),ad.bind(r.__checkbox,"change",(function(){i.setValue(!i.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return $h(e,t),Jh(e,[{key:"setValue",value:function(t){var n=Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(rd),ld=function(t){function e(t,n,r){Zh(this,e);var i=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r,s=i;if(i.__select=document.createElement("select"),Hh.isArray(o)){var a={};Hh.each(o,(function(t){a[t]=t})),o=a}return Hh.each(o,(function(t,e){var n=document.createElement("option");n.innerHTML=e,n.setAttribute("value",t),s.__select.appendChild(n)})),i.updateDisplay(),ad.bind(i.__select,"change",(function(){var t=this.options[this.selectedIndex].value;s.setValue(t)})),i.domElement.appendChild(i.__select),i}return $h(e,t),Jh(e,[{key:"setValue",value:function(t){var n=Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return ad.isActive(this.__select)?this:(this.__select.value=this.getValue(),Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(rd),cd=function(t){function e(t,n){Zh(this,e);var r=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),i=r;function o(){i.setValue(i.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),ad.bind(r.__input,"keyup",o),ad.bind(r.__input,"change",o),ad.bind(r.__input,"blur",(function(){i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())})),ad.bind(r.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return $h(e,t),Jh(e,[{key:"updateDisplay",value:function(){return ad.isActive(this.__input)||(this.__input.value=this.getValue()),Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(rd);function hd(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var dd=function(t){function e(t,n,r){Zh(this,e);var i=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,Hh.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=hd(i.__impliedStep),i}return $h(e,t),Jh(e,[{key:"setValue",value:function(t){var n=t;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=hd(t),this}}]),e}(rd);var fd=function(t){function e(t,n,r){Zh(this,e);var i=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));i.__truncationSuspended=!1;var o=i,s=void 0;function a(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(t){var e=s-t.clientY;o.setValue(o.getValue()+e*o.__impliedStep),s=t.clientY}function l(){ad.unbind(window,"mousemove",u),ad.unbind(window,"mouseup",l),a()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),ad.bind(i.__input,"change",(function(){var t=parseFloat(o.__input.value);Hh.isNaN(t)||o.setValue(t)})),ad.bind(i.__input,"blur",(function(){a()})),ad.bind(i.__input,"mousedown",(function(t){ad.bind(window,"mousemove",u),ad.bind(window,"mouseup",l),s=t.clientY})),ad.bind(i.__input,"keydown",(function(t){13===t.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,a())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return $h(e,t),Jh(e,[{key:"updateDisplay",value:function(){var t,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(t*r)/r),Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(dd);function pd(t,e,n,r,i){return r+(t-e)/(n-e)*(i-r)}var md=function(t){function e(t,n,r,i,o){Zh(this,e);var s=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:r,max:i,step:o})),a=s;function u(t){t.preventDefault();var e=a.__background.getBoundingClientRect();return a.setValue(pd(t.clientX,e.left,e.right,a.__min,a.__max)),!1}function l(){ad.unbind(window,"mousemove",u),ad.unbind(window,"mouseup",l),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function c(t){var e=t.touches[0].clientX,n=a.__background.getBoundingClientRect();a.setValue(pd(e,n.left,n.right,a.__min,a.__max))}function h(){ad.unbind(window,"touchmove",c),ad.unbind(window,"touchend",h),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),ad.bind(s.__background,"mousedown",(function(t){document.activeElement.blur(),ad.bind(window,"mousemove",u),ad.bind(window,"mouseup",l),u(t)})),ad.bind(s.__background,"touchstart",(function(t){if(1!==t.touches.length)return;ad.bind(window,"touchmove",c),ad.bind(window,"touchend",h),c(t)})),ad.addClass(s.__background,"slider"),ad.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return $h(e,t),Jh(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",Kh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(dd),gd=function(t){function e(t,n,r){Zh(this,e);var i=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===r?"Fire":r,ad.bind(i.__button,"click",(function(t){return t.preventDefault(),o.fire(),!1})),ad.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return $h(e,t),Jh(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(rd),vd=function(t){function e(t,n){Zh(this,e);var r=Qh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));r.__color=new td(r.getValue()),r.__temp=new td(0);var i=r;r.domElement=document.createElement("div"),ad.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",ad.bind(r.__input,"keydown",(function(t){13===t.keyCode&&h.call(this)})),ad.bind(r.__input,"blur",h),ad.bind(r.__selector,"mousedown",(function(){ad.addClass(this,"drag").bind(window,"mouseup",(function(){ad.removeClass(i.__selector,"drag")}))})),ad.bind(r.__selector,"touchstart",(function(){ad.addClass(this,"drag").bind(window,"touchend",(function(){ad.removeClass(i.__selector,"drag")}))}));var o,s=document.createElement("div");function a(t){f(t),ad.bind(window,"mousemove",f),ad.bind(window,"touchmove",f),ad.bind(window,"mouseup",l),ad.bind(window,"touchend",l)}function u(t){p(t),ad.bind(window,"mousemove",p),ad.bind(window,"touchmove",p),ad.bind(window,"mouseup",c),ad.bind(window,"touchend",c)}function l(){ad.unbind(window,"mousemove",f),ad.unbind(window,"touchmove",f),ad.unbind(window,"mouseup",l),ad.unbind(window,"touchend",l),d()}function c(){ad.unbind(window,"mousemove",p),ad.unbind(window,"touchmove",p),ad.unbind(window,"mouseup",c),ad.unbind(window,"touchend",c),d()}function h(){var t=Wh(this.value);!1!==t?(i.__color.__state=t,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=i.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientX,o=n.clientY,s=(r-e.left)/(e.right-e.left),a=1-(o-e.top)/(e.bottom-e.top);return a>1?a=1:a<0&&(a=0),s>1?s=1:s<0&&(s=0),i.__color.v=a,i.__color.s=s,i.setValue(i.__color.toOriginal()),!1}function p(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=i.__hue_field.getBoundingClientRect(),n=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return n>1?n=1:n<0&&(n=0),i.__color.h=360*n,i.setValue(i.__color.toOriginal()),!1}return Hh.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Hh.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Hh.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Hh.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Hh.extend(s.style,{width:"100%",height:"100%",background:"none"}),yd(s,"top","rgba(0,0,0,0)","#000"),Hh.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=r.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Hh.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),ad.bind(r.__saturation_field,"mousedown",a),ad.bind(r.__saturation_field,"touchstart",a),ad.bind(r.__field_knob,"mousedown",a),ad.bind(r.__field_knob,"touchstart",a),ad.bind(r.__hue_field,"mousedown",u),ad.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(s),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return $h(e,t),Jh(e,[{key:"updateDisplay",value:function(){var t=Wh(this.getValue());if(!1!==t){var e=!1;Hh.each(td.COMPONENTS,(function(n){if(!Hh.isUndefined(t[n])&&!Hh.isUndefined(this.__color.__state[n])&&t[n]!==this.__color.__state[n])return e=!0,{}}),this),e&&Hh.extend(this.__color.__state,t)}Hh.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;Hh.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,yd(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Hh.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),e}(rd),_d=["-moz-","-o-","-webkit-","-ms-",""];function yd(t,e,n,r){t.style.background="",Hh.each(_d,(function(i){t.style.cssText+="background: "+i+"linear-gradient("+e+", "+n+" 0%, "+r+" 100%); "}))}var xd=function(t,e){var n=e||document,r=document.createElement("style");r.type="text/css",r.innerHTML=t;var i=n.getElementsByTagName("head")[0];try{i.appendChild(r)}catch(t){}},bd='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',wd=function(t,e){var n=t[e];return Hh.isArray(arguments[2])||Hh.isObject(arguments[2])?new ld(t,e,arguments[2]):Hh.isNumber(n)?Hh.isNumber(arguments[2])&&Hh.isNumber(arguments[3])?Hh.isNumber(arguments[4])?new md(t,e,arguments[2],arguments[3],arguments[4]):new md(t,e,arguments[2],arguments[3]):Hh.isNumber(arguments[4])?new fd(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new fd(t,e,{min:arguments[2],max:arguments[3]}):Hh.isString(n)?new cd(t,e):Hh.isFunction(n)?new gd(t,e,""):Hh.isBoolean(n)?new ud(t,e):null};var Sd=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},Td=function(){function t(){Zh(this,t),this.backgroundElement=document.createElement("div"),Hh.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),ad.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Hh.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;ad.bind(this.backgroundElement,"click",(function(){e.hide()}))}return Jh(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Hh.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",ad.unbind(t.domElement,"webkitTransitionEnd",e),ad.unbind(t.domElement,"transitionend",e),ad.unbind(t.domElement,"oTransitionEnd",e)};ad.bind(this.domElement,"webkitTransitionEnd",e),ad.bind(this.domElement,"transitionend",e),ad.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-ad.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-ad.getHeight(this.domElement)/2+"px"}}]),t}();xd(function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var Ed=function(){try{return!!window.localStorage}catch(t){return!1}}(),Md=void 0,Ad=!0,Pd=void 0,Rd=!1,Cd=[],Id=function t(e){var n=this,r=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),ad.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=Hh.defaults(r,{closeOnTop:!1,autoPlace:!0,width:t.DEFAULT_WIDTH}),r=Hh.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),Hh.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),Hh.isUndefined(r.parent)&&r.hideable&&Cd.push(this),r.resizable=Hh.isUndefined(r.parent)&&r.resizable,r.autoPlace&&Hh.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=Ed&&"true"===localStorage.getItem(Bd(this,"isLocal")),s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(t){n.parent?n.getRoot().preset=t:r.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),n.revert()}},width:{get:function(){return r.width},set:function(t){r.width=t,zd(n,t)}},name:{get:function(){return r.name},set:function(t){r.name=t,a&&(a.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(e){r.closed=e,r.closed?ad.addClass(n.__ul,t.CLASS_CLOSED):ad.removeClass(n.__ul,t.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return o},set:function(t){Ed&&(o=t,t?ad.bind(window,"unload",s):ad.unbind(window,"unload",s),localStorage.setItem(Bd(n,"isLocal"),t))}}}),Hh.isUndefined(r.parent)){if(this.closed=r.closed||!1,ad.addClass(this.domElement,t.CLASS_MAIN),ad.makeSelectable(this.domElement,!1),Ed&&o){n.useLocalStorage=!0;var u=localStorage.getItem(Bd(this,"gui"));u&&(r.load=JSON.parse(u))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,ad.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),r.closeOnTop?(ad.addClass(this.__closeButton,t.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(ad.addClass(this.__closeButton,t.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),ad.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===r.closed&&(r.closed=!0);var l=document.createTextNode(r.name);ad.addClass(l,"controller-name"),a=Ld(n,l);ad.addClass(this.__ul,t.CLASS_CLOSED),ad.addClass(a,"title"),ad.bind(a,"click",(function(t){return t.preventDefault(),n.closed=!n.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(Hh.isUndefined(r.parent)&&(Ad&&(Pd=document.createElement("div"),ad.addClass(Pd,"dg"),ad.addClass(Pd,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Pd),Ad=!1),Pd.appendChild(this.domElement),ad.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||zd(n,r.width)),this.__resizeHandler=function(){n.onResizeDebounced()},ad.bind(window,"resize",this.__resizeHandler),ad.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),ad.bind(this.__ul,"transitionend",this.__resizeHandler),ad.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&Hd(this),s=function(){Ed&&"true"===localStorage.getItem(Bd(n,"isLocal"))&&localStorage.setItem(Bd(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,r.parent||((i=n.getRoot()).width+=1,Hh.defer((function(){i.width-=1})))};function Ld(t,e,n){var r=document.createElement("li");return e&&r.appendChild(e),n?t.__ul.insertBefore(r,n):t.__ul.appendChild(r),t.onResize(),r}function Od(t){ad.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&ad.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function Dd(t,e){var n=t.__preset_select[t.__preset_select.selectedIndex];n.innerHTML=e?n.value+"*":n.value}function Nd(t,e){var n=t.getRoot(),r=n.__rememberedObjects.indexOf(e.object);if(-1!==r){var i=n.__rememberedObjectIndecesToControllers[r];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[r]=i),i[e.property]=e,n.load&&n.load.remembered){var o=n.load.remembered,s=void 0;if(o[t.preset])s=o[t.preset];else{if(!o.Default)return;s=o.Default}if(s[r]&&void 0!==s[r][e.property]){var a=s[r][e.property];e.initialValue=a,e.setValue(a)}}}}function Fd(t,e,n,r){if(void 0===e[n])throw new Error('Object "'+e+'" has no property "'+n+'"');var i=void 0;if(r.color)i=new vd(e,n);else{var o=[e,n].concat(r.factoryArgs);i=wd.apply(t,o)}r.before instanceof rd&&(r.before=r.before.__li),Nd(t,i),ad.addClass(i.domElement,"c");var s=document.createElement("span");ad.addClass(s,"property-name"),s.innerHTML=i.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(i.domElement);var u=Ld(t,a,r.before);return ad.addClass(u,Id.CLASS_CONTROLLER_ROW),i instanceof vd?ad.addClass(u,"color"):ad.addClass(u,Yh(i.getValue())),function(t,e,n){if(n.__li=e,n.__gui=t,Hh.extend(n,{options:function(e){if(arguments.length>1){var r=n.__li.nextElementSibling;return n.remove(),Fd(t,n.object,n.property,{before:r,factoryArgs:[Hh.toArray(arguments)]})}if(Hh.isArray(e)||Hh.isObject(e)){var i=n.__li.nextElementSibling;return n.remove(),Fd(t,n.object,n.property,{before:i,factoryArgs:[e]})}},name:function(t){return n.__li.firstElementChild.firstElementChild.innerHTML=t,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof md){var r=new fd(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});Hh.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(t){var e=n[t],i=r[t];n[t]=r[t]=function(){var t=Array.prototype.slice.call(arguments);return i.apply(r,t),e.apply(n,t)}})),ad.addClass(e,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof fd){var i=function(e){if(Hh.isNumber(n.__min)&&Hh.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=Fd(t,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(r),i&&o.listen(),o}return e};n.min=Hh.compose(i,n.min),n.max=Hh.compose(i,n.max)}else n instanceof ud?(ad.bind(e,"click",(function(){ad.fakeEvent(n.__checkbox,"click")})),ad.bind(n.__checkbox,"click",(function(t){t.stopPropagation()}))):n instanceof gd?(ad.bind(e,"click",(function(){ad.fakeEvent(n.__button,"click")})),ad.bind(e,"mouseover",(function(){ad.addClass(n.__button,"hover")})),ad.bind(e,"mouseout",(function(){ad.removeClass(n.__button,"hover")}))):n instanceof vd&&(ad.addClass(e,"color"),n.updateDisplay=Hh.compose((function(t){return e.style.borderLeftColor=n.__color.toString(),t}),n.updateDisplay),n.updateDisplay());n.setValue=Hh.compose((function(e){return t.getRoot().__preset_select&&n.isModified()&&Dd(t.getRoot(),!0),e}),n.setValue)}(t,u,i),t.__controllers.push(i),i}function Bd(t,e){return document.location.href+"."+e}function Ud(t,e,n){var r=document.createElement("option");r.innerHTML=e,r.value=e,t.__preset_select.appendChild(r),n&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function kd(t,e){e.style.display=t.useLocalStorage?"block":"none"}function Gd(t){var e=t.__save_row=document.createElement("li");ad.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),ad.addClass(e,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",ad.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",ad.addClass(r,"button"),ad.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",ad.addClass(i,"button"),ad.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",ad.addClass(o,"button"),ad.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?Hh.each(t.load.remembered,(function(e,n){Ud(t,n,n===t.preset)})):Ud(t,"Default",!1),ad.bind(s,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(s),e.appendChild(n),e.appendChild(r),e.appendChild(i),e.appendChild(o),Ed){var a=document.getElementById("dg-local-explain"),u=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(Bd(0,"isLocal"))&&u.setAttribute("checked","checked"),kd(t,a),ad.bind(u,"change",(function(){t.useLocalStorage=!t.useLocalStorage,kd(t,a)}))}var l=document.getElementById("dg-new-constructor");ad.bind(l,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||Md.hide()})),ad.bind(n,"click",(function(){l.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),Md.show(),l.focus(),l.select()})),ad.bind(r,"click",(function(){t.save()})),ad.bind(i,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),ad.bind(o,"click",(function(){t.revert()}))}function Hd(t){var e=void 0;function n(n){return n.preventDefault(),t.width+=e-n.clientX,t.onResize(),e=n.clientX,!1}function r(){ad.removeClass(t.__closeButton,Id.CLASS_DRAG),ad.unbind(window,"mousemove",n),ad.unbind(window,"mouseup",r)}function i(i){return i.preventDefault(),e=i.clientX,ad.addClass(t.__closeButton,Id.CLASS_DRAG),ad.bind(window,"mousemove",n),ad.bind(window,"mouseup",r),!1}t.__resize_handle=document.createElement("div"),Hh.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),ad.bind(t.__resize_handle,"mousedown",i),ad.bind(t.__closeButton,"mousedown",i),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function zd(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function jd(t,e){var n={};return Hh.each(t.__rememberedObjects,(function(r,i){var o={},s=t.__rememberedObjectIndecesToControllers[i];Hh.each(s,(function(t,n){o[n]=e?t.initialValue:t.getValue()})),n[i]=o})),n}Id.toggleHide=function(){Rd=!Rd,Hh.each(Cd,(function(t){t.domElement.style.display=Rd?"none":""}))},Id.CLASS_AUTO_PLACE="a",Id.CLASS_AUTO_PLACE_CONTAINER="ac",Id.CLASS_MAIN="main",Id.CLASS_CONTROLLER_ROW="cr",Id.CLASS_TOO_TALL="taller-than-window",Id.CLASS_CLOSED="closed",Id.CLASS_CLOSE_BUTTON="close-button",Id.CLASS_CLOSE_TOP="close-top",Id.CLASS_CLOSE_BOTTOM="close-bottom",Id.CLASS_DRAG="drag",Id.DEFAULT_WIDTH=245,Id.TEXT_CLOSED="Close Controls",Id.TEXT_OPEN="Open Controls",Id._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||Id.toggleHide()},ad.bind(window,"keydown",Id._keydownHandler,!1),Hh.extend(Id.prototype,{add:function(t,e){return Fd(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return Fd(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;Hh.defer((function(){e.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Pd.removeChild(this.domElement);var t=this;Hh.each(this.__folders,(function(e){t.removeFolder(e)})),ad.unbind(window,"keydown",Id._keydownHandler,!1),Od(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var n=new Id(e);this.__folders[t]=n;var r=Ld(this,n.domElement);return ad.addClass(r,"folder"),n},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],Od(t);var e=this;Hh.each(t.__folders,(function(e){t.removeFolder(e)})),Hh.defer((function(){e.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=ad.getOffset(t.__ul).top,n=0;Hh.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(n+=ad.getHeight(e))})),window.innerHeight-e-20<n?(ad.addClass(t.domElement,Id.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(ad.removeClass(t.domElement,Id.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&Hh.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:Hh.debounce((function(){this.onResize()}),50),remember:function(){if(Hh.isUndefined(Md)&&((Md=new Td).domElement.innerHTML=bd),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;Hh.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&Gd(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&zd(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=jd(this)),t.folders={},Hh.each(this.__folders,(function(e,n){t.folders[n]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=jd(this),Dd(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=jd(this,!0)),this.load.remembered[t]=jd(this),this.preset=t,Ud(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){Hh.each(this.__controllers,(function(e){this.getRoot().load.remembered?Nd(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),Hh.each(this.__folders,(function(t){t.revert(t)})),t||Dd(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&Sd.call(window,(function(){t(e)}));Hh.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){Hh.each(this.__controllers,(function(t){t.updateDisplay()})),Hh.each(this.__folders,(function(t){t.updateDisplay()}))}});var Vd=Id,Wd=function(){function t(t){this.runTime={fps:0,resolution:""},this.target=t.target,this.data=t.params,this.player=t.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return t.prototype.createStats=function(){var t=this;setInterval((function(){t.controller.runTimeFps.setValue(t.player.runtime.fps),t.controller.runTimeResolution.setValue(t.player.view.width+"*"+t.player.view.height)}),500)},t.prototype.createControllerGUI=function(){var t,e,n,r,i,o,s=new Vd({autoPlace:!0,closed:!0});return s.domElement.style.opacity=".6",s.domElement.style.transformOrigin="100% 0",s.domElement.style.transform="scale(1.4)",this.target.appendChild(s.domElement),s.domElement.style.position="absolute",s.domElement.style.right="0",s.domElement.style.top="0",s.domElement.style.zIndex="2",this.controller={runTimeFps:s.add({FPS:0},"FPS",0),runTimeResolution:s.add({"分辨率":""},"分辨率",""),autoFps:s.add({"自动fps":null===(t=this.data.autoFPS)||void 0===t||t},"自动fps",!0),autoResolution:s.add({"自动分辨率":null!==(e=this.data.autoResolution)&&void 0!==e&&e},"自动分辨率",!0),moreCalculation:s.add({"额外计算":0},"额外计算",0,100),minFPS:s.add({"最低fps":null!==(n=this.data.minFPS)&&void 0!==n?n:40},"最低fps",0,60),maxFPS:s.add({"最高fps":null!==(r=this.data.maxFPS)&&void 0!==r?r:50},"最高fps",0,60),resolution:s.add({"目标分辨倍率":null!==(i=this.data.resolution)&&void 0!==i?i:window.devicePixelRatio},"目标分辨倍率",.5,4),minResolution:s.add({"最小分辨倍率":null!==(o=this.data.minResolution)&&void 0!==o?o:1},"最小分辨倍率",.5,4)},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,s},t.prototype.addEventListener=function(){var t,e=this;this.controller.autoFps.onChange((function(t){e.data.autoFPS=t,e.player.updateConfig(e.data)})),this.controller.maxFPS.onChange((function(t){e.data.maxFPS=t,e.player.updateConfig(e.data)})),this.controller.minFPS.onChange((function(t){e.data.minFPS=t,e.player.updateConfig(e.data)})),this.controller.autoResolution.onChange((function(t){e.data.autoResolution=t,e.player.updateConfig(e.data)})),this.controller.minResolution.onChange((function(t){e.data.minResolution=t,e.player.updateConfig(e.data)})),this.controller.resolution.onChange((function(t){e.data.resolution=t,e.player.updateConfig(e.data)})),this.controller.moreCalculation.onChange((function(n){t&&e.player.app.ticker.remove(t),n>0&&(t=function(){for(var t="";t.length<n;)t+=Math.random().toString(32).substr(2);ju()(t)},e.player.app.ticker.add(t))}))},t}(),Xd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qd=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Yd=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};window.__slide_local_logger__||(window.__slide_local_logger__=o.createInstance({name:"_slide_local_log_",driver:o.INDEXEDDB,version:1}));var Zd=window.__slide_local_logger__,Jd=window.ResizeObserver||Ch,Kd={syncDispatch:"syncDispatch",syncReceive:"syncReceive",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange"},$d=function(t){function e(e){var n=t.call(this)||this;return n.__slideState={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,appliedInteractiveSeqIds:[],mediaState:Object.create(null)},n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new Dh,n.isLoading=!1,n.interactive=!0,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.medianController=document.createElement("div"),n.frameResizeObserver=new Jd((function(t){return n.frameResizeHandler(t)})),n.timestamp=function(){return Date.now()},n.mode="local",n.log="",n.logId="",n.lastEmitedState=null,n.persistLog=function(){return qd(n,void 0,void 0,(function(){var t,e;return Yd(this,(function(n){switch(n.label){case 0:if(!Zd||!this.logId)return[3,5];n.label=1;case 1:return n.trys.push([1,4,,5]),t=this.log,[4,Zd.getItem(this.logId)];case 2:return e=n.sent()||"",[4,Zd.setItem(this.logId,e+t)];case 3:return n.sent(),this.log="",[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},n.handleSlideStateLog=function(){console.log(n.logId),console.log(JSON.stringify(n.slideState,null,2))},n.handleLogDownload=function(){return qd(n,void 0,void 0,(function(){var t,e,n;return Yd(this,(function(r){switch(r.label){case 0:return t="",Zd?(e=t,[4,Zd.getItem(this.logId)]):[3,2];case 1:t=e+(r.sent()||""),r.label=2;case 2:return t+=this.log,(n=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",this.logId),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),[2]}}))}))},e.timestamp&&(n.timestamp=e.timestamp),n.mode=e.mode,n.anchor=e.anchor,n.resize=e.resize||!1,n.interactive=e.interactive,n.player=new Vc(n.mode),n.player.setInteractive(n.interactive),n.player.updateConfig(e.renderOptions||{}),n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center",n.frame.appendChild(n.player.view),n.setMedianControllerAttribute(),n.frame.appendChild(n.medianController),n.anchor.appendChild(n.frame),(null==e?void 0:e.controller)&&new Wd({player:n.player,params:e.renderOptions||{},target:n.frame}),n.frameResizeObserver.observe(n.frame),n.player.on(jc.renderStart,(function(t){n.isLoading=!0,n.emit(Kd.renderStart,t)})),n.player.on(jc.renderEnd,(function(t){n.isLoading=!1,n.emit(Kd.renderEnd,t)})),n.player.on(jc.slideChange,(function(t){n.__slideState.currentSlideIndex=t,n.emit(Kd.slideChange,t)})),n.player.on(jc.mainSeqStateChange,(function(t){n.__slideState.mainSeqState=t,n.emitStateChange()})),n.player.on(jc.mainSeqStepChange,(function(t){n.__slideState.mainSeqStep=t,n.emitStateChange()})),n.player.on(jc.animateStart,(function(){!0!==n.isAnimating&&(n.isAnimating=!0,n.emit(Kd.animateStart))})),n.player.on(jc.animateEnd,(function(){!1!==n.isAnimating&&(n.isAnimating=!1,n.emit(Kd.animateEnd))})),n.player.on(jc.interactiveAnimTrigger,(function(t){var e=t.action,r=t.seqId;n.__slideState.appliedInteractiveSeqIds.push(r),n.emitSyncDispatch({type:"interactiveAnim",action:e}),n.emitStateChange()})),n.player.on(jc.mainSeqStepStart,Object(u.throttle)((function(t){n.emit(Kd.mainSeqStepStart)}),100)),n.player.on(jc.mainSeqStepEnd,Object(u.throttle)((function(t){n.emit(Kd.mainSeqStepEnd)}),100)),n.player.on(jc.mediaPlay,(function(t){var e={type:"play",time:n.timestamp()-1e3*t.time};n.__slideState.mediaState[t.id]=e,n.emitSyncDispatch({type:"mediaPlay",id:t.id,state:e}),n.emitStateChange()})),n.player.on(jc.mediaPause,(function(t){var e={type:"pause",time:t.time};n.__slideState.mediaState[t.id]=e,n.emitSyncDispatch({type:"mediaPause",id:t.id,state:e}),n.emitStateChange()})),n.player.on(jc.mediaSeek,(function(t){var e={type:"pause",time:0};t.isPlaying?(e.type="play",n.__slideState.mediaState[t.id]?e.time=n.__slideState.mediaState[t.id].time-1e3*t.time:e.time=n.timestamp()-1e3*t.time,n.__slideState.mediaState[t.id]=e):(e.type="pause",e.time=t.time,n.__slideState.mediaState[t.id]=e),n.emitSyncDispatch({type:"mediaSeek",id:t.id,time:t.time,state:e}),n.emitStateChange()})),n.on(Kd.syncReceive,n.receiveSyncHandler),n.renderingTaskManager.eventHub.on("task-error",(function(t){var e=t.error,r=t.task;n.emit(Kd.renderError,{error:e,index:r.slideIndex})})),window.addEventListener("__slide_log__",n.handleLogDownload),window.addEventListener("__slide_state__",n.handleSlideStateLog),n.persistLogId=window.setInterval(n.persistLog,5e3),n}return Xd(e,t),e.prototype.setMedianControllerAttribute=function(){this.medianController.id="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},e.prototype.frameResizeHandler=function(t){var e=t[0].contentRect,n=e.width,r=e.height;this.frameWidth=n,this.frameHeight=r,this.resizeView()},e.prototype.resizeView=function(){var t=this,e=this.width,n=this.height;if(e>0&&n>0){var r=this.frameWidth/e,i=r*n;if(i>this.frameHeight&&(r*=this.frameHeight/i),this.resize){var o=this.player.app;o.ticker.addOnce((function(){var e=r*(t.player.config.resolution||window.devicePixelRatio);o.renderer.resolution=e,o.renderer.plugins.interaction.resolution=o.renderer.resolution,o.renderer.resize(t.width,t.height)}))}this.view.style.transform="scale("+r+")",this.medianController.style.transform="scale("+r+")",this.medianController.style.top=(this.frameHeight-n*r)/2+"px"}},e.prototype.receiveSyncHandler=function(t){var e=this;this.log+="=== sync receive ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n","nextStep"===t.type?this.mainSeqStep===t.next-1||this.mainSeqStep+1===this.mainSeqLength?this.doNextStep():(this.setMainSeqStep(t.next,"start"),this.player.nextTick((function(){e.doNextStep()}))):"prevStep"===t.type?0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep():(this.setMainSeqStep(t.next+1,"start"),this.player.nextTick((function(){e.doPrevStep()}))):"interactiveAnim"===t.type?this.player.applyInteractiveAction(t.action):"renderSlide"===t.type?this.doRenderSlide(t.index):"mediaPlay"===t.type?(this.player.setMediaState(t.id,!0),this.__slideState.mediaState[t.id]=t.state):"mediaPause"===t.type?(this.player.setMediaState(t.id,!1),this.__slideState.mediaState[t.id]=t.state):"mediaSeek"===t.type&&(this.player.setMediaCurrentTime(t.id,t.time),this.__slideState.mediaState[t.id]=t.state)},e.prototype.setSlideState=function(t){return qd(this,void 0,void 0,(function(){var e,n=this;return Yd(this,(function(r){switch(r.label){case 0:return this.log+="=== stateChange receive ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n",t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,this.player.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,this.player.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.doRenderSlide(t.currentSlideIndex)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,Bh((function(){return n.player.currentIndex===t.currentSlideIndex&&n.player.currentStage}),3e3)];case 3:return r.sent(),e=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(e=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(e=!0,this.__slideState.mainSeqState=t.mainSeqState),e&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),t.appliedInteractiveSeqIds&&t.appliedInteractiveSeqIds.length>0&&(this.__slideState.appliedInteractiveSeqIds=t.appliedInteractiveSeqIds,t.appliedInteractiveSeqIds.forEach((function(t){n.player.seekInteractiveSeqToEnd(t)}))),t.mediaState&&(this.initMedia(t),this.__slideState.mediaState=t.mediaState),[2]}}))}))},e.prototype.initMedia=function(t){var e=this,n=function(n){var i=t.mediaState[n],o=r.__slideState.mediaState[n];if(o&&i.type===o.type&&i.time===o.time)return"continue";"play"===i.type?r.player.setMediaState(n,!0).then((function(){var t=e.timestamp();e.player.setMediaCurrentTime(n,(t-i.time)/1e3)})):r.player.setMediaState(n,!1).then((function(){e.player.setMediaCurrentTime(n,i.time)}))},r=this;for(var i in t.mediaState)n(i)},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this.player.slideCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){return this.player.mainSeqLength()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){return this.player.mainSeqStep()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){return this.player.mainSeqState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){return this.player.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){return this.player.runtime.fps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){return this.player.fps.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.player.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.player.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.player.height},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player.updateConfig(t)},e.prototype.setResource=function(t,e){this.player.setResourceData(t,e),this.__slideState.taskId=t,this.__slideState.url=e,this.emitSyncDispatch({type:"setResource",taskId:t,url:e}),this.logId=t+"-"+Math.random().toString(32).substr(2)},e.prototype._renderSlide=function(t){return qd(this,void 0,void 0,(function(){return Yd(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,[4,this.player.renderSlide(t)];case 1:return e.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),this.emitStateChange(),[2]}}))}))},e.prototype.renderSlide=function(t){var e=Number(t);(e!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(e>this.slideCount&&this.slideCount>0||("interactive"===this.mode?this.emitSyncDispatch({type:"renderSlide",index:e}):"sync"===this.mode?(this.doRenderSlide(e),this.emitSyncDispatch({type:"renderSlide",index:e})):this.doRenderSlide(e)))},e.prototype.doRenderSlide=function(t){var e=this;this.player.clearForward(),this.renderingTaskManager.addTask((function(){return e._renderSlide(t)}),t)},e.prototype.nextStep=function(){this.isLoading||("interactive"===this.mode?this.emitSyncDispatch({type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(),this.emitSyncDispatch({type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep())},e.prototype.doNextStep=function(){this.player.nextStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()},e.prototype.prevStep=function(){this.isLoading||("interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep())},e.prototype.doPrevStep=function(){this.player.prevStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()},e.prototype.emitStateChange=function(){if("local"!==this.mode){var t=this.slideState;Object(u.isEqual)(this.lastEmitedState,t)||(this.lastEmitedState=t,this.emit(Kd.stateChange,this.slideState),this.log+="=== stateChange dispatch ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(this.slideState,null,2),this.log+="\n\n")}},e.prototype.emitSyncDispatch=function(t){this.emit(Kd.syncDispatch,t),this.log+="=== sync dispatch ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n"},e.prototype.setMainSeqStep=function(t,e){this.player.setMainSeqStep(t,e)},e.prototype.setInteractive=function(t){this.interactive=t,this.player.setInteractive(t)},e.prototype.pause=function(){this.player.pause()},e.prototype.resume=function(){this.player.resume()},e.prototype.destroy=function(){this.frameResizeObserver.disconnect(),this.player.removeAllListeners(),this.player.destroy(),this.player.removeAllListeners(),window.removeEventListener("__slide_log__",this.handleLogDownload),window.removeEventListener("__slide_state__",this.handleSlideStateLog),window.clearInterval(this.persistLogId),Zd&&Zd.removeItem(this.logId).catch((function(){}));try{this.anchor.removeChild(this.player.view)}catch(t){}},e}(a.a)}]);
282
+ */$r.registerPlugin("accessibility",Ge),$r.registerPlugin("extract",xi),$r.registerPlugin("interaction",Ke),$r.registerPlugin("particle",Wo),$r.registerPlugin("prepare",Ks),$r.registerPlugin("batch",hi),$r.registerPlugin("tilingSprite",aa),Vi.registerPlugin(Ra),Vi.registerPlugin(ro),Vi.registerPlugin(wo),Vi.registerPlugin(Uo),Vi.registerPlugin(ta),vi.registerPlugin(je),vi.registerPlugin(qi);var wu="6.0.4",Su={AlphaFilter:Ia,BlurFilter:eu,BlurFilterPass:tu,ColorMatrixFilter:ru,DisplacementFilter:ou,FXAAFilter:au,NoiseFilter:lu};class Tu{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive="true"===t}}class Eu{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class Mu{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillActive&&(this.target.fillColorFilter.color=t)}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive="true"===t}}class Au{constructor(t,e){this.hardHidden=!1,this.target=t,!0===e&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible="visible"===t)}}class Pu{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),"click"===e?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):"hover"===e&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([t,e])=>{var n,r;"click"===e?null===(n=this.proxy)||void 0===n||n.addListener("click",e=>this.handleProxyAction(e,t)):"hover"===e&&(null===(r=this.proxy)||void 0===r||r.addListener("mouseover",e=>this.handleProxyAction(e,t)))})}handleProxyAction(t,e){var n;const r=t.data.global,i=this.object.getGlobalPosition(),o=r.x-i.x+this.object.pivot.x,s=r.y-i.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,s))&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new _e(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(Wc.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if("ppaction://hlinksldjump"===t.action){const n=(null!==(e=null==t?void 0:t.target)&&void 0!==e?e:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(Wc.requestGotoSlide,Number(n[1]))}else"ppaction://hlinkshowjump?jump=nextslide"===t.action?this.ctx.eventHub.emit(Wc.requestNextSlide):"ppaction://hlinkshowjump?jump=previousslide"===t.action&&this.ctx.eventHub.emit(Wc.requestPrevSlide)}}class Ru{constructor(t,e,n){var r,i,o,s,a,u;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new pe(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Be,this.ctx=e,this.style=new Au(this.container,t.hardHidden),this.designGlobalPosition={x:n.x+(null!==(i=null===(r=t.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0),y:n.y+(null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new Pu(this.container,this.ctx),t.hlinkHover&&(null===(a=this.hyperlink)||void 0===a||a.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkClick,"click")))}updateScale(){this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y}updateTransform(t){var e,n,r,i,o,s,a,u;this.designWidth=t.width,this.designHeight=t.height,this.designX=null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,this.designY=null!==(i=null===(r=t.position)||void 0===r?void 0:r.y)&&void 0!==i?i:0;const l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;const h=null!==(s=null===(o=t.position)||void 0===o?void 0:o.x)&&void 0!==s?s:0,d=null!==(u=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const f=new xs;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d}get scale(){return this.container.scale}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return this.designWidth/this.ctx.stageWidth}get design_ppt_h(){return this.designHeight/this.ctx.stageHeight}get design_ppt_x(){return this.designX/this.ctx.stageWidth}get design_ppt_y(){return this.designY/this.ctx.stageHeight}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale()}get ppt_h(){return this.scaleExt.y*this.scaleOrigin.y*this.designHeight/this.ctx.stageHeight}set ppt_h(t){this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale()}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}}class Cu{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,n,r,i]=Ou(t);let o=0,s=0,a=0;const u=Math.max(e,n,r),l=Math.min(e,n,r),c=u-l;a=(u+l)/2,0===c?o=0:u===e?o=(n-r)/c%6*60:u===n?o=60*((r-e)/c+2):u===r&&(o=60*((e-n)/c+4)),s=0===c?0:c/(1-Math.abs(2*a-1)),this.h=o,this.s=s,this.l=a,this.a=i}interpolationFrom(t,e,n){const r=t.h+(this.h-t.h)*e,i=t.s+(this.s-t.s)*e,o=t.l+(this.l-t.l)*e,s=t.a+(this.a-t.a)*e;n.h=Math.max(Math.min(r,359),0),n.s=Math.max(Math.min(i,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(s,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:n,l:r}=this;if(e<360&&e>=0&&n<=1&&n>=0&&r<=1&&r>=0){let i,o,s;const a=(1-Math.abs(2*r-1))*n,u=a*(1-Math.abs(e/60%2-1)),l=r-a/2;[i,o,s]=e>=0&&e<60?[a,u,0]:e>=60&&e<120?[u,a,0]:e>=120&&e<180?[0,a,u]:e>=180&&e<240?[0,u,a]:e>=240&&e<300?[u,0,a]:[a,0,u],t=[i+l,o+l,s+l,this.a]}return Du(t)}}class Iu{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,n,r,i]=Ou(t);this.r=e,this.g=n,this.b=r,this.a=i}isInit(){return this._isInit}interpolationFrom(t,e,n){n.r=t.r+(this.r-t.r)*e,n.g=t.g+(this.g-t.g)*e,n.b=t.b+(this.b-t.b)*e,n.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return Du([this.r,this.g,this.b,this.a])}}function Lu(t){const e=t.substring(1);return[parseInt(e.substring(0,6),16),parseInt(e.substring(6,8),16)/255]}function Ou(t){return 0===(t=t.replace(/^#/,"")).substring(6,8).length&&(t+="FF"),[parseInt(t.substring(0,2).padStart(8,"0"),16)/255,parseInt(t.substring(2,4).padStart(8,"0"),16)/255,parseInt(t.substring(4,6).padStart(8,"0"),16)/255,parseInt(t.substring(6,8).padStart(8,"0"),16)/255]}function Du(t){return"#"+Math.round(255*t[0]).toString(16).padStart(2,"0")+Math.round(255*t[1]).toString(16).padStart(2,"0")+Math.round(255*t[2]).toString(16).padStart(2,"0")+Math.round(255*t[3]).toString(16).padStart(2,"0")}function Nu(t,e,n){const r=Ou(t),i=Ou(e),o=Math.round(255*(r[0]+(i[0]-r[0])*n)),s=Math.round(255*(r[1]+(i[1]-r[1])*n)),a=Math.round(255*(r[2]+(i[2]-r[2])*n)),u=Math.round(255*(r[3]+(i[3]-r[3])*n));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}class Fu extends Pr{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0}),this.currentColor="#FFFFFFFF"}set color(t){this.currentColor=t;const e=Ou(t);this.uniforms.color=Float32Array.from(e)}get color(){return this.currentColor}}const Bu=new Su.ColorMatrixFilter;Bu.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];const Uu=new Su.ColorMatrixFilter;Uu.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];const ku=new Su.ColorMatrixFilter;ku.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];const Gu=new Su.ColorMatrixFilter;Gu.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];const Hu={darken:Bu,darkenLess:Uu,lightenLess:Gu,lighten:ku};var zu=n(3),ju=n.n(zu);class Vu{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"arrow":case"stealth":case"triangle":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+ju()(this.path),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Wu extends Ru{constructor(t,e,n){super({position:{x:t.x,y:t.y},width:t.width,height:t.height},e,n),this.fillColorFilter=new Fu,this.fill=new Mu(this),this.json=t,this.ctx=e,this.parentGlobalPos=n,this.global={x:n.x+t.x,y:n.y+t.y},this.updateTransform({position:{x:t.x,y:t.y},width:t.width,height:t.height})}get fillActive(){var t,e;return(null!==(e=null===(t=this.container.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set fillActive(t){var e,n;t?(null!==(n=null===(e=this.container.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}get renderContainer(){return this.container}get interactiveContainer(){return this.container}getTextElement(){return null}getBgElement(){return null}get ppt_x(){return this.global.x/this.ctx.stageWidth}set ppt_x(t){const e=t*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+e+this.container.pivot.x*n}get ppt_y(){return this.global.y/this.ctx.stageHeight}set ppt_y(t){const e=t*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+e+this.container.pivot.y*n}get design_ppt_x(){return this.global.x/this.ctx.stageWidth}get design_ppt_y(){return this.global.y/this.ctx.stageHeight}}var Xu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class qu extends Wu{constructor(t,e,n,r,i){super(t,e,n),this.lineWidth=r,this.lineHeight=i}getIterateEntry(){return null}getBgElement(){return null}preRender(){const{fill:t}=this.json;this.fillBgId=this.ctx.fillTexture.addFill(t.fill,this.lineWidth,this.lineHeight),this.fillTextureId=this.ctx.fillTexture.addFill({fillType:"blipFill",src:t.key,filters:[]},t.width,t.height)}render(){return Xu(this,void 0,void 0,(function*(){const t=new Be;if(this.json.highlightColor){const e=new xs,[n,r]=Lu(this.json.highlightColor);e.beginFill(n,r),e.drawRect(0,0,this.json.width,this.json.height),e.endFill(),t.addChild(e)}if(this.fillBgId&&this.fillTextureId){const e=this.ctx.fillTexture.getTexture(this.fillBgId),n=this.ctx.fillTexture.getTexture(this.fillTextureId);if(e&&n){const r=new Ms;r.texture=n,r.scale.x=.5,r.scale.y=.5;const i=new Ms;i.texture=e,i.mask=r,t.addChild(i),t.addChild(r)}}const e=Mn.create({width:this.json.width,height:this.json.height,resolution:2});this.ctx.renderer.render(t,{renderTexture:e});const n=new Ms;n.texture=e,this.container.addChild(n),this.container.name=this.json.content,t.destroy({children:!0})}))}destroy(){this.container.destroy({children:!0,texture:!0})}}var Yu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Zu extends Wu{constructor(){super(...arguments),this.units=[]}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){for(let t=0,e=this.json.textUnits.length;t<e;t++){const e=this.json.textUnits[t];if(e.fill.fill){const t=new qu(e,this.ctx,this.global,this.json.width,this.json.height);t.preRender(),this.units.push(t)}}}render(){return Yu(this,void 0,void 0,(function*(){for(const t of this.units.reverse())yield t.render(),this.container.addChild(t.container)}))}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var Ju=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Ku extends Wu{constructor(){super(...arguments),this.iterateElements=[],this.lines=[]}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((t,e)=>t=t.concat(e.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){for(let t=0,e=this.json.lines.length;t<e;t++){const e=this.json.lines[t],n=new Zu(e,this.ctx,this.global);n.container.name="line-"+t,n.preRender(),this.lines.push(n)}}render(){return Ju(this,void 0,void 0,(function*(){for(const t of this.lines)yield t.render(),this.container.addChild(t.container)}))}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var $u=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Qu{constructor(t,e,n,r){this.iterateElements=[],this.paragraphs=[],this.container=new Be,this.json=t,this.ctx=e,this.parentGlobalPos=r,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y;const i=new xs;i.drawRect(0,0,t.width,t.height),this.container.addChild(i)}updateScale(t){this.container.scale.x=t.x,this.container.scale.y=t.y}getTextElement(t,e){return"paragraph"===t?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}preRender(){for(let t=0,e=this.json.paragraphs.length;t<e;t++){const e=this.json.paragraphs[t],n=new Ku(e,this.ctx,this.global);n.preRender(),this.iterateElements=this.iterateElements.concat(n.getIterateElements()),n.container.name="段落-"+t,this.paragraphs.push(n)}}render(){return $u(this,void 0,void 0,(function*(){for(const t of this.paragraphs)yield t.render(),this.container.addChild(t.container);const{width:t}=this.container;this.container.scale.x<0&&(this.container.x+=-1*t)}))}}var tl=n(19),el=n.n(tl),nl=n(20),rl=n.n(nl);const il={Reflection:class extends Pr{constructor(t){super(el.a,rl.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uBlur:0}),this.json=t}}};var ol=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const sl={pivot:{x:0,y:0},width:0,height:0};class al extends Ru{constructor(t,e,n){var r,i,o,s;if(super(t,e,n),this.renderContainer=new Be,this.bgTextureId="",this.bgSprite=new Ms,this.backgroundMaskTextureId="",this.filterAreaJustifies=[],this.backgroundMask=new Ms,this.pathStrokeTextureId="",this.pathSprite=new Ms,this.pathMask=new Ms,this.pathMaskTextureId="",this.fillColorFilter=new Fu,this.strokeColorFilter=new Fu,this.id="",this.arrowList=[],this.fill=new Mu(this),this.stroke=new Tu(this),this.updateFilterArea=()=>{const t=this.renderContainer.getBounds(!1),e=this.filterAreaJustifies.map(e=>e(t)),n=e.map(t=>t.width),r=e.map(t=>t.height),i=new pe(t.x,t.y,Math.max(...n),Math.max(...r));this.renderContainer.filterArea=i,this.renderContainer.filters.forEach(t=>{t.uniforms.uShapeFilterArea=new Float32Array(4),t.uniforms.uShapeFilterArea[0]=i.x,t.uniforms.uShapeFilterArea[1]=i.y,t.uniforms.uShapeFilterArea[2]=i.width,t.uniforms.uShapeFilterArea[3]=i.height})},this.json=t,this.id=t.id,this.container.name=t.id,this.renderContainer.name=t.id+"-render-container",this.fillStyle=t.fillStyle,this.lineStyle=t.lineStyle,this.geometry=t.geometry,this.ctx.timingTargets.addTarget(this.id,this),"solidFill"===(null===(r=this.fillStyle)||void 0===r?void 0:r.fillType)&&(this.fillColorFilter.currentColor=this.fillStyle.color),"solidFill"===(null===(o=null===(i=this.lineStyle)||void 0===i?void 0:i.fill)||void 0===o?void 0:o.fillType)&&(this.strokeColorFilter.currentColor=this.lineStyle.fill.color),this.pathSprite.name="path-fill",this.pathMask.name="path-mask",this.bgSprite.name="bg-fill",this.backgroundMask.name="bg-mask",this.updateTransform(this.json),t.textBody){this.text=new Qu(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y});const e={x:1,y:1};(null===(s=this.json.scale)||void 0===s?void 0:s.x)&&this.json.scale.x<0&&(e.x=-1),this.text.updateScale(e)}}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e;return(null!==(e=null===(t=this.pathSprite.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set strokeActive(t){var e,n;t?(null!==(n=null===(e=this.pathSprite.filters)||void 0===e?void 0:e.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0&&(this.pathSprite.filters=[this.strokeColorFilter]):this.pathSprite.filters=[]}get fillActive(){var t,e;return(null!==(e=null===(t=this.bgSprite.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set fillActive(t){var e,n;t?(null!==(n=null===(e=this.bgSprite.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.bgSprite.filters=[this.fillColorFilter]):this.bgSprite.filters=[]}getTextElement(t,e){var n,r;return null!==(r=null===(n=this.text)||void 0===n?void 0:n.getTextElement(t,e))&&void 0!==r?r:null}getBgElement(){return this}getIterateEntry(t,e,n){return"el"===t||0===e?this:this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}createBackgroundMask(){return ol(this,void 0,void 0,(function*(){const t=this.ctx.graphicsTexture.getGraphicsData(this.backgroundMaskTextureId);t&&(this.backgroundMask.texture=t.texture,this.backgroundMask.pivot.x=t.pivot.x,this.backgroundMask.pivot.y=t.pivot.y)}))}createBackground(){var t,e,n,r,i,o,s;const{pivot:a,width:u,height:l}=(null===(t=this.geometry)||void 0===t?void 0:t.fillTransform)||sl;if("gifFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)){const t=this.ctx.fillTexture.getGifFrames(this.fillStyle.src);this.bgSprite=new bu(t,!0),this.bgSprite.play();const e=this.fillStyle.fps/60;let n=1;const r=this.fillStyle.loop;this.bgSprite.animationSpeed=e,this.bgSprite.onLoop=()=>{n+=1,r>0&&n>r&&this.bgSprite.gotoAndStop(t.length-1)},this.bgSprite.height=l||this.designHeight,this.bgSprite.width=u||this.designWidth,this.bgSprite.mask=this.backgroundMask,this.bgSprite.x=a.x,this.bgSprite.y=a.y,this.container.addChild(this.backgroundMask),this.container.addChild(this.bgSprite)}else if("groupFill"===(null===(n=this.fillStyle)||void 0===n?void 0:n.fillType)){if(this.groupFillTextureId){const t=this.ctx.fillTexture.getTexture(this.groupFillTextureId);t&&(this.bgSprite.texture=t,this.bgSprite.mask=this.backgroundMask,this.bgSprite.x=-1*(null!==(i=null===(r=this.json.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0),this.bgSprite.y=-1*(null!==(s=null===(o=this.json.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0),this.container.addChild(this.bgSprite),this.container.addChild(this.backgroundMask))}}else{const t=this.ctx.fillTexture.getTexture(this.bgTextureId);t&&(this.bgSprite.texture=t,this.bgSprite.mask=this.backgroundMask,this.container.addChild(this.backgroundMask),this.container.addChild(this.bgSprite),this.bgSprite.height=l||this.designHeight,this.bgSprite.width=u||this.designWidth,this.bgSprite.x=a.x,this.bgSprite.y=a.y)}}createPathFill(){const t=this.ctx.fillTexture.getTexture(this.pathStrokeTextureId);t&&(this.pathSprite.texture=t,this.pathSprite.pivot.x=this.pathMask.pivot.x,this.pathSprite.pivot.y=this.pathMask.pivot.y,this.pathMask.pivot.x=0,this.pathMask.pivot.y=0,this.pathSprite.mask=this.pathMask,this.pathSprite.addChild(this.pathMask),this.container.addChild(this.pathSprite))}createPathMask(){return ol(this,void 0,void 0,(function*(){const t=this.ctx.graphicsTexture.getGraphicsData(this.pathMaskTextureId);if(t){const{texture:e,pivot:n}=t;this.pathMask.texture=e,this.pathMask.pivot.x=n.x,this.pathMask.pivot.y=n.y,this.pathMask.texture=e}}))}createFilledPathMask(){var t,e;return ol(this,void 0,void 0,(function*(){const n=(null===(e=null===(t=this.geometry)||void 0===t?void 0:t.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of n){const e=this.ctx.graphicsTexture.getGraphicsData(t.id);if(e){const n=new Ms(e.texture);n.pivot.x=e.pivot.x,n.pivot.y=e.pivot.y;const r=new Ms(this.bgSprite.texture);r.pivot.x=this.bgSprite.pivot.x,r.pivot.y=this.bgSprite.pivot.y,r.mask=n,r.filters=[Hu[t.fill]],this.container.addChild(r),this.container.addChild(n)}}}))}createBackgroundTexture(){var t,e,n,r,i;if(this.fillStyle&&"gifFill"!==this.fillStyle.fillType&&"groupFill"!==this.fillStyle.fillType){const o=(null===(t=this.geometry)||void 0===t?void 0:t.fillTransform)||sl,s=(null==o?void 0:o.width)||this.designWidth,a=(null==o?void 0:o.height)||this.designHeight;this.bgTextureId=this.ctx.fillTexture.addFill(this.fillStyle,s+(null!==(n=null===(e=this.lineStyle)||void 0===e?void 0:e.width)&&void 0!==n?n:0),a+(null!==(i=null===(r=this.lineStyle)||void 0===r?void 0:r.width)&&void 0!==i?i:0))}}createPathFillTexture(){var t,e;if((null===(t=this.lineStyle)||void 0===t?void 0:t.fill)&&"gifFill"!==this.lineStyle.fill.fillType&&"groupFill"!==this.lineStyle.fill.fillType){const{width:t,height:n}=(null===(e=this.geometry)||void 0===e?void 0:e.lineTransform)||sl,r=Object(u.isNumber)(this.lineStyle.width)?this.lineStyle.width:1;this.pathStrokeTextureId=this.ctx.fillTexture.addFill(this.lineStyle.fill,(t||this.designWidth)+r,(n||this.designHeight)+r)}}createArrowFillTexture(){var t;null===(t=this.json.lineArrowList)||void 0===t||t.forEach(t=>{var e,n,r,i;const o=new Vu(Object.assign(Object.assign({},t),{fillStyle:null===(e=this.lineStyle)||void 0===e?void 0:e.fill,lineWidth:null!==(r=null===(n=this.lineStyle)||void 0===n?void 0:n.width)&&void 0!==r?r:0}));o.graphicsId=this.ctx.graphicsTexture.addGraphics(null!==(i=o.paths)&&void 0!==i?i:[],o.hash,o.pivot||{x:0,y:0},o.width,o.height,void 0,!0),o.textureId=this.ctx.fillTexture.addFill(o.fillStyle,o.width,o.height),this.arrowList.push(o)})}createArrow(){this.arrowList.forEach(t=>{const e=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId),n=this.ctx.fillTexture.getTexture(t.textureId);if(e&&n){const{texture:r,pivot:i}=e,o=new Ms(r);o.pivot.x=i.x,o.pivot.y=i.y;const s=new Ms(n);s.addChild(o),s.mask=o,s.position.x=t.position.x,s.position.y=t.position.y,s.pivot.x=t.pivot.x,s.pivot.y=t.pivot.y,s.width=t.width,s.height=t.height,s.rotation=t.rotate/180*Math.PI,t.sprite=s,this.container.addChild(s)}})}preRender(){var t,e,n,r,i,o,s,a,u,l;this.createBackgroundTexture(),this.createPathFillTexture(),this.createArrowFillTexture();const{width:c,height:h,pivot:d}=(null===(t=this.geometry)||void 0===t?void 0:t.lineTransform)||sl,f=c||this.designWidth,p=h||this.designHeight;(null===(e=this.geometry)||void 0===e?void 0:e.paths)&&this.geometry.paths.length>0&&(this.pathMaskTextureId=this.ctx.graphicsTexture.addGraphics(null!==(r=null===(n=this.geometry)||void 0===n?void 0:n.paths)&&void 0!==r?r:[],this.geometry.hash,d||{x:0,y:0},f,p,this.lineStyle,!1),this.backgroundMaskTextureId=this.ctx.graphicsTexture.addGraphics(null!==(o=null===(i=this.geometry)||void 0===i?void 0:i.paths)&&void 0!==o?o:[],this.geometry.hash,d||{x:0,y:0},f,p,this.lineStyle,!0));const m=(null===(a=null===(s=this.geometry)||void 0===s?void 0:s.paths)||void 0===a?void 0:a.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of m)this.ctx.graphicsTexture.addGraphics([t],t.hash,((null===(u=this.geometry)||void 0===u?void 0:u.lineTransform)||sl).pivot,f,p,this.lineStyle,!0,t.id);null===(l=this.text)||void 0===l||l.preRender()}subClassRender(){return ol(this,void 0,void 0,(function*(){}))}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(t=>{"reflection"===t.type&&(this.filterAreaJustifies.push(t=>(t.height*=2,t)),e.push(new il.Reflection(t)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(){var t,e,n,r,i,o;return ol(this,void 0,void 0,(function*(){yield this.createBackgroundMask(),yield this.createBackground(),yield this.subClassRender(),yield this.createFilledPathMask(),yield this.createPathMask(),yield this.createPathFill(),yield this.createArrow(),this.text&&(yield this.text.render()),"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(e=this.json.textBody)||void 0===e?void 0:e.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(this.text.container.position.x=null!==(r=null===(n=this.json.position)||void 0===n?void 0:n.x)&&void 0!==r?r:0,this.text.container.position.y=null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0,this.renderContainer.addChild(this.text.container))):(this.text&&this.container.addChild(this.text.container),this.renderContainer.addChild(this.container)),this.json.cacheAsBitMap&&(this.renderContainer.cacheAsBitmap=!0)}))}destroy(){this.bgSprite.destroy(),this.backgroundMask.destroy(),this.pathSprite.destroy(),this.pathMask.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.arrowList.forEach(t=>{var e;null===(e=t.sprite)||void 0===e||e.destroy()})}}var ul=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};function ll(t,e){for(const n in e)t.style[n]=e[n]}class cl{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=t=>{t.stopPropagation();const e=t.offsetX/this.progress.clientWidth*this.duration;this.jumpToTime(e),this.ctx.eventHub.emit(Wc.mediaSeek,{id:this.targetId,time:this.media.currentTime,isPlaying:this.media.isPlaying})},this.jumpToTime=(t=0)=>{const e=Math.floor(t)+this.start;this.media.currentTime!==e&&(this.media.currentTime=e,(this.media.paused||this.media.ended)&&setTimeout(()=>{this.media.play().then(()=>this.media.pause())}))},this.showController=t=>{t.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.end?this.start?this.duration=this.duration-this.end-this.start:this.duration-=this.end:this.start&&(this.duration-=this.start)),this.totalTime.innerText=cl.formatTime(this.duration)},this.playMedia=()=>ul(this,void 0,void 0,(function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.playCallBackList.forEach(t=>{t()})})),this.pauseMedia=()=>ul(this,void 0,void 0,(function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()})),this.onMouseOut=t=>{t.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>ul(this,void 0,void 0,(function*(){const t=this.media.currentTime-this.start;(t>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.jumpToTime()),this.currentTime.innerText=cl.formatTime(t),this.currentProgress.style.flex=(t/this.duration).toString()})),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(t=>{t()})},this.playMediaFromCtrl=()=>{this.ctx.eventHub.emit(Wc.mediaPlay,{id:this.targetId,time:this.media.currentTime}),this.playMedia()},this.pauseMediaFromCtrl=()=>{this.ctx.eventHub.emit(Wc.mediaPause,{id:this.targetId,time:this.media.currentTime}),this.pauseMedia()},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.position=t.position,this.media=t.media,this.info=t.info,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(e=this.info.cut.start)&&void 0!==e?e:0,this.end=null!==(n=this.info.cut.end)&&void 0!==n?n:0)}getMedianContainer(){let t=document.getElementById("median-container");t||(t=document.createElement("div"),t.id="median-container",this.canvasElement.parentElement.appendChild(t)),this.container=t}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),r=String(n<0?0:n).padStart(2,"0"),i=Math.floor(t%60);e=`${r}:${String(i<0?0:i).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};ll(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");ll(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),ll(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=document.createElement("img");ll(n,{height:"20px"}),n.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(n)}createTimer(){const t=document.createElement("div");ll(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){ll(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");ll(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),ll(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}createMediaController(){const{position:t}=this,{stageWidth:e,stageHeight:n}=this.ctx;t.y=t.y+this.height-50,t.x=Math.max(t.x,0),t.x=Math.min(t.x,e-300),t.y=Math.max(t.y,0),t.y=Math.min(t.y,n-50),ll(this.mediaController,{height:"50px",borderRadius:"25px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:t.x+"px",top:t.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc"}),this.createButton();const r=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,r,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",()=>this.playMedia(),!1),this.pauseButton.removeEventListener("click",()=>this.pauseMedia(),!1),this.media.removeListener("durationchange",this.getMediaDuration,!1),this.media.removeListener("timeupdate",this.mediaTimeUpdate,!1),this.media.removeListener("pause",this.onPauseMedia,!1),this.media.removeListener("play",this.onPlayMedia,!1)}show(){this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],null===(t=this.container)||void 0===t||t.removeChild(this.mediaController)}}var hl=n(9),dl=n.n(hl),fl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};function pl(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}function ml(t){return new Promise(e=>{setTimeout(e,t)})}function gl(t){const e=[],n=t.filter(t=>{const n=t.width<2048&&t.height<2048;return n||e.push(t),n}).sort((t,e)=>t.width*t.height-e.width*e.height);let r=n.length+1,i=2050,o=2050;const s=[];let a=null;for(;(i>2048||o>2048)&&n.length>0;)r-=1,a=dl()(n.slice(0,r)),i=a.width,o=a.height;return a&&s.push(a),e.forEach(t=>{const e=dl()([t]);s.push(e)}),r<n.length?s.concat(gl(n.slice(r))):s}var vl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class _l extends a.a{constructor(t){var e,n;super(),this.type="video",this.sprite=new Ms,this.isPlaying=!1,this.id=t.id,this.video=t.video,this.start=null===(e=t.video.cut)||void 0===e?void 0:e.start,this.end=null===(n=t.video.cut)||void 0===n?void 0:n.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this,this.videoResource=new mn(this.video.src,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});const{video:r,width:i,height:o,position:s}=t;this.controller=new cl({targetId:t.id,ctx:t.ctx,width:i,height:o,position:s,media:this,info:r,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=i,this.sprite.height=o,setTimeout(()=>{this.sprite.visible=!0},50)});const a=new an(null,{height:o,width:i});a.resource=this.videoResource,this.videoResource.bind(a),this.sprite=new Ms,this.sprite.visible=!1,this.sprite.texture=new Tn(a),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",t=>{t.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",t=>{t.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.videoResource.source.addEventListener(t,()=>{"timeupdate"!==t||this.isPlaying||this.pause(),this.emit(t)})})}get currentTime(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.currentTime)&&void 0!==e?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.paused)||void 0===e||e}get ended(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.ended)||void 0===e||e}get duration(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.duration)&&void 0!==e?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return vl(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.load(),yield function(t,e){return fl(this,void 0,void 0,(function*(){const n=Date.now();for(;!t()&&Date.now()-n<e;)yield ml(50)}))}(()=>{const t=this.videoResource.source;return!!(t&&t.videoWidth>0)},3e3);const e=this.videoResource.source;e&&e.videoWidth<=0||(yield null===(t=this.videoResource.source)||void 0===t?void 0:t.play())}))}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,null===(t=this.videoResource.source)||void 0===t||t.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(t=this.videoResource)||void 0===t||t.destroy(),this.controller.destroy()}}var yl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class xl extends a.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.id=t.id,this.audio=t.audio,this.container=t.container,this.container=t.container,this.audioEl=document.createElement("audio"),this.audioEl.src=this.audio.src,t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:e,height:n,position:r}=t;this.controller=new cl({targetId:t.id,ctx:t.ctx,height:n,width:e,position:r,media:this,info:this.audio,canvasElement:t.canvasElement}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.audioEl.addEventListener(t,()=>{this.emit(t)})})}get currentTime(){return this.audioEl.currentTime}set currentTime(t){this.audioEl.currentTime=t}get paused(){return this.audioEl.paused}get ended(){return this.audioEl.ended}get duration(){return this.audioEl.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return yl(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.audioEl.play()}))}pause(){this.isPlaying=!1,this.audioEl.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}destroy(){this.audioEl.pause(),this.controller.destroy()}}var bl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class wl extends al{constructor(t,e,n){super(Object.assign(Object.assign({},t),{type:"Shape"}),e,n),this.picTextureId="",this.picSprite=new Ms,this.picMask=new Ms,this.cmd=new Eu(this),this.picFill=t.picFill,this.media=null==t?void 0:t.media}applyCommand(t,e){var n,r,i,o,s;if("call"===e)if(/playFrom\(([0-9.]+)\)/.test(t)){const e=t.match(/playFrom\(([0-9.]+)\)/),r=Number(e[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.play().then(()=>{var t;null===(t=this.mediaPlayer)||void 0===t||t.seek(r)})}else"custom-pause"===t?null===(r=this.mediaPlayer)||void 0===r||r.pause():"togglePause"===t?null===(i=this.mediaPlayer)||void 0===i||i.togglePause():"stop"===t&&(null===(o=this.mediaPlayer)||void 0===o||o.pause(),null===(s=this.mediaPlayer)||void 0===s||s.seek(0))}renderPic(){var t,e,n;return bl(this,void 0,void 0,(function*(){const r=this.ctx.fillTexture.getTexture(this.picTextureId);r&&(this.picSprite.texture=r),this.picMask.texture=this.backgroundMask.texture,this.picSprite.mask=this.picMask,this.picSprite.width=this.designWidth,this.picSprite.height=this.designHeight,this.container.addChild(this.picSprite),this.container.addChild(this.picMask),"video"===(null===(t=this.media)||void 0===t?void 0:t.type)?(this.mediaPlayer=new _l({id:this.json.id+"-video",ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,position:this.picSprite.getGlobalPosition(),container:this.container,canvasElement:this.ctx.view}),(null===(e=this.mediaPlayer)||void 0===e?void 0:e.sprite)&&(this.mediaPlayer.sprite.mask=this.picMask)):"audio"===(null===(n=this.media)||void 0===n?void 0:n.type)&&(this.mediaPlayer=new xl({id:this.json.id+"-audio",ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,position:this.picSprite.getGlobalPosition(),container:this.container,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.picSprite.interactive=!0,this.picSprite.on("mouseover",()=>{this.mediaPlayer.showController()}),this.picSprite.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}))}preRender(){if(super.preRender(),"gifFill"!==this.picFill.fillType)this.picTextureId=this.ctx.fillTexture.addFill(this.picFill,this.designWidth,this.designHeight);else{let t=1;const e=this.ctx.fillTexture.getGifFrames(this.picFill.src);this.picSprite=new bu(e,!0),this.picSprite.play();const n=this.picFill.fps/60,r=this.picFill.loop;this.picSprite.animationSpeed=n,this.picSprite.onLoop=()=>{t+=1,r>0&&t>r&&this.picSprite.gotoAndStop(e.length-1)}}}subClassRender(){return bl(this,void 0,void 0,(function*(){yield this.renderPic()}))}destroy(){this.mediaPlayer&&(this.picSprite.interactive=!1,this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picSprite.destroy(),this.picMask.destroy()}}var Sl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Tl extends Ru{constructor(t,e,n){var r,i,o,s;super(t,e,n),this.children=[],this.cacheSprite=new Ms,this.json=t,this.container.name=t.id,this.ctx.timingTargets.addTarget(t.id,this);const a={x:null!==(i=null===(r=t.position)||void 0===r?void 0:r.x)&&void 0!==i?i:0,y:null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0};t.children.forEach(t=>{let e=null;"Shape"===(null==t?void 0:t.type)?e=new al(t,this.ctx,a):"Picture"===(null==t?void 0:t.type)?e=new wl(t,this.ctx,a):"Container"===(null==t?void 0:t.type)&&(e=new Tl(t,this.ctx,a)),e&&this.children.push(e)}),this.updateTransform(this.json)}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(){if(this.json.fillStyle)if("groupFill"===this.json.fillStyle.fillType)this.fillTextureId=this.groupFillTextureId;else{const{fillStyle:t,width:e,height:n}=this.json;this.fillTextureId=this.ctx.fillTexture.addFill(t,e,n)}for(const t of this.children)t.groupFillTextureId=this.fillTextureId,t.preRender()}getBgElement(){return null}getIterateEntry(){return null}getTextElement(){return null}render(){var t;return Sl(this,void 0,void 0,(function*(){const e=new Be;for(const n of this.children)yield n.render(),n.renderContainer&&e.addChild(n.renderContainer),(n.json.hlinkHover||n.json.hlinkClick)&&(null===(t=n.hyperlink)||void 0===t||t.addProxy(this.container));if(this.container.addChild(e),this.json.cacheAsTexture){const t=e.getBounds(),n=Math.min(t.x,this.designX,t.x+t.width,this.designX+this.designWidth),r=Math.max(t.x,this.designX,t.x+t.width,this.designX+this.designWidth),i=Math.min(t.y,this.designY,t.y+t.height,this.designY+this.designHeight),o=r-n,s=Math.max(t.y,this.designY,t.y+t.height,this.designY+this.designHeight)-i,a=this.designX-t.x,u=this.designY-t.y,l=Mn.create({width:o,height:s});e.position.x=a,e.position.y=u,this.ctx.renderer.render(e,{renderTexture:l}),this.cacheSprite.texture=l,this.cacheSprite.position.x=-a,this.cacheSprite.position.y=-u,this.container.addChild(this.cacheSprite),e.position.x=0,e.position.y=0,e.visible=!1}}))}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy()}}class El extends a.a{constructor(t,e,n,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=t=>{if(t)if(t.delay&&t.delay>0){const e=this.setTimeout(()=>{t.event&&(this.cond[t.event]=!0,this.detectTrigger())},t.delay);this.timeoutIds.push(e)}else this.cond[t.event]=!0,this.detectTrigger();else this.detectTrigger()},this.id=t,this.ctx=r,this.eventHubs=n,e.forEach(t=>{this.addCond(t)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=()=>this.condHandle(t);t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}setTimeout(t,e){let n=0;const r=i=>{const o=i/(vt.TARGET_FPMS||.06);n+=o,n>=e&&(t(),this.ctx.ticker.remove(r))};return this.ctx.ticker.add(r,void 0,-9),()=>{this.ctx.ticker.remove(r)}}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>"self"!==t).every(t=>!!this.cond[t])}detectTrigger(){if(Object.keys(this.cond).every(t=>!!this.cond[t])){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1});const t=this.triggerParams;this.triggerParams=void 0,this.emit("active",t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>t())}}class Ml extends a.a{constructor(t){super(),this.runtimeNodeEventHub=new a.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=()=>{var t,e,n,r,i,o;this.hasPrev()||!this.isMainSeq?"idle"===this.currentSeqState?(this.decrSeqIndex(),null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.seekToStart(),null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"running"===this.currentSeqState?(null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"end"===this.currentSeqState&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToStart(),null===(o=this.commonTimeNode.children[this.currentSeqIndex])||void 0===o||o.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide")},this.handleNext=()=>{var t,e,n,r;this.hasNext()||!this.isMainSeq?"idle"===this.currentSeqState?null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.startTimeNodeForce():"running"===this.currentSeqState?(null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce()):"end"===this.currentSeqState&&(this.incrSeqIndex(),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide")};const{json:e,iterateType:n,isIterate:r,isSub:i,parent:o,ctx:s,eventHub:u,iterateIndex:l,iterateId:c}=t;this.isMainSeq="mainSeq"===e.ctn.nodeType,this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=s,this.globalEventHub=u,this.commonTimeNode=new Kl({json:e.ctn,isSub:i,eventHubs:{global:u,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:c}),this.bindShapeEvent(),this.nextConds=new El("mainSeq",e.nextCondLst,{global:u,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new El("mainSeq",e.preCondLst,{global:u,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(Wc.mainSeqStepStart,e)}),this.commonTimeNode.on("childTimeNodeEnd",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="end",this.autoPlay&&setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(Wc.mainSeqStepEnd,e)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.commonTimeNode.resetForRepeat(),setTimeout(()=>{this.currentSeqState="idle",this.currentSeqIndex=0})}),this.nextConds.on("active",this.handleNext),this.prevConds.on("active",this.handlePrev)}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq&&this.ctx.eventHub.emit(Wc.mainSeqStepChange,t)}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq&&this.ctx.eventHub.emit(Wc.mainSeqStateChange,t)}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}bindShapeEvent(){"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const t=this.ctx.timingTargets.getTargetById(e);t&&(t.interactiveContainer.interactive=!0,t.interactiveContainer.cursor="pointer",t.interactiveContainer.on("pointerdown",()=>{const t=`shape ${e} onClick`;"interactive"!==this.ctx.mode&&"sync"!==this.ctx.mode||this.ctx.eventHub.emit(Wc.interactiveAnimTrigger,{action:t,seqId:this.json.ctn.id}),"sync"!==this.ctx.mode&&"local"!==this.ctx.mode||this.globalEventHub.emit(t)}))}}})}setCurrentStep(t,e){let n=t;this.commonTimeNode.seekToStart();const{length:r}=this.commonTimeNode.children;if(-1===n&&(n=r-1),n>=0&&n<r)for(let t=0;t<=n;t++){const r=this.commonTimeNode.children[t];t!==n?r.commonTimeNode.seekToEnd(!1,!0):"start"===e?r.commonTimeNode.seekToStart():"end"===e&&r.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=n,this.currentSeqState="start"===e?"idle":"end"}}function Al(t,e,n){const r=e.split(".");r.reduce((i,o,s)=>{if(i)return s!==r.length-1?i[o]:void(i[o]=n);console.warn(`${t} not support ${e}`)},t)}function Pl(t,e){if(!e)return null;return e.split(".").reduce((n,r)=>{if(n)return n[r];console.warn(`${t} not support ${e}`)},t)}const Rl=new class{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,n){const r=`${e}_${t}`;this.runningTimeNodes[r]&&this.runningTimeNodes[r].dispose(!0),this.runningTimeNodes[r]=n}};class Cl{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new a.a,this.onTimeLineStart=()=>{if(this.isConflict){const{target:t}=this.json.cBhvr;if("next"===this.activeWhenConflict){let e=t.id;"shape"===t.type&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),Rl.addRunningTimeNode(e,this.modifyAttrKey,this.commonTimeNode)}else"prev"===this.activeWhenConflict&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:r,ctx:i,parent:o,eventHub:s,iterateType:u,iterateIndex:l,iterateId:c}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=i,this.globalEventHub=s,this.commonTimeNode=new Kl({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:s,runtime:this.runtimeNodeEventHub},ctx:i,parent:o,isIterate:e,iterateType:u,iterateIndex:l,iterateId:c}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:u,index:l,id:c}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.onTimeLineStart)}}class Il extends Cl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=Pl(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const t=this.json.cBhvr.attrList[0];null!==this.startVal&&this.timingTarget&&Al(this.timingTarget,t,this.startVal)},this.onSeekToEnd=()=>{const t=this.json.cBhvr.attrList[0],e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&Al(this.timingTarget,t,e)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:t,delta:e})=>{if(e/t>=1){const t=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&Al(this.timingTarget,t,e)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}class Ll{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:t=>t/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:t=>t/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replaceAll("#ppt_h",`(${this.timingTarget.design_ppt_h})`);return e=e.replaceAll("#ppt_w",`(${this.timingTarget.design_ppt_w})`),e=e.replaceAll("#ppt_x",`(${this.timingTarget.design_ppt_x})`),e=e.replaceAll("#ppt_y",`(${this.timingTarget.design_ppt_y})`),e=e.replaceAll("ppt_w","vars.ppt_w"),e=e.replaceAll("ppt_h","vars.ppt_h"),e=e.replaceAll("ppt_x","vars.ppt_x"),e=e.replaceAll("ppt_y","vars.ppt_y"),e=e.replaceAll("#","vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(t=>{const n=new RegExp(`([^a-z])${t}([^a-z])`,"g");e=e.replace(n,(e,n,r)=>`${n}math.${t}${r}`)}),new Function("vars","math","$","return "+e)}}class Ol extends Ll{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const r=t.resolveValue(n),i=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(n,this.math,i):i}}class Dl extends Ll{constructor(t,e){var n;super(t,e),this.value=null===(n=t.val)||void 0===n?void 0:n.value}interpolationFrom(t,e,n){let r=t.resolveValue(n);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}class Nl extends Ll{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const r=t.resolveValue(n),i=r+(this.resolveValue(n)-r)*e;return t.fmla?t.fmla(n,this.math,i):i}}class Fl extends Ll{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return Nu(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}class Bl extends Cl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=Pl(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var t,e,n,r;(null===(t=this.timingTarget)||void 0===t?void 0:t.ppt_h)&&(this.vars.ppt_h=this.timingTarget.ppt_h),(null===(e=this.timingTarget)||void 0===e?void 0:e.ppt_w)&&(this.vars.ppt_w=this.timingTarget.ppt_w),(null===(n=this.timingTarget)||void 0===n?void 0:n.ppt_x)&&(this.vars.ppt_x=this.timingTarget.ppt_x),(null===(r=this.timingTarget)||void 0===r?void 0:r.ppt_y)&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,r=this.keyFrames.findIndex(t=>n<=t[0]),{attrList:i}=this.json.cBhvr;if(r<0){const t=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&i&&i[0]&&Al(this.timingTarget,i[0],t[1].resolveValue(this.vars)))}const o=r-1,s=this.keyFrames[r],a=this.keyFrames[o]||s,u=s[0]-a[0]==0?1:(n-a[0])/(s[0]-a[0]),l=s[1].interpolationFrom(a[1],u,this.vars);this.timingTarget&&i&&i[0]&&Al(this.timingTarget,i[0],l)},this.onSeekToStart=()=>{null!==this.startVal&&this.timingTarget&&Al(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){const t={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===e&&this.timingTarget){const e=new Nl(t,this.timingTarget);this.keyFrames.push([t.time,e])}}const t={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===e&&this.timingTarget){const e=new Nl(t,this.timingTarget);this.keyFrames.push([t.time,e])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===e&&this.timingTarget){const t=new Nl(n,this.timingTarget);this.keyFrames.push([n.time,t])}const r={time:1,val:{type:"string",value:((null===(t=n.val)||void 0===t?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if("num"===e&&this.timingTarget){const t=new Nl(r,this.timingTarget);this.keyFrames.push([r.time,t])}}if(this.json.tavLst.length>0)for(const t of this.json.tavLst)if(t.val&&this.timingTarget){let n=null;"string"===t.val.type?"num"===e?n=new Nl(t,this.timingTarget):"str"===e&&(n=new Dl(t,this.timingTarget)):"number"===t.val.type?n=new Ol(t,this.timingTarget):"color"===t.val.type?(this.isColorAnim=!0,n=new Fl(t,this.timingTarget)):"boolean"===t.val.type&&console.warn("not implements"),n&&this.keyFrames.push([t.time,n])}}}class Ul extends Pr{constructor(t){super("\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord(vec2 aVertexPosition)\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n vTransition = transition;\n vDirection = direction;\n vPercent = percent;\n vVertexPosition = aVertexPosition;\n vec2 localVertexPosition = aVertexPosition;\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord(localVertexPosition);\n}\n","\n// 纹理坐标\nvarying vec2 vTextureCoord;\n// 顶点坐标\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 outputColor;\n\n float percent = vPercent;\n float direction = vDirection;\n \n if (vTransition < 0.0) {\n percent = 1.0 - percent;\n if (vDirection > 1.5 && vDirection < 2.5) {\n direction = 1.0;\n } else if (vDirection > 0.5 && vDirection < 1.5) {\n direction = 2.0;\n } else if (vDirection > 2.5 && vDirection < 3.5) {\n direction = 4.0;\n } else {\n direction = 3.0;\n }\n }\n\n if (direction > 1.5 && direction < 2.5) { // 从下至上显示\n if (vVertexPosition.y >= 1.0 - percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.y >= 1.0 - percent && vVertexPosition.y <= 1.0 - percent + 0.2 ) {\n outputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n }\n } else if (direction > 0.5 && direction < 1.5) { // 从上至下显示\n if (vVertexPosition.y <= percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.y <= percent && vVertexPosition.y >= percent - 0.2) {\n outputColor = outputColor * (1.0 - (vVertexPosition.y - (percent - 0.2)) / 0.2);\n }\n } else if (direction > 2.5 && direction < 3.5) { // 从左到右\n if (vVertexPosition.x <= percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.x <= percent && vVertexPosition.x >= percent - 0.2) {\n outputColor = outputColor * (1.0 - (vVertexPosition.x - (percent - 0.2)) / 0.2);\n }\n } else {\n if (vVertexPosition.x >= 1.0 - percent) {\n outputColor = texture2D(uSampler, vTextureCoord);\n } else {\n outputColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n if (vVertexPosition.x >= 1.0 - percent && vVertexPosition.x <= 1.0 - percent + 0.2) {\n outputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n }\n }\n\n gl_FragColor = outputColor;\n}\n",{percent:0,direction:1,transition:t})}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}class kl extends Pr{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color1 = texture2D(uSampler, vTextureCoord);\n if (color1.a != 0.0 && percent < 1.0) {\n float alpha = percent;\n gl_FragColor = color1 * alpha;\n return;\n }\n gl_FragColor = color1;\n}\n",{percent:0})}set percent(t){this.uniforms.percent=t}}class Gl extends Cl{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;this.filter&&(this.filter.percent=n),n>=1&&this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;"out"===t.json.transition?n=-1:"in"===t.json.transition&&(n=1);const r=null===(e=t.json.filter)||void 0===e?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const t=r[1],e=r[3];if("wipe"===t){const r=new Ul(n);"up"===e?r.direction=1:"down"===e?r.direction=2:"left"===e?r.direction=3:"right"===e&&(r.direction=4),this.filter=r,this.filterType=`${t}-${e}`}else if("fade"===t){const e=new kl;this.filter=e,this.filterType=""+t}}}get modifyAttrKey(){return this.filterType}}var Hl=n(5);class zl extends Cl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:e})=>{var n;const r=e/t,i=null===(n=this.path)||void 0===n?void 0:n.getPoint(r);this.timingTarget&&i&&(this.timingTarget.ppt_x=i.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=i.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{var t;const e=null===(t=this.path)||void 0===t?void 0:t.getPoint(0);this.timingTarget&&e&&(this.timingTarget.ppt_x=e.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=e.y+this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t;const e=null===(t=this.path)||void 0===t?void 0:t.getPoint(1);this.timingTarget&&e&&(this.timingTarget.ppt_x=e.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=e.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Hl.Path,n=null===(t=this.json.path)||void 0===t?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const t of n){const[n,...r]=t.trim().replace(/\s+/g," ").split(" ");if("M"===n){const[t,n]=r.map(t=>Number(t));e.moveTo(t,n)}else if("L"===n){const[t,n]=r.map(t=>Number(t));e.lineTo(t,n)}else if("C"===n){const[t,n,i,o,s,a]=r.map(t=>Number(t));e.bezierCurveTo(t,n,i,o,s,a)}else if("Z"===n)e.closePath();else if("E"===n)console.warn("not implements");else if("c"===n){const[t,n,i,o,s,a]=r.map(t=>Number(t)),u=e.currentPoint;e.bezierCurveTo(t+u.x,n+u.y,i+u.x,o+u.y,s+u.x,a+u.y)}else if("l"===n){const t=e.currentPoint,[n,i]=r.map(t=>Number(t));e.lineTo(n+t.x,i+t.y)}else if("m"===n){const t=e.currentPoint,[n,i]=r.map(t=>Number(t));e.moveTo(n+t.x,i+t.y)}}this.path=e}}class jl extends Cl{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,r={x:1,y:1};if(this.from&&this.to)r.x=this.from.x+(this.to.x-this.from.x)*n,r.y=this.from.y+(this.to.y-this.from.y)*n;else if(this.by){const t={x:this.by.x,y:this.by.y};r.x=1+(t.x-1)*n,r.y=1+(t.y-1)*n}this.timingTarget&&(this.timingTarget.scale=r)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class Vl extends Cl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to),t.isReverse||this.updateCurrentValue();const[e]=this.json.cBhvr.attrList[0].split(".");Al(this.timingTarget,e+".on","true")},this.onTimeNodeEnd=()=>{if("remove"===this.json.cBhvr.ctn.fill){const[t]=this.json.cBhvr.attrList[0].split(".");Al(this.timingTarget,t+".on","false")}},this.onSeekToStart=()=>{if(this.timingTarget){const[t]=this.json.cBhvr.attrList[0].split(".");Al(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=Pl(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:e})=>{const n=t/e;this.to.interpolationFrom(this.from,n,this.target),this.timingTarget&&Al(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1})},"rgb"===this.json.clrSpc?(this.from=new Iu(this.json.from),this.to=new Iu(this.json.to),this.by=new Iu(this.json.by),this.target=new Iu):(this.from=new Cu(this.json.from),this.to=new Cu(this.json.to),this.by=new Cu(this.json.by),this.target=new Cu),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=Pl(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class Wl extends Cl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;let r=0,i=0;if(void 0!==this.from&&void 0!==this.to){r=this.from,i=this.to;const t=r+(i-r)*n;this.timingTarget&&(this.timingTarget.r=t)}else if(void 0!==this.by){this.lastVal||(this.lastVal=0);const t=this.by*n-this.lastVal;this.lastVal=this.by*n,this.timingTarget&&(this.timingTarget.r+=t)}},this.onTimeNodeStart=()=>{var t;Object(u.isNumber)(null===(t=this.timingTarget)||void 0===t?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&null!==this.startVal&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=null===(t=this.timingTarget)||void 0===t?void 0:t.r}}class Xl extends Cl{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,e;const{cmd:n,cmdType:r}=this.json;!this.isApplied&&n&&r&&(this.isApplied=!0,null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand(n,r))},this.onSeekToStart=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){var t,e,n,r;return(null!==(e=null===(t=this.json)||void 0===t?void 0:t.cmd)&&void 0!==e?e:"")+(null!==(r=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==r?r:"")}}var ql=n(21);class Yl{constructor(t){Yl.useRtc||(this.howl=new ql.Howl({src:[t]}))}play(){var t;null===(t=this.howl)||void 0===t||t.play()}pause(){var t;null===(t=this.howl)||void 0===t||t.pause()}stop(){var t;null===(t=this.howl)||void 0===t||t.stop()}}Yl.useRtc=!1;class Zl{constructor(t){this.runtimeNodeEventHub=new a.a,this.stopAudio=()=>{this.audio.stop()};const{json:e,isIterate:n,isSub:r,eventHub:i,ctx:o,parent:s,iterateType:u,iterateIndex:l,iterateId:c}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Kl({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:i,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:n,iterateType:u,iterateIndex:l,iterateId:c}),this.audio=new Yl(e.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.stopAudio)}}var Jl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Kl extends a.a{constructor(t){super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId=null,this.iterateShadows=[],this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.timeDelta=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.dispose())},this.handleActive=(t=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if("never"===this.json.restart)return;"whenNotActive"!==this.json.restart&&"always"!==this.json.restart||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(t))}else this.startTimeLine(t)},this.updateTimeLine=t=>{const e=t/(vt.TARGET_FPMS||.06);this.timeDelta+=e,this.duration-this.timeDelta<=e&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(t=!1)=>{(this.isTimeNodeEnd()||t)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:e,isIterate:n,ctx:r,eventHubs:i,parent:o,json:s,iterateType:a,iterateId:u,iterateIndex:l}=t;this.isSub=e,this.isIterate=n,this.parentTimeNode=o,this.json=s,this.ctx=r,this.iterateIndex=l,this.eventHubs=i,this.iterateType=a,this.iterateId=u;const c=Number(this.json.dur),h=this.json.spd||1;this.isNegativeSpeed=h<0,Number.isNaN(c)||(this.duration=c/Math.abs(h)),this.uuid+="--"+this.json.id,this.setPreStyle(),s.childTnLst&&this.createChildren(s.childTnLst),this.startConds=new El(this.json.id||"",s.stCondLst,i,this.ctx),this.endConds=new El(this.json.id||"",s.endCondLst,i,this.ctx),s.endSync&&(this.endSync=new El(this.json.id||"",[s.endSync],i,this.ctx),this.endSync.on("active",()=>{var t;"interactiveSeq"===this.json.nodeType&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),null===(t=this.endSync)||void 0===t||t.reset())})),this.startConds.on("active",t=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(t))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(t=>t.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&"nextClick"===this.json.masterRel&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&!1===this.isIterate&&this.createIterateShadow()}createIterateShadow(){const t=pl();let e=!0,n=0;const r=n=>{n===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const e=JSON.parse(JSON.stringify(this.json)),r=new Kl({json:e,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:e.iterate.type,iterateIndex:n,iterateId:t});this.iterateShadows[n]=r,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return"seq"===t.type?n=new Ml(r):"par"===t.type?n=new $l(r):"set"===t.type?n=new Il(r):"anim"===t.type?n=new Bl(r):"animEffect"===t.type?n=new Gl(r):"animMotion"===t.type?n=new zl(r):"animScale"===t.type?n=new jl(r):"animClr"===t.type?n=new Vl(r):"animRot"===t.type?n=new Wl(r):"cmd"===t.type?n=new Xl(r):"audio"===t.type&&(n=new Zl(r)),n}createSubList(t){this.subList=[],t.forEach(t=>{const e=this.createTimeNode(t,!0);e&&this.subList.push(e)})}createChildren(t){t.forEach(t=>{const e=this.createTimeNode(t,!1);e&&(e.commonTimeNode.on("timeNodeStart",t=>{this.emit("childTimeNodeStart",t)}),e.commonTimeNode.on("timeNodeEnd",t=>{this.emit("childTimeNodeEnd",t),this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())}),this.children.push(e))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(Wc.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Wc.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(Wc.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}setTimeout(t,e){let n=0;const r=i=>{const o=i/(vt.TARGET_FPMS||.06);n+=o,n>=e&&(t(),this.ctx.ticker.remove(r))};return this.ctx.ticker.add(r),()=>{this.ctx.ticker.remove(r)}}tickerDelay(t){return new Promise(e=>{this.setTimeout(()=>{e()},t)})}startIterate(){return Jl(this,void 0,void 0,(function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)return;t.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.tickerDelay(this.json.iterate.interval)}this.onTimeLineEnd()}}))}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}setPreStyle(){if(!this.json.presetClass)return;const t=[],e=n=>{n.forEach(n=>{var r,i,o;n.cBhvr&&n.cBhvr.target&&t.findIndex(t=>t.id===n.cBhvr.target.id)<0&&t.push(n.cBhvr.target),(null===(i=null===(r=null==n?void 0:n.cBhvr)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&e(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&e(n.ctn.childTnLst)})};e(this.json.childTnLst||[]),t.forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),n=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset&&("entr"===this.json.presetClass?(t.hasPreset=!0,t.style.visibility="hidden"):"exit"===this.json.presetClass&&(t.hasPreset=!0,t.style.visibility="visible"))}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(t=>/^self/.test(t.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(t=>/^self/.test(t.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isActive=!1,this.dispose(),this.timeDelta=0,this.isNegativeSpeed,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let t=this.subList.length-1;t>=0;t--){const e=this.subList[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}}dispose(t=!1){this.isConflictDispose=t,window.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(Wc.animateEnd),this.ctx.ticker.remove(this.updateTimeLine),this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToEnd(n,e));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(t=>t.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(t=>t.commonTimeNode.seekToEnd(!1)))}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||(!(!this.isIterateEnd||!this.json.iterate)||t)}emitEndEvents(){this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy())}}class $l extends a.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new a.a;const{json:e,iterateType:n,isIterate:r,isSub:i,parent:o,ctx:s,eventHub:u,iterateIndex:l,iterateId:c}=t;this.id=e.ctn.id,this.json=e,this.ctx=s,this.isIterate=r,this.globalEventHub=u,this.commonTimeNode=new Kl({json:e.ctn,isSub:i,eventHubs:{global:u,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:c}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),t.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}class Ql{constructor(t,e,n){this.json=t,this.ctx=n;const r=t.timeNodeList.find(t=>"par"===t.type&&"tmRoot"===t.ctn.nodeType);r&&(this.tmRoot=new $l({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(t=>{var e,n,r;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"mainSeq"===(null===(r=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)}))}findSeq(t){var e;return null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.find(e=>{var n,r,i;return"seq"===(null===(n=e.json)||void 0===n?void 0:n.type)&&(null===(i=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.id)===t})}start(){var t;this.json.autoPlayMainSeq?setTimeout(()=>{var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()}):null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;-1===t&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(t,e)}destroy(){var t;null===(t=this.tmRoot)||void 0===t||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}}var tc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class ec extends Tl{constructor(t,e,n){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n),this.globalEventHub=new a.a,this.json=t,this.container.visible=!1,this.ctx=e,this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(Wc.requestPrevSlide)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(Wc.requestNextSlide)});const r=new xs;r.drawRect(0,0,t.width,t.height),this.container.addChild(r)}get interactiveContainer(){return this.container}render(){const t=Object.create(null,{render:{get:()=>super.render}});return tc(this,void 0,void 0,(function*(){yield t.render.call(this),this.ctx.eventHub.emit("StageRenderEnd")}))}createTiming(){this.json.timing&&(this.timing=new Ql(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var t;null===(t=this.timing)||void 0===t||t.start()}setMainSeqApplied(){var t;null===(t=this.timing)||void 0===t||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;null===(t=this.timing)||void 0===t||t.collectMainSeqStartValue()}hasTiming(){return!!this.timing}destroy(){var t;super.destroy(),this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),this.ctx.fillTexture.destroy(),this.globalEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy()}mainSeqStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqStep())&&void 0!==e?e:0}mainSeqLength(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqLength())&&void 0!==e?e:0}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?this.globalEventHub.emit("shape slide onNext"):this.ctx.eventHub.emit(Wc.requestNextSlide)}prevStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?this.globalEventHub.emit("shape slide onPrev"):this.ctx.eventHub.emit(Wc.requestPrevSlide)}applyInteractiveAction(t){this.globalEventHub.emit(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.timing)||void 0===e||e.seekInteractiveSeqToEnd(t)}setMediaState(t,e){return tc(this,void 0,void 0,(function*(){const n=this.ctx.medias[t];n&&(e?yield n.play():yield n.pause())}))}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}const nc=134217729;function rc(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,d=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++d]);let f=0;if(h<t&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++d]),o=s,0!==a&&(i[f++]=a);h<t&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++d]),o=s,0!==a&&(i[f++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[f++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++d],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function ic(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function oc(t){return new Float64Array(t)}const sc=oc(4),ac=oc(8),uc=oc(12),lc=oc(16),cc=oc(4);function hc(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a;if(0===s||0===a||s>0!=a>0)return u;const l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){let a,u,l,c,h,d,f,p,m,g,v,_,y,x,b,w,S,T;const E=t-i,M=n-i,A=e-o,P=r-o;x=E*P,d=nc*E,f=d-(d-E),p=E-f,d=nc*P,m=d-(d-P),g=P-m,b=p*g-(x-f*m-p*m-f*g),w=A*M,d=nc*A,f=d-(d-A),p=A-f,d=nc*M,m=d-(d-M),g=M-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,sc[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,sc[1]=y-(v+h)+(h-w),T=_+v,h=T-_,sc[2]=_-(T-h)+(v-h),sc[3]=T;let R=ic(4,sc),C=22204460492503146e-32*s;if(R>=C||-R>=C)return R;if(h=t-E,a=t-(E+h)+(h-i),h=n-M,l=n-(M+h)+(h-i),h=e-A,u=e-(A+h)+(h-o),h=r-P,c=r-(P+h)+(h-o),0===a&&0===u&&0===l&&0===c)return R;if(C=11093356479670487e-47*s+33306690738754706e-32*Math.abs(R),R+=E*c+P*a-(A*l+M*u),R>=C||-R>=C)return R;x=a*P,d=nc*a,f=d-(d-a),p=a-f,d=nc*P,m=d-(d-P),g=P-m,b=p*g-(x-f*m-p*m-f*g),w=u*M,d=nc*u,f=d-(d-u),p=u-f,d=nc*M,m=d-(d-M),g=M-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,cc[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,cc[1]=y-(v+h)+(h-w),T=_+v,h=T-_,cc[2]=_-(T-h)+(v-h),cc[3]=T;const I=rc(4,sc,4,cc,ac);x=E*c,d=nc*E,f=d-(d-E),p=E-f,d=nc*c,m=d-(d-c),g=c-m,b=p*g-(x-f*m-p*m-f*g),w=A*l,d=nc*A,f=d-(d-A),p=A-f,d=nc*l,m=d-(d-l),g=l-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,cc[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,cc[1]=y-(v+h)+(h-w),T=_+v,h=T-_,cc[2]=_-(T-h)+(v-h),cc[3]=T;const L=rc(I,ac,4,cc,uc);x=a*c,d=nc*a,f=d-(d-a),p=a-f,d=nc*c,m=d-(d-c),g=c-m,b=p*g-(x-f*m-p*m-f*g),w=u*l,d=nc*u,f=d-(d-u),p=u-f,d=nc*l,m=d-(d-l),g=l-m,S=p*g-(w-f*m-p*m-f*g),v=b-S,h=b-v,cc[0]=b-(v+h)+(h-S),_=x+v,h=_-x,y=x-(_-h)+(v-h),v=y-w,h=y-v,cc[1]=y-(v+h)+(h-w),T=_+v,h=T-_,cc[2]=_-(T-h)+(v-h),cc[3]=T;const O=rc(L,uc,4,cc,lc);return lc[O-1]}(t,e,n,r,i,o,l)}oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(8),oc(8),oc(8),oc(4),oc(8),oc(8),oc(8),oc(12);oc(192),oc(192);oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(8),oc(8),oc(8),oc(8),oc(8),oc(8),oc(8),oc(8),oc(8),oc(4),oc(4),oc(4),oc(8),oc(16),oc(16),oc(16),oc(32),oc(32),oc(48),oc(64);oc(1152),oc(1152);oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(4),oc(24),oc(24),oc(24),oc(24),oc(24),oc(24),oc(24),oc(24),oc(24),oc(24),oc(1152),oc(1152),oc(1152),oc(1152),oc(1152),oc(2304),oc(2304),oc(3456),oc(5760),oc(8),oc(8),oc(8),oc(16),oc(24),oc(48),oc(48),oc(96),oc(192),oc(384),oc(384),oc(384),oc(768);oc(96),oc(96),oc(96),oc(1152);const dc=Math.pow(2,-52),fc=new Uint32Array(512);class pc{static from(t,e=xc,n=bc){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new pc(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[2*e],r=t[2*e+1];n<s&&(s=n),r<a&&(a=r),n>u&&(u=n),r>l&&(l=r),this._ids[e]=e}const c=(s+u)/2,h=(a+l)/2;let d,f,p,m=1/0;for(let e=0;e<o;e++){const n=mc(c,h,t[2*e],t[2*e+1]);n<m&&(d=e,m=n)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=mc(g,v,t[2*e],t[2*e+1]);n<m&&n>0&&(f=e,m=n)}let _=t[2*f],y=t[2*f+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===f)continue;const n=vc(g,v,_,y,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let b=t[2*p],w=t[2*p+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];_c(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(hc(g,v,_,y,b,w)<0){const t=f,e=_,n=y;f=p,_=b,y=w,p=t,b=e,w=n}const S=function(t,e,n,r,i,o){const s=n-t,a=r-e,u=i-t,l=o-e,c=s*s+a*a,h=u*u+l*l,d=.5/(s*l-a*u);return{x:t+(l*c-a*h)*d,y:e+(s*h-u*c)*d}}(g,v,_,y,b,w);this._cx=S.x,this._cy=S.y;for(let e=0;e<o;e++)this._dists[e]=mc(t[2*e],t[2*e+1],S.x,S.y);_c(this._ids,this._dists,0,o-1),this._hullStart=d;let T=3;n[d]=e[p]=f,n[f]=e[d]=p,n[p]=e[f]=d,r[d]=0,r[f]=1,r[p]=2,i.fill(-1),i[this._hashKey(g,v)]=d,i[this._hashKey(_,y)]=f,i[this._hashKey(b,w)]=p,this.trianglesLen=0,this._addTriangle(d,f,p,-1,-1,-1);for(let o,s,a=0;a<this._ids.length;a++){const u=this._ids[a],l=t[2*u],c=t[2*u+1];if(a>0&&Math.abs(l-o)<=dc&&Math.abs(c-s)<=dc)continue;if(o=l,s=c,u===d||u===f||u===p)continue;let h=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(h=i[(e+t)%this._hashSize],-1===h||h===n[h]);t++);h=e[h];let m,g=h;for(;m=n[g],hc(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===h){g=-1;break}if(-1===g)continue;let v=this._addTriangle(g,u,n[g],-1,-1,r[g]);r[u]=this._legalize(v+2),r[g]=v,T++;let _=n[g];for(;m=n[_],hc(l,c,t[2*_],t[2*_+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(_,u,m,r[u],-1,r[_]),r[u]=this._legalize(v+2),n[_]=_,T--,_=m;if(g===h)for(;m=e[g],hc(l,c,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,u,g,-1,r[g],r[m]),this._legalize(v+2),r[m]=v,n[g]=g,T--,g=m;this._hullStart=e[u]=g,n[g]=e[_]=u,n[u]=_,i[this._hashKey(l,c)]=u,i[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(T);for(let t=0,e=this._hullStart;t<T;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===i)break;t=fc[--i];continue}const u=s-s%3,l=a+(t+1)%3,c=u+(s+2)%3,h=e[o],d=e[t],f=e[l],p=e[c];if(gc(r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*p],r[2*p+1])){e[t]=p,e[s]=h;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(s,n[o]),this._link(o,c);const a=u+(s+1)%3;i<fc.length&&(fc[i++]=a)}else{if(0===i)break;t=fc[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=e,this._triangles[s+2]=n,this._link(s,r),this._link(s+1,i),this._link(s+2,o),this.trianglesLen+=3,s}}function mc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function gc(t,e,n,r,i,o,s,a){const u=t-s,l=e-a,c=n-s,h=r-a,d=i-s,f=o-a,p=c*c+h*h,m=d*d+f*f;return u*(h*m-p*f)-l*(c*m-p*d)+(u*u+l*l)*(c*f-h*d)<0}function vc(t,e,n,r,i,o){const s=n-t,a=r-e,u=i-t,l=o-e,c=s*s+a*a,h=u*u+l*l,d=.5/(s*l-a*u),f=(l*c-a*h)*d,p=(s*h-u*c)*d;return f*f+p*p}function _c(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let s=i-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=r}else{let i=n+1,o=r;yc(t,n+r>>1,i),e[t[n]]>e[t[r]]&&yc(t,n,r),e[t[i]]>e[t[r]]&&yc(t,i,r),e[t[n]]>e[t[i]]&&yc(t,n,i);const s=t[i],a=e[s];for(;;){do{i++}while(e[t[i]]<a);do{o--}while(e[t[o]]>a);if(o<i)break;yc(t,i,o)}t[n+1]=t[o],t[o]=s,r-i+1>=o-n?(_c(t,e,i,r),_c(t,e,n,o-1)):(_c(t,e,n,o-1),_c(t,e,i,r))}}function yc(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function xc(t){return t[0]}function bc(t){return t[1]}function wc(t,e,n=5){return Math.abs(t-e)<=Math.pow(10,-n)}class Sc{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const n=new Sc;return n.point=t,n.slope=e,n}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return wc(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=Sc.fromPointSlope(t,e),r=this.crossPoint(n);return r?Math.ceil(Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))):0}crossPoint(t){if(wc(t.slope,this.slope))return null;let e=0,n=0;const r=Math.tan(t.slope),i=Math.tan(this.slope),{x:o,y:s}=this.point,{x:a,y:u}=t.point;return wc(this.slope,Math.PI/2)?(e=this.point.x,n=r*(e-a)+u):wc(t.slope,Math.PI/2)?(e=t.point.x,n=i*(e-o)+s):wc(this.slope,Math.PI)||wc(this.slope,0)?(n=this.point.y,e=(n-u)/r+a):wc(t.slope,Math.PI)||wc(t.slope,0)?(n=t.point.y,e=(n-s)/i+o):(e=(r*a-u+s-i*o)/(r-i),n=i*(e-o)+s),{x:e,y:n}}}function Tc(t,e,n){return"solidFill"===t.fillType?function(t,e,n){const r=new xs,[i,o]=Lu(t.color);return r.beginFill(i,o),r.drawRect(0,0,e,n),r.endFill(),r}(t,e,n):"gradientFill"===t.fillType?function(t,e,n){let r=null;const i=new Be;if(t.stopList.sort((t,e)=>t.pos-e.pos),!t.stopList.find(t=>0===t.pos)){const e=t.stopList[0];t.stopList.unshift({pos:0,color:e.color})}if(!t.stopList.find(t=>1===t.pos)){const e=t.stopList[t.stopList.length-1];t.stopList.push({pos:1,color:e.color})}const o=t=>{const e=[];for(let n=0,r=t.length;n<r-1;n++){const r=t[n],i=t[n+1],o=r.pos+.5*(i.pos-r.pos),s=Nu(r.color,i.color,.5),a=2*n;e[a]=r,e[a+1]={color:s,pos:o},e[a+2]=i}return e};t.stopList=o(t.stopList),t.stopList=o(t.stopList),t.line?r=function(t,e,n){const r=e/2,i=n/2,o={x:-r,y:i},s={x:-r,y:-i},a={x:r,y:i},u={x:r,y:-i},l=Sc.fromPointSlope({x:-r,y:0},Math.PI/2),c=Sc.fromPointSlope({x:0,y:i},0),h=Sc.fromPointSlope({x:r,y:0},Math.PI/2),d=Sc.fromPointSlope({x:0,y:-i},0),f=[o,s,a,u],p=[l,c,h,d],m=[],g=t.stopList.slice(1,t.stopList.length-1).map(o=>{var s,a;const u=2*Math.PI;let l=null!==(a=null===(s=t.line)||void 0===s?void 0:s.ang)&&void 0!==a?a:0;for(;l>u;)l-=u;for(;l<0;)l+=u;const c={x:0,y:0};wc(l,Math.PI/2)?(c.x=0,c.y=n/2-o.pos*n):wc(l,0)?(c.x=o.pos*e-e/2,c.y=0):(c.x=o.pos*e-e/2,c.y=n/2-o.pos*n),l>Math.PI/2&&l<=Math.PI&&(c.x*=-1),l>Math.PI&&l<=2*Math.PI&&(c.y*=-1);const h=Sc.fromPointSlope(c,Math.PI/2-t.line.ang),d=p.map(t=>h.crossPoint(t)).filter(t=>t&&t.x<=r&&t.x>=-r&&t.y<=i&&t.y>=-i).map(t=>({point:t,color:o.color})).sort((t,e)=>e.point.y-t.point.y);m.push(...d);let f=Math.abs(d[1].point.x-d[0].point.x)/10;for(let t=20;t--;){const e=t%2==0?1:-1,n=c.x+e*f,s=h.resolveY(n);n<=r&&n>=-r&&s<=i&&s>=-i&&m.push({point:{x:n,y:s},color:o.color}),f+=f}return h});let v=[],_=[];t:for(let e=0;e<f.length;e++){const n=f[e];for(let e=0;e<g.length-1;e++){const r=g[e],i=g[e+1],o=r.distanceToLinearEquation(i),s=r.distanceToPoint(n),a=i.distanceToPoint(n);if(s<o&&a<o){const r=t.stopList.slice(1,t.stopList.length-1)[e],i=t.stopList.slice(1,t.stopList.length-1)[e+1],a=Nu(r.color,i.color,s/o);m.splice(e+1,0,{point:n,color:a});continue t}}const r=g[0],i=g[g.length-1],o=r.distanceToPoint(n),s=i.distanceToPoint(n);o<=s?v.push({point:n,dis:o}):_.push({point:n,dis:s})}v=v.sort((t,e)=>e.dis-t.dis);const y=v.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[0].color};{const n=t.stopList[0].color,r=t.stopList[1].color;return{point:e.point,color:Nu(n,r,1-(0===v[0].dis?1:e.dis/v[0].dis))}}}).sort((t,e)=>e.point.y-t.point.y);_=_.sort((t,e)=>e.dis-t.dis);const x=_.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[t.stopList.length-1].color};{const n=t.stopList[t.stopList.length-2].color,r=t.stopList[t.stopList.length-1].color;return{point:e.point,color:Nu(n,r,0===_[0].dis?0:e.dis/_[0].dis)}}}).sort((t,e)=>e.point.y-t.point.y),b=y.concat(...m).concat(x);for(let t=0;t<b.length;t++)b[t].point.x+=r,b[t].point.y=-b[t].point.y+i;return{points:b,position:{x:0,y:0}}}(t,e,n):t.path&&(r=function(t,e,n){var r;const i=[],o={x:0,y:0};if("circle"===(null===(r=t.path)||void 0===r?void 0:r.path)){const r=e/2,s=n/2,a=Math.sqrt(r*r+s*s);t.stopList.forEach(t=>{if(0===t.pos)i.push({point:{x:0,y:0},color:t.color});else{const e=a*t.pos,n=new Hl.Path;n.absellipse(0,0,e,e,0,2*Math.PI,!1,0),n.getPoints(50).forEach(e=>{i.push({point:{x:e.x,y:e.y},color:t.color})})}o.x=r,o.y=s})}return{points:i,position:o}}(t,e,n));if(r){const t=[],o=[],{position:s,points:a}=r,u=pc.from(a,t=>t.point.x,t=>t.point.y);for(let e=0;e<u.triangles.length;e+=3)t.push(a[u.triangles[e]].point.x,a[u.triangles[e]].point.y),t.push(a[u.triangles[e+1]].point.x,a[u.triangles[e+1]].point.y),t.push(a[u.triangles[e+2]].point.x,a[u.triangles[e+2]].point.y),o.push(...Ou(a[u.triangles[e]].color)),o.push(...Ou(a[u.triangles[e+1]].color)),o.push(...Ou(a[u.triangles[e+2]].color));const l=new Fn;l.addAttribute("aVertexPosition",t,2),l.addAttribute("aColor",o,4);const c=Mr.from("\n precision mediump float;\n attribute vec2 aVertexPosition;\n attribute vec4 aColor;\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n varying vec4 vColor;\n void main() {\n vColor = aColor;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n }","precision mediump float; \n varying vec4 vColor;\n void main() {\n float alpha = vColor.a;\n vec4 color = vColor;\n color.a = 1.0;\n gl_FragColor = color * alpha;\n }\n "),h=new xs;h.drawRect(0,0,e+1,n+1),i.mask=h,i.addChild(h);const d=new fa(l,c);d.position.x=s.x,d.position.y=s.y,i.addChild(d)}return i}(t,e,n):null}const Ec="\nvec3 rgb2hsl(vec3 rgb) {\n float cMax = max(max(rgb.r, rgb.g), rgb.b);\n float cMin = min(min(rgb.r, rgb.g), rgb.b);\n float delta = cMax - cMin;\n \n float h = 0.0;\n if (delta == 0.0) {\n h = 0.0;\n } else if (cMax == rgb.r) {\n h = 60.0 * mod(((rgb.g - rgb.b) / delta), 6.0);\n } else if (cMax == rgb.g ) {\n h = 60.0 * ((rgb.b - rgb.r) / delta + 2.0);\n } else if (cMax == rgb.b) {\n h = 60.0 * ((rgb.r - rgb.g) / delta + 4.0);\n }\n \n float l = (cMax + cMin) / 2.0;\n \n float s = 0.0;\n if (delta == 0.0) {\n s = 0.0;\n } else {\n s = delta / (1.0 - abs(2.0 * l - 1.0));\n }\n \n return vec3(h, s, l);\n}\n",Mc=[Ec],Ac={biLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec3 hsl = rgb2hsl(texColor.rgb);\n mat3 rgb2yuv = mat3(\n 0.2126, 0.7152, 0.0722,\n -0.09991, -0.33609, 0.43600,\n 0.615, -0.5586, -0.05639\n );\n vec3 yuv = texColor.rgb * rgb2yuv;\n if (yuv.x >= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0);\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n"};class Pc extends Pr{constructor(t,e){var n;super(void 0,(n=Ac[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n${Mc.map(t=>t+"\n").join("\n")}\n\n${n}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n`),{arg:e})}}const Rc=[Ec],Cc={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n"};class Ic extends Pr{constructor(t,e,n){var r;super(void 0,(r=Cc[t],`\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n${Rc.map(t=>t+"\n").join("\n")}\n\n${r}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:Float32Array.from(e),arg2:Float32Array.from(n)})}}class Lc{constructor(t,e){this.renderContainers=[],this.renderTextures=[],this.textures=Object.create(null),this.fillStyles=[],this.renderer=t,this.spriteTextures=e}addTexture(t,e){this.textures[t]=e}render(t){const{items:e,width:n,height:r}=t,i=new Be;e.forEach(t=>{if(t.item.blipFillObject)t.item.blipFillObject.position.x+=t.x+2,t.item.blipFillObject.position.y+=t.y+2,i.addChild(t.item.blipFillObject);else{const e=Tc(t.item.fill,t.width-4,t.height-4);if(e)e.position.x+=t.x+2,e.position.y+=t.y+2,i.addChild(e);else{const e=new xs;e.drawRect(0,0,t.width-4,t.height-4),i.addChild(e)}}if(t.item.name){const e=new Bs(t.item.name,{fontFamily:"Arial",fontSize:12,fill:16715792,align:"center"});e.position.x=t.x+2,e.position.y=t.y+2,i.addChild(e)}});const o=new xs;o.drawRect(0,0,Math.ceil(n),Math.ceil(r)),i.addChild(o);const s=Mn.create({width:n,height:r});this.renderTextures.push(s),this.renderContainers.push(i),this.renderer.render(i,{renderTexture:s}),e.forEach(t=>{this.textures[t.item.id]=new Tn(s.baseTexture,new pe(t.x+2,t.y+2,t.width-4,t.height-4))})}getTexture(t){return this.textures[t]||this.spriteTextures.getTexture(t)||null}getGifFrames(t){return this.spriteTextures.getGifFrames(t)}addFill(t,e,n,r){const i=JSON.stringify(t)+e+n,o=ju()(i);if(this.textures[o])return o;if(this.fillStyles.findIndex(t=>t.id===o)>=0)return o;if("blipFill"!==t.fillType)this.fillStyles.push({fill:t,width:e,height:n,id:o,name:r});else{const e=this.spriteTextures.getTexture(t.src);if(e){const n=new Ms;n.texture=e,t.filters.length>0&&(n.filters=function(t){const e=[];return t.forEach(t=>{if("biLevel"===t.type)e.push(new Pc("biLevel",t.args[0]));else if("clrChange"===t.type){const n=Ou(t.args[0]),r=Ou(t.args[1]);e.push(new Ic("clrChange",n,r))}else"alphaModFix"===t.type&&e.push(new Pc(t.type,t.args[0]))}),e}(t.filters)),this.fillStyles.push({fill:t,width:e.width,height:e.height,id:o,blipFillObject:n})}}return o}pack(){const t=this.fillStyles.filter(t=>!(!t.fill.fillType||"noFill"===t.fill.fillType||0===t.width||0===t.height)||(this.textures[t.id]=null,!1));t.forEach(t=>{t.width+=4,t.height+=4});const e=gl(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];this.render(n)}}destroy(){this.textures=Object.create(null),this.fillStyles=[],this.renderTextures.forEach(t=>t.destroy(!0)),this.renderContainers.forEach(t=>t.destroy({children:!0})),this.spriteTextures.destroy()}}function Oc(t,e,n){let r,i,o=e,s=n;0===o&&(o=s/1e4),0===s&&(s=o/1e4);const a=t%360;if(a%180==0)r=Math.cos(a*(Math.PI/180))*o,i=0;else if(a%90==0)r=0,i=-Math.sin(a*(Math.PI/180))*s;else{const t=Math.tan(a*Math.PI/180);r=o*s/Math.sqrt(Math.pow(s,2)+Math.pow(o*t,2)),(a>90&&a<270||a<-90&&a>-270)&&(r=-r),i=-t*r}return{x:r,y:i}}function Dc(t,e,n,r,i,o,s){const a={x:0,y:0},u=-o,l=Oc((i=-i)/Math.PI*180,n,r),c=t.x-l.x,h=t.y-l.y;for(let t=0;t<51;t++){const o=Oc((i+t/50*u)/Math.PI*180,n,r);o.x+=c,o.y+=h,t/50==1&&(a.x=o.x,a.y=o.y),o.x=o.x/9525*e.x,o.y=o.y/9525*e.y,s.lineTo(o.x,o.y)}return a}class Nc{constructor(t){this.renderContainers=[],this.renderTextures=[],this.idTidMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.renderer=t}render(t){const{items:e,width:n,height:r}=t,i=Mn.create({width:n,height:r});this.renderTextures.push(i);const o=new Be;e.forEach(t=>{const e=new Ms;e.texture=t.item.texture,e.x=t.x+2,e.y=t.y+2,o.addChild(e)});const s=new xs;s.drawRect(0,0,n,r),o.addChild(s),this.renderer.render(o,{renderTexture:i}),this.renderContainers.push(o),e.forEach(t=>{const e=t.item.padding;this.textures[t.item.id]={texture:new Tn(i.baseTexture,new pe(t.x+2+e,t.y+2+e,t.width-4-2*e,t.height-4-2*e)),pivot:t.item.pivot}})}getGraphicsData(t){const e=this.idTidMap[t]||"";return this.textures[e]||null}addGraphics(t,e,n,r,i,o,s,a){var u,l;const c=a||pl(),h=ju()(e+(null!==(l=null===(u=null==o?void 0:o.width)||void 0===u?void 0:u.toString())&&void 0!==l?l:0)+s);if(this.idTidMap[c]=h,this.graphics.findIndex(t=>t.id===h)<0){const{texture:e,pivot:a,padding:u}=function(t,e,n,r,i,o=!0){var s;const a={x:Math.abs(i.x),y:Math.abs(i.y)},u=window.devicePixelRatio,l=document.createElement("canvas"),c=l.getContext("2d");if(!c)throw new Error("ctx");c.lineCap=(null==r?void 0:r.cap)||"butt",c.lineJoin=(null==r?void 0:r.join)||"miter";let h=0,d=0,f=0,p=0,m=0,g="none",v="none";const _=null!==(s=null==r?void 0:r.width)&&void 0!==s?s:0;return o?(h=e,d=n,m=0,v="#ffffff"):(g="#ff0000",m=_,f=.5*_,p=.5*_,h=e+_,d=n+_,a.x+=.5*_,a.y+=.5*_),h+=Math.abs(i.x),d+=Math.abs(i.y),f+=Math.abs(i.x),p+=Math.abs(i.y),h+=4,d+=4,f+=2,p+=2,f*=u,p*=u,h=Math.ceil(h*u),d=Math.ceil(d*u),l.width=h,l.height=d,c.transform(u,0,0,u,f,p),t.forEach(t=>{c.lineWidth=m,c.strokeStyle=g,"none"!==t.fill&&(c.fillStyle=v),(null==r?void 0:r.dash)&&c.setLineDash(r.dash.split(",").map(t=>Number(t.trim()))),c.beginPath();const{scale:e}=t,n=t.path.trim().split(" ");let i={x:0,y:0};for(let t=0;t<n.length;t+=2){const r=n[t],o=n[t+1];if("M"===r){let[t,n]=o.split(",").map(t=>Number(t));i={x:t,y:n},t=t/9525*e.x,n=n/9525*e.y,c.moveTo(t,n)}else if("A"===r){const[t,n,r,s]=o.split(",").map(t=>Number(t));i=Dc(i,e,t,n,r,s,c)}else if("L"===r){let[t,n]=o.split(",").map(t=>Number(t));i={x:t,y:n},t=t/9525*e.x,n=n/9525*e.y,c.lineTo(t,n)}else if("QB"===r){let[t,n,r,s]=o.split(",").map(t=>Number(t));i={x:r,y:s},t=t/9525*e.x,n=n/9525*e.y,r=r/9525*e.x,s=s/9525*e.y,c.quadraticCurveTo(t,n,r,s)}else if("CB"===r){let[t,n,r,s,a,u]=o.split(",").map(t=>Number(t));i={x:a,y:u},t=t/9525*e.x,n=n/9525*e.y,r=r/9525*e.x,s=s/9525*e.y,a=a/9525*e.x,u=u/9525*e.y,c.bezierCurveTo(t,n,r,s,a,u)}else"C"===r&&c.closePath()}t.hasStroke&&m>0&&c.stroke(),"none"!==t.fill&&o&&c.fill("nonzero")}),{texture:new Tn(new an(l,{width:l.width/2,height:l.height/2,resolution:u})),pivot:a,padding:2}}(t,r,i,o,n,s);this.graphics.push({id:h,texture:e,pivot:a,width:e.width,height:e.height,padding:u})}return c}pack(){this.graphics.forEach(t=>{t.width+=4,t.height+=4});gl(this.graphics).forEach(t=>{this.render(t)}),this.graphics.forEach(t=>{t.texture.destroy(!0)}),this.graphics=[]}destroy(){Object.keys(this.textures).forEach(t=>{var e;null===(e=this.textures[t])||void 0===e||e.texture.destroy()}),this.textures=Object.create(null),this.graphics=[],this.renderContainers.forEach(t=>t.destroy({children:!0,baseTexture:!0,texture:!0})),this.renderTextures.forEach(t=>t.destroy(!0))}}var Fc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Bc{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.spriteSheets=[],this.isLoaded=!1,this.loader=t}getTexture(t){return this.textures[t]||null}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(t=>!!t):[]}loadSpriteSheetItem(t,e,n){return Fc(this,void 0,void 0,(function*(){const r=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${n}.json`),i=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${n}.png`),o=document.createElement("img");o.src=i,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()});const s=new an(o),a=new Qs(s,r);yield new Promise(t=>{a.parse(()=>t(""))}),this.spriteSheets.push(a),Object.keys(a.textures).forEach(t=>{const e=t.match(/^(.+)_gif_(\d+)$/);if(e&&e[1]&&e[2]){const n=e[1];this.gifs[n]||(this.gifs[n]=[]);const r=parseInt(e[2],10);this.gifs[n][r]=a.textures[t]}else this.textures[t]=a.textures[t]})}))}loadSpriteSheets(t,e,n){return this.isLoaded?Promise.resolve([]):(this.isLoaded=!0,Promise.all(t.map(t=>this.loadSpriteSheetItem(e,n,t))))}destroy(){this.isLoaded=!1,this.spriteSheets.forEach(t=>t.destroy(!0))}}class Uc{constructor(){this.prevTime=-1,this.times=10,this.dur=0,this.valeList=[],this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.dur+=e,this.times-=1,0===this.times&&(this.valeList.push(1e4/this.dur),this.times=10,this.dur=0,this.valeList.length>10&&(this.value=Math.round(this.valeList.reduce((t,e)=>t+e)/this.valeList.length),this.valeList=[])),this.prevTime=t,this.calcFps()})}}var kc=n(10),Gc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};class Hc{constructor(t){this.useCache=!1,this.useCache=t}bindTask(t){this.taskId=t,this.useCache&&(this.cache=kc.createInstance({name:"_slide_local_cache_",storeName:this.taskId,driver:kc.INDEXEDDB,version:1}),this.cache.clear().catch(()=>{}))}fetchJson(t){var e,n;return Gc(this,void 0,void 0,(function*(){let r=yield null===(e=this.cache)||void 0===e?void 0:e.getItem(t);return r&&this.useCache||(r=yield(yield fetch(t)).json(),this.useCache&&(yield null===(n=this.cache)||void 0===n?void 0:n.setItem(t,r))),r}))}fetchPng(t){var e,n;return Gc(this,void 0,void 0,(function*(){let r=yield null===(e=this.cache)||void 0===e?void 0:e.getItem(t);if(r&&this.useCache)return r;if(r=yield fetch(t).then(t=>t.blob()).then(e=>new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=()=>{r(new Error(`fetch ${t} failed`))},i.readAsDataURL(e)})),this.useCache&&(yield null===(n=this.cache)||void 0===n?void 0:n.setItem(t,r)),!r)throw new Error(`fetch ${t} failed`);return r}))}destroy(){var t;null===(t=this.cache)||void 0===t||t.clear().catch(()=>{})}}var zc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};window.PIXI=i,r.skipHello();const jc={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"};class Vc{constructor(t){this.eventHub=t,this.targets=Object.create(null)}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,n={type:"el",index:0,id:""}){var r,i;let o=this.targets[t.id];return"shape"!==t.type?o:("shape"===t.type&&t.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(t.txEl.type,t.txEl.range))&&void 0!==r?r:null),"shape"===t.type&&t.bg&&0===n.index&&(e=!1,o=null!==(i=null==o?void 0:o.getBgElement())&&void 0!==i?i:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),e&&o?o.getIterateEntry(n.type,n.index,n.id):o)}clearTargets(){this.targets=Object.create(null)}}const Wc={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",interactiveAnimTrigger:"interactiveAnimTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide"};class Xc extends a.a{constructor(t,e={}){super(),this.loader=new Hc(!1),this.transactionPlayer=new l.TransactionPlayer,this.transactionSprite=new Ms,this.isForward=!0,this.dynamicResolution=1,this.drawCall=0,this.fps=new Uc,this.width=0,this.height=0,this.currentIndex=0,this.slideCount=0,this.frameList=[],this.runtime={drawCall:0,fps:0},this.mode=t,this.config={minFPS:Object(u.isUndefined)(e.minFPS)?45:e.minFPS,maxFPS:Object(u.isUndefined)(e.maxFPS)?50:e.maxFPS,resolution:Object(u.isUndefined)(e.resolution)?window.devicePixelRatio:e.resolution,autoResolution:!Object(u.isUndefined)(e.autoResolution)&&e.autoResolution,minResolution:Object(u.isUndefined)(e.minResolution)?1:e.minResolution,autoFPS:!Object(u.isUndefined)(e.autoFPS)&&e.autoFPS},this.app=new vi({antialias:!0,autoDensity:!0,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const n=this.app.renderer,{drawElements:r}=n.gl;n.gl.drawElements=(...t)=>{r.call(n.gl,...t),this.drawCall+=1},this.app.ticker.add(t=>{this.runtime.drawCall=this.drawCall,this.drawCall=0;const e=1e3/(t/(vt.TARGET_FPMS||.06));if(this.frameList.push(e),this.frameList.length>50){const t=this.frameList.reduce((t,e)=>t+e)/this.frameList.length;if(this.runtime.fps=Math.floor(t),this.fps.value<this.config.minFPS)this.dynamicResolution=this.app.renderer.resolution-.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution),this.dynamicResolution<=this.config.minResolution&&this.config.autoFPS&&(this.app.ticker.minFPS-=2,this.app.ticker.maxFPS-=2);else if(this.fps.value>1.08*this.config.minFPS&&this.fps.value<=this.config.maxFPS){const t=Math.min(this.app.ticker.minFPS+2,this.config.minFPS),e=Math.min(this.app.ticker.maxFPS+2,this.config.maxFPS);t<=this.config.minFPS&&(this.app.ticker.minFPS=t),e<=this.config.maxFPS&&(this.app.ticker.maxFPS=e),t>=this.config.minFPS&&e>=this.config.maxFPS&&(this.dynamicResolution+=.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution))}this.config.autoResolution&&this.dynamicResolution!==this.app.renderer.resolution&&this.app.ticker.addOnce(()=>{const t=Math.min(this.dynamicResolution,this.config.resolution);this.app.renderer.resolution=t,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},ke.HIGH),this.frameList=[]}},null,ke.LOW)}get view(){return this.app.view}updateConfig(t){Object(u.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(u.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(u.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.app.ticker.addOnce(()=>{this.app.renderer.resolution=t.resolution||window.devicePixelRatio,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},ke.HIGH)),Object(u.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(u.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(u.isUndefined)(t.minResolution)||(this.config.minResolution=t.minResolution)}preload(t){return zc(this,void 0,void 0,(function*(){if(t<1||t>this.slideCount||!this.loader.cache)return;const e=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`),{sheets:n}=e;for(const t of n)yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/${t}.json`),yield this.loader.fetchPng(`${this.url}/${this.taskId}/jsonOutput/${t}.png`)}))}setResourceData(t,e){this.taskId=t,this.url=e,this.loader.bindTask(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}loadSlide(t){return zc(this,void 0,void 0,(function*(){const e=new Bc(this.loader),n=new a.a,r={mode:this.mode,renderer:this.app.renderer,graphicsTexture:new Nc(this.app.renderer),fillTexture:new Lc(this.app.renderer,e),stageWidth:0,stageHeight:0,ticker:this.app.ticker,timingTargets:new Vc(n),eventHub:n,view:this.app.view,medias:Object.create(null)},i=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`),{width:o,height:s,sheets:u}=i;yield e.loadSpriteSheets(u,this.url,this.taskId),r.stageWidth=o,r.stageHeight=s;const l=new ec(i,r,{x:0,y:0});return this.translateEvent(r.eventHub,[Wc.mainSeqStepChange,Wc.mainSeqStateChange,Wc.hyperlinkTrigger,Wc.interactiveAnimTrigger,Wc.mainSeqStepStart,Wc.mainSeqStepEnd,Wc.animateStart,Wc.animateEnd,Wc.mediaPlay,Wc.mediaPause,Wc.mediaSeek,Wc.requestGotoSlide,Wc.requestNextSlide,Wc.requestPrevSlide]),l.preRender(),r.fillTexture.pack(),r.graphicsTexture.pack(),{stage:l,json:i}}))}translateEvent(t,e){e.forEach(e=>{t.on(e,(...t)=>{this.emit(e,...t)})})}renderSlide(t){return zc(this,void 0,void 0,(function*(){this.emit(Wc.renderStart,t),this.currentIndex=Number(t);const e=yield this.loadSlide(t),{width:n,height:r,slideCount:i}=e.json;let o;this.slideCount=i,this.app.view.style.width=n+"px",this.app.view.style.height=r+"px",this.app.renderer.resize(n,r),this.width=n,this.height=r,this.currentStage&&(e.json.transition&&e.json.transition.type&&(o=this.getBase64(this.currentStage)),this.prevStage=this.currentStage),this.currentStage=e,yield e.stage.render(),e.stage.createTiming(),e.stage.container.visible=!0,e.stage.collectMainSeqStartValue(),this.isForward?e.stage.setMainSeqStep(0,"start"):e.stage.setMainSeqStep(-1,"end");const s=this.getBase64(this.currentStage);e.stage.container.visible=!1,this.app.stage.addChild(e.stage.container),o&&s&&e.json.transition&&e.json.transition.type&&(yield this.playTransaction(o,s,e.json.transition)),this.prevStage&&(this.app.stage.removeChild(this.prevStage.stage.container),this.prevStage.stage.destroy(),this.prevStage=void 0),this.isForward?e.stage.startTiming():e.stage.setMainSeqApplied(),e.stage.container.visible=!0,this.emit(Wc.renderEnd,t),this.emit(Wc.slideChange,t),this.preload(t+1).catch(()=>{}),this.preload(t-1).catch(()=>{})}))}getBase64(t){const{width:e,height:n}=t.json,r=Mn.create({width:e,height:n});this.app.renderer.render(t.stage.container,{renderTexture:r});return this.app.renderer.plugins.extract.base64(r,"image/jpeg")}playTransaction(t,e,n){return zc(this,void 0,void 0,(function*(){const r=this.app.view.parentElement;if(t&&e&&r&&jc[n.type]){this.transactionSprite.zIndex=999,this.app.stage.addChild(this.transactionSprite);const r=this.transactionPlayer.renderer.domElement,i=Tn.from(r),o=()=>i.update();this.app.ticker.add(o),this.transactionSprite.texture=i;const{width:s,height:a}=this.currentStage.json;return new Promise(r=>{var i,u;this.transactionPlayer.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:s,textureHeight:a,presetType:jc[n.type],stageWidth:s,stageHeight:a,duration:null===(u=null===(i=this.currentStage)||void 0===i?void 0:i.json.transition)||void 0===u?void 0:u.dur,delay:0,onTransactionEnd:()=>{r(),this.app.stage.removeChild(this.transactionSprite),this.app.ticker.remove(o)}})})}return Promise.resolve()}))}nextStep(){var t;null===(t=this.currentStage)||void 0===t||t.stage.nextStep()}prevStep(){var t;null===(t=this.currentStage)||void 0===t||t.stage.prevStep()}mainSeqLength(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqLength())&&void 0!==e?e:0}mainSeqStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqStep())&&void 0!==e?e:0}setMainSeqStep(t,e){var n;null===(n=this.currentStage)||void 0===n||n.stage.setMainSeqStep(t,e)}mainSeqState(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqState())&&void 0!==e?e:null}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.stage.mainSeqHasPrevStep())&&void 0!==e&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},ke.LOW)}applyInteractiveAction(t){var e;null===(e=this.currentStage)||void 0===e||e.stage.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.currentStage)||void 0===e||e.stage.seekInteractiveSeqToEnd(t)}setMediaState(t,e){var n;return zc(this,void 0,void 0,(function*(){yield null===(n=this.currentStage)||void 0===n?void 0:n.stage.setMediaState(t,e)}))}setMediaCurrentTime(t,e){var n;null===(n=this.currentStage)||void 0===n||n.stage.setMediaCurrentTime(t,e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}destroy(){this.prevStage&&this.prevStage.stage.destroy(),this.currentStage&&this.currentStage.stage.destroy(),this.loader.destroy()}}var qc,Yc=[],Zc="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(qc||(qc={}));var Jc,Kc=function(t){return Object.freeze(t)},$c=function(t,e){this.inlineSize=t,this.blockSize=e,Kc(this)},Qc=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Kc(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),th=function(t){return t instanceof SVGElement&&"getBBox"in t},eh=function(t){if(th(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},nh=function(t){var e,n;if(t instanceof Element)return!0;var r=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&t instanceof r.Element)},rh="undefined"!=typeof window?window:{},ih=new WeakMap,oh=/auto|scroll/,sh=/^tb|vertical/,ah=/msie|trident/i.test(rh.navigator&&rh.navigator.userAgent),uh=function(t){return parseFloat(t||"0")},lh=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new $c((n?e:t)||0,(n?t:e)||0)},ch=Kc({devicePixelContentBoxSize:lh(),borderBoxSize:lh(),contentBoxSize:lh(),contentRect:new Qc(0,0,0,0)}),hh=function(t,e){if(void 0===e&&(e=!1),ih.has(t)&&!e)return ih.get(t);if(eh(t))return ih.set(t,ch),ch;var n=getComputedStyle(t),r=th(t)&&t.ownerSVGElement&&t.getBBox(),i=!ah&&"border-box"===n.boxSizing,o=sh.test(n.writingMode||""),s=!r&&oh.test(n.overflowY||""),a=!r&&oh.test(n.overflowX||""),u=r?0:uh(n.paddingTop),l=r?0:uh(n.paddingRight),c=r?0:uh(n.paddingBottom),h=r?0:uh(n.paddingLeft),d=r?0:uh(n.borderTopWidth),f=r?0:uh(n.borderRightWidth),p=r?0:uh(n.borderBottomWidth),m=h+l,g=u+c,v=(r?0:uh(n.borderLeftWidth))+f,_=d+p,y=a?t.offsetHeight-_-t.clientHeight:0,x=s?t.offsetWidth-v-t.clientWidth:0,b=i?m+v:0,w=i?g+_:0,S=r?r.width:uh(n.width)-b-x,T=r?r.height:uh(n.height)-w-y,E=S+m+x+v,M=T+g+y+_,A=Kc({devicePixelContentBoxSize:lh(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:lh(E,M,o),contentBoxSize:lh(S,T,o),contentRect:new Qc(h,u,S,T)});return ih.set(t,A),A},dh=function(t,e,n){var r=hh(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case qc.DEVICE_PIXEL_CONTENT_BOX:return s;case qc.BORDER_BOX:return i;default:return o}},fh=function(t){var e=hh(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Kc([e.borderBoxSize]),this.contentBoxSize=Kc([e.contentBoxSize]),this.devicePixelContentBoxSize=Kc([e.devicePixelContentBoxSize])},ph=function(t){if(eh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},mh=function(){var t=1/0,e=[];Yc.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new fh(e.target),i=ph(e.target);r.push(n),e.lastReportedSize=dh(e.target,e.observedBox),i<t&&(t=i)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++){(0,r[n])()}return t},gh=function(t){Yc.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(ph(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},vh=function(){var t,e=0;for(gh(e);Yc.some((function(t){return t.activeTargets.length>0}));)e=mh(),gh(e);return Yc.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:Zc}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=Zc),window.dispatchEvent(t)),e>0},_h=[],yh=function(t){if(!Jc){var e=0,n=document.createTextNode("");new MutationObserver((function(){return _h.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),Jc=function(){n.textContent=""+(e?e--:e++)}}_h.push(t),Jc()},xh=0,bh={attributes:!0,characterData:!0,childList:!0,subtree:!0},wh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Sh=function(t){return void 0===t&&(t=0),Date.now()+t},Th=!1,Eh=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Th){Th=!0;var n,r=Sh(t);n=function(){var n=!1;try{n=vh()}finally{if(Th=!1,t=r-Sh(),!xh)return;n?e.run(1e3):t>0?e.run(t):e.start()}},yh((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bh)};document.body?e():rh.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),wh.forEach((function(e){return rh.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),wh.forEach((function(e){return rh.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Mh=function(t){!xh&&t>0&&Eh.start(),!(xh+=t)&&Eh.stop()},Ah=function(){function t(t,e){this.target=t,this.observedBox=e||qc.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=dh(this.target,this.observedBox,!0);return t=this.target,th(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),Ph=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Rh=new WeakMap,Ch=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ih=function(){function t(){}return t.connect=function(t,e){var n=new Ph(t,e);Rh.set(t,n)},t.observe=function(t,e,n){var r=Rh.get(t),i=0===r.observationTargets.length;Ch(r.observationTargets,e)<0&&(i&&Yc.push(r),r.observationTargets.push(new Ah(e,n&&n.box)),Mh(1),Eh.schedule())},t.unobserve=function(t,e){var n=Rh.get(t),r=Ch(n.observationTargets,e),i=1===n.observationTargets.length;r>=0&&(i&&Yc.splice(Yc.indexOf(n),1),n.observationTargets.splice(r,1),Mh(-1))},t.disconnect=function(t){var e=this,n=Rh.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),Lh=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ih.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nh(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ih.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!nh(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ih.unobserve(this,t)},t.prototype.disconnect=function(){Ih.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),Oh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Dh=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Nh=function(){function t(t,e,n,r,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=t,this.slideIndex=e,this.eventHub=r,this.id=i}return t.prototype.apply=function(){return Oh(this,void 0,void 0,(function(){var t;return Dh(this,(function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}}))}))},t}(),Fh=function(){function t(){var t=this;this.eventHub=new a.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",(function(e){var n,r=t.tasks.findIndex((function(t){return t.index===e.index})),i=r+1;i>=0&&(null===(n=t.tasks[i])||void 0===n||n.apply()),r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask()),t.eventHub.emit("task-end-"+e.id)})),this.eventHub.on("task-error",(function(e){var n=e.task,r=t.tasks.findIndex((function(t){return t.index===n.index}));r>=0&&(t.tasks.splice(r,1),t.replaceIdleTask())}))}return t.prototype.replaceIdleTask=function(){for(var t,e=this,n=new Set,r=0,i=this.tasks.length;r<i;r++)"idle"===this.tasks[r].state&&"idle"===(null===(t=this.tasks[r+1])||void 0===t?void 0:t.state)&&n.add(r);Array.from(n).forEach((function(t){e.tasks.splice(t,1)}))},t.prototype.addTask=function(t,e,n){var r=new Nh(this.index++,e,t,this.eventHub,n);this.tasks.push(r),this.tasks.sort((function(t,e){return t.index-e.index})),this.replaceIdleTask(),1===this.tasks.length&&r.apply()},t.prototype.hasStartTask=function(){return this.tasks.some((function(t){return"start"===t.state}))},t}(),Bh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Uh=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function kh(t,e){return Bh(this,void 0,void 0,(function(){var n;return Uh(this,(function(r){switch(r.label){case 0:n=Date.now(),r.label=1;case 1:return!t()&&Date.now()-n<e?[4,(i=50,new Promise((function(t){return setTimeout(t,i)})))]:[3,3];case 2:return r.sent(),[3,1];case 3:return[2]}var i}))}))}function Gh(t,e){var n=t.__state.conversionName.toString(),r=Math.round(t.r),i=Math.round(t.g),o=Math.round(t.b),s=t.a,a=Math.round(t.h),u=t.s.toFixed(1),l=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var c=t.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return"CSS_RGB"===n?"rgb("+r+","+i+","+o+")":"CSS_RGBA"===n?"rgba("+r+","+i+","+o+","+s+")":"HEX"===n?"0x"+t.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+i+","+o+"]":"RGBA_ARRAY"===n?"["+r+","+i+","+o+","+s+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+a+",s:"+u+",v:"+l+"}":"HSVA_OBJ"===n?"{h:"+a+",s:"+u+",v:"+l+",a:"+s+"}":"unknown format"}var Hh=Array.prototype.forEach,zh=Array.prototype.slice,jh={BREAK:{},extend:function(t){return this.each(zh.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(e[n])||(t[n]=e[n])}.bind(this))}),this),t},defaults:function(t){return this.each(zh.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(t[n])&&(t[n]=e[n])}.bind(this))}),this),t},compose:function(){var t=zh.call(arguments);return function(){for(var e=zh.call(arguments),n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},each:function(t,e,n){if(t)if(Hh&&t.forEach&&t.forEach===Hh)t.forEach(e,n);else if(t.length===t.length+0){var r,i=void 0;for(i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===this.BREAK)return}else for(var o in t)if(e.call(n,t[o],o)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var r=void 0;return function(){var i=this,o=arguments;function s(){r=null,n||t.apply(i,o)}var a=n||!r;clearTimeout(r),r=setTimeout(s,e),a&&t.apply(i,o)}},toArray:function(t){return t.toArray?t.toArray():zh.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return t instanceof Function}},Vh=[{litmus:jh.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:Gh},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:Gh},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:Gh},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:Gh}}},{litmus:jh.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:jh.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:jh.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(jh.isNumber(t.r)&&jh.isNumber(t.g)&&jh.isNumber(t.b)&&jh.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(jh.isNumber(t.r)&&jh.isNumber(t.g)&&jh.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(jh.isNumber(t.h)&&jh.isNumber(t.s)&&jh.isNumber(t.v)&&jh.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(jh.isNumber(t.h)&&jh.isNumber(t.s)&&jh.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],Wh=void 0,Xh=void 0,qh=function(){Xh=!1;var t=arguments.length>1?jh.toArray(arguments):arguments[0];return jh.each(Vh,(function(e){if(e.litmus(t))return jh.each(e.conversions,(function(e,n){if(Wh=e.read(t),!1===Xh&&!1!==Wh)return Xh=Wh,Wh.conversionName=n,Wh.conversion=e,jh.BREAK})),jh.BREAK})),Xh},Yh=void 0,Zh={hsv_to_rgb:function(t,e,n){var r=Math.floor(t/60)%6,i=t/60-Math.floor(t/60),o=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),u=[[n,a,o],[s,n,o],[o,n,a],[o,s,n],[a,o,n],[n,o,s]][r];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(t,e,n){var r=Math.min(t,e,n),i=Math.max(t,e,n),o=i-r,s=void 0;return 0===i?{h:NaN,s:0,v:0}:(s=t===i?(e-n)/o:e===i?2+(n-t)/o:4+(t-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/i,v:i/255})},rgb_to_hex:function(t,e,n){var r=this.hex_with_component(0,2,t);return r=this.hex_with_component(r,1,e),r=this.hex_with_component(r,0,n)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,n){return n<<(Yh=8*e)|t&~(255<<Yh)}},Jh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},$h=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Qh=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},td=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},ed=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},nd=function(){function t(){if(Kh(this,t),this.__state=qh.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return $h(t,[{key:"toString",value:function(){return Gh(this)}},{key:"toHexString",value:function(){return Gh(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),t}();function rd(t,e,n){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||nd.recalculateRGB(this,e,n),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(nd.recalculateRGB(this,e,n),this.__state.space="RGB"),this.__state[e]=t}})}function id(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||nd.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(nd.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}nd.recalculateRGB=function(t,e,n){if("HEX"===t.__state.space)t.__state[e]=Zh.component_from_hex(t.__state.hex,n);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");jh.extend(t.__state,Zh.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},nd.recalculateHSV=function(t){var e=Zh.rgb_to_hsv(t.r,t.g,t.b);jh.extend(t.__state,{s:e.s,v:e.v}),jh.isNaN(e.h)?jh.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},nd.COMPONENTS=["r","g","b","h","s","v","hex","a"],rd(nd.prototype,"r",2),rd(nd.prototype,"g",1),rd(nd.prototype,"b",0),id(nd.prototype,"h"),id(nd.prototype,"s"),id(nd.prototype,"v"),Object.defineProperty(nd.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(nd.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=Zh.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var od=function(){function t(e,n){Kh(this,t),this.initialValue=e[n],this.domElement=document.createElement("div"),this.object=e,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return $h(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),sd={};jh.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){jh.each(t,(function(t){sd[t]=e}))}));var ad=/(\d+(\.\d+)?)px/;function ud(t){if("0"===t||jh.isUndefined(t))return 0;var e=t.match(ad);return jh.isNull(e)?0:parseFloat(e[1])}var ld={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,n){var r=n,i=e;jh.isUndefined(i)&&(i=!0),jh.isUndefined(r)&&(r=!0),t.style.position="absolute",i&&(t.style.left=0,t.style.right=0),r&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,n,r){var i=n||{},o=sd[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=i.x||i.clientX||0,u=i.y||i.clientY||0;s.initMouseEvent(e,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,a,u,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var l=s.initKeyboardEvent||s.initKeyEvent;jh.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),l(e,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:s.initEvent(e,i.bubbles||!1,i.cancelable||!0)}jh.defaults(s,r),t.dispatchEvent(s)},bind:function(t,e,n,r){var i=r||!1;return t.addEventListener?t.addEventListener(e,n,i):t.attachEvent&&t.attachEvent("on"+e,n),ld},unbind:function(t,e,n,r){var i=r||!1;return t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent&&t.detachEvent("on"+e,n),ld},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var n=t.className.split(/ +/);-1===n.indexOf(e)&&(n.push(e),t.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return ld},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var n=t.className.split(/ +/),r=n.indexOf(e);-1!==r&&(n.splice(r,1),t.className=n.join(" "))}else t.className=void 0;return ld},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return ud(e["border-left-width"])+ud(e["border-right-width"])+ud(e["padding-left"])+ud(e["padding-right"])+ud(e.width)},getHeight:function(t){var e=getComputedStyle(t);return ud(e["border-top-width"])+ud(e["border-bottom-width"])+ud(e["padding-top"])+ud(e["padding-bottom"])+ud(e.height)},getOffset:function(t){var e=t,n={left:0,top:0};if(e.offsetParent)do{n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent}while(e);return n},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},cd=function(t){function e(t,n){Kh(this,e);var r=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),i=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),ld.bind(r.__checkbox,"change",(function(){i.setValue(!i.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return td(e,t),$h(e,[{key:"setValue",value:function(t){var n=Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(od),hd=function(t){function e(t,n,r){Kh(this,e);var i=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r,s=i;if(i.__select=document.createElement("select"),jh.isArray(o)){var a={};jh.each(o,(function(t){a[t]=t})),o=a}return jh.each(o,(function(t,e){var n=document.createElement("option");n.innerHTML=e,n.setAttribute("value",t),s.__select.appendChild(n)})),i.updateDisplay(),ld.bind(i.__select,"change",(function(){var t=this.options[this.selectedIndex].value;s.setValue(t)})),i.domElement.appendChild(i.__select),i}return td(e,t),$h(e,[{key:"setValue",value:function(t){var n=Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return ld.isActive(this.__select)?this:(this.__select.value=this.getValue(),Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(od),dd=function(t){function e(t,n){Kh(this,e);var r=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),i=r;function o(){i.setValue(i.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),ld.bind(r.__input,"keyup",o),ld.bind(r.__input,"change",o),ld.bind(r.__input,"blur",(function(){i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())})),ld.bind(r.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return td(e,t),$h(e,[{key:"updateDisplay",value:function(){return ld.isActive(this.__input)||(this.__input.value=this.getValue()),Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(od);function fd(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var pd=function(t){function e(t,n,r){Kh(this,e);var i=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,jh.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=fd(i.__impliedStep),i}return td(e,t),$h(e,[{key:"setValue",value:function(t){var n=t;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=fd(t),this}}]),e}(od);var md=function(t){function e(t,n,r){Kh(this,e);var i=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));i.__truncationSuspended=!1;var o=i,s=void 0;function a(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(t){var e=s-t.clientY;o.setValue(o.getValue()+e*o.__impliedStep),s=t.clientY}function l(){ld.unbind(window,"mousemove",u),ld.unbind(window,"mouseup",l),a()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),ld.bind(i.__input,"change",(function(){var t=parseFloat(o.__input.value);jh.isNaN(t)||o.setValue(t)})),ld.bind(i.__input,"blur",(function(){a()})),ld.bind(i.__input,"mousedown",(function(t){ld.bind(window,"mousemove",u),ld.bind(window,"mouseup",l),s=t.clientY})),ld.bind(i.__input,"keydown",(function(t){13===t.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,a())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return td(e,t),$h(e,[{key:"updateDisplay",value:function(){var t,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(t*r)/r),Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(pd);function gd(t,e,n,r,i){return r+(t-e)/(n-e)*(i-r)}var vd=function(t){function e(t,n,r,i,o){Kh(this,e);var s=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:r,max:i,step:o})),a=s;function u(t){t.preventDefault();var e=a.__background.getBoundingClientRect();return a.setValue(gd(t.clientX,e.left,e.right,a.__min,a.__max)),!1}function l(){ld.unbind(window,"mousemove",u),ld.unbind(window,"mouseup",l),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function c(t){var e=t.touches[0].clientX,n=a.__background.getBoundingClientRect();a.setValue(gd(e,n.left,n.right,a.__min,a.__max))}function h(){ld.unbind(window,"touchmove",c),ld.unbind(window,"touchend",h),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),ld.bind(s.__background,"mousedown",(function(t){document.activeElement.blur(),ld.bind(window,"mousemove",u),ld.bind(window,"mouseup",l),u(t)})),ld.bind(s.__background,"touchstart",(function(t){if(1!==t.touches.length)return;ld.bind(window,"touchmove",c),ld.bind(window,"touchend",h),c(t)})),ld.addClass(s.__background,"slider"),ld.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return td(e,t),$h(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",Qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(pd),_d=function(t){function e(t,n,r){Kh(this,e);var i=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===r?"Fire":r,ld.bind(i.__button,"click",(function(t){return t.preventDefault(),o.fire(),!1})),ld.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return td(e,t),$h(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(od),yd=function(t){function e(t,n){Kh(this,e);var r=ed(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));r.__color=new nd(r.getValue()),r.__temp=new nd(0);var i=r;r.domElement=document.createElement("div"),ld.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",ld.bind(r.__input,"keydown",(function(t){13===t.keyCode&&h.call(this)})),ld.bind(r.__input,"blur",h),ld.bind(r.__selector,"mousedown",(function(){ld.addClass(this,"drag").bind(window,"mouseup",(function(){ld.removeClass(i.__selector,"drag")}))})),ld.bind(r.__selector,"touchstart",(function(){ld.addClass(this,"drag").bind(window,"touchend",(function(){ld.removeClass(i.__selector,"drag")}))}));var o,s=document.createElement("div");function a(t){f(t),ld.bind(window,"mousemove",f),ld.bind(window,"touchmove",f),ld.bind(window,"mouseup",l),ld.bind(window,"touchend",l)}function u(t){p(t),ld.bind(window,"mousemove",p),ld.bind(window,"touchmove",p),ld.bind(window,"mouseup",c),ld.bind(window,"touchend",c)}function l(){ld.unbind(window,"mousemove",f),ld.unbind(window,"touchmove",f),ld.unbind(window,"mouseup",l),ld.unbind(window,"touchend",l),d()}function c(){ld.unbind(window,"mousemove",p),ld.unbind(window,"touchmove",p),ld.unbind(window,"mouseup",c),ld.unbind(window,"touchend",c),d()}function h(){var t=qh(this.value);!1!==t?(i.__color.__state=t,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=i.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientX,o=n.clientY,s=(r-e.left)/(e.right-e.left),a=1-(o-e.top)/(e.bottom-e.top);return a>1?a=1:a<0&&(a=0),s>1?s=1:s<0&&(s=0),i.__color.v=a,i.__color.s=s,i.setValue(i.__color.toOriginal()),!1}function p(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=i.__hue_field.getBoundingClientRect(),n=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return n>1?n=1:n<0&&(n=0),i.__color.h=360*n,i.setValue(i.__color.toOriginal()),!1}return jh.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),jh.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),jh.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),jh.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),jh.extend(s.style,{width:"100%",height:"100%",background:"none"}),bd(s,"top","rgba(0,0,0,0)","#000"),jh.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=r.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",jh.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),ld.bind(r.__saturation_field,"mousedown",a),ld.bind(r.__saturation_field,"touchstart",a),ld.bind(r.__field_knob,"mousedown",a),ld.bind(r.__field_knob,"touchstart",a),ld.bind(r.__hue_field,"mousedown",u),ld.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(s),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return td(e,t),$h(e,[{key:"updateDisplay",value:function(){var t=qh(this.getValue());if(!1!==t){var e=!1;jh.each(nd.COMPONENTS,(function(n){if(!jh.isUndefined(t[n])&&!jh.isUndefined(this.__color.__state[n])&&t[n]!==this.__color.__state[n])return e=!0,{}}),this),e&&jh.extend(this.__color.__state,t)}jh.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;jh.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,bd(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),jh.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),e}(od),xd=["-moz-","-o-","-webkit-","-ms-",""];function bd(t,e,n,r){t.style.background="",jh.each(xd,(function(i){t.style.cssText+="background: "+i+"linear-gradient("+e+", "+n+" 0%, "+r+" 100%); "}))}var wd=function(t,e){var n=e||document,r=document.createElement("style");r.type="text/css",r.innerHTML=t;var i=n.getElementsByTagName("head")[0];try{i.appendChild(r)}catch(t){}},Sd='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',Td=function(t,e){var n=t[e];return jh.isArray(arguments[2])||jh.isObject(arguments[2])?new hd(t,e,arguments[2]):jh.isNumber(n)?jh.isNumber(arguments[2])&&jh.isNumber(arguments[3])?jh.isNumber(arguments[4])?new vd(t,e,arguments[2],arguments[3],arguments[4]):new vd(t,e,arguments[2],arguments[3]):jh.isNumber(arguments[4])?new md(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new md(t,e,{min:arguments[2],max:arguments[3]}):jh.isString(n)?new dd(t,e):jh.isFunction(n)?new _d(t,e,""):jh.isBoolean(n)?new cd(t,e):null};var Ed=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},Md=function(){function t(){Kh(this,t),this.backgroundElement=document.createElement("div"),jh.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),ld.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),jh.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;ld.bind(this.backgroundElement,"click",(function(){e.hide()}))}return $h(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),jh.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",ld.unbind(t.domElement,"webkitTransitionEnd",e),ld.unbind(t.domElement,"transitionend",e),ld.unbind(t.domElement,"oTransitionEnd",e)};ld.bind(this.domElement,"webkitTransitionEnd",e),ld.bind(this.domElement,"transitionend",e),ld.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-ld.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-ld.getHeight(this.domElement)/2+"px"}}]),t}();wd(function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var Ad=function(){try{return!!window.localStorage}catch(t){return!1}}(),Pd=void 0,Rd=!0,Cd=void 0,Id=!1,Ld=[],Od=function t(e){var n=this,r=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),ld.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=jh.defaults(r,{closeOnTop:!1,autoPlace:!0,width:t.DEFAULT_WIDTH}),r=jh.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),jh.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),jh.isUndefined(r.parent)&&r.hideable&&Ld.push(this),r.resizable=jh.isUndefined(r.parent)&&r.resizable,r.autoPlace&&jh.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=Ad&&"true"===localStorage.getItem(kd(this,"isLocal")),s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(t){n.parent?n.getRoot().preset=t:r.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),n.revert()}},width:{get:function(){return r.width},set:function(t){r.width=t,Vd(n,t)}},name:{get:function(){return r.name},set:function(t){r.name=t,a&&(a.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(e){r.closed=e,r.closed?ld.addClass(n.__ul,t.CLASS_CLOSED):ld.removeClass(n.__ul,t.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return o},set:function(t){Ad&&(o=t,t?ld.bind(window,"unload",s):ld.unbind(window,"unload",s),localStorage.setItem(kd(n,"isLocal"),t))}}}),jh.isUndefined(r.parent)){if(this.closed=r.closed||!1,ld.addClass(this.domElement,t.CLASS_MAIN),ld.makeSelectable(this.domElement,!1),Ad&&o){n.useLocalStorage=!0;var u=localStorage.getItem(kd(this,"gui"));u&&(r.load=JSON.parse(u))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,ld.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),r.closeOnTop?(ld.addClass(this.__closeButton,t.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(ld.addClass(this.__closeButton,t.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),ld.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===r.closed&&(r.closed=!0);var l=document.createTextNode(r.name);ld.addClass(l,"controller-name"),a=Dd(n,l);ld.addClass(this.__ul,t.CLASS_CLOSED),ld.addClass(a,"title"),ld.bind(a,"click",(function(t){return t.preventDefault(),n.closed=!n.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(jh.isUndefined(r.parent)&&(Rd&&(Cd=document.createElement("div"),ld.addClass(Cd,"dg"),ld.addClass(Cd,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Cd),Rd=!1),Cd.appendChild(this.domElement),ld.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||Vd(n,r.width)),this.__resizeHandler=function(){n.onResizeDebounced()},ld.bind(window,"resize",this.__resizeHandler),ld.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),ld.bind(this.__ul,"transitionend",this.__resizeHandler),ld.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&jd(this),s=function(){Ad&&"true"===localStorage.getItem(kd(n,"isLocal"))&&localStorage.setItem(kd(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,r.parent||((i=n.getRoot()).width+=1,jh.defer((function(){i.width-=1})))};function Dd(t,e,n){var r=document.createElement("li");return e&&r.appendChild(e),n?t.__ul.insertBefore(r,n):t.__ul.appendChild(r),t.onResize(),r}function Nd(t){ld.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&ld.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function Fd(t,e){var n=t.__preset_select[t.__preset_select.selectedIndex];n.innerHTML=e?n.value+"*":n.value}function Bd(t,e){var n=t.getRoot(),r=n.__rememberedObjects.indexOf(e.object);if(-1!==r){var i=n.__rememberedObjectIndecesToControllers[r];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[r]=i),i[e.property]=e,n.load&&n.load.remembered){var o=n.load.remembered,s=void 0;if(o[t.preset])s=o[t.preset];else{if(!o.Default)return;s=o.Default}if(s[r]&&void 0!==s[r][e.property]){var a=s[r][e.property];e.initialValue=a,e.setValue(a)}}}}function Ud(t,e,n,r){if(void 0===e[n])throw new Error('Object "'+e+'" has no property "'+n+'"');var i=void 0;if(r.color)i=new yd(e,n);else{var o=[e,n].concat(r.factoryArgs);i=Td.apply(t,o)}r.before instanceof od&&(r.before=r.before.__li),Bd(t,i),ld.addClass(i.domElement,"c");var s=document.createElement("span");ld.addClass(s,"property-name"),s.innerHTML=i.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(i.domElement);var u=Dd(t,a,r.before);return ld.addClass(u,Od.CLASS_CONTROLLER_ROW),i instanceof yd?ld.addClass(u,"color"):ld.addClass(u,Jh(i.getValue())),function(t,e,n){if(n.__li=e,n.__gui=t,jh.extend(n,{options:function(e){if(arguments.length>1){var r=n.__li.nextElementSibling;return n.remove(),Ud(t,n.object,n.property,{before:r,factoryArgs:[jh.toArray(arguments)]})}if(jh.isArray(e)||jh.isObject(e)){var i=n.__li.nextElementSibling;return n.remove(),Ud(t,n.object,n.property,{before:i,factoryArgs:[e]})}},name:function(t){return n.__li.firstElementChild.firstElementChild.innerHTML=t,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof vd){var r=new md(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});jh.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(t){var e=n[t],i=r[t];n[t]=r[t]=function(){var t=Array.prototype.slice.call(arguments);return i.apply(r,t),e.apply(n,t)}})),ld.addClass(e,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof md){var i=function(e){if(jh.isNumber(n.__min)&&jh.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=Ud(t,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(r),i&&o.listen(),o}return e};n.min=jh.compose(i,n.min),n.max=jh.compose(i,n.max)}else n instanceof cd?(ld.bind(e,"click",(function(){ld.fakeEvent(n.__checkbox,"click")})),ld.bind(n.__checkbox,"click",(function(t){t.stopPropagation()}))):n instanceof _d?(ld.bind(e,"click",(function(){ld.fakeEvent(n.__button,"click")})),ld.bind(e,"mouseover",(function(){ld.addClass(n.__button,"hover")})),ld.bind(e,"mouseout",(function(){ld.removeClass(n.__button,"hover")}))):n instanceof yd&&(ld.addClass(e,"color"),n.updateDisplay=jh.compose((function(t){return e.style.borderLeftColor=n.__color.toString(),t}),n.updateDisplay),n.updateDisplay());n.setValue=jh.compose((function(e){return t.getRoot().__preset_select&&n.isModified()&&Fd(t.getRoot(),!0),e}),n.setValue)}(t,u,i),t.__controllers.push(i),i}function kd(t,e){return document.location.href+"."+e}function Gd(t,e,n){var r=document.createElement("option");r.innerHTML=e,r.value=e,t.__preset_select.appendChild(r),n&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function Hd(t,e){e.style.display=t.useLocalStorage?"block":"none"}function zd(t){var e=t.__save_row=document.createElement("li");ld.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),ld.addClass(e,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",ld.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",ld.addClass(r,"button"),ld.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",ld.addClass(i,"button"),ld.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",ld.addClass(o,"button"),ld.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?jh.each(t.load.remembered,(function(e,n){Gd(t,n,n===t.preset)})):Gd(t,"Default",!1),ld.bind(s,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(s),e.appendChild(n),e.appendChild(r),e.appendChild(i),e.appendChild(o),Ad){var a=document.getElementById("dg-local-explain"),u=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(kd(0,"isLocal"))&&u.setAttribute("checked","checked"),Hd(t,a),ld.bind(u,"change",(function(){t.useLocalStorage=!t.useLocalStorage,Hd(t,a)}))}var l=document.getElementById("dg-new-constructor");ld.bind(l,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||Pd.hide()})),ld.bind(n,"click",(function(){l.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),Pd.show(),l.focus(),l.select()})),ld.bind(r,"click",(function(){t.save()})),ld.bind(i,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),ld.bind(o,"click",(function(){t.revert()}))}function jd(t){var e=void 0;function n(n){return n.preventDefault(),t.width+=e-n.clientX,t.onResize(),e=n.clientX,!1}function r(){ld.removeClass(t.__closeButton,Od.CLASS_DRAG),ld.unbind(window,"mousemove",n),ld.unbind(window,"mouseup",r)}function i(i){return i.preventDefault(),e=i.clientX,ld.addClass(t.__closeButton,Od.CLASS_DRAG),ld.bind(window,"mousemove",n),ld.bind(window,"mouseup",r),!1}t.__resize_handle=document.createElement("div"),jh.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),ld.bind(t.__resize_handle,"mousedown",i),ld.bind(t.__closeButton,"mousedown",i),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function Vd(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function Wd(t,e){var n={};return jh.each(t.__rememberedObjects,(function(r,i){var o={},s=t.__rememberedObjectIndecesToControllers[i];jh.each(s,(function(t,n){o[n]=e?t.initialValue:t.getValue()})),n[i]=o})),n}Od.toggleHide=function(){Id=!Id,jh.each(Ld,(function(t){t.domElement.style.display=Id?"none":""}))},Od.CLASS_AUTO_PLACE="a",Od.CLASS_AUTO_PLACE_CONTAINER="ac",Od.CLASS_MAIN="main",Od.CLASS_CONTROLLER_ROW="cr",Od.CLASS_TOO_TALL="taller-than-window",Od.CLASS_CLOSED="closed",Od.CLASS_CLOSE_BUTTON="close-button",Od.CLASS_CLOSE_TOP="close-top",Od.CLASS_CLOSE_BOTTOM="close-bottom",Od.CLASS_DRAG="drag",Od.DEFAULT_WIDTH=245,Od.TEXT_CLOSED="Close Controls",Od.TEXT_OPEN="Open Controls",Od._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||Od.toggleHide()},ld.bind(window,"keydown",Od._keydownHandler,!1),jh.extend(Od.prototype,{add:function(t,e){return Ud(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return Ud(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;jh.defer((function(){e.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Cd.removeChild(this.domElement);var t=this;jh.each(this.__folders,(function(e){t.removeFolder(e)})),ld.unbind(window,"keydown",Od._keydownHandler,!1),Nd(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var n=new Od(e);this.__folders[t]=n;var r=Dd(this,n.domElement);return ld.addClass(r,"folder"),n},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],Nd(t);var e=this;jh.each(t.__folders,(function(e){t.removeFolder(e)})),jh.defer((function(){e.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=ld.getOffset(t.__ul).top,n=0;jh.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(n+=ld.getHeight(e))})),window.innerHeight-e-20<n?(ld.addClass(t.domElement,Od.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(ld.removeClass(t.domElement,Od.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&jh.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:jh.debounce((function(){this.onResize()}),50),remember:function(){if(jh.isUndefined(Pd)&&((Pd=new Md).domElement.innerHTML=Sd),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;jh.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&zd(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&Vd(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=Wd(this)),t.folders={},jh.each(this.__folders,(function(e,n){t.folders[n]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=Wd(this),Fd(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=Wd(this,!0)),this.load.remembered[t]=Wd(this),this.preset=t,Gd(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){jh.each(this.__controllers,(function(e){this.getRoot().load.remembered?Bd(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),jh.each(this.__folders,(function(t){t.revert(t)})),t||Fd(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&Ed.call(window,(function(){t(e)}));jh.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){jh.each(this.__controllers,(function(t){t.updateDisplay()})),jh.each(this.__folders,(function(t){t.updateDisplay()}))}});var Xd=Od,qd=function(){function t(t){this.runTime={fps:0,resolution:""},this.target=t.target,this.data=t.params,this.player=t.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return t.prototype.createStats=function(){var t=this;setInterval((function(){t.controller.runTimeFps.setValue(t.player.runtime.fps),t.controller.runTimeResolution.setValue(t.player.view.width+"*"+t.player.view.height)}),500)},t.prototype.createControllerGUI=function(){var t,e,n,r,i,o,s=new Xd({autoPlace:!0,closed:!0});return s.domElement.style.opacity=".6",s.domElement.style.transformOrigin="100% 0",s.domElement.style.transform="scale(1.4)",this.target.appendChild(s.domElement),s.domElement.style.position="absolute",s.domElement.style.right="0",s.domElement.style.top="0",s.domElement.style.zIndex="2",this.controller={runTimeFps:s.add({FPS:0},"FPS",0),runTimeResolution:s.add({"分辨率":""},"分辨率",""),autoFps:s.add({"自动fps":null===(t=this.data.autoFPS)||void 0===t||t},"自动fps",!0),autoResolution:s.add({"自动分辨率":null!==(e=this.data.autoResolution)&&void 0!==e&&e},"自动分辨率",!0),moreCalculation:s.add({"额外计算":0},"额外计算",0,100),minFPS:s.add({"最低fps":null!==(n=this.data.minFPS)&&void 0!==n?n:40},"最低fps",0,60),maxFPS:s.add({"最高fps":null!==(r=this.data.maxFPS)&&void 0!==r?r:50},"最高fps",0,60),resolution:s.add({"目标分辨倍率":null!==(i=this.data.resolution)&&void 0!==i?i:window.devicePixelRatio},"目标分辨倍率",.5,4),minResolution:s.add({"最小分辨倍率":null!==(o=this.data.minResolution)&&void 0!==o?o:1},"最小分辨倍率",.5,4)},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,s},t.prototype.addEventListener=function(){var t,e=this;this.controller.autoFps.onChange((function(t){e.data.autoFPS=t,e.player.updateConfig(e.data)})),this.controller.maxFPS.onChange((function(t){e.data.maxFPS=t,e.player.updateConfig(e.data)})),this.controller.minFPS.onChange((function(t){e.data.minFPS=t,e.player.updateConfig(e.data)})),this.controller.autoResolution.onChange((function(t){e.data.autoResolution=t,e.player.updateConfig(e.data)})),this.controller.minResolution.onChange((function(t){e.data.minResolution=t,e.player.updateConfig(e.data)})),this.controller.resolution.onChange((function(t){e.data.resolution=t,e.player.updateConfig(e.data)})),this.controller.moreCalculation.onChange((function(n){t&&e.player.app.ticker.remove(t),n>0&&(t=function(){for(var t="";t.length<n;)t+=Math.random().toString(32).substr(2);ju()(t)},e.player.app.ticker.add(t))}))},t}(),Yd=function(){function t(t){var e=this;this.tasks=[],this.shadowTasks=[],this.schedule=function(){var t=e.tasks[0];t?e.fn(t).then((function(){e.tasks.splice(0,1),window.requestAnimationFrame(e.schedule)})):window.requestAnimationFrame(e.schedule)},this.fn=t,this.schedule()}return t.prototype.addTask=function(t){this.shadowTasks.push(t),this.tasks.push(t)},t}(),Zd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jd=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Kd=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};window.__slide_local_logger__||(window.__slide_local_logger__=o.createInstance({name:"_slide_local_log_",driver:o.INDEXEDDB,version:1}));var $d=window.__slide_local_logger__,Qd=window.ResizeObserver||Lh,tf={syncDispatch:"syncDispatch",syncReceive:"syncReceive",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange"},ef=function(t){function e(e){var n=t.call(this)||this;return n.__slideState={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,appliedInteractiveSeqIds:[],mediaState:Object.create(null)},n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new Fh,n.isLoading=!1,n.interactive=!0,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.medianController=document.createElement("div"),n.frameResizeObserver=new Qd((function(){return n.frameResizeHandler()})),n.timestamp=function(){return Date.now()},n.mode="local",n.log="",n.logId="",n.lastEmitedState=null,n.persistLog=function(){return Jd(n,void 0,void 0,(function(){var t,e;return Kd(this,(function(n){switch(n.label){case 0:if(!$d||!this.logId)return[3,5];n.label=1;case 1:return n.trys.push([1,4,,5]),t=this.log,[4,$d.getItem(this.logId)];case 2:return e=n.sent()||"",[4,$d.setItem(this.logId,e+t)];case 3:return n.sent(),this.log="",[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},n.handleSlideRef=function(){console.log(n)},n.handleSlideStateLog=function(){console.log(n.logId),console.log(JSON.stringify(n.slideState,null,2))},n.handleLogDownload=function(){return Jd(n,void 0,void 0,(function(){var t,e,n;return Kd(this,(function(r){switch(r.label){case 0:return t="",$d?(e=t,[4,$d.getItem(this.logId)]):[3,2];case 1:t=e+(r.sent()||""),r.label=2;case 2:return t+=this.log,(n=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",this.logId),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),[2]}}))}))},n.receiveSyncHandler=function(t){return Jd(n,void 0,void 0,(function(){var e=this;return Kd(this,(function(n){switch(n.label){case 0:return this.log+="=== sync receive ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n","nextStep"!==t.type?[3,1]:(this.mainSeqStep===t.next-1||this.mainSeqStep+1===this.mainSeqLength?this.doNextStep():(this.setMainSeqStep(t.next,"start"),this.player.nextTick((function(){e.doNextStep()}))),[3,6]);case 1:return"prevStep"!==t.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep():(this.setMainSeqStep(t.next+1,"start"),this.player.nextTick((function(){e.doPrevStep()}))),[3,6]);case 2:return"interactiveAnim"!==t.type?[3,3]:(this.player.applyInteractiveAction(t.action),[3,6]);case 3:return"renderSlide"!==t.type?[3,5]:[4,this.doRenderSlide(t.index,t.isForward)];case 4:return n.sent(),[3,6];case 5:"mediaPlay"===t.type?(this.player.setMediaState(t.id,!0),this.__slideState.mediaState[t.id]=t.state):"mediaPause"===t.type?(this.player.setMediaState(t.id,!1),this.__slideState.mediaState[t.id]=t.state):"mediaSeek"===t.type&&(this.player.setMediaCurrentTime(t.id,t.time),this.__slideState.mediaState[t.id]=t.state),n.label=6;case 6:return[2]}}))}))},n.handlePrevSlide=function(){return Jd(n,void 0,void 0,(function(){var t;return Kd(this,(function(e){return(t=this.player.currentIndex-1)>=1&&this.renderSlide(t,!1),[2]}))}))},n.handleNextSlide=function(){return Jd(n,void 0,void 0,(function(){var t;return Kd(this,(function(e){return(t=this.player.currentIndex+1)<=this.slideCount&&this.renderSlide(t,!0),[2]}))}))},n.handleGotoSlide=function(t){t<=n.slideCount&&t>=1&&n.renderSlide(t,!0)},e.timestamp&&(n.timestamp=e.timestamp),n.syncQueue=new Yd(n.receiveSyncHandler),n.mode=e.mode,n.anchor=e.anchor,n.resize=e.resize||!1,n.interactive=e.interactive,n.player=new Xc(n.mode),n.player.setInteractive(n.interactive),n.player.updateConfig(e.renderOptions||{}),n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center",n.frame.appendChild(n.player.view),n.setMedianControllerAttribute(),n.frame.appendChild(n.medianController),n.anchor.appendChild(n.frame),(null==e?void 0:e.controller)&&new qd({player:n.player,params:e.renderOptions||{},target:n.frame}),n.frameResizeObserver.observe(n.frame),n.player.on(Wc.renderStart,(function(t){n.isLoading=!0,n.emit(tf.renderStart,t)})),n.player.on(Wc.renderEnd,(function(t){n.isLoading=!1,n.emit(tf.renderEnd,t)})),n.player.on(Wc.slideChange,(function(t){n.__slideState.currentSlideIndex=t,n.emit(tf.slideChange,t)})),n.player.on(Wc.mainSeqStateChange,(function(t){n.__slideState.mainSeqState=t,n.emitStateChange()})),n.player.on(Wc.mainSeqStepChange,(function(t){n.__slideState.mainSeqStep=t,n.emitStateChange()})),n.player.on(Wc.animateStart,(function(){!0!==n.isAnimating&&(n.isAnimating=!0,n.emit(tf.animateStart))})),n.player.on(Wc.animateEnd,(function(){!1!==n.isAnimating&&(n.isAnimating=!1,n.emit(tf.animateEnd))})),n.player.on(Wc.interactiveAnimTrigger,(function(t){var e=t.action,r=t.seqId;n.__slideState.appliedInteractiveSeqIds.push(r),n.emitSyncDispatch({slideIndex:n.__slideState.currentSlideIndex,type:"interactiveAnim",action:e}),n.emitStateChange()})),n.player.on(Wc.mainSeqStepStart,(function(t){n.emit(tf.mainSeqStepStart)})),n.player.on(Wc.mainSeqStepEnd,(function(t){n.emit(tf.mainSeqStepEnd)})),n.player.on(Wc.mediaPlay,(function(t){var e={type:"play",time:n.timestamp()-1e3*t.time};n.__slideState.mediaState[t.id]=e,n.emitSyncDispatch({slideIndex:n.__slideState.currentSlideIndex,type:"mediaPlay",id:t.id,state:e}),n.emitStateChange()})),n.player.on(Wc.mediaPause,(function(t){var e={type:"pause",time:t.time};n.__slideState.mediaState[t.id]=e,n.emitSyncDispatch({slideIndex:n.__slideState.currentSlideIndex,type:"mediaPause",id:t.id,state:e}),n.emitStateChange()})),n.player.on(Wc.mediaSeek,(function(t){var e={type:"pause",time:0};t.isPlaying?(e.type="play",n.__slideState.mediaState[t.id]?e.time=n.__slideState.mediaState[t.id].time-1e3*t.time:e.time=n.timestamp()-1e3*t.time,n.__slideState.mediaState[t.id]=e):(e.type="pause",e.time=t.time,n.__slideState.mediaState[t.id]=e),n.emitSyncDispatch({slideIndex:n.__slideState.currentSlideIndex,type:"mediaSeek",id:t.id,time:t.time,state:e}),n.emitStateChange()})),n.player.on(Wc.requestPrevSlide,n.handlePrevSlide),n.player.on(Wc.requestNextSlide,n.handleNextSlide),n.player.on(Wc.requestGotoSlide,n.handleGotoSlide),n.on(tf.syncReceive,(function(t){n.syncQueue.addTask(t)})),n.renderingTaskManager.eventHub.on("task-error",(function(t){var e=t.error,r=t.task;n.emit(tf.renderError,{error:e,index:r.slideIndex})})),window.addEventListener("__slide_log__",n.handleLogDownload),window.addEventListener("__slide_state__",n.handleSlideStateLog),window.addEventListener("__slide_ref__",n.handleSlideRef),n.persistLogId=window.setInterval(n.persistLog,5e3),n.resizeView=Object(u.debounce)(n.resizeView.bind(n),100),n}return Zd(e,t),e.prototype.setMedianControllerAttribute=function(){this.medianController.id="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},e.prototype.frameResizeHandler=function(){var t=this.frame.getBoundingClientRect(),e=t.width,n=t.height;this.frameWidth=e,this.frameHeight=n,this.resizeView()},e.prototype.resizeView=function(){var t=this,e=this.width,n=this.height;if(e>0&&n>0){var r=this.frameWidth/e,i=r*n;if(i>this.frameHeight&&(r*=this.frameHeight/i),this.resize){var o=this.player.app;o.ticker.addOnce((function(){var e=r*(t.player.config.resolution||window.devicePixelRatio);o.renderer.resolution=e,o.renderer.plugins.interaction.resolution=o.renderer.resolution,o.renderer.resize(t.width,t.height)}))}this.view.style.transform="scale("+r+")",this.medianController.style.transform="scale("+r+")",this.medianController.style.top=(this.frameHeight-n*r)/2+"px"}},e.prototype.setSlideState=function(t){return Jd(this,void 0,void 0,(function(){var e,n=this;return Kd(this,(function(r){switch(r.label){case 0:return this.log+="=== stateChange receive ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n",t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,this.player.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,this.player.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.doRenderSlide(t.currentSlideIndex)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,kh((function(){return n.player.currentIndex===t.currentSlideIndex&&n.player.currentStage}),3e3)];case 3:return r.sent(),e=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(e=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(e=!0,this.__slideState.mainSeqState=t.mainSeqState),e&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),t.appliedInteractiveSeqIds&&t.appliedInteractiveSeqIds.length>0&&(this.__slideState.appliedInteractiveSeqIds=t.appliedInteractiveSeqIds,t.appliedInteractiveSeqIds.forEach((function(t){n.player.seekInteractiveSeqToEnd(t)}))),t.mediaState&&(this.initMedia(t),this.__slideState.mediaState=t.mediaState),[2]}}))}))},e.prototype.initMedia=function(t){var e=this,n=function(n){var i=t.mediaState[n],o=r.__slideState.mediaState[n];if(o&&i.type===o.type&&i.time===o.time)return"continue";"play"===i.type?r.player.setMediaState(n,!0).then((function(){var t=e.timestamp();e.player.setMediaCurrentTime(n,(t-i.time)/1e3)})):r.player.setMediaState(n,!1).then((function(){e.player.setMediaCurrentTime(n,i.time)}))},r=this;for(var i in t.mediaState)n(i)},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this.player.slideCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){return this.player.mainSeqLength()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){return this.player.mainSeqStep()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){return this.player.mainSeqState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){return this.player.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){return this.player.runtime.fps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){return this.player.fps.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.player.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.player.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.player.height},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player.updateConfig(t)},e.prototype.setResource=function(t,e){this.player.setResourceData(t,e),this.__slideState.taskId=t,this.__slideState.url=e,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:t,url:e}),this.logId=t+"-"+Math.random().toString(32).substr(2)},e.prototype._renderSlide=function(t){return Jd(this,void 0,void 0,(function(){return Kd(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,[4,this.player.renderSlide(t)];case 1:return e.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),this.emitStateChange(),[2]}}))}))},e.prototype.renderSlide=function(t,e){void 0===e&&(e=!0),this.isLoading=!0;var n=Number(t);(n!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(n>this.slideCount&&this.slideCount>0||("interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:n,isForward:e}):"sync"===this.mode?(this.doRenderSlide(n,e),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:n,isForward:e})):this.doRenderSlide(n,e)))},e.prototype.doRenderSlide=function(t,e){var n=this;void 0===e&&(e=!0);var r=Math.random().toString(2);return this.player.isForward=e,this.renderingTaskManager.addTask((function(){return n._renderSlide(t)}),t,r),new Promise((function(t){n.renderingTaskManager.eventHub.once("task-end-"+r,t)}))},e.prototype.nextStep=function(){this.isLoading||(this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep():this.handleNextSlide())},e.prototype.doNextStep=function(){this.player.nextStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()},e.prototype.prevStep=function(){this.isLoading||(this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide())},e.prototype.doPrevStep=function(){this.player.prevStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()},e.prototype.emitStateChange=function(){if("local"!==this.mode){var t=this.slideState;Object(u.isEqual)(this.lastEmitedState,t)||(this.lastEmitedState=t,this.emit(tf.stateChange,this.slideState),this.log+="=== stateChange dispatch ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(this.slideState,null,2),this.log+="\n\n")}},e.prototype.emitSyncDispatch=function(t){this.emit(tf.syncDispatch,t),this.log+="=== sync dispatch ["+(new Date).toISOString()+"] ===\n",this.log+=JSON.stringify(t,null,2),this.log+="\n\n"},e.prototype.setMainSeqStep=function(t,e){this.player.setMainSeqStep(t,e)},e.prototype.setInteractive=function(t){this.interactive=t,this.player.setInteractive(t)},e.prototype.pause=function(){this.player.pause()},e.prototype.resume=function(){this.player.resume()},e.prototype.destroy=function(){this.frameResizeObserver.disconnect(),this.player.removeAllListeners(),this.player.destroy(),this.player.removeAllListeners(),window.removeEventListener("__slide_log__",this.handleLogDownload),window.removeEventListener("__slide_state__",this.handleSlideStateLog),window.clearInterval(this.persistLogId),$d&&$d.removeItem(this.logId).catch((function(){}));try{this.anchor.removeChild(this.player.view)}catch(t){}},e}(a.a)}]);