@haiku/player
Version:
Haiku Player is a JavaScript library for building user interfaces
1 lines • 201 kB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).HaikuDOMPlayer=e()}}(function(){return function e(t,n,r){function i(o,l){if(!n[o]){if(!t[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return i(n||e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{i="function"==typeof clearTimeout?clearTimeout:l}catch(e){i=l}}();function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}var u,c=[],f=!1,d=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!f){var e=s(p);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new y(e,t)),1!==c.length||f||s(h)};function y(e,t){this.fun=e,this.array=t}y.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function m(){}a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],2:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i={onHaikuComponentWillInitialize:null,onHaikuComponentDidMount:null,onHaikuComponentWillMount:null,onHaikuComponentDidInitialize:null,onHaikuComponentWillUnmount:null,options:{seed:null,automount:!0,autoplay:!0,forceFlush:!1,freeze:!1,loop:!1,frame:null,clock:{},sizing:null,alwaysComputeSizing:!0,preserve3d:"auto",contextMenu:"enabled",position:"relative",overflowX:null,overflowY:null,overflow:null,mixpanel:"6f31d4f99cf71024ce27c3e404a79a61",useWebkitPrefix:void 0,interactionMode:e("./helpers/interactionModes").InteractionMode.LIVE},states:null,eventHandlers:null,timelines:null,vanities:null,children:null,placeholder:null};n.default={build:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n={onHaikuComponentWillInitialize:null,onHaikuComponentDidMount:null,onHaikuComponentDidInitialize:null,onHaikuComponentWillUnmount:null,options:null,states:null,eventHandlers:null,timelines:null,template:null,vanities:null,children:null,placeholder:null},a=e.slice();return a.unshift(i),a.forEach(function(e){if(e&&"object"==typeof e){e.onHaikuComponentWillInitialize&&(n.onHaikuComponentWillInitialize=e.onHaikuComponentWillInitialize),e.onHaikuComponentDidMount&&(n.onHaikuComponentDidMount=e.onHaikuComponentDidMount),e.onHaikuComponentDidInitialize&&(n.onHaikuComponentDidInitialize=e.onHaikuComponentDidInitialize),e.onHaikuComponentWillUnmount&&(n.onHaikuComponentWillUnmount=e.onHaikuComponentWillUnmount),e.options&&(n.options=r({},n.options,e.options));for(var t in e)void 0!==e[t]&&i.options.hasOwnProperty(t)&&(n.options[t]=e[t]);e.states&&(n.states=r({},n.states,e.states)),e.initialStates&&"object"==typeof e.initialStates&&(n.states=r({},n.states,e.initialStates)),e.eventHandlers&&(n.eventHandlers=r({},n.eventHandlers,e.eventHandlers)),e.timelines&&(n.timelines=r({},n.timelines,e.timelines)),e.vanities&&(n.vanities=r({},n.vanities,e.vanities)),e.children&&(n.children=e.children),e.placeholder&&(n.placeholder=e.placeholder)}}),n.options.overflow&&(n.options.overflowX||n.options.overflowY)&&(console.warn("[haiku player] `overflow` overrides `overflowY`/`overflowX`"),n.options.overflowX=null,n.options.overflowY=null),n},seed:function(){return Math.random().toString(36).slice(2)},DEFAULTS:i}},{"./helpers/interactionModes":34}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./HaikuGlobal"),i=e("./helpers/SimpleEventEmitter"),a=e("./vendor/assign"),o=e("./vendor/raf"),l={frameDuration:16.666,frameDelay:16.666,marginOfErrorForDelta:1};r.default.HaikuGlobalAnimationHarness||(r.default.HaikuGlobalAnimationHarness={},r.default.HaikuGlobalAnimationHarness.queue=[],r.default.HaikuGlobalAnimationHarness.frame=function(){for(var e=r.default.HaikuGlobalAnimationHarness.queue,t=e.length,n=0;n<t;n++)e[n]();r.default.HaikuGlobalAnimationHarness.raf=o.default.request(r.default.HaikuGlobalAnimationHarness.frame)},r.default.HaikuGlobalAnimationHarness.cancel=function(){r.default.HaikuGlobalAnimationHarness.raf&&o.default.cancel(r.default.HaikuGlobalAnimationHarness.raf)},r.default.HaikuGlobalAnimationHarness.frame());function s(e,t,n){i.default.create(this),this._tickables=e,this._component=t,this.assignOptions(n),this._isRunning=!1,this._reinitialize(),r.default.HaikuGlobalAnimationHarness.queue.push(this.run.bind(this)),this.GLOBAL_ANIMATION_HARNESS=r.default.HaikuGlobalAnimationHarness,this._entityIndex=s.clocks.push(this)-1}n.default=s,s.clocks=[],r.default.HaikuClock=s,s.prototype._reinitialize=function(){return this._numLoopsRun=0,this._localFramesElapsed=0,this._localTimeElapsed=0,this._deltaSinceLastTick=0,this._localExplicitlySetTime=null,this},s.prototype.addTickable=function(e){return this._tickables.push(e),this},s.prototype.assignOptions=function(e){return this.options=a.default(this.options||{},l,e||{}),this},s.prototype.run=function(){if(this.isRunning())if(this._isTimeControlled())this.tick();else{this._numLoopsRun++;var e=this._localTimeElapsed,t=e+this.options.frameDuration,n=t-e+this._deltaSinceLastTick;n>=this.options.frameDelay-this.options.marginOfErrorForDelta?(this.tick(),this._localFramesElapsed++,this._localTimeElapsed=t,this._deltaSinceLastTick=0):this._deltaSinceLastTick=n}return this},s.prototype.tick=function(){for(var e=0;e<this._tickables.length;e++)this._tickables[e].performTick();return this},s.prototype.getTime=function(){return this.getExplicitTime()},s.prototype.setTime=function(e){return this._localExplicitlySetTime=parseInt(e||0,10),this},s.prototype.getFPS=function(){return Math.round(1e3/this.options.frameDuration)},s.prototype.getExplicitTime=function(){return this._isTimeControlled()?this.getControlledTime():this.getRunningTime()},s.prototype.getControlledTime=function(){return this._localExplicitlySetTime},s.prototype._isTimeControlled=function(){return"number"==typeof this._localExplicitlySetTime},s.prototype.getRunningTime=function(){return this._localTimeElapsed},s.prototype.isRunning=function(){return this._isRunning},s.prototype.start=function(){return this._isRunning=!0,this},s.prototype.stop=function(){return this._isRunning=!1,this},s.prototype.getFrameDuration=function(){return this.options.frameDuration}},{"./HaikuGlobal":6,"./helpers/SimpleEventEmitter":18,"./vendor/assign":96,"./vendor/raf":148}],4:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./Config"),a=e("./HaikuGlobal"),o=e("./HaikuTimeline"),l=e("./helpers/addElementToHashTable"),s=e("./helpers/applyPropertyToElement"),u=e("./helpers/clone"),c=e("./helpers/consoleErrorOnce"),f=e("./helpers/cssQueryList"),d=e("./helpers/interactionModes"),p=e("./helpers/isMutableProperty"),h=e("./helpers/manaFlattenTree"),y=e("./helpers/scopifyElements"),m=e("./helpers/SimpleEventEmitter"),g=e("./helpers/upgradeBytecodeInPlace"),v=e("./helpers/initializeComponentTree"),_=e("./Layout3D"),b=e("./ValueBuilder"),k=e("./vendor/assign"),x=e("./../package.json").version,T="string",w="object",O="haiku-id",I="Default";function A(e,t,n,r){var i=this;if(!e)throw new Error("Empty bytecode not allowed");if(!e.template)throw new Error("Bytecode must define template");if(!t)throw new Error("Component requires a context");if(!n.options)throw new Error("Config options required");if(!n.options.seed)throw new Error("Seed value must be provided");e.timelines||(e.timelines={}),m.default.create(this),this.PLAYER_VERSION=x,this.emit("haikuComponentWillInitialize",this),n.onHaikuComponentWillInitialize&&n.onHaikuComponentWillInitialize(this),n.options.hotEditingMode?this._bytecode=e:this._bytecode=u.default(e),g.default(this._bytecode,{referenceUniqueness:n.options.hotEditingMode?void 0:Math.random().toString(36).slice(2)}),this._context=t,this.cache={},this._builder=new b.default(this),this._states={},this.state={},this._stateChanges={},this._anyStateChange=!1,this._eventsFired={},this._anyEventChange=!1,this.assignConfig(n),this._metadata=r||{},this._timelineInstances={},this._mutableTimelines=void 0,this._hydrateMutableTimelines(),this._flatManaTree=[],this._bytecode.template.attributes[O]||console.warn("[haiku player] bytecode template has no id"),function(e){if(!e)throw new Error("Empty template not allowed");if(typeof e===w)return e.elementName||console.warn("[haiku player] warning: saw unexpected bytecode template format"),e;throw new Error("Unknown bytecode template format")}(this._bytecode.template),n.options.hotEditingMode?this._template=this._bytecode.template:this._template=function e(t){if(!t)return t;if(typeof t===T)return t;var n={elementName:t.elementName,attributes:null,children:null};if(t.attributes){n.attributes={};for(var r in t.attributes)if(t.attributes[r]&&"object"==typeof t.attributes[r]){n.attributes[r]={};for(var i in t.attributes[r])n.attributes[r][i]=t.attributes[r][i]}else n.attributes[r]=t.attributes[r]}if(t.children){n.children=[];for(var a=0;a<t.children.length;a++)n.children[a]=e(t.children[a])}return n}(this._bytecode.template),this._needsFullFlush=!1,this._alwaysFlush=!1,this._lastTemplateExpansion=null,this._lastDeltaPatches=null,this._matchedElementCache={},this._renderScopes={},this._doesEmitEventsVerbosely=!1,this._frameEventListeners={},this._nestedComponentElements={},this._hashTableOfIdsToElements={},this._registeredElementEventListeners={},this._horizonElements={},this._controlFlowData={},this.on("timeline:tick",function(e,t,n){if(i._frameEventListeners[e]&&i._frameEventListeners[e][t])for(var r=0;r<i._frameEventListeners[e][t].length;r++)i._frameEventListeners[e][t][r](t,n)}),this.emit("haikuComponentDidInitialize",this),n.onHaikuComponentDidInitialize&&n.onHaikuComponentDidInitialize(this),this._isDeactivated=!1,this._isSleeping=!1,this._entityIndex=A.components.push(this)-1}n.default=A,A.PLAYER_VERSION=x,A.components=[],a.default.HaikuComponent=A,A.prototype._markHorizonElement=function(e){if(e&&e.attributes){var t=e.attributes[O]||e.attributes.id;t&&(this._horizonElements[t]=e)}},A.prototype._isHorizonElement=function(e){if(e&&e.attributes){var t=e.attributes[O]||e.attributes.id;return!!this._horizonElements[t]}return!1},A.prototype._getRealElementsAtId=function(e){return this._hashTableOfIdsToElements[e]?this._hashTableOfIdsToElements[e]:[]},A.prototype._addElementToHashTable=function(e,t){return l.default(this._hashTableOfIdsToElements,e,t),this},A.prototype._didElementRenderSurrogate=function(e,t,n){if(!e)return!1;if(!e.attributes)return!1;var r=e.attributes["haiku-id"]||e.attributes.id;return!!r&&(!!this._controlFlowData[r]&&(!!this._controlFlowData[r].renderedSurrogates&&this._controlFlowData[r].renderedSurrogates[t]===n))},A.prototype._markElementSurrogateAsRendered=function(e,t,n){var r=e&&e.attributes&&(e.attributes["haiku-id"]||e.attributes.id);r&&(this._controlFlowData[r]||(this._controlFlowData[r]={}),this._controlFlowData[r].renderedSurrogates||(this._controlFlowData[r].renderedSurrogates={}),this._controlFlowData[r].renderedSurrogates[t]=n)},A.prototype.callRemount=function(e,t){this.emit("haikuComponentWillMount",this),this.config.onHaikuComponentWillMount&&this.config.onHaikuComponentWillMount(this),e&&this.assignConfig(e),t||(this._markForFullFlush(),this.clearCaches());var n=this.getTimelines();for(var r in n){var i=n[r];this.config.options.autoplay?r===I&&i.play({skipMarkForFullFlush:t}):i.pause()}this._context.contextMount(),this.emit("haikuComponentDidMount",this),this.config.onHaikuComponentDidMount&&this.config.onHaikuComponentDidMount(this)},A.prototype.callUnmount=function(e){e&&this.assignConfig(e);var t=this.getTimelines();for(var n in t){t[n].pause()}this._context.contextUnmount(),this.emit("haikuComponentWillUnmount",this),this.config.onHaikuComponentWillUnmount&&this.config.onHaikuComponentWillUnmount(this)},A.prototype.assignConfig=function(e){this.config=i.default.build(this.config||{},e||{}),this._context.assignConfig(this.config,{skipComponentAssign:!0});for(var t in this._timelineInstances){this._timelineInstances[t].assignOptions(this.config.options)}return L(this._states,this,this.config.states),S(this,this.config.eventHandlers),k.default(this._bytecode.timelines,this.config.timelines),this},A.prototype.set=function(e,t){return this.state[e]=t,this},A.prototype.get=function(e){return this.state[e]},A.prototype.setState=function(e){if(!e)return this;if("object"!=typeof e)return this;for(var t in e)this.set(t,e[t]);return this},A.prototype.getStates=function(){return this.state},A.prototype.clearCaches=function(e){if(this._states={},(!e||e&&!1!==e.clearStates)&&L(this._states,this,this.config.states),e&&e.clearPreviouslyRegisteredEventListeners&&this.clearRegisteredElementEventListeners(),(!e||e&&!1!==e.clearEventHandlers)&&S(this,this.config.eventHandlers),this._stateChanges={},this._anyStateChange=!1,this._eventsFired={},this._anyEventChange=!1,this._needsFullFlush=!1,this._lastTemplateExpansion=null,this._lastDeltaPatches=null,this._renderScopes={},this._controlFlowData={},this._rehydrateFlatManaTree(),this._matchedElementCache={},this._clearDetectedEventsFired(),this._clearDetectedInputChanges(),this._builder.clearCaches(e),this._hydrateMutableTimelines(),this.cache={},this._bytecode.timelines)for(var t in this._bytecode.timelines)delete this._bytecode.timelines[t].__max;return this},A.prototype.getClock=function(){return this._context.getClock()},A.prototype.getTimelines=function(){return this._fetchTimelines()},A.prototype._fetchTimelines=function(){for(var e=Object.keys(this._bytecode.timelines),t=0;t<e.length;t++){var n=e[t];if(n){var r=this._getTimelineDescriptor(n);this._timelineInstances[n]||(this._timelineInstances[n]=new o.default(this,n,r,this.config.options))}}return this._timelineInstances},A.prototype.getTimeline=function(e){return this.getTimelines()[e]},A.prototype.getDefaultTimeline=function(){return this.getTimelines()[I]},A.prototype.getActiveTimelines=function(){var e={},t=this.getTimelines();for(var n in t){var r=t[n];r.isActive()&&(e[n]=r)}return e},A.prototype.stopAllTimelines=function(){for(var e in this._timelineInstances)this.stopTimeline(e)},A.prototype.startAllTimelines=function(){for(var e in this._timelineInstances)this.startTimeline(e)},A.prototype.startTimeline=function(e){var t=this._context.clock.getExplicitTime(),n=this._getTimelineDescriptor(e),r=this._timelineInstances[e];if(r)r.start(t,n);else{var i=new o.default(this,e,n,this.config.options);i.start(t,n),this._timelineInstances[e]=i}},A.prototype.stopTimeline=function(e){var t=this._context.clock.getExplicitTime(),n=this._getTimelineDescriptor(e),r=this._timelineInstances[e];r&&r.stop(t,n)},A.prototype._getTimelineDescriptor=function(e){return this._bytecode.timelines[e]},A.prototype._getInjectables=function(e){var t={};k.default(t,this._builder._getSummonablesSchema(e));for(var n in this._states){var r=this._states[n].type;r||(r=typeof this._states[n]),t[n]=r}return t},A.prototype._getTopLevelElement=function(){return this._template},A.prototype.deactivate=function(){return this._isDeactivated=!0,this},A.prototype.isDeactivated=function(){return this._isDeactivated},A.prototype.sleepOn=function(){return this._isSleeping=!0,this},A.prototype.sleepOff=function(){return this._isSleeping=!1,this},A.prototype.isSleeping=function(){return this._isSleeping},A.prototype.clearRegisteredElementEventListeners=function(){for(var e in this._registeredElementEventListeners)for(var t in this._registeredElementEventListeners[e]){var n=this._registeredElementEventListeners[e][t],r=n.target,i=n.handler;r&&i&&this._context._renderer.removeListener&&this._context._renderer.removeListener(r,i,t),delete this._registeredElementEventListeners[e][t]}this._frameEventListeners={}},A.prototype.hasRegisteredListenerOnElement=function(e,t){var n=e.attributes[O]||e.attributes.id;return!!n&&(this._registeredElementEventListeners[n]&&this._registeredElementEventListeners[n][t])},A.prototype.markDidRegisterListenerOnElement=function(e,t,n,r){var i=e.attributes[O]||e.attributes.id;return i?(this._registeredElementEventListeners[i]||(this._registeredElementEventListeners[i]={}),this._registeredElementEventListeners[i][n]={handler:r,target:t},this):this},A.prototype.dump=function(){return this.getBytecodeMetadata().relpath+":"+this.getComponentId()+"["+this._entityIndex+"]"},A.prototype.getComponentId=function(){return this._bytecode.template.attributes[O]},A.prototype.getBytecodeMetadata=function(){return this._bytecode.metadata},A.prototype.getAddressableProperties=function(e){var t=this;if(void 0===e&&(e={}),!this._bytecode.states)return e;var n=function(n){var i=r._bytecode.states[n];e[n]={name:n,type:"state",prefix:n,suffix:void 0,fallback:i.value,typedef:i.type,mock:i.mock,target:r,value:function(){return t.state[n]}}},r=this;for(var i in this._bytecode.states)n(i);return e};function S(e,t){var n=k.default({},e._bytecode.eventHandlers,t);for(var r in n){var i=n[r];for(var a in i){E(e,i[a],r,a)}}}function E(e,t,n,r){t.original&&(t.handler=t.original),t.original=t.handler,t.handler=function(i){for(var a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];if(d.isPreviewMode(e.config.options.interactionMode)){e._anyEventChange=!0,e._eventsFired[n]||(e._eventsFired[n]={}),e._eventsFired[n][r]=i||!0;try{(l=t.original).call.apply(l,[e,i].concat(a))}catch(e){return c.default(e),1}}var l}}function M(e,t){if("any"!==e.type&&"*"!==e.type&&void 0!==e.type&&null!==e.type)if("event"!==e.type&&"listener"!==e.type){if("array"===e.type){if(!Array.isArray(e.value))throw new Error("Property value `"+t+"` must be an array")}else if("object"===e.type){if(e.value&&"object"!=typeof e.value)throw new Error("Property value `"+t+"` must be an object")}else if(typeof e.value!==e.type)throw new Error("Property value `"+t+"` must be a `"+e.type+"`")}else if("function"!=typeof e.value&&null!==e.value&&void 0!==e.value)throw new Error("Property value `"+t+"` must be an event listener function")}function L(e,t,n){var r=k.default({},t._bytecode.states,n);for(var i in r){var a=r[i];if(void 0===a.value)throw new Error("Property `"+i+"` cannot be undefined; use null for empty states");M(a,i),e[i]=a.value,C(t,t.state,e,a,i)}}function C(e,t,n,r,i){Object.defineProperty(t,i,{configurable:!0,get:function(){return n[i]},set:function(t){return e._stateChanges[i]=t,e._anyStateChange=!0,r.setter?n[i]=r.setter.call(e,t):n[i]=t,e._doesEmitEventsVerbosely&&e.emit("state:set",i,n[i],n),n[i]}})}A.prototype._markForFullFlush=function(){return this._needsFullFlush=!0,this},A.prototype._unmarkForFullFlush=function(){return this._needsFullFlush=!1,this},A.prototype._shouldPerformFullFlush=function(){return this._needsFullFlush||this._alwaysFlush},A.prototype._clearDetectedEventsFired=function(){return this._anyEventChange=!1,this._eventsFired={},this},A.prototype._clearDetectedInputChanges=function(){return this._anyStateChange=!1,this._stateChanges={},this},A.prototype.patch=function(e,t,n){if(void 0===n&&(n=!1),this.isDeactivated())return{};var r=this._context.clock.getExplicitTime(),i=[];for(var a in this._timelineInstances){var o=this._timelineInstances[a];o.isActive()&&(o._doUpdateWithGlobalClockTime(r),"Default"!==a&&o.isFinished()||i.push(o))}this._lastDeltaPatches=function(e,t,n,r,i,a,o){void 0===o&&(o=!1);_.default.initializeTreeAttributes(t,n),v.default(t,e,r,null);var l={};P(i,l,e,r,!0,o),a.sizing&&R(t,n,a.sizing,l);for(var s in l){var u=l[s];z(u,u.__parent,a,r)}return l}(this,this._template,e,this._context,i,t,n);for(var l in this._nestedComponentElements){var s=this._nestedComponentElements[l];this._lastDeltaPatches[l]=s,s.__instance.patch(s,{})}return this._clearDetectedEventsFired(),this._clearDetectedInputChanges(),this._lastDeltaPatches},A.prototype._getPrecalcedPatches=function(){return this.isDeactivated()?{}:this._lastDeltaPatches||{}},A.prototype._rehydrateFlatManaTree=function(){return this._flatManaTree=h.default(this._template,j),this._flatManaTree},A.prototype.render=function(e,t){if(!this.isDeactivated()){var n=this._context.clock.getExplicitTime(),r=this._flatManaTree.length;this._rehydrateFlatManaTree(),r.length!==this._flatManaTree.length&&(this._matchedElementCache={});for(var i in this._timelineInstances){var a=this._timelineInstances[i];a.isActive()&&a._doUpdateWithGlobalClockTime(n)}return function(e,t,n,r,i){var a=[];if(e._bytecode.timelines)for(var o in e._bytecode.timelines){var l=e.getTimeline(o);l&&(l.isActive()&&(l.isFinished()&&o!==I||a.push(l)))}_.default.initializeTreeAttributes(t,n),v.default(t,e,r,null),y.default(t,null,null),P(a,null,e,r,!1),i.sizing&&R(t,n,i.sizing,null);z(t,n,i,r)}(this,this._template,e,this._context,t||{}),this._lastTemplateExpansion=function e(t,n,r){if(t.__handlers)for(var i in t.__handlers){var a=t.__handlers[i];a.__subscribed||t.__instance&&t.__instance.instance&&(t.__instance.instance.on(i,a),a.__subscribed=!0)}if(t.__instance){var o=D(t),l=o.children,s=t.__instance.render(t,t.__instance.config.options,l);if(s){var u=e(s,t.__instance,r);o.children=[u]}else o.children=[];return o}if(typeof t.elementName===T){var c=D(t);if(t.children&&t.children.length>0)for(var f=0;f<t.children.length;f++){var d=t.children[f];c.children[f]=e(d,n,r)}return c}return t}(this._template,this,this._context),this._unmarkForFullFlush(),this._lastTemplateExpansion}},A.prototype.findElementsByHaikuId=function(e){return N("haiku:"+e,this._flatManaTree,this._matchedElementCache)},A.prototype._hydrateMutableTimelines=function(){if(this._mutableTimelines={},this._bytecode.timelines)for(var e in this._bytecode.timelines)for(var t in this._bytecode.timelines[e])for(var n in this._bytecode.timelines[e][t])if(p.default(this._bytecode.timelines[e][t][n],n)){var i=this._mutableTimelines[e]||{},a=i[t]||{};this._mutableTimelines=r({},this._mutableTimelines,(o={},o[e]=r({},i,(l={},l[t]=r({},a,(s={},s[n]=this._bytecode.timelines[e][t][n],s)),l)),o))}var o,l,s};function P(e,t,n,r,i,a){void 0===a&&(a=!1),i||function(e){if(e._bytecode.eventHandlers)for(var t in e._bytecode.eventHandlers){var n=e._bytecode.eventHandlers[t];for(var r in n){var i=n[r];if(!i.handler.__subscribed&&!i.handler.__external){if("component:will-mount"===r){e.on("haikuComponentWillMount",i.handler),i.handler.__subscribed=!0;continue}if("component:did-mount"===r){e.on("haikuComponentDidMount",i.handler),i.handler.__subscribed=!0;continue}if("component:will-unmount"===r){e.on("haikuComponentWillUnmount",i.handler),i.handler.__subscribed=!0;continue}var a=r.split(":");if(a.length>1&&"timeline"===a[0]){var o=a[1],l=parseInt(a[2],10);e._frameEventListeners[o]||(e._frameEventListeners[o]={}),e._frameEventListeners[o][l]||(e._frameEventListeners[o][l]=[]),e._frameEventListeners[o][l].push(i.handler),i.handler.__subscribed=!0;continue}i.handler.__external=!0}}var s=N(t,e._flatManaTree,e._matchedElementCache);if(s&&!(s.length<1))for(var u=0;u<s.length;u++)for(var c in n){var f=n[c];f.__subscribed||U(s[u],c,f.handler)}}}(n);for(var o=0;o<e.length;o++){var l=e[o],u=l.getName(),c=i&&!n.config.options.hotEditingMode?n._mutableTimelines[u]:n._bytecode.timelines[u];if("object"==typeof c){var f=l.getBoundedTime();for(var d in c){var p=c[d];if(p){var h=N(d,n._flatManaTree,n._matchedElementCache);if(h&&!(h.length<1))for(var y=0;y<h.length;y++){var m=h[y],g=m&&m.attributes&&m.attributes.id,v=m&&m.attributes&&m.attributes[O]||g,_=n._builder.build({},u,f,v,m,p,i,n,a);if(_&&_.transform&&(m.__transformed=!0),_&&t&&v&&(t[v]=m),_)for(var b in _){var k=_[b];s.default(m,b,k,r,n)}}}}}}}function D(e){var t={__instance:null,__handlers:null,__transformed:null,__parent:null,__scope:null,__target:null,layout:null,elementName:null,attributes:null,children:null};t.__instance=e.__instance,t.__handlers=e.__handlers,t.__transformed=e.__transformed,t.__parent=e.__parent,t.__scope=e.__scope,t.__target=e.__target,t.layout=e.layout,t.elementName=e.elementName,t.attributes={};for(var n in e.attributes)t.attributes[n]=e.attributes[n];return t.children=[],t}var j={name:"elementName",attributes:"attributes",children:"children"};function N(e,t,n){return n[e]?n[e]:n[e]=f.default(t,e,j)}function z(e,t,n,r){if(e&&"string"!=typeof e&&(function(e,t){if(t){var n=t.layout.computed.size;e.layout.computed=_.default.computeLayout(e.layout,e.layout.matrix,n)}}(e,t),e.children&&!(e.children.length<1)))for(var i=0;i<e.children.length;i++)z(e.children[i],e,n,r)}function U(e,t,n){return e.__handlers||(e.__handlers={}),e.__handlers[t]=n,e}function R(e,t,n,r){var i=e.layout.sizeAbsolute.x,a=e.layout.sizeAbsolute.y,o=t.layout.computed.size.x,l=t.layout.computed.size.y,s=o/i,u=l/a;e.attributes.style["transform-origin"]||(e.attributes.style["transform-origin"]="top left");var c=!1;switch(n){case"normal":1===e.layout.scale.x&&1===e.layout.scale.y||(c=!0,e.layout.scale.x=e.layout.scale.y=1);break;case"stretch":s!==e.layout.scale.x&&(c=!0,e.layout.scale.x=s),u!==e.layout.scale.y&&(c=!0,e.layout.scale.y=u);break;case"contain":case!0:var f=null;~~(s*i)<=o&&~~(s*a)<=l&&(f=s),~~(u*i)<=o&&~~(u*a)<=l&&(null===f?f=u:u>=f&&(f=u)),e.layout.scale.x!==f&&(c=!0,e.layout.scale.x=f),e.layout.scale.y!==f&&(c=!0,e.layout.scale.y=f);var d=-(f*i-o)/2,p=-(f*a-l)/2;e.layout.translation.x!==d&&(c=!0,e.layout.translation.x=d),e.layout.translation.y!==p&&(c=!0,e.layout.translation.y=p);break;case"cover":var h=null;h=~~(s*a)>=l?s:~~(u*i)>=o?u:Math.max(s,u),e.layout.scale.x!==h&&(c=!0,e.layout.scale.x=h),e.layout.scale.y!==h&&(c=!0,e.layout.scale.y=h);var y=-(h*i-o)/2,m=-(h*a-l)/2;e.layout.translation.x!==y&&(c=!0,e.layout.translation.x=y),e.layout.translation.y!==m&&(c=!0,e.layout.translation.y=m)}c&&r&&(r[e.attributes[O]]=e)}},{"./../package.json":170,"./Config":2,"./HaikuGlobal":6,"./HaikuTimeline":8,"./Layout3D":9,"./ValueBuilder":11,"./helpers/SimpleEventEmitter":18,"./helpers/addElementToHashTable":19,"./helpers/applyPropertyToElement":21,"./helpers/clone":23,"./helpers/consoleErrorOnce":24,"./helpers/cssQueryList":31,"./helpers/initializeComponentTree":33,"./helpers/interactionModes":34,"./helpers/isMutableProperty":35,"./helpers/manaFlattenTree":36,"./helpers/scopifyElements":39,"./helpers/upgradeBytecodeInPlace":41,"./vendor/assign":96}],5:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./Config"),a=e("./HaikuClock"),o=e("./HaikuComponent"),l=e("./HaikuGlobal"),s=e("./helpers/PRNG"),u=e("./../package.json").version,c="Default";function f(e,t,n,r,i){if(!t)throw new Error("Context requires a renderer");if(!r)throw new Error("Context requires bytecode");this.PLAYER_VERSION=u,this._prng=null,this.assignConfig(i||{}),this._mount=e,this._mount&&!this._mount.haiku&&(this._mount.haiku={context:this}),this._renderer=t,this._mount&&this._renderer.initialize&&this._renderer.initialize(this._mount),this._platform=n,this._entityIndex=f.contexts.push(this)-1,this._tickables=[],this._tickables.push({performTick:this.tick.bind(this)}),this.config.options.frame&&this._tickables.push({performTick:this.config.options.frame}),this.component=new o.default(r,this,this.config,null),this.clock=new a.default(this._tickables,this.component,this.config.options.clock||{}),this.clock.run(),this.component.startTimeline(c),this._mount&&this._renderer.menuize&&"disabled"!==this.config.options.contextMenu&&this._renderer.menuize(this._mount,this.component),this._mount&&this._platform&&this._platform.location&&"localhost"!==this._platform.location.hostname&&"0.0.0.0"!==this._platform.location.hostname&&this._renderer.mixpanel&&this.config.options.mixpanel&&this._renderer.mixpanel(this._mount,this.config.options.mixpanel,this.component),this._ticks=0,this.config.options.automount&&this.component.getClock().start()}n.default=f,f.contexts=[],f.PLAYER_VERSION=u,l.default.HaikuContext=f,f.prototype.getRootComponent=function(){return this.component},f.prototype.getClock=function(){return this.clock},f.prototype.contextMount=function(){if(this._unmountedTickables)for(var e=this._unmountedTickables.splice(0),t=0;t<e.length;t++)this.addTickable(e[t])},f.prototype.contextUnmount=function(){this._unmountedTickables=this._tickables.splice(0)},f.prototype.addTickable=function(e){for(var t=!1,n=0;n<this._tickables.length;n++)if(e===this._tickables[n]){t=!0;break}t||this._tickables.push(e)},f.prototype.removeTickable=function(e){for(var t=this._tickables.length-1;t>=0;t--)e===this._tickables[t]&&this._tickables.splice(t,1)},f.prototype.assignConfig=function(e,t){this.config=r({},e),this.clock&&this.clock.assignOptions(this.config.options.clock),this.component&&(t&&t.skipComponentAssign||this.component.assignConfig(this.config)),this._prng=new s.default(this.config.options.seed)},f.prototype.performFullFlushRender=function(){if(this._mount){var e=this._renderer.createContainer(this._mount),t=this.component.render(e,this.config.options);void 0!==t&&this._renderer.render(this._mount,e,t,this.component)}},f.prototype.performPatchRender=function(e){if(void 0===e&&(e=!1),this._mount){var t=this._renderer.shouldCreateContainer?this._renderer.createContainer(this._mount):this._renderer.getLastContainer(),n=this.component.patch(t,this.config.options,e);this._renderer.patch(this._mount,n,this.component)}},f.prototype.updateMountRootStyles=function(){if(this._mount){var e=this._mount&&this._mount.children[0];e&&(this.config.options.position&&e.style.position!==this.config.options.position&&(e.style.position=this.config.options.position),this.config.options.overflow?e.style.overflow=this.config.options.overflow:(this.config.options.overflowX&&e.style.overflowX!==this.config.options.overflowX&&(e.style.overflowX=this.config.options.overflowX),this.config.options.overflowY&&e.style.overflowY!==this.config.options.overflowY&&(e.style.overflowY=this.config.options.overflowY)))}},f.prototype.tick=function(e){void 0===e&&(e=!1);var t=!1;this.component.isDeactivated()||this.component.isSleeping()||(this.component._shouldPerformFullFlush()||this.config.options.forceFlush||this._ticks<1?(this.performFullFlushRender(),t=!0):this.performPatchRender(e),this.updateMountRootStyles(),this._ticks<1&&this.component.callRemount(null,t),this._ticks++)},f.prototype.getDeterministicRand=function(){return this._prng.random()},f.prototype.getDeterministicTime=function(){var e=this.getClock().getRunningTime();return this.config.options.timestamp+e},f.prototype._getGlobalUserState=function(){return this._renderer&&this._renderer.getUser&&this._renderer.getUser()},f.createComponentFactory=function(e,t,n,r){if(!e)throw new Error("A runtime renderer class object is required");if(!t)throw new Error("A runtime `bytecode` object is required");var a=i.default.build({options:{seed:i.default.seed(),timestamp:Date.now()}},{options:t&&t.options},n);function o(n,l){var s=i.default.build(a,l),u=new e(s),c=new f(n,u,r,t,s),d=c.getRootComponent();return o.bytecode=t,o.renderer=u,o.mount=n,o.context=c,o.component=d,d}return o.PLAYER_VERSION=u,o}},{"./../package.json":170,"./Config":2,"./HaikuClock":3,"./HaikuComponent":4,"./HaikuGlobal":6,"./helpers/PRNG":16}],6:[function(e,t,n){(function(t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./reflection/enhance"),i=e("./reflection/inject");var a=function(){var e={};return"undefined"!=typeof window?e=window:void 0!==t&&(e=t),e.haiku||(e.haiku={}),e.haiku.enhance||(e.haiku.enhance=r.default),e.haiku.inject||(e.haiku.inject=i.default),e.haiku}();n.default=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./reflection/enhance":56,"./reflection/inject":58}],7:[function(e,t,n){(function(t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./../package.json").version,i="undefined"!=typeof window?window:void 0!==t?t:{};i.HaikuHelpers||(i.HaikuHelpers={}),i.HaikuHelpers[r]||(i.HaikuHelpers[r]={helpers:{},schema:{}});var a=i.HaikuHelpers[r];a.register=function(e,t){return a.helpers[e]=t,a.schema[e]="function",a},n.default=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./../package.json":170}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./helpers/getTimelineMaxTime"),i=e("./helpers/SimpleEventEmitter"),a=e("./vendor/assign"),o={loop:!0};function l(e,t,n,a){i.default.create(this),this._component=e,this._name=t,this._descriptor=n,this.assignOptions(a||{}),this._globalClockTime=0,this._localElapsedTime=0,this._localExplicitlySetTime=null,this._maxExplicitlyDefinedTime=r.default(n),this._isActive=!1,this._isPlaying=!1}n.default=l,l.prototype.assignOptions=function(e){return this.options=a.default(this.options||{},o,e||{}),this},l.prototype._ensureClockIsRunning=function(){var e=this._component.getClock();return e.isRunning()||e.start(),this},l.prototype._setComponent=function(e){return this._component=e,this},l.prototype._updateInternalProperties=function(e){var t=e-this._globalClockTime;this._globalClockTime=e,this._isTimeControlled()?this._localElapsedTime=this._localExplicitlySetTime:(this.options.loop&&this._localElapsedTime>this._maxExplicitlyDefinedTime&&(this._localElapsedTime=0+this._maxExplicitlyDefinedTime-this._localElapsedTime),this._localElapsedTime+=t),this.isFinished()&&(this._isPlaying=!1)},l.prototype._doUpdateWithGlobalClockTime=function(e){return this.isFrozen()?this._updateInternalProperties(this._globalClockTime):this._updateInternalProperties(e),this.isActive()&&this.isPlaying()&&this._shout("tick"),this._shout("update"),this},l.prototype._resetMaxDefinedTimeFromDescriptor=function(e){return this._maxExplicitlyDefinedTime=r.default(e),this},l.prototype._isTimeControlled=function(){return"number"==typeof this.getControlledTime()},l.prototype._controlTime=function(e,t){return this._localExplicitlySetTime=parseInt(e||0,10),this._updateInternalProperties(t),this},l.prototype.getName=function(){return this._name},l.prototype.getMaxTime=function(){return this._maxExplicitlyDefinedTime},l.prototype.getClockTime=function(){return this._globalClockTime},l.prototype.getElapsedTime=function(){return this._localElapsedTime},l.prototype.getControlledTime=function(){return this._localExplicitlySetTime},l.prototype.getBoundedTime=function(){var e=this.getMaxTime(),t=this.getElapsedTime();return t>e?e:t},l.prototype.getTime=function(){return this.getBoundedTime()},l.prototype.getBoundedFrame=function(){var e=this.getBoundedTime(),t=this._component.getClock().getFrameDuration();return Math.round(e/t)},l.prototype.getUnboundedFrame=function(){var e=this.getElapsedTime(),t=this._component.getClock().getFrameDuration();return Math.round(e/t)},l.prototype.getFrame=function(){return this.getBoundedFrame()},l.prototype.isPlaying=function(){return!!this._isPlaying},l.prototype.isActive=function(){return!!this._isActive},l.prototype.isFrozen=function(){return!!this.options.freeze},l.prototype.isFinished=function(){return!this.options.loop&&~~this.getElapsedTime()>this.getMaxTime()},l.prototype.duration=function(){return this.getMaxTime()||0},l.prototype.getDuration=function(){return this.duration()},l.prototype.setRepeat=function(e){return this.options.loop=e,this},l.prototype.getRepeat=function(){return!!this.options.loop},l.prototype.freeze=function(){return this.options.freeze=!0,this},l.prototype.unfreeze=function(){return this.options.freeze=!1,this},l.prototype._shout=function(e){var t=this.getFrame(),n=Math.round(this.getTime()),r=this.getName();return this.emit(e,t,n),this._component.emit("timeline:"+e,r,t,n),this},l.prototype.start=function(e,t){return this._localElapsedTime=0,this._isActive=!0,this._isPlaying=!0,this._globalClockTime=e||0,this._maxExplicitlyDefinedTime=r.default(t),this._shout("start"),this},l.prototype.stop=function(e,t){return this._isActive=!1,this._isPlaying=!1,this._maxExplicitlyDefinedTime=r.default(t),this._shout("stop"),this},l.prototype.pause=function(){var e=this._component.getClock().getTime(),t=this._component._getTimelineDescriptor(this._name);return this.stop(e,t),this._shout("pause"),this},l.prototype.play=function(e){var t=e||{};this._ensureClockIsRunning();var n=this._component.getClock().getTime(),r=this._component._getTimelineDescriptor(this._name),i=this._localElapsedTime;return this.start(n,r),null!==this._localExplicitlySetTime?(this._localElapsedTime=this._localExplicitlySetTime,this._localExplicitlySetTime=null):this._localElapsedTime=i,t.skipMarkForFullFlush||this._component._markForFullFlush(),this._shout("play"),this},l.prototype.seek=function(e){this._ensureClockIsRunning();var t=this._component.getClock().getTime();this._controlTime(e,t);var n=this._component._getTimelineDescriptor(this._name);return this.start(t,n),this._component._markForFullFlush(),this._shout("seek"),this},l.prototype.gotoAndPlay=function(e){return this._ensureClockIsRunning(),this.seek(e),this.play(),this},l.prototype.gotoAndStop=function(e){return this._ensureClockIsRunning(),this.seek(e),this}},{"./helpers/SimpleEventEmitter":18,"./helpers/getTimelineMaxTime":32,"./vendor/assign":96}],9:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./layout/computeMatrix"),a=e("./layout/computeOrientationFlexibly"),o=e("./layout/computeSize"),l={circle:!0,ellipse:!0,foreignObject:!0,g:!0,image:!0,line:!0,mesh:!0,path:!0,polygon:!0,polyline:!0,rect:!0,switch:!0,symbol:!0,text:!0,textPath:!0,tspan:!0,unknown:!0,use:!0},s=0,u=0,c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f={THREE:3,TWO:2};function d(e,t,n){return{shown:!0,opacity:1,mount:{x:e||0,y:t||0,z:n||0},align:{x:e||0,y:t||0,z:n||0},origin:{x:e||0,y:t||0,z:n||0},translation:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0,w:0},orientation:{x:0,y:0,z:0,w:0},scale:{x:1,y:1,z:1},sizeMode:{x:s,y:s,z:s},sizeProportional:{x:1,y:1,z:1},sizeDifferential:{x:0,y:0,z:0},sizeAbsolute:{x:0,y:0,z:0}}}function p(){return h(c)}function h(e){return e.slice()}function y(e,t){return[e[0]*t[0]+e[1]*t[4]+e[2]*t[8]+e[3]*t[12],e[0]*t[1]+e[1]*t[5]+e[2]*t[9]+e[3]*t[13],e[0]*t[2]+e[1]*t[6]+e[2]*t[10]+e[3]*t[14],e[0]*t[3]+e[1]*t[7]+e[2]*t[11]+e[3]*t[15],e[4]*t[0]+e[5]*t[4]+e[6]*t[8]+e[7]*t[12],e[4]*t[1]+e[5]*t[5]+e[6]*t[9]+e[7]*t[13],e[4]*t[2]+e[5]*t[6]+e[6]*t[10]+e[7]*t[14],e[4]*t[3]+e[5]*t[7]+e[6]*t[11]+e[7]*t[15],e[8]*t[0]+e[9]*t[4]+e[10]*t[8]+e[11]*t[12],e[8]*t[1]+e[9]*t[5]+e[10]*t[9]+e[11]*t[13],e[8]*t[2]+e[9]*t[6]+e[10]*t[10]+e[11]*t[14],e[8]*t[3]+e[9]*t[7]+e[10]*t[11]+e[11]*t[15],e[12]*t[0]+e[13]*t[4]+e[14]*t[8]+e[15]*t[12],e[12]*t[1]+e[13]*t[5]+e[14]*t[9]+e[15]*t[13],e[12]*t[2]+e[13]*t[6]+e[14]*t[10]+e[15]*t[14],e[12]*t[3]+e[13]*t[7]+e[14]*t[11]+e[15]*t[15]]}n.default={multiplyArrayOfMatrices:function(e){for(var t=p(),n=0;n<e.length;n++)t=y(t,e[n]);return t},computeLayout:function(e,t,n){delete e.computed;var a=n||{x:0,y:0,z:0};void 0!==a.z&&null!==a.z||(a.z=u);var l=o.default(e,e.sizeMode,a);return r({},e,{size:l,matrix:i.default(e,t,l,a)})},createLayoutSpec:d,computeOrientationFlexibly:a.default,createMatrix:p,multiplyMatrices:y,copyMatrix:h,initializeTreeAttributes:function e(t,n){if(t&&"string"!=typeof t){(r=t).attributes||(r.attributes={}),r.attributes.style||(r.attributes.style={}),r.layout||(r.layout=d(null,null,null),r.layout.matrix=p(),r.layout.format=l[r.elementName]?f.TWO:f.THREE);var r;if(t.__parent=n,t.children&&!(t.children.length<1))for(var i=0;i<t.children.length;i++)e(t.children[i],t)}},FORMATS:f,SIZE_ABSOLUTE:1,SIZE_PROPORTIONAL:s,ATTRIBUTES:d(null,null,null)}},{"./layout/computeMatrix":45,"./layout/computeOrientationFlexibly":46,"./layout/computeSize":47}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./vendor/just-curves"),i=1,a="object",o="number",l=0,s=16.666,u="string";function c(e,t,n){var r=t-e;if(0===r)return i;return i-(t-n)/r}function f(e,t,n){return e+(t-e)*n}function d(e,t,n,r,l,s){if(Array.isArray(l)&&Array.isArray(s)){for(var u=[],p=0;p<l.length;p++)u[p]=d(e,t,n,r,l[p],s[p]);return u}if(l&&typeof l===a&&s&&typeof s===a){var h={};for(var y in l)h[y]=d(e,t,n,r,l[y],s[y]);return h}return typeof l===o&&typeof s===o?function(e,t,n,r,a,o){var l=c(n,r,a);return l>i&&(l=i),o&&(l=o(l)),f(e,t,l)}(l,s,n,r,e,t):l}function p(e,t){return e-t}function h(e){return parseInt(e,10)}function y(e,t){for(var n=function(e){if(e.__sorted)return e.__sorted;var t=Object.keys(e).sort(p).map(h);return e.__sorted=t,e.__sorted}(e),r=0;r<n.length;r++){var i=r+1,a=n[r],o=n[i];if(a<=t){if(o>t)return[a,o];if(i>=n.length)return[a]}}}function m(e,t,n,i,a){var o=t.value;if(!t.curve)return o;if(!i)return o;var l=t.curve;typeof l===u&&(l=r.default[l]);return d(a,l,e,n,o,i.value)}n.default={calculateValue:function(e,t){e[l]||(e[l]={});var n=y(e,t);if(n&&!(n.length<1)){var r=n[0],i=e[r],a=n[1];return m(r,i,a,e[a],t)}},calculateValueAndReturnUndefinedIfNotWorthwhile:function(e,t){e[l]||(e[l]={});var n=y(e,t);if(n&&!(n.length<1)){var r=n[0],i=n[1],a=e[r],o=e[i];if(a&&a.machine||o&&o.machine)return m(r,a,i,o,t);if(void 0!==i)return t<=i+s?m(r,a,i,o,t):void 0;if(t<=r+s)return m(r,a,i,o,t)}}}},{"./vendor/just-curves":137}],11:[function(e,t,n){(function(t,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("./HaikuHelpers"),a=e("./helpers/BasicUtils"),o=e("./helpers/consoleErrorOnce"),l=e("./helpers/interactionModes"),s=e("./properties/dom/parsers"),u=e("./properties/dom/schema"),c=e("./reflection/enhance"),f=e("./Transitions"),d=e("./vendor/assign"),p="function",h="object";var y={};"undefined"!=typeof window&&(y.$window={schema:{width:"number",height:"number",screen:{availHeight:"number",availLeft:"number",availWidth:"number",colorDepth:"number",height:"number",pixelDepth:"number",width:"number",orientation:{angle:"number",type:"string"}},navigator:{userAgent:"string",appCodeName:"string",appName:"string",appVersion:"string",cookieEnabled:"boolean",doNotTrack:"boolean",language:"string",maxTouchPoints:"number",onLine:"boolean",platform:"string",product:"string",vendor:"string"},document:{charset:"string",compatMode:"string",contentType:"string",cookie:"string",documentURI:"string",fullscreen:"boolean",readyState:"number",referrer:"string",title:"string"},location:{hash:"string",host:"string",hostname:"string",href:"string",pathname:"string",protocol:"string",search:"string"}},summon:function(e,t){e.$window||(e.$window={});var n=e.$window;n.width=window.innerWidth,n.height=window.innerHeight,window.screen&&(n.screen||(n.screen={}),n.screen.availHeight=window.screen.availHeight,n.screen.availLeft=window.screen.availLeft,n.screen.availWidth=window.screen.availWidth,n.screen.colorDepth=window.screen.colorDepth,n.screen.height=window.screen.height,n.screen.pixelDepth=window.screen.pixelDepth,n.screen.width=window.screen.width,window.screen.orientation&&(n.screen.orientation||(n.screen.orientation={}),n.screen.orientation.angle=window.screen.orientation.angle,n.screen.orientation.type=window.screen.orientation.type)),"undefined"!=typeof navigator&&(n.navigator||(n.navigator={}),n.navigator.userAgent=navigator.userAgent,n.navigator.appCodeName=navigator.appCodeName,n.navigator.appName=navigator.appName,n.navigator.appVersion=navigator.appVersion,n.navigator.cookieEnabled=navigator.cookieEnabled,n.navigator.doNotTrack=navigator.doNotTrack,n.navigator.language=navigator.language,n.navigator.maxTouchPoints=navigator.maxTouchPoints,n.navigator.onLine=navigator.onLine,n.navigator.platform=navigator.platform,n.navigator.product=navigator.product,n.navigator.userAgent=navigator.userAgent,n.navigator.vendor=navigator.vendor),window.document&&(n.document||(n.document={}),n.document.charset=window.document.charset,n.document.compatMode=window.document.compatMode,n.document.contenttype=window.document.contentType,n.document.cookie=window.document.cookie,n.document.documentURI=window.document.documentURI,n.document.fullscreen=window.document.fullscreen,n.document.readyState=window.document.readyState,n.document.referrer=window.document.referrer,n.document.title=window.document.title),window.location&&(n.location||(n.location={}),n.location.hash=window.location.hash,n.location.host=window.location.host,n.location.hostname=window.location.hostname,n.location.href=window.location.href,n.location.pathname=window.location.pathname,n.location.protocol=window.location.protocol,n.location.search=window.location.search)}}),void 0!==r&&(y.$global={schema:{process:{pid:"number",arch:"string",platform:"string",argv:["string"],title:"string",version:"string",env:{}}},summon:function(e,n){e.$global||(e.$global={});var r=e.$global;void 0!==t&&(r.process||(r.process={}),r.process.pid=t.pid,r.process.arch=t.arch,r.process.platform=t.platform,r.process.argv=t.argv,r.process.title=t.title,r.process.version=t.version,r.process.env=t.env)}}),y.$player={schema:{version:"string",options:{seed:"string",loop:"boolean",sizing:"string",preserve3d:"boolean",position:"string",overflowX:"string",overflowY:"string"},timeline:{name:"string",duration:"number",repeat:"boolean",time:{apparent:"number",elapsed:"number",max:"number"},frame:{apparent:"number",elapsed:"number"}},clock:{frameDuration:"number",frameDelay:"number",time:{apparent:"number",elapsed:"number"}}},summon:function(e,t,n,r,i){e.$player||(e.$player={});var a=e.$player;a.version=n._context.PLAYER_VERSION;var o=n._context.config.options;o&&(a.options||(a.options={}),a.options.seed=o.seed,a.options.loop=o.loop,a.options.sizing=o.sizing,a.options.preserve3d=o.preserve3d,a.options.position=o.position,a.options.overflowX=o.overflowX,a.options.overflowY=o.overflowY);var s=n.getTimeline(i);s&&(a.timeline||(a.timeline={}),a.timeline.name=i,a.timeline.duration=s.getDuration(),a.timeline.repeat=s.getRepeat(),a.timeline.time||(a.timeline.time={}),a.timeline.time.apparent=s.getTime(),a.timeline.time.elapsed=l.isPreviewMode(n.config.options.interactionMode)?s.getElapsedTime():a.timeline.time.apparent,a.timeline.time.max=s.getMaxTime(),a.timeline.frame||(a.timeline.frame={}),a.timeline.frame.apparent=s.getFrame(),a.timeline.frame.elapsed=l.isPreviewMode(n.config.options.interactionMode)?s.getUnboundedFrame():a.timeline.frame.apparent);var u=n.getClock();u&&(a.clock||(a.clock={}),a.clock.frameDuration=u.options.frameDuration,a.clock.frameDelay=u.options.frameDelay,a.clock.time||(a.clock.time={}),a.clock.time.apparent=u.getExplicitTime(),a.clock.time.elapsed=l.isPreviewMode(n.config.options.interactionMode)?u.getRunningTime():a.clock.time.apparent)}};var m={properties:function(e){var t=u.default[e.elementName];return t||(console.warn("[haiku player] element "+e.elementName+" has no schema defined"),{})}};function g(e,t,n,r,i){if(!i)return{};if("string"==typeof i)return{};e[t]={};var a=e[t];a.properties={name:null,attributes:null},a.properties.name=i.elementName,a.properties.attributes=i.attributes,i.layout.computed&&(a.properties.matrix=i.layout.computed.matrix,a.properties.size=i.layout.computed.size),a.properties.align=i.layout.align,a.properties.mount=i.layout.mount,a.properties.opacity=i.layout.opacity,a.properties.origin=i.layout.origin,a.properties.rotation=i.layout.rotation,a.properties.orientation=i.layout.orientation,a.properties.scale=i.layout.scale,a.properties.shown=i.layout.shown,a.properties.sizeAbsolute=i.layout.sizeAbsolute,a.properties.sizeDifferential=i.layout.sizeDifferential,a.properties.sizeMode=i.layout.sizeMode,a.properties.sizeProportional=i.layout.sizeProportional,a.properties.translation=i.layout.translation}y.$tree={schema:{parent:m,children:[m],siblings:[m],component:m,root:m,element:m},summon:function(e,t,n,r){if(e.$tree||(e.$tree={}),e.$tree.siblings=[],e.$tree.parent=null,r.__parent){"string"==typeof t||t.$tree&&t.$tree.parent;g(e.$tree,"parent",0,0,r.__parent);for(var i=0;i<r.__parent.children.length;i++){var a=r.__parent.children[i];"string"==typeof t||t.$tree&&t.$tree.siblings&&t.$tree.siblings[i];g(e.$tree.siblings,i,0,0,a)}}if(e.$tree.c