eligius 1.0.12 → 1.0.13

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("jquery"),t=require("ts-is-present"),n=require("fs"),i=require("path"),r=require("lottie-web"),o=require("hotkeys-js"),s=require("uuid");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(n),c=a(i),h=a(r),d=a(o);function p(){p=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=Object.create((t&&t.prototype instanceof h?t:h).prototype),o=new I(i||[]);return r._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=y(s,n);if(a){if(a===c)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),r}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function h(){}function d(){}function f(){}var v={};a(v,r,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(L([])));g&&g!==t&&n.call(g,r)&&(v=g);var E=f.prototype=h.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(r,o,s,a){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,s,a)}),(function(e){i("throw",e,s,a)})):t.resolve(h).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,a)}))}a(u.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,c;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function L(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=f,a(E,"constructor",f),a(f,"constructor",d),d.displayName=a(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},b(_.prototype),a(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new _(u(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(E),a(E,s,"Generator"),a(E,r,(function(){return this})),a(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;P(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function f(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){f(o,i,r,s,a,"next",e)}function a(e){f(o,i,r,s,a,"throw",e)}s(void 0)}))}}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m.apply(this,arguments)}function g(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,E(e,t)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function b(e){if(Array.isArray(e))return e.map(b);if(e instanceof u.default)return"jQuery object";if(null!==e&&"object"==typeof e){if("class"===e.constructor.toString().substring(0,5)||!e.constructor.toString().startsWith("function Object()")){var t=e.constructor.toString();return t.substring(0,t.indexOf("{")+1)}return Object.fromEntries(Object.entries(e).map((function(e){return[e[0],b(e[1])]})))}if("function"==typeof e){var n=e.toString();return n.indexOf("{")>-1?n.substring(0,n.indexOf("{")+1):n}return e}var _=function(){function e(e){this.agent=void 0,this.agent=e}return e.prototype.handleEvent=function(e,t,n){var i={eventName:e,eventTopic:t,args:b(n)};try{this.agent.postMessage("eligius-diagnostics-event",i)}catch(e){console.error("postmessage failed"),console.error(e),console.log("message",i)}},e}(),y=function(){function e(){}return e.send=function(e,t){console.log(e,t)},e}();y.active=void 0;var T="undefined"!=typeof structuredClone?structuredClone:function(e){return JSON.parse(JSON.stringify(e))};function P(e){return t.isDefined(e)?T(e):e}var I=function(){function e(e,t,n){this.name=void 0,this.startOperations=void 0,this.eventbus=void 0,this.id="",this.name=e,this.startOperations=t,this.eventbus=n}var t=e.prototype;return t.start=function(e){var t,n=this;y.active&&y.send("eligius-diagnostics-action",(null!=(t=this.name)?t:"Action")+" begins executing start operations");var i={currentIndex:-1,eventbus:this.eventbus},r=new Promise((function(t,r){n.executeOperation(n.startOperations,0,t,r,e,i)})).catch((function(e){throw y.active&&y.send("eligius-diagnostics-action-error",{name:name,error:e}),console.error("Error in action start '"+n.name+"'"),console.error(e),e}));return y.active?r.then((function(e){var t;return y.send("eligius-diagnostics-action",(null!=(t=n.name)?t:"Action")+" finished executing start operations"),e})):r},t.executeOperation=function(e,t,n,i,r,o){var s,a=this;if(void 0===r&&(r={}),void 0!==o.newIndex&&(t=o.newIndex,delete o.newIndex),o.currentIndex=t,o.skipNextOperation&&(t<e.length?this.executeOperation(e,++t,n,i,r,o):n(r)),t<e.length){var u=e[t],l=u.operationData?P(u.operationData):{},c=Object.assign(r,l);y.active&&y.send("eligius-diagnostics-operation",{systemName:u.systemName,operationData:c,context:m({},o,{eventbus:void 0})});var h=u.instance.call(o,c);"object"==typeof(s=h)&&"function"==typeof s.then?h.then((function(r){a.executeOperation(e,++t,n,i,r,o)})).catch((function(e){i(e)})):this.executeOperation(e,++t,n,i,h,o)}else n(r)},e}(),L=function(e){function t(t,n,i,r){var o;return(o=e.call(this,t,n,r)||this).endOperations=void 0,o.endOperations=i,o}return g(t,e),t.prototype.end=function(e){var t,n=this;if(y.active&&y.send("eligius-diagnostics-action",(null!=(t=this.name)?t:"Action")+" begins executing end operations"),!this.endOperations.length)return Promise.resolve(e);var i={currentIndex:-1,eventbus:this.eventbus},r=new Promise((function(t,r){n.executeOperation(n.endOperations,0,t,r,e,i)})).catch((function(e){throw console.error("Error in action end '"+n.name+"'"),e}));return y.active?r.then((function(e){var t;return y.send("eligius-diagnostics-action",(null!=(t=n.name)?t:"Action")+" finished executing start operations"),e})):r},t}(I),x=function(e){function t(t,n,i,r,o){var s;return(s=e.call(this,t,n,i,o)||this).duration=void 0,s.active=!1,s.duration=r,s}g(t,e);var n=t.prototype;return n.start=function(t){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,e.prototype.start.call(this,t)):new Promise((function(e){e()}))},n.end=function(t){return this.active=!1,e.prototype.end.call(this,t)},t}(L);function w(e){return e&&(t=e.flatMap((function(e){var t;return[].concat(e.startOperations,null!=(t=e.endOperations)?t:[])})))?t.filter((function(e){var t;return!(null==(t=e.operationData)||!t.hasOwnProperty("systemName"))&&e.operationData.systemName.endsWith("Controller")})).map((function(e){return{systemName:e.operationData.systemName}})):[];var t}function N(e){return e&&(t=e.flatMap((function(e){var t;return[].concat(e.startOperations,null!=(t=e.endOperations)?t:[])})))?t.map((function(e){return{systemName:e.systemName}})):[];var t}function S(e){var t={};return e.filter((function(e){return!t[e.systemName]&&(t[e.systemName]=!0,!0)}))}function O(e,t){if(!e)throw Error("properties arg cannot be null");if(!t)throw Error("sourceObject arg cannot be null");var n=t,i=null;return e.forEach((function(t,r){if(r===e.length-1){var o=t.split("+");o.length>1&&(t=o[0],i=o[1])}n=n[t]})),i?n+i:n}var R=function(){function e(e,t){this.importer=void 0,this.eventbus=void 0,this.importer=e,this.eventbus=t}return e.prototype.process=function(e,n){if(j(e,e,this.importer),!t.isDefined(e.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:e.id,engine:m({},e.engine),timelineProviderSettings:P(e.timelineProviderSettings),containerSelector:e.containerSelector,language:e.language,layoutTemplate:e.layoutTemplate,availableLanguages:P(e.availableLanguages),actions:q(e.actions,this.importer,this.eventbus),initActions:q(e.initActions,this.importer,this.eventbus),labels:P(e.labels),timelineFlow:P(e.timelineFlow),timelines:A(e.timelines,this.importer,this.eventbus)},r=[];return e.eventActions&&n&&(r=function(e,t,n,i){return e.map((function(e){return C(e,n)})).map((function(n,r){var o=e[r],s=o.eventName,a=o.eventTopic,u=new I(n.name,n.startOperations,i);return t.registerAction(u,s,a),u}))}(e.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(e,t){var n;return m({},e,((n={})[t.name]=t,n))}),{}),i]},e}();function A(e,t,n){var i=k.bind(null,t,n);return e.map((function(e){return m({},e,{timelineActions:e.timelineActions.map(i)})}))}function D(e,t){return{id:t.id,systemName:t.systemName,operationData:P(t.operationData),instance:e.import(t.systemName)[t.systemName]}}function C(e,t){var n=D.bind(null,t);return{id:e.id,name:e.name,startOperations:e.startOperations.map(n)}}function U(e,t){var n=D.bind(null,t);return m({},C(e,t),{endOperations:e.endOperations.map(n)})}function k(e,t,n){var i,r=U(n,e),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},s=r.id,a=new x(r.name,r.startOperations,r.endOperations,o,t);return a.id=s,a}function q(e,t,n){return e.map((function(e){return U(e,t)})).map((function(e){var t=new L(e.name,e.startOperations,e.endOperations,n);return t.id=e.id,t}))}function j(e,n,i){t.isDefined(e)&&(Array.isArray(e)?e.forEach((function(e){j(e,n,i)})):Object.keys(e).forEach((function(t){!function(e,t,n,i){var r,o=t[e];if("string"==typeof o){if(o.startsWith("config:")){var s=o.substring(7,o.length);t[e]=(r=n,O(s.split("."),r))}else if(o.startsWith("template:")){var a=o.substring(9,o.length),u=i.import(a)[a];t[e]=u}else if(o.startsWith("json:")){var l=o.substring(5,o.length),c=i.import(l)[l];t[e]=c}}else"object"==typeof o&&j(o,n,i)}(t,e,n,i)})))}var M=function(){};M.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",M.PLAY_REQUEST="timeline-play-request",M.STOP_REQUEST="timeline-stop-request",M.PAUSE_REQUEST="timeline-pause-request",M.SEEK_REQUEST="timeline-seek-request",M.RESIZE_REQUEST="timeline-resize-request",M.CONTAINER_REQUEST="timeline-container-request",M.DURATION_REQUEST="timeline-duration-request",M.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",M.DURATION="timeline-duration",M.TIME="timeline-time",M.SEEKED="timeline-seeked",M.COMPLETE="timeline-complete",M.RESTART="timeline-restart",M.PLAY="timeline-play",M.STOP="timeline-stop",M.PAUSE="timeline-pause",M.SEEK="timeline-seek",M.RESIZE="timeline-resize",M.POSITION_UPDATE="timeline-position-update",M.TIME_UPDATE="timeline-time-update",M.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",M.FIRST_FRAME="timeline-firstframe",M.REQUEST_INSTANCE="request-instance",M.REQUEST_ACTION="request-action",M.REQUEST_FUNCTION="request-function",M.REQUEST_TIMELINE_URI="request-timeline-uri",M.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",M.REQUEST_ENGINE_ROOT="request-engine-root",M.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",M.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",M.EXECUTE_TIMELINEACTION="execute-timelineaction",M.RESIZE_TIMELINEACTION="resize-timelineaction",M.REQUEST_LABEL_COLLECTION="request-label-collection",M.REQUEST_LABEL_COLLECTIONS="request-label-collections",M.REQUEST_CURRENT_LANGUAGE="request-current-language",M.LANGUAGE_CHANGE="language-change";var Q=function(){function e(){this.operationData=void 0,this.actionInstanceInfos=void 0,this.name="EventListenerController"}var t=e.prototype;return t.init=function(e){this.operationData={selectedElement:e.selectedElement,eventName:e.eventName,actions:e.actions.slice(),actionOperationData:e.actionOperationData?P(e.actionOperationData):void 0}},t.attach=function(e){var t=this;if(this.operationData){var n=this.operationData,i=n.selectedElement,r=n.actions,o=n.eventName;this.actionInstanceInfos||(this.actionInstanceInfos=[],r.forEach((function(n){var i,r=t._isStartAction(n);e.broadcast(M.REQUEST_ACTION,[r[1],(i=r[0],function(e){var n;null==(n=t.actionInstanceInfos)||n.push({start:i,action:e})})])})),i.on(o,this._eventHandler.bind(this)))}},t._isStartAction=function(e){return"end:"===e.substr(0,"end:".length)?[!1,e.substr("end:".length)]:[!0,e]},t._eventHandler=function(e){if(this.operationData&&this.actionInstanceInfos){var t=this.operationData.actionOperationData?P(this.operationData.actionOperationData):{};e.target&&(t.targetValue=e.target.value),this._executeAction(this.actionInstanceInfos,t,0)}},t._executeAction=function(){var e=v(p().mark((function e(t,n,i){var r,o,s;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i<t.length)){e.next=8;break}return o=(r=t[i]).action,s=r.start?o.start.bind(o):o.end.bind(o),e.next=6,s(n);case 6:this._executeAction(t,Object.assign(n,e.sent),++i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t.detach=function(e){var t;null==(t=this.operationData)||t.selectedElement.off(this.operationData.eventName)},e}(),H=function(){function e(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController",this.requestLabelDataBound=void 0}var t=e.prototype;return t.init=function(e){this.operationData=Object.assign({},e)},t.setLabelId=function(e){this.requestLabelDataBound&&(this.requestLabelDataBound(e),this.setLabel())},t.attach=function(e){var t=this;this.operationData&&(e.broadcast(M.REQUEST_CURRENT_LANGUAGE,[function(e){t.currentLanguage=e}]),this.requestLabelDataBound=this.requestLabelData.bind(this,e),this.requestLabelDataBound(this.operationData.labelId),this.setLabel(),this.listeners.push(e.on(M.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},t.requestLabelData=function(e,t){var n=this;e.broadcast(M.REQUEST_LABEL_COLLECTION,[t,function(e){n.createTextDataLookup(e)}])},t.setLabel=function(){var e;this.currentLanguage&&(null==(e=this.operationData)||e.selectedElement.html(this.labelData[this.currentLanguage]))},t.detach=function(e){this.listeners.forEach((function(e){return e()})),this.requestLabelDataBound=void 0},t.handleLanguageChange=function(e){this.currentLanguage=e,this.setLabel()},t.createTextDataLookup=function(e){var t=this;e.forEach((function(e){t.labelData[e.languageCode]=e.label}))},e}(),F=function(){function e(){this.name="LottieController",this.currentLanguage=null,this.labelData={},this.listeners=[],this.animationItem=null,this.operationData=null,this.serializedData=null,this.serializedIEData=null,this.freezePosition=-1,this.endPosition=-1}var t=e.prototype;return t.init=function(e){this.operationData={selectedElement:e.selectedElement,renderer:e.renderer,loop:e.loop,autoplay:e.autoplay,animationData:e.animationData,json:e.json,labelIds:e.labelIds,viewBox:e.viewBox,iefallback:e.iefallback},e.url.indexOf("[")>-1&&this.parseFilename(e.url),this.serializedData=this.operationData.json?JSON.stringify(this.operationData.json):JSON.stringify(this.operationData.animationData),this.operationData.iefallback&&(this.serializedIEData=JSON.stringify(this.operationData.iefallback))},t.parseFilename=function(e){var t=this;e.substr(e.indexOf("[")+1,e.indexOf("]")-e.indexOf("[")-1).split(",").forEach((function(e){var n=e.split("=");"freeze"===n[0]?t.freezePosition=+n[1]:"end"===n[0]&&(t.endPosition=+n[1])}))},t.attach=function(e){if(this.operationData){var t=this.operationData.labelIds;if(t&&t.length){var n={};e.broadcast(M.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(e.on(M.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),e.broadcast(M.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},t.detach=function(e){this.listeners.forEach((function(e){e()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},t.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},t.createAnimation=function(){var e,t=this;if(this.operationData&&this.serializedData){null==(e=this.animationItem)||e.destroy();var n=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,i=this.operationData.labelIds;i&&i.length&&i.forEach((function(e){var i;n=n.split("!!"+e+"!!").join(t.labelData[e][null!=(i=t.currentLanguage)?i:""])}));var r=JSON.parse(n);this.animationItem=h.default.loadAnimation({autoplay:this.operationData.autoplay,container:this.operationData.selectedElement[0],loop:this.operationData.loop,rendererSettings:this.operationData.renderer,animationData:r}),this.endPosition<0&&(this.endPosition=this.animationItem.timeCompleted),this.freezePosition>-1&&this.animationItem.playSegments([0,this.freezePosition],!0),this.operationData.viewBox&&this.operationData.selectedElement.find("svg").attr("viewBox",this.operationData.viewBox)}},t.createTextDataLookup=function(e){var t=this;e.forEach((function(e,n){e.forEach((function(e){t.operationData&&(t.labelData[t.operationData.labelIds[n]][e.code]=e.label)}))}))},t.handleLanguageChange=function(e){this.currentLanguage=e,this.createAnimation()},t.isIE=function(){var e=!!window.document.documentMode;return!e&&!!window.StyleMedia||e},e}(),z=function(){function e(){this.name="NavigationController",this.navigation=[],this.navLookup={},this.navVidIdLookup={},this.ctrlLookup={},this.activeNavigationPoint=null,this.labelControllers=[],this.eventhandlers=[],this.eventbus=null,this.container=null}var t=e.prototype;return t.init=function(e){this.container=e.selectedElement,this.navigation=this.buildNavigationData(e.json)},t.attach=function(e){this.container&&(this.eventbus=e,this.eventhandlers.push(e.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(e.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(e.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(e.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},t.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var e=this.getQueryVariable(0),t=0;e&&(t=this.navLookup[e].videoUrlIndex),this.highlightMenu(t)},t.getQueryVariable=function(e){var t=window.location.href,n=t.indexOf("#");if(n>-1){var i=t.substring(n+2);if(i)return i.split("/")[e]}return null},t.handleRequestCurrentNavigation=function(e){if(this.activeNavigationPoint){var t=this.ctrlLookup[this.activeNavigationPoint.labelId];e({navigationData:this.activeNavigationPoint,title:t.labelData[t.currentLanguage||""]})}else e(null)},t.detach=function(e){this.eventhandlers.forEach((function(e){e()})),this.labelControllers.forEach((function(t){t.detach(e)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},t.pushCurrentState=function(e){var t;if(void 0===e&&(e=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};e>-1&&(i.position=e),null==(t=this.eventbus)||t.broadcast("push-history-state",[i])}}},t.buildHtml=function(e,t){var n=u.default("<ul/>");t.forEach(this.addNavElement.bind(this,n)),e.append(n)},t.addNavElement=function(e,t){if(t.visible){var n=u.default("<li/>"),i=u.default("<a href='javascript:;' id='nav_"+t.videoUrlIndex+"'/>");if(n.append(i),this.addLabel(i,t.labelId),this.addClickHandler(i,t.videoUrlIndex),t.children){var r=u.default("<ul/>");t.children.forEach(this.addNavElement.bind(this,r)),n.append(r)}e.append(n)}},t.addClickHandler=function(e,t){e.mouseup(this.menuMouseupHandler.bind(this,t))},t.menuMouseupHandler=function(e){var t,n=this.navVidIdLookup[e];n&&(null==(t=this.eventbus)||t.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},t.handleNavigateVideoUrl=function(e,t){var n;void 0===t&&(t=0),this.highlightMenu(e),null==(n=this.eventbus)||n.broadcast("request-video-url",[e,t]),this.activeNavigationPoint=this.navVidIdLookup[e],this.pushCurrentState(t)},t.highlightMenu=function(e){var t=u.default("#nav_"+e);t.length&&(u.default(".current-menu-item").removeClass("current-menu-item"),t.addClass("current-menu-item"))},t.handleVideoComplete=function(e){var t,n,i=this.navVidIdLookup[e];i.autoNext?null==(t=this.eventbus)||t.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},t.addLabel=function(e,t){var n,i=this,r={selectedElement:e,labelId:t};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(e){e.init(r),e.attach(i.eventbus),i.labelControllers.push(e),i.ctrlLookup[t]=e}])},t.buildNavigationData=function(e){var t=this,n=[];return e.navigationData.forEach((function(n,i){t.navLookup[n.id]=n,t.navVidIdLookup[n.videoUrlIndex]=n,n.previous=e.navigationData[i-1]})),e.navigationData.forEach((function(n,i){n.nextId?(n.next=t.navLookup[n.nextId],delete n.nextId):n.next=e.navigationData[i+1]})),e.roots.forEach((function(e){var i=t.navLookup[e];i.children&&(i.children=i.children.map((function(e){return t.navLookup[e]}))),n.push(i)})),n},e}(),G=function(){function e(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[],this.duration=0}var t=e.prototype;return t.init=function(e){this.selectedElement=e.selectedElement,this.textElement=e.textElement},t.attach=function(e){var t,n=this;this.detachers.push(e.on(M.POSITION_UPDATE,this.positionUpdateHandler.bind(this))),e.broadcast(M.DURATION_REQUEST,[function(e){return n.duration=e}]);var i=this.clickHandler.bind(this,e);null==(t=this.selectedElement)||t.on("click",i),this.detachers.push((function(){var e;return null==(e=n.selectedElement)?void 0:e.off("click",i)}))},t.detach=function(e){this.detachers.forEach((function(e){e()}))},t.positionUpdateHandler=function(e){var t,n,i=100/e.duration*e.position;null==(t=this.selectedElement)||t.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},t.clickHandler=function(e,t){var n=t.target.getBoundingClientRect();e.broadcast(M.SEEK_REQUEST,[Math.floor(this.duration/100*(100/n.width*(t.clientX-n.left)))])},e}(),V=function(){function e(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var t=e.prototype;return t.init=function(e){this.navigation=this.buildNavigationData(e.json)},t.attach=function(e){this.eventhandlers.push(e.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(e.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=e,window.onpopstate=this.handlePopstate.bind(this);var t=this.getQueryVariable(0);if(t){var n=this.navLookup[t],i=+this.getQueryVariable(1);this.eventbus.broadcast("request-video-url",[n.videoUrlIndex,i,!0])}else window.history.pushState({navigationId:this.navigation[0].id},"","#/"+this.navigation[0].id)},t.handlePopstate=function(e){var t,n,i,r,o=null!=(t=null==(n=e.state)?void 0:n.position)?t:0,s=this.navLookup[e.state?e.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[s.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[s.videoUrlIndex,o,!0])},t.detach=function(e){this.eventhandlers&&this.eventhandlers.forEach((function(e){e()})),this.eventbus=null},t.handleBeforeRequestVideoUrl=function(e,t,n){var i,r=this;void 0===n&&(n=!1),(n=void 0!==n&&n)||null==(i=this.eventbus)||i.broadcast("request-current-navigation",[function(e){r.pushState(e)}])},t.getQueryVariable=function(e){var t=window.location.href,n=t.indexOf("#");if(n>-1){var i=t.substring(n+2);if(i)return i.split("/")[e]}return""},t.handlePushHistoryState=function(e){this.pushState(e)},t.pushState=function(e){if(e&&e.navigationData&&e.navigationData.visible){var t,n=void 0!==e.position?e.position:-1;n<0&&(null==(t=this.eventbus)||t.broadcast("request-current-video-position",[function(e){n=e>3?e-3:0}]));var i=window.history.state;i&&i.navigationId!==e.navigationData.id?window.history.pushState({navigationId:e.navigationData.id,position:n},e.title,"#/"+e.navigationData.id+"/"+n):i&&i.navigationId===e.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},e.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:e.navigationData.id,position:n},e.title,"#/"+e.navigationData.id+"/"+n),window.document.title=e.title}},t.buildNavigationData=function(e){var t=this,n=[];return e.navigationData.forEach((function(n,i){t.navLookup[n.id]=n,t.navVidIdLookup[n.videoUrlIndex]=n,n.previous=e.navigationData[i-1]})),e.navigationData.forEach((function(n,i){n.nextId?(n.next=t.navLookup[n.nextId],delete n.nextId):n.next=e.navigationData[i+1]})),e.roots.forEach((function(e){var i=t.navLookup[e];i.children&&(i.children=i.children.map((function(e){return t.navLookup[e]}))),n.push(i)})),n},e}(),B=function(){function e(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var t=e.prototype;return t.attach=function(e){var t=e.on(M.TIME,this.onTimeHandler.bind(this)),n=e.on(M.SEEKED,this.onSeekedHandler.bind(this)),i=e.on(M.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[t,i,n])},t.detach=function(e){this.internalDetach()},t.internalDetach=function(e){e&&e.forEach((function(e){e()}))},t.languageChangeHandler=function(e){this.currentLanguage=e,this.lastFunc&&this.lastFunc()},t.removeTitle=function(e){null==e||e.empty(),this.lastFunc=null},t.onTimeHandler=function(e){var t=this.actionLookup[e.position];t&&(t(),this.lastFunc=t)},t.onSeekedHandler=function(e){for(var t=e.position,n=this.actionLookup[t];!n&&--t>=0;)n=this.actionLookup[t];n?(n(),this.lastFunc=n):this.removeTitle()},t.setTitle=function(e,t){this.currentLanguage&&e.html(t[this.currentLanguage])},t.createActionLookup=function(e,t){for(var n=e.subtitleData,i=n[0].titles,r={},o=0,s=i.length;o<s;o++){for(var a={},u=0,l=n.length;u<l;u++){var c=n[u];a[c.lang]=c.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,t,a),r[i[o].duration.end]=this.removeTitle}return r},t.init=function(e){var t=e.selectedElement;this.removeTitle=this.removeTitle.bind(this,t),this.currentLanguage=e.language,this.actionLookup=this.createActionLookup(e,t)},e}(),K={__proto__:null,EventListenerController:Q,LabelController:H,LottieController:F,NavigationController:z,ProgressbarController:G,RoutingController:V,SubtitlesController:B},W=function(){function e(e,t,n,i){this.configuration=void 0,this.eventbus=void 0,this.timelineProviders=void 0,this.languageManager=void 0,this._timeLineActionsLookup={},this._eventbusRemovers=[],this._currentTimelineUri="",this._activeTimelineProvider=void 0,this._lastPosition=-1,this.configuration=e,this.eventbus=t,this.timelineProviders=n,this.languageManager=i}var t=e.prototype;return t.init=function(){var e;this._createLayoutTemplate(),this._addInitialisationListeners();var t=this.configuration.timelines;return this._currentTimelineUri=null!=(e=null==t?void 0:t[0].uri)?e:"",this._createTimelineLookup(),this._initializeTimelineProvider()},t._createLayoutTemplate=function(){var e=this.configuration.containerSelector,t=u.default(e);if(!t||!t.length)throw new Error("Container selector not found: "+e);var n=this.configuration.layoutTemplate;n&&n.length?t.html(n):console.warn("layoutTemplate is empty, unable to create layout")},t._initializeTimelineProvider=function(){var e,t,n=this;if(null==(e=this.configuration.timelines)||!e.length)throw new Error("No timelines present");var i=this.configuration.timelines[0],r=this.timelineProviders[i.type];if(!r)throw new Error("No timeline provider configured for type "+i.type);return null==(t=this._activeTimelineProvider)||t.destroy(),this._activeTimelineProvider=r.provider,new Promise(function(){var e=v(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n._activeTimelineProvider){e.next=8;break}return e.next=3,n._activeTimelineProvider.init();case 3:return e.next=5,n._executeActions(n.configuration.initActions,"start");case 5:t(n._activeTimelineProvider),e.next=9;break;case 8:throw new Error("NO ACTIVE TIMELINE PROVIDER");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},t._cleanUp=function(){var e=v(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._cleanUpTimeline();case 2:return e.next=4,this._executeActions(this.configuration.initActions,"end");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.destroy=function(){var e=v(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._cleanUp();case 2:this.languageManager.destroy(),this._activeTimelineProvider=void 0,this._eventbusRemovers.forEach((function(e){return e()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(e){return e.provider.destroy()})),u.default(this.configuration.containerSelector).empty();case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t._addEventListener=function(e,t,n){this._eventbusRemovers.push(this.eventbus.on(e,t,n))},t._addInitialisationListeners=function(){this._addEventListener(M.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector)),this._addEventListener(M.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this)),this._addEventListener(M.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor)),this._addEventListener(M.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this)),this._addEventListener(M.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this)),this._addEventListener(M.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this)),this._addEventListener(M.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)),this._addEventListener(M.TIME,this._onTimeHandler.bind(this,Math.floor)),this._addEventListener(M.SEEK,this._onSeekHandler.bind(this,Math.floor))},t._createTimelineLookup=function(){var e=this;this.configuration.timelines&&this.configuration.timelines.forEach((function(t){t.timelineActions.forEach(e._addTimelineAction.bind(e,t.uri))}))},t._addTimelineAction=function(e,t){var n,i=t.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,e),i),o=t.start.bind(t);null!=(n=t.id)&&n.length&&(o.id=t.id,o.isStart=!0),r.push(o);var s=t.duration.end;if(s<0&&(s=t.duration.end=Infinity),isFinite(s)){var a=this._initializeTimelinePosition(this._timeLineActionsLookup[e],s),u=t.end.bind(t);t.id||(u.id=t.id),a.push(u)}},t._initializeUriLookup=function(e,t){return e[t]||(e[t]={}),e[t]},t._initializeTimelinePosition=function(e,t){return e[t]||(e[t]=[]),e[t]},t._executeActions=function(){var e=v(p().mark((function e(t,n,i){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===i&&(i=0),!(t&&i<t.length)){e.next=6;break}return r=t[i],e.next=5,r[n]();case 5:return e.abrupt("return",this._executeActions(t,n,++i));case 6:return e.abrupt("return",new Promise((function(e){e()})));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t._handleRequestEngineRoot=function(e,t){t(u.default(e))},t._handleRequestTimelineUri=function(){var e=v(p().mark((function e(t,n,i){var r,o,s,a=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._activeTimelineProvider){e.next=2;break}return e.abrupt("return");case 2:return this._activeTimelineProvider.stop(),e.next=6,this._cleanUpTimeline();case 6:if((o=this.configuration.timelines.find((function(e){return e.uri===t})))&&this._activeTimelineProvider&&this._currentTimelineUri!==o.uri){e.next=9;break}return e.abrupt("return");case 9:this._currentTimelineUri=o.uri,this.eventbus.broadcast(M.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(s=this.timelineProviders[o.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=s.provider),this._activeTimelineProvider.loop=o.loop,n=null!=(r=n)?r:0,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(M.FIRST_FRAME,(function(){a._activeTimelineProvider&&(a._activeTimelineProvider.pause(),a.eventbus.broadcast(M.DURATION,[a._activeTimelineProvider.getDuration()]),a._executeStartActions().then((function(){var e,t;n=null!=(e=n)?e:0,null==(t=a._activeTimelineProvider)||t.seek(n),a._onSeekHandler(Math.floor,{offset:n})})))})),this._activeTimelineProvider.playlistItem(t);case 17:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},t._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},t._getActionsForPosition=function(e,t){return t.filter((function(t){return!t.active&&t.duration.start<=e&&t.duration.end>=e}))},t._getActiveActions=function(e){return e.filter((function(e){return e.active})).sort((function(e,t){return t.duration.start<e.duration.start?-1:t.duration.start>e.duration.start?1:0}))},t._executeRelevantActions=function(e,t){var n=this._getRelevantTimelineActions(),i=e.apply(this,[n]);return this._executeActions(i,t,0)},t._handleRequestTimelinePosition=function(e,t){var n;t(e((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},t._handleTimelineComplete=function(){this._cleanUpTimeline()},t._handleExecuteTimelineAction=function(e,t,n){var i=this._getTimelineActionsForUri(e),r=null==i?void 0:i[t];r&&(n?r.start():r.end())},t._resizeTimelineAction=function(){console.error("no resizing implemented")},t._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},t._requestCurrentTimeline=function(e){e(this._currentTimelineUri)},t._getTimelineActionsForUri=function(e){var t,n=this.configuration.timelines.find((function(t){return t.uri===e}));return null!=(t=null==n?void 0:n.timelineActions)?t:[]},t._onTimeHandler=function(e,t){if(!isNaN(t.position)){var n,i,r=e(t.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(M.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(M.TIME_UPDATE,[t.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},t._onSeekHandler=function(e,t){var n=this;if(!isNaN(t.offset)){var i=e(t.offset);this._executeSeekActions(i).then((function(){var e;null==(e=n._activeTimelineProvider)||e.start()}))}},t._executeActionsForPosition=function(e){this._lastPosition=e;var t=this._timeLineActionsLookup[this._currentTimelineUri];if(t){var n=t[e];null==n||n.forEach((function(e){e()}))}},t._executeSeekActions=function(e){var t=this,n=this._getRelevantTimelineActions();if(!n)return Promise.resolve();var i=this._getActiveActions(n),r=this._getActionsForPosition(e,n),o=this._executeActions(i,"end",0);return new Promise((function(e){o.then((function(){t._executeActions(r,"start",0).then((function(){e()}))}))}))},e}(),Y=function(){function e(){this._actionRegistry=new Map}var t=e.prototype;return t.registerAction=function(e,t,n){var i;n&&n.length&&(t=t+":"+n),this._actionRegistry.has(t)||this._actionRegistry.set(t,[]),null==(i=this._actionRegistry.get(t))||i.push(e)},t.handleEvent=function(e,t,n){t&&(e=e+":"+t);var i=this._actionRegistry.get(e);if(i){var r={eventArgs:n};i.forEach((function(e){e.start(r)}))}},e}(),J=function(){function e(){this.eventHandlers=new Map,this.eventInterceptors=new Map,this.eventListeners=[],this.clear()}var t=e.prototype;return t.clear=function(){this.eventHandlers=new Map,this.eventListeners=[],this.eventInterceptors=new Map},t._getEventInterceptors=function(e,t){return t&&(e=e+":"+t),this.eventInterceptors.has(e)||this.eventInterceptors.set(e,[]),this.eventInterceptors.get(e)},t._getEventHandlers=function(e,t){return t&&(e=e+":"+t),this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e)},t.on=function(e,t,n){var i=this;return this._getEventHandlers(e,n).push(t),function(){i.off(e,t,n)}},t.once=function(e,t,n){var i=this,r=function r(){t.apply(void 0,arguments),i.off(e,r,n)};return this.on(e,r,n),function(){i.off(e,r,n)}},t.off=function(e,t,n){var i=this._getEventHandlers(e,n);if(i){var r=i.indexOf(t);r>-1&&i.splice(r,1)}},t.broadcast=function(e,t){this._callHandlers(e,void 0,t)},t.broadcastForTopic=function(e,t,n){this._callHandlers(e,t,n)},t.registerEventlistener=function(e){var t=this;return this.eventListeners.push(e),function(){var n=t.eventListeners.indexOf(e);n>-1&&t.eventListeners.splice(n,1)}},t.registerInterceptor=function(e,t,n){var i=this._getEventInterceptors(e,n);return i.push(t),function(){var e=i.indexOf(t);e>-1&&i.splice(e,1)}},t._callHandlers=function(e,t,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(e,t);r&&(this._getEventInterceptors(e,t).forEach((function(e){n=e.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(e,t,n)})),null!=(i=n)&&i.length?r.forEach((function(e){return e.apply(void 0,n)})):r.forEach((function(e){return e()})))},e}(),Z=function(){function e(e){this.eventbus=void 0,this.eventbus=e}return e.prototype.intercept=function(e){return this.eventbus.broadcast(M.BEFORE_REQUEST_TIMELINE_URI,e.slice()),e},e}(),X={__proto__:null,ActionRegistryEventbusListener:Y,Eventbus:J,RequestVideoUriInterceptor:Z},$=function(){function e(e,t,n){if(this._currentLanguage=void 0,this._eventbus=void 0,this._labelLookup=void 0,this._eventbusRemovers=[],this._currentLanguage=e,this._eventbus=n,!e)throw new Error("language ctor arg cannot have zero length");this._setRootElementLang(e),this._labelLookup=this._createLabelLookup(t),this._addEventbusListeners(n)}var t=e.prototype;return t.destroy=function(){this._eventbusRemovers.forEach((function(e){return e()}))},t._addEventbusListeners=function(e){this._eventbusRemovers.push(e.on(M.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusRemovers.push(e.on(M.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusRemovers.push(e.on(M.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusRemovers.push(e.on(M.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},t._handleRequestCurrentLanguage=function(e){e(this._currentLanguage)},t._handleRequestLabelCollection=function(e,t){t(this._labelLookup[e])},t._handleRequestLabelCollections=function(e,t){var n=this;t(e.map((function(e){return n._labelLookup[e]})))},t._handleLanguageChange=function(e){e&&e.length?(this._currentLanguage=e,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},t._setRootElementLang=function(e){var t=this;this._eventbus.broadcast(M.REQUEST_ENGINE_ROOT,[function(n){var i=t._extractLanguageFromCulture(e);u.default(n).attr("lang",i)}])},t._extractLanguageFromCulture=function(e){return e.indexOf("-")>-1?e.split("-").shift():e},t._createLabelLookup=function(e){return e.reduce((function(e,t){return e[t.id]=t.labels,e}),{})},e}(),ee=function(){function e(e,t,n){var i,r;this._actionsLookup={},this._eventbus=void 0,this._eventRemovers=[],this._importer=void 0,this._resizeTimeout=-1,this._importer=e,this._eventbus=null!=(i=null==n?void 0:n.eventbus)?i:new J,y.active=null!=(r=null==n?void 0:n.devtools)&&r,y.active&&this._initializeDevtools(this._eventbus),this._eventRemovers.push(this._eventbus.on(M.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(M.REQUEST_ACTION,this._requestActionHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(M.REQUEST_FUNCTION,this._requestFunctionHandler.bind(this)));var o=this._handleSpacePress.bind(this);d.default("space",o),this._eventRemovers.push((function(){return d.default.unbind("space",o)}));var s=this._resizeHandler.bind(this),a=u.default(t);a.on("resize",s),this._eventRemovers.push((function(){return a.off("resize",s)}))}var t=e.prototype;return t._handleSpacePress=function(e,t){return e.preventDefault(),this._eventbus.broadcast(M.PLAY_TOGGLE_REQUEST),!1},t._initializeDevtools=function(e){var t=this,n=window.__ELIGIUS_DEV_TOOLS__;if(n){var i=n.agent;this._eventRemovers.push(e.registerEventlistener(new _(i))),this._eventRemovers.push(i.subscribe((function(e){if("playcontrol"===e.type)switch(e.data.kind){case"play":t._eventbus.broadcast(M.PLAY_REQUEST);break;case"stop":t._eventbus.broadcast(M.STOP_REQUEST);break;case"pause":t._eventbus.broadcast(M.PAUSE_REQUEST);break;case"seek":t._eventbus.broadcast(M.SEEK_REQUEST,[e.data.args])}}))),y.send=function(e,t){var n=b(t);try{i.postMessage(e,n)}catch(e){console.error("postmessage failed"),console.error(e),console.log("message",n)}},y.send("eligius-diagnostics-factory","Diagnostics initialized")}else console.warn("__ELIGIUS_DEV_TOOLS__ property not found on window, please install the Eligius Devtools extension.")},t.destroy=function(){this._eventRemovers.forEach((function(e){return e()}))},t._resizeHandler=function(){var e=this;this._resizeTimeout&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=-1),this._resizeTimeout=setTimeout((function(){e._eventbus.broadcast(M.RESIZE)}),200)},t._importSystemEntryWithEventbusDependency=function(e){return new(this._importSystemEntry(e))(this._eventbus)},t._importSystemEntry=function(e){return this._importer.import(e)[e]},t._requestInstanceHandler=function(e,t){t(this._importSystemEntryWithEventbusDependency(e))},t._requestFunctionHandler=function(e,t){t(this._importSystemEntry(e))},t._requestActionHandler=function(e,t){var n=this._actionsLookup[e];n?t(n):(console.error("Unknown action: "+e),t(null))},t.createEngine=function(e,t){var n,i=this._importSystemEntry(e.engine.systemName),r=void 0;null!=(n=e.eventActions)&&n.length&&(r=new Y,this._eventRemovers.push(this._eventbus.registerEventlistener(r))),this._eventRemovers.push(this._eventbus.registerInterceptor(M.REQUEST_TIMELINE_URI,new Z(this._eventbus)));var o=(t=t||new R(this._importer,this._eventbus)).process(e,r),s=o[1];this._actionsLookup=o[0];var a=this._createTimelineProviders(s,this._eventbus),u=new $(e.language,e.labels,this._eventbus);return new i(s,this._eventbus,a,u)},t._createTimelineProviders=function(e,t){var n=this;return Object.entries(e.timelineProviderSettings).reduce((function(i,r){var o=r[0],s=r[1];if(!s)return i;var a=n._importSystemEntry(s.systemName);return i[o]={id:s.id,vendor:s.vendor,provider:new a(t,e)},i}),{})},e}(),te=function(e){return e.selectedElement.addClass(e.className),e},ne=function(e,t){return t.data(e)}.bind(null,"eligiusEngineControllers");function ie(e,t){return m({},e,t)}function re(e,t,n){e(n?ie(t,n):t)}var oe=function(e){var t=e.controllerInstance;!function(e,t){e.data("eligiusEngineControllers")||e.data("eligiusEngineControllers",[]);var n=ne(e);n&&n.push(t)}(e.selectedElement,t),t.init(e);var n=t.attach(this.eventbus);return n?new Promise((function(t,i){n.then((function(n){re(t,e,n)}),i)})):e},se=function(e){var t=e.animationEasing,n=e.selectedElement,i=e.animationProperties,r=e.animationDuration;return new Promise((function(o,s){try{t?n.animate(i,r,t,(function(){re(o,{},e)})):n.animate(i,r,(function(){re(o,{},e)}))}catch(e){s(e)}}))},ae=function(e){var t=e.selectedElement,n=e.className,i=e.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{t.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&t.removeClass(n),re(r,{},e)}))}catch(e){o(e)}}));return t.addClass(n),r},ue={},le=function(e,t){var n=t?e[t]:e;return n&&n!==e?P(n):n}.bind(null,ue),ce=function(e,t){Object.entries(t).forEach((function(t){return e[t[0]]=t[1]})),console.log("cache",e)}.bind(null,ue);function he(e,t){if("string"==typeof t&&t.toLowerCase().startsWith("operationdata.")){var n=t.split(".");return n.shift(),O(n,e)}if("string"==typeof t&&t.toLowerCase().startsWith("globaldata.")){var i=t.split(".");return i.shift(),O(i,le())}return t}var de=function(e){var t=e.eventTopic,n=e.eventName,i=function(e,t){if(t){var n=he.bind(null,e);return t.map(n)}}(e,e.eventArgs);return t?this.eventbus.broadcastForTopic(n,t,i):this.eventbus.broadcast(n,i),function(e){delete e.eventName,delete e.eventTopic,delete e.eventArgs}(e),e},pe=[];function fe(e,t){var n=t!==e?P(t):t;return ve(t,n,he.bind(null,e)),n}function ve(e,t,n){if(!(pe.indexOf(e)>-1)){pe.push(e);try{Object.entries(e).forEach((function(e){var i=e[1];i instanceof u.default||("string"==typeof i?t[e[0]]=n(i):Array.isArray(i)?i.forEach((function(e,t,i){"string"==typeof e?i[t]=n(e):ve(e,e,n)})):"object"==typeof i&&ve(i,i,n))}))}finally{var i=pe.indexOf(e);pe.splice(i,1)}}}var me={"+":function(e,t){return e+t},"-":function(e,t){return e-t},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"**":function(e,t){return Math.pow(e,t)}},ge=function(e){return(e=fe(e,e)).calculationResult=me[e.operator](+e.left,+e.right),e},Ee=function(e){return e.selectedElement.empty(),e},be=function(e){var t=e.properties;return t?(t.forEach((function(t){delete e[t]})),delete e.properties,e):{}},_e=function(e){var t=(e=fe(e,e)).elementName,n=e.attributes,i=e.text,r=n?" "+Object.entries(n).map((function(e){return e[0]+'="'+e[1]+'"'})).join(" "):"",o=u.default(i?"<"+t+r+">"+i+"</"+t+">":"<"+t+r+"/>");return e.template=o,e},ye=function(e){var t=this,n=e.systemName;return new Promise((function(i,r){t.eventbus.broadcast(M.REQUEST_FUNCTION,[n,function(n){var o=n(e,t.eventbus);o?o.then((function(){re(i,{},e)}),r):re(i,{},e)}])}))},Te=function(e){var t=e.actionInstance,n=e.actionOperationData;return delete e.actionOperationData,new Promise((function(i,r){e=ie(e,n),t.end(e).then((function(){Object.keys(n).forEach((function(t){delete e[t]})),re(i,e)}),r)}))},Pe=function(e){var t=this;return t.skipNextOperation?delete t.skipNextOperation:void 0!==t.loopIndex&&void 0!==t.loopLength&&t.loopIndex<t.loopLength?(t.loopIndex=t.loopIndex+1,t.newIndex=t.startIndex):(delete t.loopIndex,delete t.loopLength,delete t.startIndex,delete t.newIndex),e},Ie=function(e){return e.controllerInstance=Object.assign(e.controllerInstance,e.controllerExtension),e},Le=function(e){var t=e.controllerName,n=ne(e.selectedElement).find((function(e){return e.name===t}));return n||console.warn("controller for name '"+t+"' was not found on the given element"),e.controllerInstance=n,e},xe=function(e){var t=e.systemName;return e.controllerInstance=void 0,this.eventbus.broadcast(M.REQUEST_INSTANCE,[t,function(t){e.controllerInstance=t}]),e},we=function(e){var t,n,i=e.selectedElement,r=e.modifier,o={width:null!=(t=i.innerWidth())?t:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&(o=function(e,t){var n=m({},e),i=null;if(t.indexOf("|")>-1){var r=t.split("|");t=r[0],i=r[1]}var o=t.substring(0,1),s=function(e){var t=e.substring(e.length-1,e.length);"h"!==t&&"w"!==t&&"%"!==t&&(t=null);var n="%"===t;return n&&"h"!==(t=e.substring(e.length-1,e.length-2))&&"w"!==t&&(t=null),[t,1,n]}(t),a=s[0],u=s[2],l=parseInt(null!==a?t.substring(1,t.length-(s[1]-1)):t.substring(1),10),c=l,h=l;u&&(c=n.width/100*l,h=n.height/100*l);var d=function(e,t,n,i,r){var o=m({},e);switch(t){case"+":switch(n){case"h":o.height+=r;break;case"w":o.width+=i;break;default:o.height+=r,o.width+=i}break;case"-":switch(n){case"h":o.height-=r;break;case"w":o.width-=i;break;default:o.height-=r,o.width-=i}break;case"/":switch(n){case"h":o.height/=r;break;case"w":o.width/=i;break;default:o.height/=r,o.width/=i}break;case"*":switch(n){case"h":o.height*=r;break;case"w":o.width*=i;break;default:o.height*=r,o.width*=i}break;default:console.error("Unknown operator found: "+t)}return o}(n,o,a,c,h);return i?function(e,t){var n=m({},t),i=e.substring(0,1),r=e.substring(e.indexOf("[")+1,e.indexOf("]")-(e.indexOf("[")-1)),o=r.split("=")[1].split("-");if(2!==o.filter(Boolean).length)throw new Error("Badly formatted modifier, expect two ratios: "+r);return"h"===i?n.height=n.width/+o[0]*+o[1]:"w"===i&&(n.width=n.height/+o[1]*+o[0]),n}(i,d):d}(o,r)),e.dimensions=o,e},Ne=function(e){return this.eventbus.broadcast(M.REQUEST_FUNCTION,[e.systemName,function(t){e.importedInstance=t}]),delete e.systemName,e},Se=function(e){var t=new URLSearchParams(window.location.search),n=Object.fromEntries(t.entries()),i=e.defaultValues;return i&&(Object.entries(i).filter((function(e){return!(e[0]in n)})).forEach((function(e){return n[e[0]]=e[1]})),delete e.defaultValues),e.queryParams=n,e},Oe=function(e){var t=e.methodName,n=e.methodArguments;return delete e.methodName,delete e.methodArguments,e.methodResult=e.instance[t].apply(e.instance,null!=n?n:[]),e},Re={},Ae=function(e){var t=e.url;return e.cache&&Re[t]?(e.json=Re[t],e):fetch(t).then(function(){var n=v(p().mark((function n(i){var r;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.json();case 2:return r=e.json=n.sent,Re[t]=r,n.abrupt("return",e);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},De=function(e){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:e}),console.groupEnd(),e},Ce=function(e){return(e=fe(e,e)).args=e.args.map((function(e){return"string"==typeof(t=e)&&t in Math&&"function"!=typeof Math[t]?Math[e]:e;var t})),e.mathResult=Math[e.functionName].apply(null,e.args),e},Ue=function(e){return e.selectedElement.removeClass(e.className),e},ke=function(e){var t=e.controllerName,n=ne(e.selectedElement),i=null==n?void 0:n.find((function(e){return e.name===t}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return e},qe=function(e){return e.selectedElement.remove(),e},je=function(e){var t=e.propertyNames;return t.indexOf("propertyNames")<0&&t.push("propertyNames"),Object.fromEntries(Object.entries(e).filter((function(e){return!t.includes(e[0])})))},Me=function(e){var t=e.newParentSelector;return e.selectedElement.remove().appendTo(t),e},Qe=function(e){return this.eventbus.broadcast(M.REQUEST_ACTION,[e.systemName,function(t){e.actionInstance=t}]),e},He=function(e){var t=e.actionInstance;return e=ie(e,e.actionOperationData),t.resize?t.resize(e):e};function Fe(e,t){var n=e.find(t);return n.length||console.warn("selector '"+t+"' wasn't found!"),n}var ze=function(e){var t=e.selector,n=e.useSelectedElementAsRoot,i=void 0!==n&&n;if(!t)throw new Error("selectElement: selector is either empty or not defined.");return i&&e.selectedElement?(e.selectedElement=Fe(e.selectedElement,t),e):(this.eventbus.broadcast(M.REQUEST_ENGINE_ROOT,[function(n){e.selectedElement=Fe(n,t)}]),e)},Ge=function(e){var t=e.selectedElement;return Object.entries(e.attributes).forEach((function(e){t.attr(e[0],e[1])})),e},Ve=function(e){var t=e.insertionType,n=void 0===t?"overwrite":t,i=e.selectedElement,r=e.template;switch(!0){case"overwrite"===n:i.html(r);break;case"append"===n:i.append(r);break;case"prepend"===n:i.prepend(r)}return delete e.insertionType,e},Be=function(e){var t=e.properties,n=Object.fromEntries(Object.entries(e).filter((function(e){return t.includes(e[0])})));return ce(n),delete e.properties,e},Ke=function(e){var t=e.override,n=void 0!==t&&t,i=e.properties;delete e.properties,delete e.override;var r=fe(e,i);return n?r:Object.assign(e,r)},We=function(e){var t=fe(e,e.properties);return e.selectedElement.css(t),e},Ye=function(e){var t=e.actionInstance,n=e.actionOperationData;return delete e.actionOperationData,new Promise((function(i,r){e=ie(e,n),t.start(e).then((function(){Object.keys(n).forEach((function(t){delete e[t]})),re(i,e)}),r)}))},Je=function(e){var t=this,n=e.collection;if(null!==n&&!Array.isArray(n))throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===t.loopIndex&&(null!=n&&n.length?(t.loopIndex=0,t.loopLength=n.length-1,t.startIndex=t.currentIndex):t.skipNextOperation=!0),null!=n&&n.length&&void 0!==t.loopIndex&&(e.currentItem=n[t.loopIndex]),e},Ze=function(e){return e.selectedElement.toggleClass(e.className),e},Xe=function(e){return e.selectedElement.toggle(),e},$e=function(e){var t=e.milliseconds;return new Promise((function(n){setTimeout((function(){re(n,e)}),t)}))},et={__proto__:null,addClass:te,addControllerToElement:oe,animate:se,animateWithClass:ae,broadcastEvent:de,calc:ge,clearElement:Ee,clearOperationData:be,createElement:_e,customFunction:ye,endAction:Te,endLoop:Pe,extendController:Ie,getControllerFromElement:Le,getControllerInstance:xe,getElementDimensions:we,getImport:Ne,getQueryParams:Se,invokeObjectMethod:Oe,loadJSON:Ae,log:De,math:Ce,removeClass:Ue,removeControllerFromElement:ke,removeElement:qe,removePropertiesFromOperationData:je,reparentElement:Me,requestAction:Qe,resizeAction:He,selectElement:ze,setElementAttributes:Ge,setElementContent:Ve,setGlobalData:Be,setOperationData:Ke,setStyle:We,startAction:Ye,startLoop:Je,toggleClass:Ze,toggleElement:Xe,wait:$e},tt=function(){function e(e,t){this.eventbus=void 0,this.config=void 0,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=s.v4(),this.loop=!1,this.eventbus=e,this.config=t,this._addEventListeners()}var t=e.prototype;return t._extractUrls=function(e){return e.timelines.filter((function(e){return"mediaplayer"===e.type})).map((function(e){return e.uri}))},t.init=function(){var e=this,t=this.config.timelineProviderSettings.mediaplayer;if(!t)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=t.selector,i=this._extractUrls(this.config),r=window.jwplayer,o=u.default("#"+n);if(!o.length)throw new Error("videoplayer selector '"+n+"' not found");var s=o.innerWidth(),a=o.innerHeight();return 0===s&&(s=100),0===a&&(a=300),this._player=r(n),this._player.setup({file:i[0],image:t.poster,height:a,width:s,controls:!0,autostart:!1,displaytitle:!1,displaydescription:!1,nextUpDisplay:!1,abouttext:"Eligius",aboutlink:"http://www.google.com",stretching:"fill",repeat:!1}),this._playlist.length=0,i.forEach((function(n){e._playlist.push({file:n,title:n,image:t.poster})})),new Promise((function(t){e._player.once("ready",(function(){e._handlePlayerReady(t)})),e._player.load(e._playlist)}))},t._handlePlayerReady=function(e){var t=this;this._player.once("firstFrame",(function(){t._player.pause(),t.eventbus.broadcast(M.DURATION,[t.getDuration()]),e(t)})),this._player.on(M.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(M.SEEKED,this._seekedHandler.bind(this)),this._player.on(M.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){t._player.play()}),10)},t._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(M.COMPLETE,[this._player.getPlaylistIndex()]))},t._seekedHandler=function(){this.eventbus.broadcast(M.SEEKED,[this.getPosition(),this.getDuration()])},t.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(e){return e()}))},t._loopHandler=function(e,t){var n=e(t.position);this.loop&&n===e(this._player.getDuration()-1)&&this.seek(0)},t._timeResetLoopHandler=function(){this.loop&&this.seek(0)},t._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(M.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.DURATION_REQUEST,this.duration.bind(this)))},t._container=function(e){var t="";"html5"!==this._player.getProvider().name&&(t="_wrapper"),e(u.default("#"+this._videoElementId+t))},t.toggleplay=function(){this._paused?this.start():this.pause()},t.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(M.PLAY)},t.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(M.STOP)},t.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(M.PAUSE)},t.seek=function(e){var t=this._player.getPosition();this._player.seek(e),this.eventbus.broadcast(M.SEEK,[e,t,this._player.getDuration()])},t.resize=function(e,t){this._player.resize(e,t),this.eventbus.broadcast(M.RESIZE,[e,t])},t.duration=function(e){e(Math.floor(this.getDuration()))},t.playlistItem=function(e){var t=this._playlist.findIndex((function(t){return t.file===e}));t>-1&&this._player.playlistItem(t)},t.getPosition=function(){return this._player.getPosition()},t.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},t.getState=function(){return this._player.getState()},t.getDuration=function(){return this._player.getDuration()},t.getMute=function(){return this._player.getMute()},t.getVolume=function(){return this._player.getVolume()},t.setMute=function(e){this._player.setMute(e)},t.setVolume=function(e){this._player.setVolume(e)},e}(),nt=function(){function e(e,t){this.eventbus=void 0,this.config=void 0,this._currentPosition=0,this._updateBound=this._update.bind(this),this._eventbusListeners=[],this._firstFrame=!0,this._currentPlaylistItem=void 0,this._tickInterval=1e3,this._playlist=void 0,this._containerElement=void 0,this._abortController=void 0,this.playState="stopped",this.loop=!1,this.eventbus=e,this.config=t,this.eventbus=e,this.config=t,this._playlist=this._extractPlaylist(t),this._currentPlaylistItem=this._playlist[0]}var t=e.prototype;return t._extractPlaylist=function(e){return e.timelines.filter((function(e){return"animation"===e.type}))},t.playlistItem=function(e){if(null!==e&&e.length&&0!==this._playlist.length){var t=this._playlist.find((function(t){return t.uri===e}));if(!t)throw new Error("Unknown playlist uri: "+e);this._currentPlaylistItem=t,this._firstFrame=!0}},t._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(M.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},t._update=function(e){if("running"===this.playState){if(this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(M.FIRST_FRAME)),this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(M.COMPLETE);this._resetToStartPosition(),this.eventbus.broadcast(M.RESTART)}this.eventbus.broadcast(M.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(M.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])}},t._start=function(){var e;"running"!==this.playState&&(this.playState="running",null==(e=this._abortController)||e.abort(),this._abortController=new AbortController,function(e,t,n){var i,r,o,s=null!=(i=null==(r=document)||null==(o=r.timeline)?void 0:o.currentTime)?i:performance.now();function a(e){t.aborted||(n(e),u(e))}function u(t){var n=Math.round((t-s)/e)*e,i=s+n+e-performance.now();setTimeout((function(){return requestAnimationFrame(a)}),i)}u(s)}(this._tickInterval,this._abortController.signal,this._updateBound))},t._resetToStartPosition=function(){this._currentPosition=0},t._resize=function(){console.error("Not implemented yet")},t._container=function(e){e(this._containerElement)},t._stopAnimationInterval=function(e){var t;void 0===e&&(e=!0),null==(t=this._abortController)||t.abort(),this._abortController=void 0,e&&this._resetToStartPosition()},t.init=function(){if(this._addEventListeners(),this._currentPlaylistItem=this._playlist[0],this._containerElement=u.default(this._currentPlaylistItem.selector),!this._containerElement.length)throw new Error("timeline selector '"+this._currentPlaylistItem.selector+"' not found");return new Promise((function(e){e()}))},t.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(e){return e()})),this._containerElement=void 0},t.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},t.start=function(){this._start(),this.eventbus.broadcast(M.PLAY)},t.stop=function(){this._stopAnimationInterval(),this.playState="stopped",this.eventbus.broadcast(M.STOP)},t.pause=function(){this._stopAnimationInterval(!1),this.playState="paused",this.eventbus.broadcast(M.PAUSE)},t.seek=function(e){e<0||e>this._currentPlaylistItem.duration||(this.eventbus.broadcast(M.SEEK,[e,this._currentPosition,this.getDuration()]),this._currentPosition=e,this.eventbus.broadcast(M.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(M.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(M.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},t.getPosition=function(){return this._currentPosition},t.getDuration=function(){return this._currentPlaylistItem.duration},t.requestDurationHandler=function(e){e(this._currentPlaylistItem.duration)},e}(),it=et,rt=K,ot={__proto__:null,JwPlayerTimelineProvider:tt,RequestAnimationFrameTimelineProvider:nt},st=X,at=function(){function e(){this.engines=new Map,this.engines.set("EligiusEngine",W)}var t=e.prototype;return t.getOperationNames=function(){return Object.keys(it)},t.getControllerNames=function(){return Object.keys(rt)},t.getProviderNames=function(){return Object.keys(ot)},t.import=function(e){var t,n,i,r,o,s=null!=(t=null!=(n=null!=(i=null!=(r=it[e])?r:rt[e])?i:ot[e])?n:st[e])?t:this.engines.get(e);return(o={})[e]=s,o},e}(),ut={__proto__:null,addClass:function(){return{description:"Add a class to the selected element.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},addControllerToElement:function(){return{description:"Adds the current controller to the selected element(s)",dependentProperties:["selectedElement","controllerInstance"]}},animate:function(){return{description:"Animates the selected element with the given animation settings.",dependentProperties:["selectedElement"],properties:{animationEasing:"ParameterType:boolean",animationProperties:{type:"ParameterType:object",required:!0},animationDuration:{type:"ParameterType:number",required:!0}}}},animateWithClass:function(){return{description:"Animates the selected element by adding the given animation class.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0},removeClass:"ParameterType:boolean"}}},broadcastEvent:function(){return{description:"Broadcasts an eventbus event with the given type, topic and optional arguments",properties:{eventArgs:"ParameterType:array",eventTopic:"ParameterType:eventTopic",eventName:{type:"ParameterType:eventName",required:!0}}}},calc:function(){return{description:"Calculates the given left and right hand sides using the specified operator",properties:{left:{type:"ParameterType:number",description:"The left operand",required:!0},right:{type:"ParameterType:number",description:"The right operand",required:!0},operator:[{value:"+",description:"Adds the left and right operands"},{value:"-",description:"Subtracts the left and right operands"},{value:"*",description:"Multiplies the left and right operands"},{value:"/",description:"Divides the left and right operands"},{value:"%",description:"Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number"},{value:"**",description:"Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times."}]},outputProperties:{calculationResult:"ParameterType:number"}}},clearElement:function(){return{description:"clears the given element",dependentProperties:["selectedElement"]}},clearOperationData:function(){return{description:"clears the current operation data",properties:{properties:"ParameterType:array"}}},createElement:function(){return{description:"Creates an HTML element with the given name and optionally adds the given attributes",properties:{elementName:{type:"ParameterType:htmlElementName",required:!0},attributes:"ParameterType:object",text:"ParameterType:string"},outputProperties:{template:"ParameterType:object"}}},customFunction:function(){return{description:"Executes the specified custom function",properties:{systemName:{type:"ParameterType:systemName",required:!0}}}},endAction:function(){return{description:"Ends the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},endLoop:function(){return{description:"Ends the current loop"}},extendController:function(){return{description:"Extends the current controller",dependentProperties:["controllerInstance"],properties:{controllerExtension:"ParameterType:object"}}},getControllerFromElement:function(){return{description:"Retrieves the specified controller from the current element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}},getControllerInstance:function(){return{description:"Retrieves an instance of the specified controller",properties:{systemName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}},getElementDimensions:function(){return{description:"Calculates the dimensions for the current element",dependentProperties:["selectedElement"],properties:{modifier:"ParameterType:dimensionsModifier"},outputProperties:{dimensions:"ParameterType:dimensions"}}},getImport:function(){return{description:"Retrieves a javascript import specified by the given system name",properties:{systemName:{type:"ParameterType:systemName",required:!0}},outputProperties:{importedInstance:"ParameterType:object"}}},getQueryParams:function(){return{description:"Retrieves the current query parameters from the browser's address bar",outputProperties:{queryParams:"ParameterType:object"}}},invokeObjectMethod:function(){return{description:"Invokes the specified method on the given object with the optional specified arguments",properties:{instance:{type:"ParameterType:object",required:!0},methodName:{type:"ParameterType:string",required:!0},methodArguments:"ParameterType:array"},outputProperties:{methodResult:"ParameterType:object"}}},loadJSON:function(){return{description:"Load JSON from the given url",properties:{url:{type:"ParameterType:url",required:!0},cache:"ParameterType:boolean"},outputProperties:{json:"ParameterType:object"}}},log:function(){return{description:"Logs the current context and operation data to the console"}},math:function(){return{description:"This operation performs the given math function of the specified arguments.",properties:{args:{type:"ParameterType:array",required:!0},functionName:Object.getOwnPropertyNames(Math).filter((function(e){return"function"==typeof Math[e]})).map((function(e){return{value:e}})),mathResult:"ParameterType:number"}}},removeClass:function(){return{description:"Removes the specified class from the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},removeControllerFromElement:function(){return{description:"Removes the specified controller from the selected element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}}}},removeElement:function(){return{description:"Removes the selected element from the DOM",dependentProperties:["selectedElement"]}},removePropertiesFromOperationData:function(){return{description:"Removes the specified properties from the current operation data",properties:{propertyNames:"ParameterType:array"}}},reparentElement:function(){return{description:"Moves the selected element to the new location described by the given selector",dependentProperties:["selectedElement"],properties:{newParentSelector:{type:"ParameterType:selector",required:!0}}}},requestAction:function(){return{description:"Retrieves an instance of the specified action",properties:{systemName:{type:"ParameterType:actionName",required:!0}},outputProperties:{actionInstance:"ParameterType:object"}}},resizeAction:function(){return{description:"Triggers a resize on the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},selectElement:function(){return{description:"Selects an element using the given selector",properties:{selector:{type:"ParameterType:selector",required:!0},useSelectedElementAsRoot:"ParameterType:boolean"},outputProperties:{selectedElement:"ParameterType:jQuery"}}},setElementAttributes:function(){return{description:"Sets the given attributes on the selected element",dependentProperties:["selectedElement"],properties:{attributes:{type:"ParameterType:object",required:!0}}}},setElementContent:function(){return{description:"Sets the given HTML content in the selected element",dependentProperties:["selectedElement","template"],properties:{insertionType:[{value:"overwrite",description:"the contents of the selected element are replaced by the given template",default:!0},{value:"append",description:"the new content will be inserted after the current content"},{value:"prepend",description:"the new content will be inserted before the current content"}]}}},setGlobalData:function(){return{description:"Copies the specified values from the operationData to the global data",properties:{properties:{type:"ParameterType:array",required:!0}}}},setOperationData:function(){return{description:"Sets the given properties on the current operation data",properties:{properties:{type:"ParameterType:object",required:!0},override:"ParameterType:boolean"}}},setStyle:function(){return{description:"Sets the given style properties on the selected element",properties:{properties:{type:"ParameterType:object",required:!0},selectedElement:"ParameterType:jQuery"}}},startAction:function(){return{description:"Starts the selected action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},startLoop:function(){return{description:"Starts a loop over the given collection",properties:{collection:{type:"ParameterType:array",required:!0},currentItem:"ParameterType:object"}}},toggleClass:function(){return{description:"Toggles the given class on the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},toggleElement:function(){return{description:"Toggles the selected element",dependentProperties:["selectedElement"]}},wait:function(){return{description:"Waits the given amount of milliseconds before the action continues",properties:{milliseconds:{type:"ParameterType:number",required:!0}}}}};exports.Action=I,exports.ActionRegistryEventbusListener=Y,exports.ConfigurationResolver=R,exports.DEV_TOOLS_KEY="__ELIGIUS_DEV_TOOLS__",exports.DevToolEventListener=_,exports.Diagnostics=y,exports.EligiusEngine=W,exports.EligiusResourceImporter=at,exports.EndableAction=L,exports.EngineFactory=ee,exports.EventListenerController=Q,exports.Eventbus=J,exports.JwPlayerTimelineProvider=tt,exports.LabelController=H,exports.LanguageManager=$,exports.LottieController=F,exports.NavigationController=z,exports.ProgressbarController=G,exports.RequestAnimationFrameTimelineProvider=nt,exports.RequestVideoUriInterceptor=Z,exports.RoutingController=V,exports.SubtitlesController=B,exports.TimelineAction=x,exports.TimelineEventNames=M,exports.addClass=te,exports.addControllerToElement=oe,exports.animate=se,exports.animateWithClass=ae,exports.broadcastEvent=de,exports.calc=ge,exports.clearElement=Ee,exports.clearOperationData=be,exports.createElement=_e,exports.customFunction=ye,exports.endAction=Te,exports.endLoop=Pe,exports.extendController=Ie,exports.generateImporterSourceCode=function(e,t,n){var i=function(e,t,n){return[].concat(function(e){var t,n=N(e.initActions.concat(e.actions).concat(null!=(t=e.eventActions)?t:[]));if(e.timelines){var i=e.timelines.flatMap((function(e){return e.timelineActions}));n=n.concat(N(i))}return S(n)}(e),n.flatMap((function(e){return i=e.extension,l.default.readdirSync(c.default.join(t,n=e.path)).map((function(e){return{systemName:""+c.default.basename(e,i).replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()})),path:"./"+n+"/"+e,defaultImport:!0}}));var n,i})),function(e){var t,n,i,r,o=[];return(t=o).push.apply(t,w(e.initActions)),(n=o).push.apply(n,w(e.actions)),(i=o).push.apply(i,w(e.timelines.flatMap((function(e){return e.timelineActions})))),(r=o).push.apply(r,w(e.eventActions)),S(o)}(e),function(e){return e.timelineProviderSettings?Object.values(e.timelineProviderSettings).map((function(e){return{systemName:e.systemName}})):[]}(e),function(e){return e.engine?[{systemName:e.engine.systemName}]:[]}(e))}(e,t,n),r=function(e){var t=e.filter((function(e){return e.defaultImport})).map((function(e){return"import "+e.systemName+" from '"+e.path+"';"})).concat(e.filter((function(e){return!e.defaultImport})).map((function(e){var t;return"import {"+e.systemName+"} from '"+(null!=(t=e.path)?t:"eligius")+"';"})));return t.push("import { ISimpleResourceImporter } from 'eligius';"),t.push(""),t.push("const imports: Record<string, any> = {"),t.push.apply(t,e.map((function(e){return e.systemName+": { '"+e.systemName+"': "+e.systemName+" },"}))),t.push("};"),t.push(""),t.push("class EligiusResourceImporter implements ISimpleResourceImporter {"),t.push("import(name: string): Record<string, any> {"),t.push("if (imports.hasOwnProperty(name)) { return imports[name]; }"),t.push("throw Error(`Unknown systemName: ${name}`);"),t.push("}}"),t.push(""),t.push("export default EligiusResourceImporter;"),t.join("\n")}(i);return r},exports.getControllerFromElement=Le,exports.getControllerInstance=xe,exports.getElementDimensions=we,exports.getImport=Ne,exports.getQueryParams=Se,exports.invokeObjectMethod=Oe,exports.loadJSON=Ae,exports.log=De,exports.math=Ce,exports.metadata=ut,exports.removeClass=Ue,exports.removeControllerFromElement=ke,exports.removeElement=qe,exports.removePropertiesFromOperationData=je,exports.reparentElement=Me,exports.requestAction=Qe,exports.resizeAction=He,exports.selectElement=ze,exports.setElementAttributes=Ge,exports.setElementContent=Ve,exports.setGlobalData=Be,exports.setOperationData=Ke,exports.setStyle=We,exports.startAction=Ye,exports.startLoop=Je,exports.toggleClass=Ze,exports.toggleElement=Xe,exports.wait=$e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("jquery"),t=require("ts-is-present"),n=require("fs"),i=require("path"),r=require("lottie-web"),o=require("hotkeys-js"),s=require("uuid");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(n),c=a(i),h=a(r),d=a(o);function p(){p=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=Object.create((t&&t.prototype instanceof h?t:h).prototype),o=new I(i||[]);return r._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=y(s,n);if(a){if(a===c)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),r}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function h(){}function d(){}function f(){}var v={};a(v,r,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(L([])));g&&g!==t&&n.call(g,r)&&(v=g);var E=f.prototype=h.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(r,o,s,a){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,s,a)}),(function(e){i("throw",e,s,a)})):t.resolve(h).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,a)}))}a(u.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,c;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function L(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=f,a(E,"constructor",f),a(f,"constructor",d),d.displayName=a(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},b(_.prototype),a(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new _(u(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(E),a(E,s,"Generator"),a(E,r,(function(){return this})),a(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;P(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function f(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){f(o,i,r,s,a,"next",e)}function a(e){f(o,i,r,s,a,"throw",e)}s(void 0)}))}}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m.apply(this,arguments)}function g(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,E(e,t)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function b(e){if(Array.isArray(e))return e.map(b);if(e instanceof u.default)return"jQuery object";if(null!==e&&"object"==typeof e){if("class"===e.constructor.toString().substring(0,5)||!e.constructor.toString().startsWith("function Object()")){var t=e.constructor.toString();return t.substring(0,t.indexOf("{")+1)}return Object.fromEntries(Object.entries(e).map((function(e){return[e[0],b(e[1])]})))}if("function"==typeof e){var n=e.toString();return n.indexOf("{")>-1?n.substring(0,n.indexOf("{")+1):n}return e}var _=function(){function e(e){this.agent=void 0,this.agent=e}return e.prototype.handleEvent=function(e,t,n){var i={eventName:e,eventTopic:t,args:b(n)};try{this.agent.postMessage("eligius-diagnostics-event",i)}catch(e){console.error("postmessage failed"),console.error(e),console.log("message",i)}},e}(),y=function(){function e(){}return e.send=function(e,t){console.log(e,t)},e}();y.active=void 0;var T="undefined"!=typeof structuredClone?structuredClone:function(e){return JSON.parse(JSON.stringify(e))};function P(e){return t.isDefined(e)?T(e):e}var I=function(){function e(e,t,n){this.name=void 0,this.startOperations=void 0,this.eventbus=void 0,this.id="",this.name=e,this.startOperations=t,this.eventbus=n}var t=e.prototype;return t.start=function(e){var t,n=this;y.active&&y.send("eligius-diagnostics-action",(null!=(t=this.name)?t:"Action")+" begins executing start operations");var i={currentIndex:-1,eventbus:this.eventbus},r=new Promise((function(t,r){n.executeOperation(n.startOperations,0,t,r,e,i)})).catch((function(e){throw y.active&&y.send("eligius-diagnostics-action-error",{name:name,error:e}),console.error("Error in action start '"+n.name+"'"),console.error(e),e}));return y.active?r.then((function(e){var t;return y.send("eligius-diagnostics-action",(null!=(t=n.name)?t:"Action")+" finished executing start operations"),e})):r},t.executeOperation=function(e,t,n,i,r,o){var s,a=this;if(void 0===r&&(r={}),void 0!==o.newIndex&&(t=o.newIndex,delete o.newIndex),o.currentIndex=t,o.skipNextOperation&&(t<e.length?this.executeOperation(e,++t,n,i,r,o):n(r)),t<e.length){var u=e[t],l=u.operationData?P(u.operationData):{},c=Object.assign(r,l);y.active&&y.send("eligius-diagnostics-operation",{systemName:u.systemName,operationData:c,context:m({},o,{eventbus:void 0})});var h=u.instance.call(o,c);"object"==typeof(s=h)&&"function"==typeof s.then?h.then((function(r){a.executeOperation(e,++t,n,i,r,o)})).catch((function(e){i(e)})):this.executeOperation(e,++t,n,i,h,o)}else n(r)},e}(),L=function(e){function t(t,n,i,r){var o;return(o=e.call(this,t,n,r)||this).endOperations=void 0,o.endOperations=i,o}return g(t,e),t.prototype.end=function(e){var t,n=this;if(y.active&&y.send("eligius-diagnostics-action",(null!=(t=this.name)?t:"Action")+" begins executing end operations"),!this.endOperations.length)return Promise.resolve(e);var i={currentIndex:-1,eventbus:this.eventbus},r=new Promise((function(t,r){n.executeOperation(n.endOperations,0,t,r,e,i)})).catch((function(e){throw console.error("Error in action end '"+n.name+"'"),e}));return y.active?r.then((function(e){var t;return y.send("eligius-diagnostics-action",(null!=(t=n.name)?t:"Action")+" finished executing start operations"),e})):r},t}(I),x=function(e){function t(t,n,i,r,o){var s;return(s=e.call(this,t,n,i,o)||this).duration=void 0,s.active=!1,s.duration=r,s}g(t,e);var n=t.prototype;return n.start=function(t){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,e.prototype.start.call(this,t)):new Promise((function(e){e()}))},n.end=function(t){return this.active=!1,e.prototype.end.call(this,t)},t}(L);function w(e){return e&&(t=e.flatMap((function(e){var t;return[].concat(e.startOperations,null!=(t=e.endOperations)?t:[])})))?t.filter((function(e){var t;return!(null==(t=e.operationData)||!t.hasOwnProperty("systemName"))&&e.operationData.systemName.endsWith("Controller")})).map((function(e){return{systemName:e.operationData.systemName}})):[];var t}function N(e){return e&&(t=e.flatMap((function(e){var t;return[].concat(e.startOperations,null!=(t=e.endOperations)?t:[])})))?t.map((function(e){return{systemName:e.systemName}})):[];var t}function S(e){var t={};return e.filter((function(e){return!t[e.systemName]&&(t[e.systemName]=!0,!0)}))}function O(e,t){if(!e)throw Error("properties arg cannot be null");if(!t)throw Error("sourceObject arg cannot be null");var n=t,i=null;return e.forEach((function(t,r){if(r===e.length-1){var o=t.split("+");o.length>1&&(t=o[0],i=o[1])}n=n[t]})),i?n+i:n}var R=function(){function e(e,t){this.importer=void 0,this.eventbus=void 0,this.importer=e,this.eventbus=t}return e.prototype.process=function(e,n){if(j(e,e,this.importer),!t.isDefined(e.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:e.id,engine:m({},e.engine),timelineProviderSettings:P(e.timelineProviderSettings),containerSelector:e.containerSelector,language:e.language,layoutTemplate:e.layoutTemplate,availableLanguages:P(e.availableLanguages),actions:q(e.actions,this.importer,this.eventbus),initActions:q(e.initActions,this.importer,this.eventbus),labels:P(e.labels),timelineFlow:P(e.timelineFlow),timelines:A(e.timelines,this.importer,this.eventbus)},r=[];return e.eventActions&&n&&(r=function(e,t,n,i){return e.map((function(e){return C(e,n)})).map((function(n,r){var o=e[r],s=o.eventName,a=o.eventTopic,u=new I(n.name,n.startOperations,i);return t.registerAction(u,s,a),u}))}(e.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(e,t){var n;return m({},e,((n={})[t.name]=t,n))}),{}),i]},e}();function A(e,t,n){var i=k.bind(null,t,n);return e.map((function(e){return m({},e,{timelineActions:e.timelineActions.map(i)})}))}function D(e,t){return{id:t.id,systemName:t.systemName,operationData:P(t.operationData),instance:e.import(t.systemName)[t.systemName]}}function C(e,t){var n=D.bind(null,t);return{id:e.id,name:e.name,startOperations:e.startOperations.map(n)}}function U(e,t){var n=D.bind(null,t);return m({},C(e,t),{endOperations:e.endOperations.map(n)})}function k(e,t,n){var i,r=U(n,e),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},s=r.id,a=new x(r.name,r.startOperations,r.endOperations,o,t);return a.id=s,a}function q(e,t,n){return e.map((function(e){return U(e,t)})).map((function(e){var t=new L(e.name,e.startOperations,e.endOperations,n);return t.id=e.id,t}))}function j(e,n,i){t.isDefined(e)&&(Array.isArray(e)?e.forEach((function(e){j(e,n,i)})):Object.keys(e).forEach((function(t){!function(e,t,n,i){var r,o=t[e];if("string"==typeof o){if(o.startsWith("config:")){var s=o.substring(7,o.length);t[e]=(r=n,O(s.split("."),r))}else if(o.startsWith("template:")){var a=o.substring(9,o.length),u=i.import(a)[a];t[e]=u}else if(o.startsWith("json:")){var l=o.substring(5,o.length),c=i.import(l)[l];t[e]=c}}else"object"==typeof o&&j(o,n,i)}(t,e,n,i)})))}var M=function(){};M.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",M.PLAY_REQUEST="timeline-play-request",M.STOP_REQUEST="timeline-stop-request",M.PAUSE_REQUEST="timeline-pause-request",M.SEEK_REQUEST="timeline-seek-request",M.RESIZE_REQUEST="timeline-resize-request",M.CONTAINER_REQUEST="timeline-container-request",M.DURATION_REQUEST="timeline-duration-request",M.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",M.DURATION="timeline-duration",M.TIME="timeline-time",M.SEEKED="timeline-seeked",M.COMPLETE="timeline-complete",M.RESTART="timeline-restart",M.PLAY="timeline-play",M.STOP="timeline-stop",M.PAUSE="timeline-pause",M.SEEK="timeline-seek",M.RESIZE="timeline-resize",M.POSITION_UPDATE="timeline-position-update",M.TIME_UPDATE="timeline-time-update",M.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",M.FIRST_FRAME="timeline-firstframe",M.REQUEST_INSTANCE="request-instance",M.REQUEST_ACTION="request-action",M.REQUEST_FUNCTION="request-function",M.REQUEST_TIMELINE_URI="request-timeline-uri",M.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",M.REQUEST_ENGINE_ROOT="request-engine-root",M.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",M.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",M.EXECUTE_TIMELINEACTION="execute-timelineaction",M.RESIZE_TIMELINEACTION="resize-timelineaction",M.REQUEST_LABEL_COLLECTION="request-label-collection",M.REQUEST_LABEL_COLLECTIONS="request-label-collections",M.REQUEST_CURRENT_LANGUAGE="request-current-language",M.LANGUAGE_CHANGE="language-change";var Q=function(){function e(){this.operationData=void 0,this.actionInstanceInfos=void 0,this.name="EventListenerController"}var t=e.prototype;return t.init=function(e){this.operationData={selectedElement:e.selectedElement,eventName:e.eventName,actions:e.actions.slice(),actionOperationData:e.actionOperationData?P(e.actionOperationData):void 0}},t.attach=function(e){var t=this;if(this.operationData){var n=this.operationData,i=n.selectedElement,r=n.actions,o=n.eventName;this.actionInstanceInfos||(this.actionInstanceInfos=[],r.forEach((function(n){var i,r=t._isStartAction(n);e.broadcast(M.REQUEST_ACTION,[r[1],(i=r[0],function(e){var n;null==(n=t.actionInstanceInfos)||n.push({start:i,action:e})})])})),i.on(o,this._eventHandler.bind(this)))}},t._isStartAction=function(e){return"end:"===e.substr(0,"end:".length)?[!1,e.substr("end:".length)]:[!0,e]},t._eventHandler=function(e){if(this.operationData&&this.actionInstanceInfos){var t=this.operationData.actionOperationData?P(this.operationData.actionOperationData):{};e.target&&(t.targetValue=e.target.value),this._executeAction(this.actionInstanceInfos,t,0)}},t._executeAction=function(){var e=v(p().mark((function e(t,n,i){var r,o,s;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i<t.length)){e.next=8;break}return o=(r=t[i]).action,s=r.start?o.start.bind(o):o.end.bind(o),e.next=6,s(n);case 6:this._executeAction(t,Object.assign(n,e.sent),++i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t.detach=function(e){var t;null==(t=this.operationData)||t.selectedElement.off(this.operationData.eventName)},e}(),H=function(){function e(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController",this.requestLabelDataBound=void 0}var t=e.prototype;return t.init=function(e){this.operationData=Object.assign({},e)},t.setLabelId=function(e){this.requestLabelDataBound&&(this.requestLabelDataBound(e),this.setLabel())},t.attach=function(e){var t=this;this.operationData&&(e.broadcast(M.REQUEST_CURRENT_LANGUAGE,[function(e){t.currentLanguage=e}]),this.requestLabelDataBound=this.requestLabelData.bind(this,e),this.requestLabelDataBound(this.operationData.labelId),this.setLabel(),this.listeners.push(e.on(M.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},t.requestLabelData=function(e,t){var n=this;e.broadcast(M.REQUEST_LABEL_COLLECTION,[t,function(e){n.createTextDataLookup(e)}])},t.setLabel=function(){var e;this.currentLanguage&&(null==(e=this.operationData)||e.selectedElement.html(this.labelData[this.currentLanguage]))},t.detach=function(e){this.listeners.forEach((function(e){return e()})),this.requestLabelDataBound=void 0},t.handleLanguageChange=function(e){this.currentLanguage=e,this.setLabel()},t.createTextDataLookup=function(e){var t=this;e.forEach((function(e){t.labelData[e.languageCode]=e.label}))},e}(),F=function(){function e(){this.name="LottieController",this.currentLanguage=null,this.labelData={},this.listeners=[],this.animationItem=null,this.operationData=null,this.serializedData=null,this.serializedIEData=null,this.freezePosition=-1,this.endPosition=-1}var t=e.prototype;return t.init=function(e){this.operationData={selectedElement:e.selectedElement,renderer:e.renderer,loop:e.loop,autoplay:e.autoplay,animationData:e.animationData,json:e.json,labelIds:e.labelIds,viewBox:e.viewBox,iefallback:e.iefallback},e.url.indexOf("[")>-1&&this.parseFilename(e.url),this.serializedData=this.operationData.json?JSON.stringify(this.operationData.json):JSON.stringify(this.operationData.animationData),this.operationData.iefallback&&(this.serializedIEData=JSON.stringify(this.operationData.iefallback))},t.parseFilename=function(e){var t=this;e.substr(e.indexOf("[")+1,e.indexOf("]")-e.indexOf("[")-1).split(",").forEach((function(e){var n=e.split("=");"freeze"===n[0]?t.freezePosition=+n[1]:"end"===n[0]&&(t.endPosition=+n[1])}))},t.attach=function(e){if(this.operationData){var t=this.operationData.labelIds;if(t&&t.length){var n={};e.broadcast(M.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(e.on(M.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),e.broadcast(M.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},t.detach=function(e){this.listeners.forEach((function(e){e()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},t.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},t.createAnimation=function(){var e,t=this;if(this.operationData&&this.serializedData){null==(e=this.animationItem)||e.destroy();var n=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,i=this.operationData.labelIds;i&&i.length&&i.forEach((function(e){var i;n=n.split("!!"+e+"!!").join(t.labelData[e][null!=(i=t.currentLanguage)?i:""])}));var r=JSON.parse(n);this.animationItem=h.default.loadAnimation({autoplay:this.operationData.autoplay,container:this.operationData.selectedElement[0],loop:this.operationData.loop,rendererSettings:this.operationData.renderer,animationData:r}),this.endPosition<0&&(this.endPosition=this.animationItem.timeCompleted),this.freezePosition>-1&&this.animationItem.playSegments([0,this.freezePosition],!0),this.operationData.viewBox&&this.operationData.selectedElement.find("svg").attr("viewBox",this.operationData.viewBox)}},t.createTextDataLookup=function(e){var t=this;e.forEach((function(e,n){e.forEach((function(e){t.operationData&&(t.labelData[t.operationData.labelIds[n]][e.code]=e.label)}))}))},t.handleLanguageChange=function(e){this.currentLanguage=e,this.createAnimation()},t.isIE=function(){var e=!!window.document.documentMode;return!e&&!!window.StyleMedia||e},e}(),z=function(){function e(){this.name="NavigationController",this.navigation=[],this.navLookup={},this.navVidIdLookup={},this.ctrlLookup={},this.activeNavigationPoint=null,this.labelControllers=[],this.eventhandlers=[],this.eventbus=null,this.container=null}var t=e.prototype;return t.init=function(e){this.container=e.selectedElement,this.navigation=this.buildNavigationData(e.json)},t.attach=function(e){this.container&&(this.eventbus=e,this.eventhandlers.push(e.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(e.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(e.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(e.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},t.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var e=this.getQueryVariable(0),t=0;e&&(t=this.navLookup[e].videoUrlIndex),this.highlightMenu(t)},t.getQueryVariable=function(e){var t=window.location.href,n=t.indexOf("#");if(n>-1){var i=t.substring(n+2);if(i)return i.split("/")[e]}return null},t.handleRequestCurrentNavigation=function(e){if(this.activeNavigationPoint){var t=this.ctrlLookup[this.activeNavigationPoint.labelId];e({navigationData:this.activeNavigationPoint,title:t.labelData[t.currentLanguage||""]})}else e(null)},t.detach=function(e){this.eventhandlers.forEach((function(e){e()})),this.labelControllers.forEach((function(t){t.detach(e)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},t.pushCurrentState=function(e){var t;if(void 0===e&&(e=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};e>-1&&(i.position=e),null==(t=this.eventbus)||t.broadcast("push-history-state",[i])}}},t.buildHtml=function(e,t){var n=u.default("<ul/>");t.forEach(this.addNavElement.bind(this,n)),e.append(n)},t.addNavElement=function(e,t){if(t.visible){var n=u.default("<li/>"),i=u.default("<a href='javascript:;' id='nav_"+t.videoUrlIndex+"'/>");if(n.append(i),this.addLabel(i,t.labelId),this.addClickHandler(i,t.videoUrlIndex),t.children){var r=u.default("<ul/>");t.children.forEach(this.addNavElement.bind(this,r)),n.append(r)}e.append(n)}},t.addClickHandler=function(e,t){e.mouseup(this.menuMouseupHandler.bind(this,t))},t.menuMouseupHandler=function(e){var t,n=this.navVidIdLookup[e];n&&(null==(t=this.eventbus)||t.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},t.handleNavigateVideoUrl=function(e,t){var n;void 0===t&&(t=0),this.highlightMenu(e),null==(n=this.eventbus)||n.broadcast("request-video-url",[e,t]),this.activeNavigationPoint=this.navVidIdLookup[e],this.pushCurrentState(t)},t.highlightMenu=function(e){var t=u.default("#nav_"+e);t.length&&(u.default(".current-menu-item").removeClass("current-menu-item"),t.addClass("current-menu-item"))},t.handleVideoComplete=function(e){var t,n,i=this.navVidIdLookup[e];i.autoNext?null==(t=this.eventbus)||t.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},t.addLabel=function(e,t){var n,i=this,r={selectedElement:e,labelId:t};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(e){e.init(r),e.attach(i.eventbus),i.labelControllers.push(e),i.ctrlLookup[t]=e}])},t.buildNavigationData=function(e){var t=this,n=[];return e.navigationData.forEach((function(n,i){t.navLookup[n.id]=n,t.navVidIdLookup[n.videoUrlIndex]=n,n.previous=e.navigationData[i-1]})),e.navigationData.forEach((function(n,i){n.nextId?(n.next=t.navLookup[n.nextId],delete n.nextId):n.next=e.navigationData[i+1]})),e.roots.forEach((function(e){var i=t.navLookup[e];i.children&&(i.children=i.children.map((function(e){return t.navLookup[e]}))),n.push(i)})),n},e}(),G=function(){function e(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[],this.duration=0}var t=e.prototype;return t.init=function(e){this.selectedElement=e.selectedElement,this.textElement=e.textElement},t.attach=function(e){var t,n=this;this.detachers.push(e.on(M.POSITION_UPDATE,this.positionUpdateHandler.bind(this))),e.broadcast(M.DURATION_REQUEST,[function(e){return n.duration=e}]);var i=this.clickHandler.bind(this,e);null==(t=this.selectedElement)||t.on("click",i),this.detachers.push((function(){var e;return null==(e=n.selectedElement)?void 0:e.off("click",i)}))},t.detach=function(e){this.detachers.forEach((function(e){e()}))},t.positionUpdateHandler=function(e){var t,n,i=100/e.duration*e.position;null==(t=this.selectedElement)||t.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},t.clickHandler=function(e,t){var n=t.target.getBoundingClientRect();e.broadcast(M.SEEK_REQUEST,[Math.floor(this.duration/100*(100/n.width*(t.clientX-n.left)))])},e}(),V=function(){function e(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var t=e.prototype;return t.init=function(e){this.navigation=this.buildNavigationData(e.json)},t.attach=function(e){this.eventhandlers.push(e.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(e.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=e,window.onpopstate=this.handlePopstate.bind(this);var t=this.getQueryVariable(0);if(t){var n=this.navLookup[t],i=+this.getQueryVariable(1);this.eventbus.broadcast("request-video-url",[n.videoUrlIndex,i,!0])}else window.history.pushState({navigationId:this.navigation[0].id},"","#/"+this.navigation[0].id)},t.handlePopstate=function(e){var t,n,i,r,o=null!=(t=null==(n=e.state)?void 0:n.position)?t:0,s=this.navLookup[e.state?e.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[s.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[s.videoUrlIndex,o,!0])},t.detach=function(e){this.eventhandlers&&this.eventhandlers.forEach((function(e){e()})),this.eventbus=null},t.handleBeforeRequestVideoUrl=function(e,t,n){var i,r=this;void 0===n&&(n=!1),(n=void 0!==n&&n)||null==(i=this.eventbus)||i.broadcast("request-current-navigation",[function(e){r.pushState(e)}])},t.getQueryVariable=function(e){var t=window.location.href,n=t.indexOf("#");if(n>-1){var i=t.substring(n+2);if(i)return i.split("/")[e]}return""},t.handlePushHistoryState=function(e){this.pushState(e)},t.pushState=function(e){if(e&&e.navigationData&&e.navigationData.visible){var t,n=void 0!==e.position?e.position:-1;n<0&&(null==(t=this.eventbus)||t.broadcast("request-current-video-position",[function(e){n=e>3?e-3:0}]));var i=window.history.state;i&&i.navigationId!==e.navigationData.id?window.history.pushState({navigationId:e.navigationData.id,position:n},e.title,"#/"+e.navigationData.id+"/"+n):i&&i.navigationId===e.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},e.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:e.navigationData.id,position:n},e.title,"#/"+e.navigationData.id+"/"+n),window.document.title=e.title}},t.buildNavigationData=function(e){var t=this,n=[];return e.navigationData.forEach((function(n,i){t.navLookup[n.id]=n,t.navVidIdLookup[n.videoUrlIndex]=n,n.previous=e.navigationData[i-1]})),e.navigationData.forEach((function(n,i){n.nextId?(n.next=t.navLookup[n.nextId],delete n.nextId):n.next=e.navigationData[i+1]})),e.roots.forEach((function(e){var i=t.navLookup[e];i.children&&(i.children=i.children.map((function(e){return t.navLookup[e]}))),n.push(i)})),n},e}(),B=function(){function e(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var t=e.prototype;return t.attach=function(e){var t=e.on(M.TIME,this.onTimeHandler.bind(this)),n=e.on(M.SEEKED,this.onSeekedHandler.bind(this)),i=e.on(M.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[t,i,n])},t.detach=function(e){this.internalDetach()},t.internalDetach=function(e){e&&e.forEach((function(e){e()}))},t.languageChangeHandler=function(e){this.currentLanguage=e,this.lastFunc&&this.lastFunc()},t.removeTitle=function(e){null==e||e.empty(),this.lastFunc=null},t.onTimeHandler=function(e){var t=this.actionLookup[e.position];t&&(t(),this.lastFunc=t)},t.onSeekedHandler=function(e){for(var t=e.position,n=this.actionLookup[t];!n&&--t>=0;)n=this.actionLookup[t];n?(n(),this.lastFunc=n):this.removeTitle()},t.setTitle=function(e,t){this.currentLanguage&&e.html(t[this.currentLanguage])},t.createActionLookup=function(e,t){for(var n=e.subtitleData,i=n[0].titles,r={},o=0,s=i.length;o<s;o++){for(var a={},u=0,l=n.length;u<l;u++){var c=n[u];a[c.lang]=c.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,t,a),r[i[o].duration.end]=this.removeTitle}return r},t.init=function(e){var t=e.selectedElement;this.removeTitle=this.removeTitle.bind(this,t),this.currentLanguage=e.language,this.actionLookup=this.createActionLookup(e,t)},e}(),K={__proto__:null,EventListenerController:Q,LabelController:H,LottieController:F,NavigationController:z,ProgressbarController:G,RoutingController:V,SubtitlesController:B},W=function(){function e(e,t,n,i){this.configuration=void 0,this.eventbus=void 0,this.timelineProviders=void 0,this.languageManager=void 0,this._timeLineActionsLookup={},this._eventbusRemovers=[],this._currentTimelineUri="",this._activeTimelineProvider=void 0,this._lastPosition=-1,this.configuration=e,this.eventbus=t,this.timelineProviders=n,this.languageManager=i}var t=e.prototype;return t.init=function(){var e;this._createLayoutTemplate(),this._addInitialisationListeners();var t=this.configuration.timelines;return this._currentTimelineUri=null!=(e=null==t?void 0:t[0].uri)?e:"",this._createTimelineLookup(),this._initializeTimelineProvider()},t._createLayoutTemplate=function(){var e=this.configuration.containerSelector,t=u.default(e);if(!t||!t.length)throw new Error("Container selector not found: "+e);var n=this.configuration.layoutTemplate;n&&n.length?t.html(n):console.warn("layoutTemplate is empty, unable to create layout")},t._initializeTimelineProvider=function(){var e,t,n=this;if(null==(e=this.configuration.timelines)||!e.length)throw new Error("No timelines present");var i=this.configuration.timelines[0],r=this.timelineProviders[i.type];if(!r)throw new Error("No timeline provider configured for type "+i.type);return null==(t=this._activeTimelineProvider)||t.destroy(),this._activeTimelineProvider=r.provider,new Promise(function(){var e=v(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n._activeTimelineProvider){e.next=8;break}return e.next=3,n._activeTimelineProvider.init();case 3:return e.next=5,n._executeActions(n.configuration.initActions,"start");case 5:t(n._activeTimelineProvider),e.next=9;break;case 8:throw new Error("NO ACTIVE TIMELINE PROVIDER");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},t._cleanUp=function(){var e=v(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._cleanUpTimeline();case 2:return e.next=4,this._executeActions(this.configuration.initActions,"end");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.destroy=function(){var e=v(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._cleanUp();case 2:this.languageManager.destroy(),this._activeTimelineProvider=void 0,this._eventbusRemovers.forEach((function(e){return e()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(e){return e.provider.destroy()})),u.default(this.configuration.containerSelector).empty();case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t._addEventListener=function(e,t,n){this._eventbusRemovers.push(this.eventbus.on(e,t,n))},t._addInitialisationListeners=function(){this._addEventListener(M.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector)),this._addEventListener(M.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this)),this._addEventListener(M.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor)),this._addEventListener(M.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this)),this._addEventListener(M.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this)),this._addEventListener(M.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this)),this._addEventListener(M.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)),this._addEventListener(M.TIME,this._onTimeHandler.bind(this,Math.floor)),this._addEventListener(M.SEEK,this._onSeekHandler.bind(this,Math.floor))},t._createTimelineLookup=function(){var e=this;this.configuration.timelines&&this.configuration.timelines.forEach((function(t){t.timelineActions.forEach(e._addTimelineAction.bind(e,t.uri))}))},t._addTimelineAction=function(e,t){var n,i=t.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,e),i),o=t.start.bind(t);null!=(n=t.id)&&n.length&&(o.id=t.id,o.isStart=!0),r.push(o);var s=t.duration.end;if(s<0&&(s=t.duration.end=Infinity),isFinite(s)){var a=this._initializeTimelinePosition(this._timeLineActionsLookup[e],s),u=t.end.bind(t);t.id||(u.id=t.id),a.push(u)}},t._initializeUriLookup=function(e,t){return e[t]||(e[t]={}),e[t]},t._initializeTimelinePosition=function(e,t){return e[t]||(e[t]=[]),e[t]},t._executeActions=function(){var e=v(p().mark((function e(t,n,i){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===i&&(i=0),!(t&&i<t.length)){e.next=6;break}return r=t[i],e.next=5,r[n]();case 5:return e.abrupt("return",this._executeActions(t,n,++i));case 6:return e.abrupt("return",new Promise((function(e){e()})));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t._handleRequestEngineRoot=function(e,t){t(u.default(e))},t._handleRequestTimelineUri=function(){var e=v(p().mark((function e(t,n,i){var r,o,s,a=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._activeTimelineProvider){e.next=2;break}return e.abrupt("return");case 2:return this._activeTimelineProvider.stop(),e.next=6,this._cleanUpTimeline();case 6:if((o=this.configuration.timelines.find((function(e){return e.uri===t})))&&this._activeTimelineProvider&&this._currentTimelineUri!==o.uri){e.next=9;break}return e.abrupt("return");case 9:this._currentTimelineUri=o.uri,this.eventbus.broadcast(M.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(s=this.timelineProviders[o.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=s.provider),this._activeTimelineProvider.loop=o.loop,n=null!=(r=n)?r:0,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(M.FIRST_FRAME,(function(){a._activeTimelineProvider&&(a._activeTimelineProvider.pause(),a.eventbus.broadcast(M.DURATION,[a._activeTimelineProvider.getDuration()]),a._executeStartActions().then((function(){var e,t;n=null!=(e=n)?e:0,null==(t=a._activeTimelineProvider)||t.seek(n),a._onSeekHandler(Math.floor,{offset:n})})))})),this._activeTimelineProvider.playlistItem(t);case 17:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),t._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},t._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},t._getActionsForPosition=function(e,t){return t.filter((function(t){return!t.active&&t.duration.start<=e&&t.duration.end>=e}))},t._getActiveActions=function(e){return e.filter((function(e){return e.active})).sort((function(e,t){return t.duration.start<e.duration.start?-1:t.duration.start>e.duration.start?1:0}))},t._executeRelevantActions=function(e,t){var n=this._getRelevantTimelineActions(),i=e.apply(this,[n]);return this._executeActions(i,t,0)},t._handleRequestTimelinePosition=function(e,t){var n;t(e((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},t._handleTimelineComplete=function(){this._cleanUpTimeline()},t._handleExecuteTimelineAction=function(e,t,n){var i=this._getTimelineActionsForUri(e),r=null==i?void 0:i[t];r&&(n?r.start():r.end())},t._resizeTimelineAction=function(){console.error("no resizing implemented")},t._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},t._requestCurrentTimeline=function(e){e(this._currentTimelineUri)},t._getTimelineActionsForUri=function(e){var t,n=this.configuration.timelines.find((function(t){return t.uri===e}));return null!=(t=null==n?void 0:n.timelineActions)?t:[]},t._onTimeHandler=function(e,t){if(!isNaN(t.position)){var n,i,r=e(t.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(M.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(M.TIME_UPDATE,[t.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},t._onSeekHandler=function(e,t){var n=this;if(!isNaN(t.offset)){var i=e(t.offset);this._executeSeekActions(i).then((function(){var e;null==(e=n._activeTimelineProvider)||e.start()}))}},t._executeActionsForPosition=function(e){this._lastPosition=e;var t=this._timeLineActionsLookup[this._currentTimelineUri];if(t){var n=t[e];null==n||n.forEach((function(e){e()}))}},t._executeSeekActions=function(e){var t=this,n=this._getRelevantTimelineActions();if(!n)return Promise.resolve();var i=this._getActiveActions(n),r=this._getActionsForPosition(e,n),o=this._executeActions(i,"end",0);return new Promise((function(e){o.then((function(){t._executeActions(r,"start",0).then((function(){e()}))}))}))},e}(),Y=function(){function e(){this._actionRegistry=new Map}var t=e.prototype;return t.registerAction=function(e,t,n){var i;n&&n.length&&(t=t+":"+n),this._actionRegistry.has(t)||this._actionRegistry.set(t,[]),null==(i=this._actionRegistry.get(t))||i.push(e)},t.handleEvent=function(e,t,n){t&&(e=e+":"+t);var i=this._actionRegistry.get(e);if(i){var r={eventArgs:n};i.forEach((function(e){e.start(r)}))}},e}(),J=function(){function e(){this.eventHandlers=new Map,this.eventInterceptors=new Map,this.eventListeners=[],this.clear()}var t=e.prototype;return t.clear=function(){this.eventHandlers=new Map,this.eventListeners=[],this.eventInterceptors=new Map},t._getEventInterceptors=function(e,t){return t&&(e=e+":"+t),this.eventInterceptors.has(e)||this.eventInterceptors.set(e,[]),this.eventInterceptors.get(e)},t._getEventHandlers=function(e,t){return t&&(e=e+":"+t),this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e)},t.on=function(e,t,n){var i=this;return this._getEventHandlers(e,n).push(t),function(){i.off(e,t,n)}},t.once=function(e,t,n){var i=this,r=function r(){t.apply(void 0,arguments),i.off(e,r,n)};return this.on(e,r,n),function(){i.off(e,r,n)}},t.off=function(e,t,n){var i=this._getEventHandlers(e,n);if(i){var r=i.indexOf(t);r>-1&&i.splice(r,1)}},t.broadcast=function(e,t){this._callHandlers(e,void 0,t)},t.broadcastForTopic=function(e,t,n){this._callHandlers(e,t,n)},t.registerEventlistener=function(e){var t=this;return this.eventListeners.push(e),function(){var n=t.eventListeners.indexOf(e);n>-1&&t.eventListeners.splice(n,1)}},t.registerInterceptor=function(e,t,n){var i=this._getEventInterceptors(e,n);return i.push(t),function(){var e=i.indexOf(t);e>-1&&i.splice(e,1)}},t._callHandlers=function(e,t,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(e,t);r&&(this._getEventInterceptors(e,t).forEach((function(e){n=e.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(e,t,n)})),null!=(i=n)&&i.length?r.forEach((function(e){return e.apply(void 0,n)})):r.forEach((function(e){return e()})))},e}(),Z=function(){function e(e){this.eventbus=void 0,this.eventbus=e}return e.prototype.intercept=function(e){return this.eventbus.broadcast(M.BEFORE_REQUEST_TIMELINE_URI,e.slice()),e},e}(),X={__proto__:null,ActionRegistryEventbusListener:Y,Eventbus:J,RequestVideoUriInterceptor:Z},$=function(){function e(e,t,n){if(this._currentLanguage=void 0,this._eventbus=void 0,this._labelLookup=void 0,this._eventbusRemovers=[],this._currentLanguage=e,this._eventbus=n,!e)throw new Error("language ctor arg cannot have zero length");this._setRootElementLang(e),this._labelLookup=this._createLabelLookup(t),this._addEventbusListeners(n)}var t=e.prototype;return t.destroy=function(){this._eventbusRemovers.forEach((function(e){return e()}))},t._addEventbusListeners=function(e){this._eventbusRemovers.push(e.on(M.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusRemovers.push(e.on(M.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusRemovers.push(e.on(M.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusRemovers.push(e.on(M.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},t._handleRequestCurrentLanguage=function(e){e(this._currentLanguage)},t._handleRequestLabelCollection=function(e,t){t(this._labelLookup[e])},t._handleRequestLabelCollections=function(e,t){var n=this;t(e.map((function(e){return n._labelLookup[e]})))},t._handleLanguageChange=function(e){e&&e.length?(this._currentLanguage=e,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},t._setRootElementLang=function(e){var t=this;this._eventbus.broadcast(M.REQUEST_ENGINE_ROOT,[function(n){var i=t._extractLanguageFromCulture(e);u.default(n).attr("lang",i)}])},t._extractLanguageFromCulture=function(e){return e.indexOf("-")>-1?e.split("-").shift():e},t._createLabelLookup=function(e){return e.reduce((function(e,t){return e[t.id]=t.labels,e}),{})},e}(),ee=function(){function e(e,t,n){var i,r;this._actionsLookup={},this._eventbus=void 0,this._eventRemovers=[],this._importer=void 0,this._resizeTimeout=-1,this._importer=e,this._eventbus=null!=(i=null==n?void 0:n.eventbus)?i:new J,y.active=null!=(r=null==n?void 0:n.devtools)&&r,y.active&&this._initializeDevtools(this._eventbus),this._eventRemovers.push(this._eventbus.on(M.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(M.REQUEST_ACTION,this._requestActionHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(M.REQUEST_FUNCTION,this._requestFunctionHandler.bind(this)));var o=this._handleSpacePress.bind(this);d.default("space",o),this._eventRemovers.push((function(){return d.default.unbind("space",o)}));var s=this._resizeHandler.bind(this),a=u.default(t);a.on("resize",s),this._eventRemovers.push((function(){return a.off("resize",s)}))}var t=e.prototype;return t._handleSpacePress=function(e,t){return e.preventDefault(),this._eventbus.broadcast(M.PLAY_TOGGLE_REQUEST),!1},t._initializeDevtools=function(e){var t=this,n=window.__ELIGIUS_DEV_TOOLS__;if(n){var i=n.agent;this._eventRemovers.push(e.registerEventlistener(new _(i))),this._eventRemovers.push(i.subscribe((function(e){if("playcontrol"===e.type)switch(e.data.kind){case"play":t._eventbus.broadcast(M.PLAY_REQUEST);break;case"stop":t._eventbus.broadcast(M.STOP_REQUEST);break;case"pause":t._eventbus.broadcast(M.PAUSE_REQUEST);break;case"seek":t._eventbus.broadcast(M.SEEK_REQUEST,[e.data.args])}}))),y.send=function(e,t){var n=b(t);try{i.postMessage(e,n)}catch(e){console.error("postmessage failed"),console.error(e),console.log("message",n)}},y.send("eligius-diagnostics-factory","Diagnostics initialized")}else console.warn("__ELIGIUS_DEV_TOOLS__ property not found on window, please install the Eligius Devtools extension.")},t.destroy=function(){this._eventRemovers.forEach((function(e){return e()}))},t._resizeHandler=function(){var e=this;this._resizeTimeout&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=-1),this._resizeTimeout=setTimeout((function(){e._eventbus.broadcast(M.RESIZE)}),200)},t._importSystemEntryWithEventbusDependency=function(e){return new(this._importSystemEntry(e))(this._eventbus)},t._importSystemEntry=function(e){return this._importer.import(e)[e]},t._requestInstanceHandler=function(e,t){t(this._importSystemEntryWithEventbusDependency(e))},t._requestFunctionHandler=function(e,t){t(this._importSystemEntry(e))},t._requestActionHandler=function(e,t){var n=this._actionsLookup[e];n?t(n):(console.error("Unknown action: "+e),t(null))},t.createEngine=function(e,t){var n,i=this._importSystemEntry(e.engine.systemName),r=void 0;null!=(n=e.eventActions)&&n.length&&(r=new Y,this._eventRemovers.push(this._eventbus.registerEventlistener(r))),this._eventRemovers.push(this._eventbus.registerInterceptor(M.REQUEST_TIMELINE_URI,new Z(this._eventbus)));var o=(t=t||new R(this._importer,this._eventbus)).process(e,r),s=o[1];this._actionsLookup=o[0];var a=this._createTimelineProviders(s,this._eventbus),u=new $(e.language,e.labels,this._eventbus);return new i(s,this._eventbus,a,u)},t._createTimelineProviders=function(e,t){var n=this;return Object.entries(e.timelineProviderSettings).reduce((function(i,r){var o=r[0],s=r[1];if(!s)return i;var a=n._importSystemEntry(s.systemName);return i[o]={id:s.id,vendor:s.vendor,provider:new a(t,e)},i}),{})},e}(),te=function(e){return e.selectedElement.addClass(e.className),e},ne=function(e,t){return t.data(e)}.bind(null,"eligiusEngineControllers");function ie(e,t){return m({},e,t)}function re(e,t,n){e(n?ie(t,n):t)}var oe=function(e){var t=e.controllerInstance;!function(e,t){e.data("eligiusEngineControllers")||e.data("eligiusEngineControllers",[]);var n=ne(e);n&&n.push(t)}(e.selectedElement,t),t.init(e);var n=t.attach(this.eventbus);return n?new Promise((function(t,i){n.then((function(n){re(t,e,n)}),i)})):e},se=function(e){var t=e.animationEasing,n=e.selectedElement,i=e.animationProperties,r=e.animationDuration;return new Promise((function(o,s){try{t?n.animate(i,r,t,(function(){re(o,{},e)})):n.animate(i,r,(function(){re(o,{},e)}))}catch(e){s(e)}}))},ae=function(e){var t=e.selectedElement,n=e.className,i=e.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{t.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&t.removeClass(n),re(r,{},e)}))}catch(e){o(e)}}));return t.addClass(n),r},ue={},le=function(e,t){var n=t?e[t]:e;return n&&n!==e?P(n):n}.bind(null,ue),ce=function(e,t){Object.entries(t).forEach((function(t){return e[t[0]]=t[1]}))}.bind(null,ue);function he(e,t){if("string"==typeof t&&t.toLowerCase().startsWith("operationdata.")){var n=t.split(".");return n.shift(),O(n,e)}if("string"==typeof t&&t.toLowerCase().startsWith("globaldata.")){var i=t.split(".");return i.shift(),O(i,le())}return t}var de=function(e){var t=e.eventTopic,n=e.eventName,i=function(e,t){if(t){var n=he.bind(null,e);return t.map(n)}}(e,e.eventArgs);return t?this.eventbus.broadcastForTopic(n,t,i):this.eventbus.broadcast(n,i),function(e){delete e.eventName,delete e.eventTopic,delete e.eventArgs}(e),e},pe=[];function fe(e,t){var n=t!==e?P(t):t;return ve(t,n,he.bind(null,e)),n}function ve(e,t,n){if(!(pe.indexOf(e)>-1)){pe.push(e);try{Object.entries(e).forEach((function(e){var i=e[1];i instanceof u.default||("string"==typeof i?t[e[0]]=n(i):Array.isArray(i)?i.forEach((function(e,t,i){"string"==typeof e?i[t]=n(e):ve(e,e,n)})):"object"==typeof i&&ve(i,i,n))}))}finally{var i=pe.indexOf(e);pe.splice(i,1)}}}var me={"+":function(e,t){return e+t},"-":function(e,t){return e-t},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"**":function(e,t){return Math.pow(e,t)}},ge=function(e){return(e=fe(e,e)).calculationResult=me[e.operator](+e.left,+e.right),e},Ee=function(e){return e.selectedElement.empty(),e},be=function(e){var t=e.properties;return t?(t.forEach((function(t){delete e[t]})),delete e.properties,e):{}},_e=function(e){var t=(e=fe(e,e)).elementName,n=e.attributes,i=e.text,r=n?" "+Object.entries(n).map((function(e){return e[0]+'="'+e[1]+'"'})).join(" "):"",o=u.default(i?"<"+t+r+">"+i+"</"+t+">":"<"+t+r+"/>");return e.template=o,e},ye=function(e){var t=this,n=e.systemName;return new Promise((function(i,r){t.eventbus.broadcast(M.REQUEST_FUNCTION,[n,function(n){var o=n(e,t.eventbus);o?o.then((function(){re(i,{},e)}),r):re(i,{},e)}])}))},Te=function(e){var t=e.actionInstance,n=e.actionOperationData;return delete e.actionOperationData,new Promise((function(i,r){e=ie(e,n),t.end(e).then((function(){Object.keys(n).forEach((function(t){delete e[t]})),re(i,e)}),r)}))},Pe=function(e){var t=this;return t.skipNextOperation?delete t.skipNextOperation:void 0!==t.loopIndex&&void 0!==t.loopLength&&t.loopIndex<t.loopLength?(t.loopIndex=t.loopIndex+1,t.newIndex=t.startIndex):(delete t.loopIndex,delete t.loopLength,delete t.startIndex,delete t.newIndex),e},Ie=function(e){return e.controllerInstance=Object.assign(e.controllerInstance,e.controllerExtension),e},Le=function(e){var t=e.controllerName,n=ne(e.selectedElement).find((function(e){return e.name===t}));return n||console.warn("controller for name '"+t+"' was not found on the given element"),e.controllerInstance=n,e},xe=function(e){var t=e.systemName;return e.controllerInstance=void 0,this.eventbus.broadcast(M.REQUEST_INSTANCE,[t,function(t){e.controllerInstance=t}]),e},we=function(e){var t,n,i=e.selectedElement,r=e.modifier,o={width:null!=(t=i.innerWidth())?t:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&(o=function(e,t){var n=m({},e),i=null;if(t.indexOf("|")>-1){var r=t.split("|");t=r[0],i=r[1]}var o=t.substring(0,1),s=function(e){var t=e.substring(e.length-1,e.length);"h"!==t&&"w"!==t&&"%"!==t&&(t=null);var n="%"===t;return n&&"h"!==(t=e.substring(e.length-1,e.length-2))&&"w"!==t&&(t=null),[t,1,n]}(t),a=s[0],u=s[2],l=parseInt(null!==a?t.substring(1,t.length-(s[1]-1)):t.substring(1),10),c=l,h=l;u&&(c=n.width/100*l,h=n.height/100*l);var d=function(e,t,n,i,r){var o=m({},e);switch(t){case"+":switch(n){case"h":o.height+=r;break;case"w":o.width+=i;break;default:o.height+=r,o.width+=i}break;case"-":switch(n){case"h":o.height-=r;break;case"w":o.width-=i;break;default:o.height-=r,o.width-=i}break;case"/":switch(n){case"h":o.height/=r;break;case"w":o.width/=i;break;default:o.height/=r,o.width/=i}break;case"*":switch(n){case"h":o.height*=r;break;case"w":o.width*=i;break;default:o.height*=r,o.width*=i}break;default:console.error("Unknown operator found: "+t)}return o}(n,o,a,c,h);return i?function(e,t){var n=m({},t),i=e.substring(0,1),r=e.substring(e.indexOf("[")+1,e.indexOf("]")-(e.indexOf("[")-1)),o=r.split("=")[1].split("-");if(2!==o.filter(Boolean).length)throw new Error("Badly formatted modifier, expect two ratios: "+r);return"h"===i?n.height=n.width/+o[0]*+o[1]:"w"===i&&(n.width=n.height/+o[1]*+o[0]),n}(i,d):d}(o,r)),e.dimensions=o,e},Ne=function(e){return this.eventbus.broadcast(M.REQUEST_FUNCTION,[e.systemName,function(t){e.importedInstance=t}]),delete e.systemName,e},Se=function(e){var t=new URLSearchParams(window.location.search),n=Object.fromEntries(t.entries()),i=e.defaultValues,r=void 0===i?{}:i;return delete e.defaultValues,e.queryParams=m({},r,n),e},Oe=function(e){var t=e.methodName,n=e.methodArguments;return delete e.methodName,delete e.methodArguments,e.methodResult=e.instance[t].apply(e.instance,null!=n?n:[]),e},Re={},Ae=function(e){var t=e.url;return e.cache&&Re[t]?(e.json=Re[t],e):fetch(t).then(function(){var n=v(p().mark((function n(i){var r;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.json();case 2:return r=e.json=n.sent,Re[t]=r,n.abrupt("return",e);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},De=function(e){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:e}),console.groupEnd(),e},Ce=function(e){return(e=fe(e,e)).args=e.args.map((function(e){return"string"==typeof(t=e)&&t in Math&&"function"!=typeof Math[t]?Math[e]:e;var t})),e.mathResult=Math[e.functionName].apply(null,e.args),e},Ue=function(e){return e.selectedElement.removeClass(e.className),e},ke=function(e){var t=e.controllerName,n=ne(e.selectedElement),i=null==n?void 0:n.find((function(e){return e.name===t}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return e},qe=function(e){return e.selectedElement.remove(),e},je=function(e){var t=e.propertyNames;return t.indexOf("propertyNames")<0&&t.push("propertyNames"),Object.fromEntries(Object.entries(e).filter((function(e){return!t.includes(e[0])})))},Me=function(e){var t=e.newParentSelector;return e.selectedElement.remove().appendTo(t),e},Qe=function(e){return this.eventbus.broadcast(M.REQUEST_ACTION,[e.systemName,function(t){e.actionInstance=t}]),e},He=function(e){var t=e.actionInstance;return e=ie(e,e.actionOperationData),t.resize?t.resize(e):e};function Fe(e,t){var n=e.find(t);return n.length||console.warn("selector '"+t+"' wasn't found!"),n}var ze=function(e){var t=e.selector,n=e.useSelectedElementAsRoot,i=void 0!==n&&n;if(!t)throw new Error("selectElement: selector is either empty or not defined.");return i&&e.selectedElement?(e.selectedElement=Fe(e.selectedElement,t),e):(this.eventbus.broadcast(M.REQUEST_ENGINE_ROOT,[function(n){e.selectedElement=Fe(n,t)}]),e)},Ge=function(e){var t=e.selectedElement;return Object.entries(e.attributes).forEach((function(e){t.attr(e[0],e[1])})),e},Ve=function(e){var t=e.insertionType,n=void 0===t?"overwrite":t,i=e.selectedElement,r=e.template;switch(!0){case"overwrite"===n:i.html(r);break;case"append"===n:i.append(r);break;case"prepend"===n:i.prepend(r)}return delete e.insertionType,e},Be=function(e){var t=e.properties,n=Object.fromEntries(Object.entries(e).filter((function(e){return t.includes(e[0])})));return ce(n),delete e.properties,e},Ke=function(e){var t=e.override,n=void 0!==t&&t,i=e.properties;delete e.properties,delete e.override;var r=fe(e,i);return n?r:Object.assign(e,r)},We=function(e){var t=fe(e,e.properties);return e.selectedElement.css(t),e},Ye=function(e){var t=e.actionInstance,n=e.actionOperationData;return delete e.actionOperationData,new Promise((function(i,r){e=ie(e,n),t.start(e).then((function(){Object.keys(n).forEach((function(t){delete e[t]})),re(i,e)}),r)}))},Je=function(e){var t=this,n=e.collection;if(null!==n&&!Array.isArray(n))throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===t.loopIndex&&(null!=n&&n.length?(t.loopIndex=0,t.loopLength=n.length-1,t.startIndex=t.currentIndex):t.skipNextOperation=!0),null!=n&&n.length&&void 0!==t.loopIndex&&(e.currentItem=n[t.loopIndex]),e},Ze=function(e){return e.selectedElement.toggleClass(e.className),e},Xe=function(e){return e.selectedElement.toggle(),e},$e=function(e){var t=e.milliseconds;return new Promise((function(n){setTimeout((function(){re(n,e)}),t)}))},et={__proto__:null,addClass:te,addControllerToElement:oe,animate:se,animateWithClass:ae,broadcastEvent:de,calc:ge,clearElement:Ee,clearOperationData:be,createElement:_e,customFunction:ye,endAction:Te,endLoop:Pe,extendController:Ie,getControllerFromElement:Le,getControllerInstance:xe,getElementDimensions:we,getImport:Ne,getQueryParams:Se,invokeObjectMethod:Oe,loadJSON:Ae,log:De,math:Ce,removeClass:Ue,removeControllerFromElement:ke,removeElement:qe,removePropertiesFromOperationData:je,reparentElement:Me,requestAction:Qe,resizeAction:He,selectElement:ze,setElementAttributes:Ge,setElementContent:Ve,setGlobalData:Be,setOperationData:Ke,setStyle:We,startAction:Ye,startLoop:Je,toggleClass:Ze,toggleElement:Xe,wait:$e},tt=function(){function e(e,t){this.eventbus=void 0,this.config=void 0,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=s.v4(),this.loop=!1,this.eventbus=e,this.config=t,this._addEventListeners()}var t=e.prototype;return t._extractUrls=function(e){return e.timelines.filter((function(e){return"mediaplayer"===e.type})).map((function(e){return e.uri}))},t.init=function(){var e=this,t=this.config.timelineProviderSettings.mediaplayer;if(!t)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=t.selector,i=this._extractUrls(this.config),r=window.jwplayer,o=u.default("#"+n);if(!o.length)throw new Error("videoplayer selector '"+n+"' not found");var s=o.innerWidth(),a=o.innerHeight();return 0===s&&(s=100),0===a&&(a=300),this._player=r(n),this._player.setup({file:i[0],image:t.poster,height:a,width:s,controls:!0,autostart:!1,displaytitle:!1,displaydescription:!1,nextUpDisplay:!1,abouttext:"Eligius",aboutlink:"http://www.google.com",stretching:"fill",repeat:!1}),this._playlist.length=0,i.forEach((function(n){e._playlist.push({file:n,title:n,image:t.poster})})),new Promise((function(t){e._player.once("ready",(function(){e._handlePlayerReady(t)})),e._player.load(e._playlist)}))},t._handlePlayerReady=function(e){var t=this;this._player.once("firstFrame",(function(){t._player.pause(),t.eventbus.broadcast(M.DURATION,[t.getDuration()]),e(t)})),this._player.on(M.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(M.SEEKED,this._seekedHandler.bind(this)),this._player.on(M.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){t._player.play()}),10)},t._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(M.COMPLETE,[this._player.getPlaylistIndex()]))},t._seekedHandler=function(){this.eventbus.broadcast(M.SEEKED,[this.getPosition(),this.getDuration()])},t.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(e){return e()}))},t._loopHandler=function(e,t){var n=e(t.position);this.loop&&n===e(this._player.getDuration()-1)&&this.seek(0)},t._timeResetLoopHandler=function(){this.loop&&this.seek(0)},t._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(M.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.DURATION_REQUEST,this.duration.bind(this)))},t._container=function(e){var t="";"html5"!==this._player.getProvider().name&&(t="_wrapper"),e(u.default("#"+this._videoElementId+t))},t.toggleplay=function(){this._paused?this.start():this.pause()},t.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(M.PLAY)},t.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(M.STOP)},t.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(M.PAUSE)},t.seek=function(e){var t=this._player.getPosition();this._player.seek(e),this.eventbus.broadcast(M.SEEK,[e,t,this._player.getDuration()])},t.resize=function(e,t){this._player.resize(e,t),this.eventbus.broadcast(M.RESIZE,[e,t])},t.duration=function(e){e(Math.floor(this.getDuration()))},t.playlistItem=function(e){var t=this._playlist.findIndex((function(t){return t.file===e}));t>-1&&this._player.playlistItem(t)},t.getPosition=function(){return this._player.getPosition()},t.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},t.getState=function(){return this._player.getState()},t.getDuration=function(){return this._player.getDuration()},t.getMute=function(){return this._player.getMute()},t.getVolume=function(){return this._player.getVolume()},t.setMute=function(e){this._player.setMute(e)},t.setVolume=function(e){this._player.setVolume(e)},e}(),nt=function(){function e(e,t){this.eventbus=void 0,this.config=void 0,this._currentPosition=0,this._updateBound=this._update.bind(this),this._eventbusListeners=[],this._firstFrame=!0,this._currentPlaylistItem=void 0,this._tickInterval=1e3,this._playlist=void 0,this._containerElement=void 0,this._abortController=void 0,this.playState="stopped",this.loop=!1,this.eventbus=e,this.config=t,this.eventbus=e,this.config=t,this._playlist=this._extractPlaylist(t),this._currentPlaylistItem=this._playlist[0]}var t=e.prototype;return t._extractPlaylist=function(e){return e.timelines.filter((function(e){return"animation"===e.type}))},t.playlistItem=function(e){if(null!==e&&e.length&&0!==this._playlist.length){var t=this._playlist.find((function(t){return t.uri===e}));if(!t)throw new Error("Unknown playlist uri: "+e);this._currentPlaylistItem=t,this._firstFrame=!0}},t._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(M.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(M.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},t._update=function(e){if("running"===this.playState){if(this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(M.FIRST_FRAME)),this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(M.COMPLETE);this._resetToStartPosition(),this.eventbus.broadcast(M.RESTART),this._broadCastPosition()}this._broadCastPosition()}},t._broadCastPosition=function(){this.eventbus.broadcast(M.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(M.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])},t._start=function(){var e;"running"!==this.playState&&(this.playState="running",null==(e=this._abortController)||e.abort(),this._abortController=new AbortController,0==this._currentPosition&&this._broadCastPosition(),function(e,t,n){var i,r,o,s=null!=(i=null==(r=document)||null==(o=r.timeline)?void 0:o.currentTime)?i:performance.now();function a(e){t.aborted||(n(e),u(e))}function u(t){var n=Math.round((t-s)/e)*e,i=s+n+e-performance.now();setTimeout((function(){return requestAnimationFrame(a)}),i)}u(s)}(this._tickInterval,this._abortController.signal,this._updateBound))},t._resetToStartPosition=function(){this._currentPosition=0},t._resize=function(){console.error("Not implemented yet")},t._container=function(e){e(this._containerElement)},t._stopAnimationInterval=function(e){var t;void 0===e&&(e=!0),null==(t=this._abortController)||t.abort(),this._abortController=void 0,e&&this._resetToStartPosition()},t.init=function(){if(this._addEventListeners(),this._currentPlaylistItem=this._playlist[0],this._containerElement=u.default(this._currentPlaylistItem.selector),!this._containerElement.length)throw new Error("timeline selector '"+this._currentPlaylistItem.selector+"' not found");return new Promise((function(e){e()}))},t.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(e){return e()})),this._containerElement=void 0},t.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},t.start=function(){this._start(),this.eventbus.broadcast(M.PLAY)},t.stop=function(){this._stopAnimationInterval(),this.playState="stopped",this.eventbus.broadcast(M.STOP)},t.pause=function(){this._stopAnimationInterval(!1),this.playState="paused",this.eventbus.broadcast(M.PAUSE)},t.seek=function(e){e<0||e>this._currentPlaylistItem.duration||(this.eventbus.broadcast(M.SEEK,[e,this._currentPosition,this.getDuration()]),this._currentPosition=e,this.eventbus.broadcast(M.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(M.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(M.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},t.getPosition=function(){return this._currentPosition},t.getDuration=function(){return this._currentPlaylistItem.duration},t.requestDurationHandler=function(e){e(this._currentPlaylistItem.duration)},e}(),it=et,rt=K,ot={__proto__:null,JwPlayerTimelineProvider:tt,RequestAnimationFrameTimelineProvider:nt},st=X,at=function(){function e(){this.engines=new Map,this.engines.set("EligiusEngine",W)}var t=e.prototype;return t.getOperationNames=function(){return Object.keys(it)},t.getControllerNames=function(){return Object.keys(rt)},t.getProviderNames=function(){return Object.keys(ot)},t.import=function(e){var t,n,i,r,o,s=null!=(t=null!=(n=null!=(i=null!=(r=it[e])?r:rt[e])?i:ot[e])?n:st[e])?t:this.engines.get(e);return(o={})[e]=s,o},e}(),ut={__proto__:null,addClass:function(){return{description:"Add a class to the selected element.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},addControllerToElement:function(){return{description:"Adds the current controller to the selected element(s)",dependentProperties:["selectedElement","controllerInstance"]}},animate:function(){return{description:"Animates the selected element with the given animation settings.",dependentProperties:["selectedElement"],properties:{animationEasing:"ParameterType:boolean",animationProperties:{type:"ParameterType:object",required:!0},animationDuration:{type:"ParameterType:number",required:!0}}}},animateWithClass:function(){return{description:"Animates the selected element by adding the given animation class.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0},removeClass:"ParameterType:boolean"}}},broadcastEvent:function(){return{description:"Broadcasts an eventbus event with the given type, topic and optional arguments",properties:{eventArgs:"ParameterType:array",eventTopic:"ParameterType:eventTopic",eventName:{type:"ParameterType:eventName",required:!0}}}},calc:function(){return{description:"Calculates the given left and right hand sides using the specified operator",properties:{left:{type:"ParameterType:number",description:"The left operand",required:!0},right:{type:"ParameterType:number",description:"The right operand",required:!0},operator:[{value:"+",description:"Adds the left and right operands"},{value:"-",description:"Subtracts the left and right operands"},{value:"*",description:"Multiplies the left and right operands"},{value:"/",description:"Divides the left and right operands"},{value:"%",description:"Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number"},{value:"**",description:"Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times."}]},outputProperties:{calculationResult:"ParameterType:number"}}},clearElement:function(){return{description:"clears the given element",dependentProperties:["selectedElement"]}},clearOperationData:function(){return{description:"clears the current operation data",properties:{properties:"ParameterType:array"}}},createElement:function(){return{description:"Creates an HTML element with the given name and optionally adds the given attributes",properties:{elementName:{type:"ParameterType:htmlElementName",required:!0},attributes:"ParameterType:object",text:"ParameterType:string"},outputProperties:{template:"ParameterType:object"}}},customFunction:function(){return{description:"Executes the specified custom function",properties:{systemName:{type:"ParameterType:systemName",required:!0}}}},endAction:function(){return{description:"Ends the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},endLoop:function(){return{description:"Ends the current loop"}},extendController:function(){return{description:"Extends the current controller",dependentProperties:["controllerInstance"],properties:{controllerExtension:"ParameterType:object"}}},getControllerFromElement:function(){return{description:"Retrieves the specified controller from the current element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}},getControllerInstance:function(){return{description:"Retrieves an instance of the specified controller",properties:{systemName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}},getElementDimensions:function(){return{description:"Calculates the dimensions for the current element",dependentProperties:["selectedElement"],properties:{modifier:"ParameterType:dimensionsModifier"},outputProperties:{dimensions:"ParameterType:dimensions"}}},getImport:function(){return{description:"Retrieves a javascript import specified by the given system name",properties:{systemName:{type:"ParameterType:systemName",required:!0}},outputProperties:{importedInstance:"ParameterType:object"}}},getQueryParams:function(){return{description:"Retrieves the current query parameters from the browser's address bar",outputProperties:{queryParams:"ParameterType:object"}}},invokeObjectMethod:function(){return{description:"Invokes the specified method on the given object with the optional specified arguments",properties:{instance:{type:"ParameterType:object",required:!0},methodName:{type:"ParameterType:string",required:!0},methodArguments:"ParameterType:array"},outputProperties:{methodResult:"ParameterType:object"}}},loadJSON:function(){return{description:"Load JSON from the given url",properties:{url:{type:"ParameterType:url",required:!0},cache:"ParameterType:boolean"},outputProperties:{json:"ParameterType:object"}}},log:function(){return{description:"Logs the current context and operation data to the console"}},math:function(){return{description:"This operation performs the given math function of the specified arguments.",properties:{args:{type:"ParameterType:array",required:!0},functionName:Object.getOwnPropertyNames(Math).filter((function(e){return"function"==typeof Math[e]})).map((function(e){return{value:e}})),mathResult:"ParameterType:number"}}},removeClass:function(){return{description:"Removes the specified class from the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},removeControllerFromElement:function(){return{description:"Removes the specified controller from the selected element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}}}},removeElement:function(){return{description:"Removes the selected element from the DOM",dependentProperties:["selectedElement"]}},removePropertiesFromOperationData:function(){return{description:"Removes the specified properties from the current operation data",properties:{propertyNames:"ParameterType:array"}}},reparentElement:function(){return{description:"Moves the selected element to the new location described by the given selector",dependentProperties:["selectedElement"],properties:{newParentSelector:{type:"ParameterType:selector",required:!0}}}},requestAction:function(){return{description:"Retrieves an instance of the specified action",properties:{systemName:{type:"ParameterType:actionName",required:!0}},outputProperties:{actionInstance:"ParameterType:object"}}},resizeAction:function(){return{description:"Triggers a resize on the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},selectElement:function(){return{description:"Selects an element using the given selector",properties:{selector:{type:"ParameterType:selector",required:!0},useSelectedElementAsRoot:"ParameterType:boolean"},outputProperties:{selectedElement:"ParameterType:jQuery"}}},setElementAttributes:function(){return{description:"Sets the given attributes on the selected element",dependentProperties:["selectedElement"],properties:{attributes:{type:"ParameterType:object",required:!0}}}},setElementContent:function(){return{description:"Sets the given HTML content in the selected element",dependentProperties:["selectedElement","template"],properties:{insertionType:[{value:"overwrite",description:"the contents of the selected element are replaced by the given template",default:!0},{value:"append",description:"the new content will be inserted after the current content"},{value:"prepend",description:"the new content will be inserted before the current content"}]}}},setGlobalData:function(){return{description:"Copies the specified values from the operationData to the global data",properties:{properties:{type:"ParameterType:array",required:!0}}}},setOperationData:function(){return{description:"Sets the given properties on the current operation data",properties:{properties:{type:"ParameterType:object",required:!0},override:"ParameterType:boolean"}}},setStyle:function(){return{description:"Sets the given style properties on the selected element",properties:{properties:{type:"ParameterType:object",required:!0},selectedElement:"ParameterType:jQuery"}}},startAction:function(){return{description:"Starts the selected action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}},startLoop:function(){return{description:"Starts a loop over the given collection",properties:{collection:{type:"ParameterType:array",required:!0},currentItem:"ParameterType:object"}}},toggleClass:function(){return{description:"Toggles the given class on the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}},toggleElement:function(){return{description:"Toggles the selected element",dependentProperties:["selectedElement"]}},wait:function(){return{description:"Waits the given amount of milliseconds before the action continues",properties:{milliseconds:{type:"ParameterType:number",required:!0}}}}};exports.Action=I,exports.ActionRegistryEventbusListener=Y,exports.ConfigurationResolver=R,exports.DEV_TOOLS_KEY="__ELIGIUS_DEV_TOOLS__",exports.DevToolEventListener=_,exports.Diagnostics=y,exports.EligiusEngine=W,exports.EligiusResourceImporter=at,exports.EndableAction=L,exports.EngineFactory=ee,exports.EventListenerController=Q,exports.Eventbus=J,exports.JwPlayerTimelineProvider=tt,exports.LabelController=H,exports.LanguageManager=$,exports.LottieController=F,exports.NavigationController=z,exports.ProgressbarController=G,exports.RequestAnimationFrameTimelineProvider=nt,exports.RequestVideoUriInterceptor=Z,exports.RoutingController=V,exports.SubtitlesController=B,exports.TimelineAction=x,exports.TimelineEventNames=M,exports.addClass=te,exports.addControllerToElement=oe,exports.animate=se,exports.animateWithClass=ae,exports.broadcastEvent=de,exports.calc=ge,exports.clearElement=Ee,exports.clearOperationData=be,exports.createElement=_e,exports.customFunction=ye,exports.endAction=Te,exports.endLoop=Pe,exports.extendController=Ie,exports.generateImporterSourceCode=function(e,t,n){var i=function(e,t,n){return[].concat(function(e){var t,n=N(e.initActions.concat(e.actions).concat(null!=(t=e.eventActions)?t:[]));if(e.timelines){var i=e.timelines.flatMap((function(e){return e.timelineActions}));n=n.concat(N(i))}return S(n)}(e),n.flatMap((function(e){return i=e.extension,l.default.readdirSync(c.default.join(t,n=e.path)).map((function(e){return{systemName:""+c.default.basename(e,i).replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()})),path:"./"+n+"/"+e,defaultImport:!0}}));var n,i})),function(e){var t,n,i,r,o=[];return(t=o).push.apply(t,w(e.initActions)),(n=o).push.apply(n,w(e.actions)),(i=o).push.apply(i,w(e.timelines.flatMap((function(e){return e.timelineActions})))),(r=o).push.apply(r,w(e.eventActions)),S(o)}(e),function(e){return e.timelineProviderSettings?Object.values(e.timelineProviderSettings).map((function(e){return{systemName:e.systemName}})):[]}(e),function(e){return e.engine?[{systemName:e.engine.systemName}]:[]}(e))}(e,t,n),r=function(e){var t=e.filter((function(e){return e.defaultImport})).map((function(e){return"import "+e.systemName+" from '"+e.path+"';"})).concat(e.filter((function(e){return!e.defaultImport})).map((function(e){var t;return"import {"+e.systemName+"} from '"+(null!=(t=e.path)?t:"eligius")+"';"})));return t.push("import { ISimpleResourceImporter } from 'eligius';"),t.push(""),t.push("const imports: Record<string, any> = {"),t.push.apply(t,e.map((function(e){return e.systemName+": { '"+e.systemName+"': "+e.systemName+" },"}))),t.push("};"),t.push(""),t.push("class EligiusResourceImporter implements ISimpleResourceImporter {"),t.push("import(name: string): Record<string, any> {"),t.push("if (imports.hasOwnProperty(name)) { return imports[name]; }"),t.push("throw Error(`Unknown systemName: ${name}`);"),t.push("}}"),t.push(""),t.push("export default EligiusResourceImporter;"),t.join("\n")}(i);return r},exports.getControllerFromElement=Le,exports.getControllerInstance=xe,exports.getElementDimensions=we,exports.getImport=Ne,exports.getQueryParams=Se,exports.invokeObjectMethod=Oe,exports.loadJSON=Ae,exports.log=De,exports.math=Ce,exports.metadata=ut,exports.removeClass=Ue,exports.removeControllerFromElement=ke,exports.removeElement=qe,exports.removePropertiesFromOperationData=je,exports.reparentElement=Me,exports.requestAction=Qe,exports.resizeAction=He,exports.selectElement=ze,exports.setElementAttributes=Ge,exports.setElementContent=Ve,exports.setGlobalData=Be,exports.setOperationData=Ke,exports.setStyle=We,exports.startAction=Ye,exports.startLoop=Je,exports.toggleClass=Ze,exports.toggleElement=Xe,exports.wait=$e;
2
2
  //# sourceMappingURL=eligius.cjs.production.min.js.map