eligius 1.0.18 → 1.0.20

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 t=require("jquery"),e=require("ts-is-present"),n=require("fs"),i=require("path"),r=require("uuid"),o=require("lottie-web"),a=require("hotkeys-js");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=s(t),c=s(n),l=s(i),h=s(o),d=s(a);function p(){p=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var r=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(i||[]);return r._invoke=function(t,e,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 a=n.delegate;if(a){var s=_(a,n);if(s){if(s===l)continue;return s}}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=c(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function d(){}function f(){}var v={};s(v,r,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(I([])));g&&g!==e&&n.call(g,r)&&(v=g);var E=f.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function y(t,e){function i(r,o,a,s){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function _(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=f,s(E,"constructor",f),s(f,"constructor",d),d.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},b(y.prototype),s(y.prototype,o,(function(){return this})),t.AsyncIterator=y,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new y(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(E),s(E,a,"Generator"),s(E,r,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=I,w.prototype={constructor:w,reset:function(t){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(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){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(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;x(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function f(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function v(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){f(o,i,r,a,s,"next",t)}function s(t){f(o,i,r,a,s,"throw",t)}a(void 0)}))}}function m(){return m=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},m.apply(this,arguments)}function g(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,E(t,e)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function b(t){return"function"==typeof t}function y(t){return null!==t&&"object"==typeof t}function _(t){if(Array.isArray(t))return t.map(_);if(t instanceof u.default)return"jQuery object";if(y(t)){if("class"===t.constructor.toString().substring(0,5)||!t.constructor.toString().startsWith("function Object()")){var e=t.constructor.toString();return e.substring(0,e.indexOf("{")+1)}return Object.fromEntries(Object.entries(t).map((function(t){return[t[0],_(t[1])]})))}if(b(t)){var n=t.toString();return n.indexOf("{")>-1?n.substring(0,n.indexOf("{")+1):n}return t}var T=function(){function t(t){this.agent=void 0,this.agent=t}return t.prototype.handleEvent=function(t,e,n){var i={eventName:t,eventTopic:e,args:_(n)};try{this.agent.postMessage("eligius-diagnostics-event",i)}catch(t){console.error("postmessage failed"),console.error(t),console.log("message",i)}},t}(),x=function(){function t(){}return t.send=function(t,e){console.log(t,e)},t}();x.active=void 0;var w="undefined"!=typeof structuredClone?structuredClone:function(t){return JSON.parse(JSON.stringify(t))};function I(t){return e.isDefined(t)?w(t):t}var P=function(){function t(t,e,n){this.name=void 0,this.startOperations=void 0,this.eventbus=void 0,this.id="",this._contextStack=[],this.name=t,this.startOperations=e,this.eventbus=n}var e=t.prototype;return e.start=function(t){var e,n=this;x.active&&x.send("eligius-diagnostics-action",(null!=(e=this.name)?e:"Action")+" begins executing start operations"),this._initializeContextStack();var i=new Promise((function(e,i){n.executeOperation(n.startOperations,0,e,i,t)})).catch((function(t){throw x.active&&x.send("eligius-diagnostics-action-error",{name:n.name,error:t}),console.error("Error in action start '"+n.name+"'"),console.error(t),t}));return x.active?i.then((function(t){var e;return x.send("eligius-diagnostics-action",(null!=(e=n.name)?e:"Action")+" finished executing start operations"),t})):i},e._initializeContextStack=function(){this._contextStack=[{currentIndex:-1,eventbus:this.eventbus,operations:this.startOperations}]},e._pushContext=function(t){var e={currentIndex:t.currentIndex,eventbus:t.eventbus,operations:t.operations};return this._contextStack.push(e),e},e._popContext=function(){var t=this._contextStack.pop();this._contextStack[this._contextStack.length-1].currentIndex=t.currentIndex},e.executeOperation=function(t,e,n,i,r){var o=this;void 0===r&&(r={});var a,s=this._contextStack[this._contextStack.length-1];if(void 0!==s.newIndex&&(e=s.newIndex,delete s.newIndex),s.currentIndex=e,e<t.length){var u,c=t[e],l=I(null!=(u=c.operationData)?u:{}),h=Object.assign(r,l);"when"===c.systemName?s=this._pushContext(s):"startLoop"===c.systemName&&s.owner!==c&&((s=this._pushContext(s)).owner=c),x.active&&x.send("eligius-diagnostics-operation",{systemName:c.systemName,operationData:h,context:m({},s,{eventbus:void 0})});var d=c.instance.call(s,h);("endWhen"===c.systemName||"endLoop"===c.systemName&&void 0===s.newIndex)&&this._popContext(),"object"==typeof(a=d)&&"function"==typeof a.then?d.then((function(r){return o.executeOperation(t,++e,n,i,r)})).catch((function(t){i(t)})):this.executeOperation(t,++e,n,i,d)}else n(r)},t}(),L=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,r)||this).endOperations=void 0,o.endOperations=i,o}return g(e,t),e.prototype.end=function(t){var e,n=this;if(x.active&&x.send("eligius-diagnostics-action",(null!=(e=this.name)?e:"Action")+" begins executing end operations"),!this.endOperations.length)return Promise.resolve(null!=t?t:{});this._initializeContextStack();var i=new Promise((function(e,i){n.executeOperation(n.endOperations,0,e,i,t)})).catch((function(t){throw x.active&&x.send("eligius-diagnostics-action-error",{name:n.name,error:t}),console.error("Error in action end '"+n.name+"'"),t}));return x.active?i.then((function(t){var e;return x.send("eligius-diagnostics-action",(null!=(e=n.name)?e:"Action")+" finished executing start operations"),t})):i},e}(P),O=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,i,o)||this).duration=void 0,a.active=!1,a.duration=r,a}g(e,t);var n=e.prototype;return n.start=function(e){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,t.prototype.start.call(this,e)):Promise.resolve({})},n.end=function(e){return this.active=!1,t.prototype.end.call(this,e)},e}(L);function S(t){return t&&(e=t.flatMap((function(t){var e;return[].concat(t.startOperations,null!=(e=t.endOperations)?e:[])})))?e.filter((function(t){var e;return!(null==(e=t.operationData)||!e.hasOwnProperty("systemName"))&&t.operationData.systemName.endsWith("Controller")})).map((function(t){var e;return{systemName:(null!=(e=t.operationData)?e:{}).systemName}})):[];var e}function C(t){return t&&(e=t.flatMap((function(t){var e;return[].concat(t.startOperations,null!=(e=t.endOperations)?e:[])})))?e.map((function(t){return{systemName:t.systemName}})):[];var e}function N(t){var e={};return t.filter((function(t){return!e[t.systemName]&&(e[t.systemName]=!0,!0)}))}var A=function(t){return t.selectedElement.addClass(t.className),t},R=function(t,e){return e.data(t)}.bind(null,"eligiusEngineControllers");function D(t,e){return m({},t,e)}function U(t,e,n){t(n?D(e,n):e)}var k=function(t){var e=t.controllerInstance;!function(t,e){t.data("eligiusEngineControllers")||t.data("eligiusEngineControllers",[]);var n=R(t);n&&n.push(e)}(t.selectedElement,e),e.init(t);var n=e.attach(this.eventbus);return n?new Promise((function(e,i){n.then((function(n){U(e,t,n)}),i)})):t},q=function(t){var e=t.animationEasing,n=t.selectedElement,i=t.animationProperties,r=t.animationDuration;return new Promise((function(o,a){try{e?n.animate(i,r,e,(function(){U(o,{},t)})):n.animate(i,r,(function(){U(o,{},t)}))}catch(t){a(t)}}))},j=function(t){var e=t.selectedElement,n=t.className,i=t.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{e.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&e.removeClass(n),U(r,{},t)}))}catch(t){o(t)}}));return e.addClass(n),r};function M(t){return"string"==typeof t}function F(t,e){var n=e,i=null;return t.forEach((function(e,r){if(r===t.length-1){var o=e.split("+");o.length>1&&(e=o[0],i=o[1])}n=n[e]})),i?""+n+i:n}var Q={},H=function(t,e){var n=e?t[e]:t;return n&&n!==t?I(n):n}.bind(null,Q),z=function(t,e){Object.entries(e).forEach((function(e){return t[e[0]]=e[1]}))}.bind(null,Q);function G(t,e,n){if(M(n)){var i,r=n.split(".");switch(null==(i=r.shift())?void 0:i.toLowerCase()){case"operationdata":return F(r,t);case"globaldata":return F(r,H());case"context":return F(r,e)}}return n}var V=function(t){var e=t.eventTopic,n=t.eventName,i=function(t,e,n){if(n){var i=G.bind(null,t,e);return n.map(i)}}(t,this,t.eventArgs);return e?this.eventbus.broadcastForTopic(n,e,i):this.eventbus.broadcast(n,i),function(t){delete t.eventName,delete t.eventTopic,delete t.eventArgs}(t),t},B=[];function W(t,e,n){var i=n!==t?I(n):n;return K(n,i,G.bind(null,t,e)),i}function K(t,e,n){if(!(B.indexOf(t)>-1)){B.push(t);try{Object.entries(t).forEach((function(t){var i=t[0],r=t[1];r instanceof u.default||(M(r)?e[i]=n(r):Array.isArray(r)?r.forEach((function(t,e,i){M(t)?i[e]=n(t):K(t,t,n)})):y(r)&&K(r,r,n))}))}finally{var i=B.indexOf(t);B.splice(i,1)}}}var Y={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"**":function(t,e){return Math.pow(t,e)}},J=function(t){return(t=W(t,this,t)).calculationResult=Y[t.operator](+t.left,+t.right),t},Z=function(t){return t.selectedElement.empty(),t},X=function(t){var e=t.properties;return e?(e.forEach((function(e){delete t[e]})),delete t.properties,t):{}},$=function(t){var e=(t=W(t,this,t)).elementName,n=t.attributes,i=t.text,r=n?" "+Object.entries(n).map((function(t){return t[0]+'="'+t[1]+'"'})).join(" "):"",o=u.default(i?"<"+e+r+">"+i+"</"+e+">":"<"+e+r+"/>");return t.template=o,t},tt=function(){};tt.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",tt.PLAY_REQUEST="timeline-play-request",tt.STOP_REQUEST="timeline-stop-request",tt.PAUSE_REQUEST="timeline-pause-request",tt.SEEK_REQUEST="timeline-seek-request",tt.RESIZE_REQUEST="timeline-resize-request",tt.CONTAINER_REQUEST="timeline-container-request",tt.DURATION_REQUEST="timeline-duration-request",tt.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",tt.DURATION="timeline-duration",tt.TIME="timeline-time",tt.SEEKED="timeline-seeked",tt.COMPLETE="timeline-complete",tt.RESTART="timeline-restart",tt.PLAY="timeline-play",tt.STOP="timeline-stop",tt.PAUSE="timeline-pause",tt.SEEK="timeline-seek",tt.RESIZE="timeline-resize",tt.POSITION_UPDATE="timeline-position-update",tt.TIME_UPDATE="timeline-time-update",tt.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",tt.FIRST_FRAME="timeline-firstframe",tt.REQUEST_INSTANCE="request-instance",tt.REQUEST_ACTION="request-action",tt.REQUEST_FUNCTION="request-function",tt.REQUEST_TIMELINE_URI="request-timeline-uri",tt.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",tt.REQUEST_ENGINE_ROOT="request-engine-root",tt.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",tt.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",tt.EXECUTE_TIMELINEACTION="execute-timelineaction",tt.RESIZE_TIMELINEACTION="resize-timelineaction",tt.REQUEST_LABEL_COLLECTION="request-label-collection",tt.REQUEST_LABEL_COLLECTIONS="request-label-collections",tt.REQUEST_CURRENT_LANGUAGE="request-current-language",tt.LANGUAGE_CHANGE="language-change";var et=function(t){var e=this,n=t.systemName;return new Promise((function(i,r){e.eventbus.broadcast(tt.REQUEST_FUNCTION,[n,function(n){var o=n.apply(e,[t]);o?o.then((function(){U(i,{},t)}),r):U(i,{},t)}])}))},nt=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=D(t,n),e.end(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),U(i,t)}),r)}))},it=function(t){return void 0!==this.loopIndex&&void 0!==this.loopLength&&this.loopIndex<this.loopLength&&(this.loopIndex=this.loopIndex+1,this.newIndex=this.loopStartIndex,delete this.currentItem),t},rt=function(t){return delete this.whenEvaluation,t},ot=function(t){return t.controllerInstance=Object.assign(t.controllerInstance,t.controllerExtension),t},at=function(t){var e=t.controllerName,n=R(t.selectedElement).find((function(t){return t.name===e}));return n||console.warn("controller for name '"+e+"' was not found on the given element"),t.controllerInstance=n,t},st=function(t){var e=t.systemName;return t.controllerInstance=void 0,this.eventbus.broadcast(tt.REQUEST_INSTANCE,[e,function(e){t.controllerInstance=e}]),t},ut=function(t){var e,n,i=t.selectedElement,r=t.modifier,o={width:null!=(e=i.innerWidth())?e:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&(o=function(t,e){var n=m({},t),i=null;if(e.indexOf("|")>-1){var r=e.split("|");e=r[0],i=r[1]}var o=e.substring(0,1),a=function(t){var e=t.substring(t.length-1,t.length);"h"!==e&&"w"!==e&&"%"!==e&&(e=null);var n="%"===e;return n&&"h"!==(e=t.substring(t.length-1,t.length-2))&&"w"!==e&&(e=null),[e,1,n]}(e),s=a[0],u=a[2],c=parseInt(null!==s?e.substring(1,e.length-(a[1]-1)):e.substring(1),10),l=c,h=c;u&&(l=n.width/100*c,h=n.height/100*c);var d=function(t,e,n,i,r){var o=m({},t);switch(e){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: "+e)}return o}(n,o,s,l,h);return i?function(t,e){var n=m({},e),i=t.substring(0,1),r=t.substring(t.indexOf("[")+1,t.indexOf("]")-(t.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)),t.dimensions=o,t},ct=function(t){return this.eventbus.broadcast(tt.REQUEST_FUNCTION,[t.systemName,function(e){t.importedInstance=e}]),delete t.systemName,t},lt=function(t){var e=new URLSearchParams(window.location.search),n=Object.fromEntries(e.entries()),i=t.defaultValues,r=void 0===i?{}:i;return delete t.defaultValues,t.queryParams=m({},r,n),t},ht=function(t){var e=t.methodName,n=t.methodArguments;return delete t.methodName,delete t.methodArguments,t.methodResult=t.instance[e].apply(t.instance,null!=n?n:[]),t},dt={},pt=function(t){var e=t.url;return t.cache&&dt[e]?(t.json=dt[e],t):fetch(e).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=t.json=n.sent,dt[e]=r,n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}())},ft=function(t){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:t}),console.groupEnd(),t},vt=function(t){return(t=W(t,this,t)).args=t.args.map((function(t){return M(e=t)&&e in Math&&!b(Math[e])?Math[t]:t;var e})),t.mathResult=Math[t.functionName].apply(null,t.args),t};function mt(t){return t.systemName===this.self?(this.counter=this.counter+1,!1):t.systemName===this.matchingName&&0===this.counter||(t.systemName===this.matchingName&&this.counter>0&&(this.counter=this.counter-1),!1)}var gt=function(t){var e,n;return this.whenEvaluation&&(this.newIndex=(n=(e=this).operations.slice(e.currentIndex).findIndex(mt.bind({counter:0,self:"when",matchingName:"endWhen"})))>-1?n+(e.currentIndex+1):e.operations.length),t},Et=function(t){return t.selectedElement.removeClass(t.className),t},bt=function(t){var e=t.controllerName,n=R(t.selectedElement),i=null==n?void 0:n.find((function(t){return t.name===e}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return t},yt=function(t){return t.selectedElement.remove(),t},_t=function(t){var e=t.propertyNames;return e.indexOf("propertyNames")<0&&e.push("propertyNames"),Object.fromEntries(Object.entries(t).filter((function(t){return!e.includes(t[0])})))},Tt=function(t){var e=t.newParentSelector;return t.selectedElement.remove().appendTo(e),t},xt=function(t){return this.eventbus.broadcast(tt.REQUEST_ACTION,[t.systemName,function(e){t.actionInstance=e}]),t},wt=function(t){var e=t.actionInstance;return t=D(t,t.actionOperationData),e.resize?e.resize(t):t};function It(t,e){var n=t.find(e);return n.length||console.warn("selector '"+e+"' wasn't found!"),n}var Pt=function(t){var e=t.selector,n=t.useSelectedElementAsRoot,i=void 0!==n&&n;if(!e)throw new Error("selectElement: selector is either empty or not defined.");return i&&t.selectedElement?(t.selectedElement=It(t.selectedElement,e),t):(this.eventbus.broadcast(tt.REQUEST_ENGINE_ROOT,[function(n){t.selectedElement=It(n,e)}]),t)},Lt=function(t){var e=t.selectedElement;return Object.entries(t.attributes).forEach((function(t){e.attr(t[0],t[1])})),t},Ot=function(t){var e=t.insertionType,n=void 0===e?"overwrite":e,i=t.selectedElement,r=t.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 t.insertionType,t},St=function(t){var e=t.properties,n=Object.fromEntries(Object.entries(t).filter((function(t){return e.includes(t[0])})));return z(n),delete t.properties,t},Ct=function(t){var e=t.override,n=void 0!==e&&e,i=t.properties;delete t.properties,delete t.override;var r=W(t,this,i);return n?r:Object.assign(t,r)},Nt=function(t){var e=W(t,this,t.properties);return t.selectedElement.css(e),t},At=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=D(t,n),e.start(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),U(i,t)}),r)}))},Rt=function(t){var e,n,i=t.collection;if(null!==i&&!Array.isArray(i))throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===this.loopIndex&&(this.loopEndIndex=(n=(e=this).operations.slice(e.currentIndex+1).findIndex(mt.bind({counter:0,self:"startLoop",matchingName:"endLoop"})))>-1?n+(e.currentIndex+1):e.operations.length,null!=i&&i.length?(this.loopIndex=0,this.loopLength=i.length-1,this.loopStartIndex=this.currentIndex):(this.newIndex=this.loopEndIndex,delete this.loopIndex,delete this.loopLength,delete this.loopStartIndex,delete this.loopEndIndex)),null!=i&&i.length&&void 0!==this.loopIndex&&(this.currentItem=i[this.loopIndex]),t},Dt=function(t){return t.selectedElement.toggleClass(t.className),t},Ut=function(t){return t.selectedElement.toggle(),t},kt=function(t){var e=t.milliseconds;return new Promise((function(n){setTimeout((function(){U(n,t)}),e)}))},qt=function(t){var e=function(t,e,n){var i=t.split(/!=|==|>=|<=|>|</),r=i[0],o=i[1],a=t.substring(r.length,t.length-o.length),s=+r,u=+o;return[isNaN(s)?G(e,n,r):s,a,isNaN(u)?G(e,n,o):u]}(t.expression,t,this);return this.whenEvaluation=jt[e[1]](e[0],e[2]),this.whenEvaluation||(this.newIndex=function(t){var e=t.operations.slice(t.currentIndex+1),n=e.findIndex(mt.bind({counter:0,self:"when",matchingName:"otherwise"}));if(n>-1)return n+t.currentIndex+1;var i=e.findIndex(mt.bind({counter:0,self:"when",matchingName:"endWhen"}));return i>-1?i+(t.currentIndex+1):t.operations.length}(this)),delete t.expression,t},jt={"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},"<":function(t,e){return t<e}},Mt={__proto__:null,addClass:A,addControllerToElement:k,animate:q,animateWithClass:j,broadcastEvent:V,calc:J,clearElement:Z,clearOperationData:X,createElement:$,customFunction:et,endAction:nt,endLoop:it,endWhen:rt,extendController:ot,getControllerFromElement:at,getControllerInstance:st,getElementDimensions:ut,getImport:ct,getQueryParams:lt,invokeObjectMethod:ht,loadJSON:pt,log:ft,math:vt,otherwise:gt,removeClass:Et,removeControllerFromElement:bt,removeElement:yt,removePropertiesFromOperationData:_t,reparentElement:Tt,requestAction:xt,resizeAction:wt,selectElement:Pt,setElementAttributes:Lt,setElementContent:Ot,setGlobalData:St,setOperationData:Ct,setStyle:Nt,startAction:At,startLoop:Rt,toggleClass:Dt,toggleElement:Ut,wait:kt,when:qt},Ft=function(){function t(t){this.configurationfactory=void 0,this.configurationfactory=t}var e=t.prototype;return e.createAction=function(t){var e=new Ht(t,this);return this.configurationfactory.addAction(e.actionConfig),e},e.createInitAction=function(t){var e=new Ht(t,this);return this.configurationfactory.addInitAction(e.actionConfig),e},e.createEventAction=function(t){var e=new Qt(t,this);return this.configurationfactory.addEventAction(e.actionConfig),e},e.createTimelineAction=function(t,e){var n=new zt(e,this);return this.configurationfactory.addTimelineAction(t,n.actionConfig),n},e.end=function(){return this.configurationfactory},t}(),Qt=function(){function t(t,e){this.factory=void 0,this.actionConfig=void 0,this.factory=e,this.actionConfig={name:"",id:r.v4(),startOperations:[]},null!=t&&t.length&&(this.actionConfig.name=t)}var e=t.prototype;return e.getId=function(){return this.actionConfig.id},e.setName=function(t){return this.actionConfig.name=t,this},e.getConfiguration=function(t){var e=I(this.actionConfig),n=t.call(this,e);return n&&(this.actionConfig=n),this},e.addStartOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addStartOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},e.addStartOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);return this.actionConfig.startOperations.push({id:r.v4(),systemName:t,operationData:e}),this},e.next=function(){return this.factory},t}(),Ht=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).actionConfig.endOperations=[],i}g(e,t);var n=e.prototype;return n.addEndOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addEndOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},n.addEndOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);var n=this.actionConfig.endOperations;return n||(n=this.actionConfig.endOperations=[]),n.push({id:r.v4(),systemName:t,operationData:e}),this},e}(Qt),zt=function(t){function e(){return t.apply(this,arguments)||this}return g(e,t),e.prototype.addDuration=function(t,e){return this.actionConfig.duration={start:t},e&&(this.actionConfig.duration.end=e),this},e}(Ht);function Gt(t,e,n){n>=t.length?n=0:n<0&&(n=t.length-1),t.splice(n,0,t.splice(e,1)[0])}var Vt=function(){function t(t,e){this.actionConfig=void 0,this.configurationFactory=void 0,this.actionConfig=t,this.configurationFactory=e}var n=t.prototype;return n.updateConfiguration=function(){this.actionConfig=m({},this.actionConfig)},n.getConfiguration=function(t){var e=I(this.actionConfig),n=t.call(this,e);return n&&(this.actionConfig=n),this},n.setName=function(t){return this.actionConfig=m({},this.actionConfig,{name:t}),this},n.getName=function(){return this.actionConfig.name},n.addStartOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addStartOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},n.addStartOperation=function(t,e,n){if(!Mt[t])throw Error("Unknown operation: "+t);var i=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],o={id:null!=n?n:r.v4(),systemName:t,operationData:e};return i.push(o),this.actionConfig=m({},this.actionConfig,{startOperations:i}),new Kt(o,this)},n.editStartOperation=function(t){var n=this.actionConfig.startOperations.find((function(e){return e.id===t}));if(e.isDefined(n))return new Kt(n,this);throw new Error("start operation not found for id "+t)},n.removeStartOperation=function(t){var e=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],n=e.find((function(e){return e.id===t}));if(!n)throw new Error("start operation not found for id "+t);var i=e.indexOf(n);return i>-1&&(e.splice(i,1),this.actionConfig=m({},this.actionConfig,{startOperations:e})),this},n.moveStartOperation=function(t,e){var n=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],i=n.find((function(e){return e.id===t}));if(!i)throw new Error("start operation not found for id "+t);var r=n.indexOf(i);return r>-1&&(Gt(n,r,"up"===e?r+1:r-1),this.actionConfig=m({},this.actionConfig,{startOperations:n})),this},n.next=function(){return this.configurationFactory},t}(),Bt=function(t){function n(){return t.apply(this,arguments)||this}g(n,t);var i=n.prototype;return i.addEndOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addEndOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},i.addEndOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);var n=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i={id:r.v4(),systemName:t,operationData:e};return n.push(i),this.actionConfig.endOperations=n,new Kt(i,this)},i.editEndOperation=function(t){var n=this.actionConfig.endOperations.find((function(e){return e.id===t}));if(e.isDefined(n))return new Kt(n,this);throw new Error("operation not found for id "+t)},i.removeEndOperation=function(t){var n=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i=n.find((function(e){return e.id===t}));if(!e.isDefined(i))throw new Error("operation not found for id "+t);var r=n.indexOf(i);return r>-1&&(n.splice(r,1),this.actionConfig=m({},this.actionConfig,{endOperations:n})),this},i.moveEndOperation=function(t,n){var i=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],r=i.find((function(e){return e.id===t}));if(!e.isDefined(r))throw new Error("operation not found for id "+t);var o=i.indexOf(r);return o>-1&&(Gt(i,o,"up"===n?o+1:o-1),this.actionConfig=m({},this.actionConfig,{endOperations:i})),this},n}(Vt),Wt=function(t){function e(){return t.apply(this,arguments)||this}return g(e,t),e.prototype.setDuration=function(t,e){if(null!=e&&t>e)throw Error("start position cannot be higher than end position");var n={start:t};return e&&(n.end=e),this.actionConfig=m({},this.actionConfig,{duration:n}),this},e}(Bt),Kt=function(){function t(t,e){this.operationConfig=void 0,this.actionEditor=void 0,this.operationConfig=t,this.actionEditor=e}var e=t.prototype;return e.getConfiguration=function(t){var e=I(this.operationConfig),n=t.call(this,e);return n&&(this.operationConfig=n),this},e.getSystemName=function(){return this.operationConfig.systemName},e.setSystemName=function(t){if(!Mt[t])throw Error("Unknown operation: "+t);return this.operationConfig.systemName=t,this.actionEditor.updateConfiguration(),this},e.setOperationData=function(t){return this.operationConfig.operationData=t,this.actionEditor.updateConfiguration(),this},e.setOperationDataItem=function(t,e){var n=this.operationConfig.operationData,i=void 0===n?{}:n;return i[t]=e,this.setOperationData(i)},e.getOperationDataKeys=function(){var t=this.operationConfig.operationData;return t?Object.keys(t):[]},e.getOperationDataValue=function(t){var e=this.operationConfig.operationData;return null==e?void 0:e[t]},e.next=function(){return this.actionEditor},t}(),Yt=function(){function t(t,e){this.eventbus=void 0,this.config=void 0,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=r.v4(),this.loop=!1,this.eventbus=t,this.config=e,this._addEventListeners()}var e=t.prototype;return e._extractUrls=function(t){return t.timelines.filter((function(t){return"mediaplayer"===t.type})).map((function(t){return t.uri}))},e.init=function(){var t=this,e=this.config.timelineProviderSettings.mediaplayer;if(!e)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=e.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 a=o.innerWidth(),s=o.innerHeight();return 0===a&&(a=100),0===s&&(s=300),this._player=r(n),this._player.setup({file:i[0],image:e.poster,height:s,width:a,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){t._playlist.push({file:n,title:n,image:e.poster})})),new Promise((function(e){t._player.once("ready",(function(){t._handlePlayerReady(e)})),t._player.load(t._playlist)}))},e._handlePlayerReady=function(t){var e=this;this._player.once("firstFrame",(function(){e._player.pause(),e.eventbus.broadcast(tt.DURATION,[e.getDuration()]),t()})),this._player.on(tt.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(tt.SEEKED,this._seekedHandler.bind(this)),this._player.on(tt.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){e._player.play()}),10)},e._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(tt.COMPLETE,[this._player.getPlaylistIndex()]))},e._seekedHandler=function(){this.eventbus.broadcast(tt.SEEKED,[this.getPosition(),this.getDuration()])},e.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(t){return t()}))},e._loopHandler=function(t,e){var n=t(e.position);this.loop&&n===t(this._player.getDuration()-1)&&this.seek(0)},e._timeResetLoopHandler=function(){this.loop&&this.seek(0)},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(tt.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.DURATION_REQUEST,this.duration.bind(this)))},e._container=function(t){var e="";"html5"!==this._player.getProvider().name&&(e="_wrapper"),t(u.default("#"+this._videoElementId+e))},e.toggleplay=function(){this._paused?this.start():this.pause()},e.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(tt.PLAY)},e.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(tt.STOP)},e.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(tt.PAUSE)},e.seek=function(t){var e=this._player.getPosition();this._player.seek(t),this.eventbus.broadcast(tt.SEEK,[t,e,this._player.getDuration()])},e.resize=function(t,e){this._player.resize(t,e),this.eventbus.broadcast(tt.RESIZE,[t,e])},e.duration=function(t){t(Math.floor(this.getDuration()))},e.playlistItem=function(t){var e=this._playlist.findIndex((function(e){return e.file===t}));e>-1&&this._player.playlistItem(e)},e.getPosition=function(){return this._player.getPosition()},e.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},e.getState=function(){return this._player.getState()},e.getDuration=function(){return this._player.getDuration()},e.getMute=function(){return this._player.getMute()},e.getVolume=function(){return this._player.getVolume()},e.setMute=function(t){this._player.setMute(t)},e.setVolume=function(t){this._player.setVolume(t)},t}(),Jt=function(){function t(t,e){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=t,this.config=e,this.eventbus=t,this.config=e,this._playlist=this._extractPlaylist(e),this._currentPlaylistItem=this._playlist[0]}var e=t.prototype;return e._extractPlaylist=function(t){return t.timelines.filter((function(t){return"animation"===t.type}))},e.playlistItem=function(t){if(null!==t&&t.length&&0!==this._playlist.length){var e=this._playlist.find((function(e){return e.uri===t}));if(!e)throw new Error("Unknown playlist uri: "+t);this._currentPlaylistItem=e,this._firstFrame=!0}},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(tt.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},e._update=function(t){if("running"===this.playState){if(this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(tt.COMPLETE);this._resetToStartPosition(),this.eventbus.broadcast(tt.RESTART),this._broadCastPosition()}this._broadCastPosition()}},e._broadCastPosition=function(){this.eventbus.broadcast(tt.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(tt.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])},e._start=function(){var t;"running"!==this.playState&&(this.playState="running",null==(t=this._abortController)||t.abort(),this._abortController=new AbortController,this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(tt.FIRST_FRAME)),0==this._currentPosition&&this._broadCastPosition(),function(t,e,n){var i,r,o,a=null!=(i=null==(r=document)||null==(o=r.timeline)?void 0:o.currentTime)?i:performance.now();function s(t){e.aborted||(n(t),u(t))}function u(e){var n=Math.round((e-a)/t)*t,i=a+n+t-performance.now();setTimeout((function(){return requestAnimationFrame(s)}),i)}u(a)}(this._tickInterval,this._abortController.signal,this._updateBound))},e._resetToStartPosition=function(){this._currentPosition=0},e._resize=function(){console.error("Not implemented yet, not even sure this needs to be implemented...")},e._container=function(t){t(this._containerElement)},e._stopAnimationInterval=function(t){var e;void 0===t&&(t=!0),null==(e=this._abortController)||e.abort(),this._abortController=void 0,t&&this._resetToStartPosition()},e.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 Promise.resolve()},e.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(t){return t()})),this._containerElement=void 0},e.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},e.start=function(){this._start(),this.eventbus.broadcast(tt.PLAY)},e.stop=function(){this._stopAnimationInterval(),this.playState="stopped",this.eventbus.broadcast(tt.STOP)},e.pause=function(){this._stopAnimationInterval(!1),this.playState="paused",this.eventbus.broadcast(tt.PAUSE)},e.seek=function(t){t<0||t>this._currentPlaylistItem.duration||(this.eventbus.broadcast(tt.SEEK,[t,this._currentPosition,this.getDuration()]),this._currentPosition=t,this.eventbus.broadcast(tt.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(tt.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(tt.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},e.getPosition=function(){return this._currentPosition},e.getDuration=function(){return this._currentPlaylistItem.duration},e.requestDurationHandler=function(t){t(this._currentPlaylistItem.duration)},t}(),Zt={__proto__:null,JwPlayerTimelineProvider:Yt,RequestAnimationFrameTimelineProvider:Jt},Xt=function(){function t(t,e){this.providersSettings=void 0,this.configurationFactory=void 0,this.providersSettings=t,this.configurationFactory=e}var e=t.prototype;return e.addProvider=function(t){if(this.providersSettings[t])throw new Error("Settings for a '"+t+"' provider already exist");var e={id:r.v4(),poster:void 0,selector:void 0,systemName:"",vendor:""};return this.providersSettings[t]=e,new $t(e,this,this.configurationFactory)},e.editProvider=function(t){if(!this.providersSettings[t])throw new Error("No settings for a '"+t+"' provider exist yet");return new $t(this.providersSettings[t],this,this.configurationFactory)},e.next=function(){return this.configurationFactory},t}(),$t=function(){function t(t,e,n){this.providerSettings=void 0,this.providersSettingsEditor=void 0,this.configurationFactory=void 0,this.providerSettings=t,this.providersSettingsEditor=e,this.configurationFactory=n}var e=t.prototype;return e.setVendor=function(t){return this.providerSettings.vendor=t,this},e.setSelector=function(t){return this.providerSettings.selector=t,this},e.setSystemName=function(t){if(!Zt[t])throw new Error("Unknown timeline provider system name: "+t);return this.providerSettings.systemName=t,this},e.next=function(){return this.providersSettingsEditor},e.end=function(){return this.configurationFactory},t}(),te=function(){function t(t){this.actionCreatorFactory=void 0,this.configuration=void 0,this.configuration=t||{},this.actionCreatorFactory=new Ft(this)}t.extend=function(t,e,n){return t[e]=n.bind(t),t},t.extendMultiple=function(e,n){return Object.entries(n).forEach((function(n){return t.extend(e,n[0],n[1])})),e};var e=t.prototype;return e.init=function(t){return this.configuration={id:r.v4(),engine:{systemName:"EligiusEngine"},containerSelector:"[data-ct-container=true]",timelineProviderSettings:{},language:t,availableLanguages:[],layoutTemplate:"",initActions:[],actions:[],timelines:[],labels:[]},this},e.setLayoutTemplate=function(t){return this.configuration.layoutTemplate=t,this},e.setDefaultLanguage=function(t){return this.configuration.language=t,this},e.setContainerSelector=function(t){return this.configuration.containerSelector=t,this},e.editTimelineProviderSettings=function(){return new Xt(this.configuration.timelineProviderSettings||{},this)},e.getConfiguration=function(t){var e=I(this.configuration),n=t.call(this,e);return n&&(this.configuration=n),this},e.addLanguage=function(t,e){var n=this._initializeCollection(this.configuration,"availableLanguages");if(n.find((function(e){return e.languageCode===t})))throw new Error("Language code '"+t+"' already exists");return n.push({id:r.v4(),languageCode:t,label:e}),this},e._internalAddAction=function(t,e){var n=this._initializeCollection(this.configuration,t);null==n||n.push(e)},e._initializeCollection=function(t,e){return t[e]||(t[e]=[]),t[e]},e.addAction=function(t){this._internalAddAction("actions",t)},e.addInitAction=function(t){this._internalAddAction("initActions",t)},e.addEventAction=function(t){this._internalAddAction("eventActions",t)},e.addTimelineAction=function(t,e){var n=this.getTimeline(t);if(!n)throw Error("No timeline found for uri '"+t+"'");this._initializeCollection(n,"timelineActions").push(e)},e.createAction=function(t){return this.actionCreatorFactory.createAction(t)},e.createInitAction=function(t){return this.actionCreatorFactory.createInitAction(t)},e.createEventAction=function(t){return this.actionCreatorFactory.createEventAction(t)},e.createTimelineAction=function(t,e){return this.actionCreatorFactory.createTimelineAction(t,e)},e.addTimeline=function(t,e,n,i,o){var a=this._initializeCollection(this.configuration,"timelines");if(this.getTimeline(t))throw Error("timeline for uri "+t+" already exists");var s={id:r.v4(),type:e,uri:t,duration:n,loop:i,selector:o,timelineActions:[]};return a.push(s),this},e.getTimeline=function(t){return this.configuration.timelines.find((function(e){return e.uri===t}))},e.removeTimeline=function(t){var e=this.getTimeline(t);if(e){var n=this.configuration.timelines.indexOf(e);n>-1&&this.configuration.timelines.splice(n,1)}return this},e._initializeLabel=function(t,e){var n=e.find((function(e){return e.id===t}));return n||(e.push({id:t,labels:[]}),n=e[e.length-1]),n},e._getLabelTranslation=function(t,e){var n=t.find((function(t){return t.languageCode===e}));return n||(n={id:r.v4(),languageCode:e,label:""},t.push(n)),n},e.addLabel=function(t,e,n){var i=this._initializeCollection(this.configuration,"labels"),r=this._initializeLabel(t,i);return this._getLabelTranslation(r.labels,e).label=n,this},e.editAction=function(t){var e=this.configuration.actions.find((function(e){return e.id===t}));if(e)return new Bt(e,this);throw new Error("Action not found for id "+t)},e.editEventAction=function(t){var e,n=null==(e=this.configuration.eventActions)?void 0:e.find((function(e){return e.id===t}));if(n)return new Vt(n,this);throw new Error("Event action not found for id "+t)},e.editInitAction=function(t){var e=this.configuration.initActions.find((function(e){return e.id===t}));if(e)return new Bt(e,this);throw new Error("Init action not found for id "+t)},e.editTimelineAction=function(t,e){var n=this.getTimeline(t);if(!n)throw new Error("Timeline not found for id "+e);var i=n.timelineActions.find((function(t){return t.id===e}));if(i)return new Wt(i,this);throw new Error("Timeline action not found for id "+e)},t}(),ee=function(){function t(){this.operationData=void 0,this.actionInstanceInfos=void 0,this.name="EventListenerController"}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,eventName:t.eventName,actions:t.actions.slice(),actionOperationData:t.actionOperationData?I(t.actionOperationData):void 0}},e.attach=function(t){var e=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=e._isStartAction(n);t.broadcast(tt.REQUEST_ACTION,[r[1],(i=r[0],function(t){var n;null==(n=e.actionInstanceInfos)||n.push({start:i,action:t})})])})),i.on(o,this._eventHandler.bind(this)))}},e._isStartAction=function(t){return"end:"===t.substr(0,"end:".length)?[!1,t.substr("end:".length)]:[!0,t]},e._eventHandler=function(t){if(this.operationData&&this.actionInstanceInfos){var e=this.operationData.actionOperationData?I(this.operationData.actionOperationData):{};t.target&&(e.targetValue=t.target.value),this._executeAction(this.actionInstanceInfos,e,0)}},e._executeAction=function(){var t=v(p().mark((function t(e,n,i){var r,o,a;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i<e.length)){t.next=8;break}return o=(r=e[i]).action,a=r.start?o.start.bind(o):o.end.bind(o),t.next=6,a(n);case 6:this._executeAction(e,Object.assign(n,t.sent),++i);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e.detach=function(t){var e;null==(e=this.operationData)||e.selectedElement.off(this.operationData.eventName)},t}(),ne=function(){function t(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController",this.requestLabelDataBound=void 0}var e=t.prototype;return e.init=function(t){this.operationData=Object.assign({},t)},e.setLabelId=function(t){this.requestLabelDataBound&&(this.requestLabelDataBound(t),this.setLabel())},e.attach=function(t){var e=this;this.operationData&&(t.broadcast(tt.REQUEST_CURRENT_LANGUAGE,[function(t){e.currentLanguage=t}]),this.requestLabelDataBound=this.requestLabelData.bind(this,t),this.requestLabelDataBound(this.operationData.labelId),this.setLabel(),this.listeners.push(t.on(tt.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},e.requestLabelData=function(t,e){var n=this;t.broadcast(tt.REQUEST_LABEL_COLLECTION,[e,function(t){n.createTextDataLookup(t)}])},e.setLabel=function(){var t;this.currentLanguage&&(null==(t=this.operationData)||t.selectedElement.html(this.labelData[this.currentLanguage]))},e.detach=function(t){this.listeners.forEach((function(t){return t()})),this.requestLabelDataBound=void 0},e.handleLanguageChange=function(t){this.currentLanguage=t,this.setLabel()},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t){e.labelData[t.languageCode]=t.label}))},t}(),ie=function(){function t(){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 e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,renderer:t.renderer,loop:t.loop,autoplay:t.autoplay,animationData:t.animationData,json:t.json,labelIds:t.labelIds,viewBox:t.viewBox,iefallback:t.iefallback},t.url.indexOf("[")>-1&&this.parseFilename(t.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))},e.parseFilename=function(t){var e=this;t.substr(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split(",").forEach((function(t){var n=t.split("=");"freeze"===n[0]?e.freezePosition=+n[1]:"end"===n[0]&&(e.endPosition=+n[1])}))},e.attach=function(t){if(this.operationData){var e=this.operationData.labelIds;if(e&&e.length){var n={};t.broadcast(tt.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(t.on(tt.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),t.broadcast(tt.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},e.detach=function(t){this.listeners.forEach((function(t){t()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},e.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},e.createAnimation=function(){var t,e=this;if(this.operationData&&this.serializedData){null==(t=this.animationItem)||t.destroy();var n=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,i=this.operationData.labelIds;i&&i.length&&i.forEach((function(t){var i;n=n.split("!!"+t+"!!").join(e.labelData[t][null!=(i=e.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)}},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t,n){t.forEach((function(t){e.operationData&&(e.labelData[e.operationData.labelIds[n]][t.code]=t.label)}))}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.createAnimation()},e.isIE=function(){var t=!!window.document.documentMode;return!t&&!!window.StyleMedia||t},t}(),re=function(){function t(){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 e=t.prototype;return e.init=function(t){this.container=t.selectedElement,this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.container&&(this.eventbus=t,this.eventhandlers.push(t.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(t.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(t.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(t.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},e.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var t=this.getQueryVariable(0),e=0;t&&(e=this.navLookup[t].videoUrlIndex),this.highlightMenu(e)},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return null},e.handleRequestCurrentNavigation=function(t){if(this.activeNavigationPoint){var e=this.ctrlLookup[this.activeNavigationPoint.labelId];t({navigationData:this.activeNavigationPoint,title:e.labelData[e.currentLanguage||""]})}else t(null)},e.detach=function(t){this.eventhandlers.forEach((function(t){t()})),this.labelControllers.forEach((function(e){e.detach(t)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},e.pushCurrentState=function(t){var e;if(void 0===t&&(t=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};t>-1&&(i.position=t),null==(e=this.eventbus)||e.broadcast("push-history-state",[i])}}},e.buildHtml=function(t,e){var n=u.default("<ul/>");e.forEach(this.addNavElement.bind(this,n)),t.append(n)},e.addNavElement=function(t,e){if(e.visible){var n=u.default("<li/>"),i=u.default("<a href='javascript:;' id='nav_"+e.videoUrlIndex+"'/>");if(n.append(i),this.addLabel(i,e.labelId),this.addClickHandler(i,e.videoUrlIndex),e.children){var r=u.default("<ul/>");e.children.forEach(this.addNavElement.bind(this,r)),n.append(r)}t.append(n)}},e.addClickHandler=function(t,e){t.mouseup(this.menuMouseupHandler.bind(this,e))},e.menuMouseupHandler=function(t){var e,n=this.navVidIdLookup[t];n&&(null==(e=this.eventbus)||e.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},e.handleNavigateVideoUrl=function(t,e){var n;void 0===e&&(e=0),this.highlightMenu(t),null==(n=this.eventbus)||n.broadcast("request-video-url",[t,e]),this.activeNavigationPoint=this.navVidIdLookup[t],this.pushCurrentState(e)},e.highlightMenu=function(t){var e=u.default("#nav_"+t);e.length&&(u.default(".current-menu-item").removeClass("current-menu-item"),e.addClass("current-menu-item"))},e.handleVideoComplete=function(t){var e,n,i=this.navVidIdLookup[t];i.autoNext?null==(e=this.eventbus)||e.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},e.addLabel=function(t,e){var n,i=this,r={selectedElement:t,labelId:e};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(t){t.init(r),t.attach(i.eventbus),i.labelControllers.push(t),i.ctrlLookup[e]=t}])},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),oe=function(){function t(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[],this.duration=0}var e=t.prototype;return e.init=function(t){this.selectedElement=t.selectedElement,this.textElement=t.textElement},e.attach=function(t){var e,n=this;this.detachers.push(t.on(tt.POSITION_UPDATE,this.positionUpdateHandler.bind(this))),t.broadcast(tt.DURATION_REQUEST,[function(t){return n.duration=t}]);var i=this.clickHandler.bind(this,t);null==(e=this.selectedElement)||e.on("click",i),this.detachers.push((function(){var t;return null==(t=n.selectedElement)?void 0:t.off("click",i)}))},e.detach=function(t){this.detachers.forEach((function(t){t()}))},e.positionUpdateHandler=function(t){var e,n,i=100/t.duration*t.position;null==(e=this.selectedElement)||e.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},e.clickHandler=function(t,e){var n=e.target.getBoundingClientRect();t.broadcast(tt.SEEK_REQUEST,[Math.floor(this.duration/100*(100/n.width*(e.clientX-n.left)))])},t}(),ae=function(){function t(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var e=t.prototype;return e.init=function(t){this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.eventhandlers.push(t.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(t.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=t,window.onpopstate=this.handlePopstate.bind(this);var e=this.getQueryVariable(0);if(e){var n=this.navLookup[e],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)},e.handlePopstate=function(t){var e,n,i,r,o=null!=(e=null==(n=t.state)?void 0:n.position)?e:0,a=this.navLookup[t.state?t.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[a.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[a.videoUrlIndex,o,!0])},e.detach=function(t){this.eventhandlers&&this.eventhandlers.forEach((function(t){t()})),this.eventbus=null},e.handleBeforeRequestVideoUrl=function(t,e,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(t){r.pushState(t)}])},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return""},e.handlePushHistoryState=function(t){this.pushState(t)},e.pushState=function(t){if(t&&t.navigationData&&t.navigationData.visible){var e,n=void 0!==t.position?t.position:-1;n<0&&(null==(e=this.eventbus)||e.broadcast("request-current-video-position",[function(t){n=t>3?t-3:0}]));var i=window.history.state;i&&i.navigationId!==t.navigationData.id?window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n):i&&i.navigationId===t.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},t.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n),window.document.title=t.title}},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),se=function(){function t(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var e=t.prototype;return e.attach=function(t){var e=t.on(tt.TIME,this.onTimeHandler.bind(this)),n=t.on(tt.SEEKED,this.onSeekedHandler.bind(this)),i=t.on(tt.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[e,i,n])},e.detach=function(t){this.internalDetach()},e.internalDetach=function(t){t&&t.forEach((function(t){t()}))},e.languageChangeHandler=function(t){this.currentLanguage=t,this.lastFunc&&this.lastFunc()},e.removeTitle=function(t){null==t||t.empty(),this.lastFunc=null},e.onTimeHandler=function(t){var e=this.actionLookup[t.position];e&&(e(),this.lastFunc=e)},e.onSeekedHandler=function(t){for(var e=t.position,n=this.actionLookup[e];!n&&--e>=0;)n=this.actionLookup[e];n?(n(),this.lastFunc=n):this.removeTitle()},e.setTitle=function(t,e){this.currentLanguage&&t.html(e[this.currentLanguage])},e.createActionLookup=function(t,e){for(var n=t.subtitleData,i=n[0].titles,r={},o=0,a=i.length;o<a;o++){for(var s={},u=0,c=n.length;u<c;u++){var l=n[u];s[l.lang]=l.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,e,s),r[i[o].duration.end]=this.removeTitle}return r},e.init=function(t){var e=t.selectedElement;this.removeTitle=this.removeTitle.bind(this,e),this.currentLanguage=t.language,this.actionLookup=this.createActionLookup(t,e)},t}(),ue={__proto__:null,EventListenerController:ee,LabelController:ne,LottieController:ie,NavigationController:re,ProgressbarController:oe,RoutingController:ae,SubtitlesController:se},ce={__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"}},endWhen:function(){return{description:"Ends the current when block"}},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(t){return b(Math[t])})).map((function(t){return{value:t}})),mathResult:"ParameterType:number"}}},otherwise:function(){return{description:"Inverts the control flow for `when` logic"}},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}}}},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}}}},when:function(){return{description:"Evaluates the given expression, when it evaluates to false context.skipNextOperation will be set to true",properties:{expression:{type:"ParameterType:expression",required:!0}}}}},le=function(){function t(){}return t.prototype.getOperationNames=function(){return Object.keys(Mt)},t}(),he=function(){function t(){}return t.prototype.getControllerNames=function(){return Object.keys(ue)},t}(),de=function(){function t(){}return t.prototype.getOperationMetadata=function(t){var e=ce[t];if(!e)throw new Error("Could not find metadata for operation called "+t);return e()},t}(),pe=function(){function t(){}return t.prototype.getEventNames=function(){return Object.values(tt)},t}(),fe=function(){function t(t,e){this.importer=void 0,this.eventbus=void 0,this.importer=t,this.eventbus=e}return t.prototype.process=function(t,n){if(_e(t,t,this.importer),!e.isDefined(t.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:t.id,engine:m({},t.engine),timelineProviderSettings:I(t.timelineProviderSettings),containerSelector:t.containerSelector,language:t.language,layoutTemplate:t.layoutTemplate,availableLanguages:I(t.availableLanguages),actions:ye(t.actions,this.importer,this.eventbus),initActions:ye(t.initActions,this.importer,this.eventbus),labels:I(t.labels),timelineFlow:I(t.timelineFlow),timelines:ve(t.timelines,this.importer,this.eventbus)},r=[];return t.eventActions&&n&&(r=function(t,e,n,i){return t.map((function(t){return ge(t,n)})).map((function(n,r){var o=t[r],a=o.eventName,s=o.eventTopic,u=new P(n.name,n.startOperations,i);return e.registerAction(u,a,s),u}))}(t.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(t,e){var n;return m({},t,((n={})[e.name]=e,n))}),{}),i]},t}();function ve(t,e,n){var i=be.bind(null,e,n);return t.map((function(t){return m({},t,{timelineActions:t.timelineActions.map(i)})}))}function me(t,e){var n;return{id:e.id,systemName:e.systemName,operationData:null!=(n=I(e.operationData))?n:{},instance:t.import(e.systemName)[e.systemName]}}function ge(t,e){var n=me.bind(null,e);return{id:t.id,name:t.name,startOperations:t.startOperations.map(n)}}function Ee(t,e){var n=me.bind(null,e);return m({},ge(t,e),{endOperations:t.endOperations.map(n)})}function be(t,e,n){var i,r=Ee(n,t),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},a=r.id,s=new O(r.name,r.startOperations,r.endOperations,o,e);return s.id=a,s}function ye(t,e,n){return t.map((function(t){return Ee(t,e)})).map((function(t){var e=new L(t.name,t.startOperations,t.endOperations,n);return e.id=t.id,e}))}function _e(t,n,i){e.isDefined(t)&&(Array.isArray(t)?t.forEach((function(t){_e(t,n,i)})):Object.keys(t).forEach((function(e){!function(t,e,n,i){var r,o=e[t];if(M(o)){if(o.startsWith("config:")){var a=o.substring(7,o.length);e[t]=(r=n,F(a.split("."),r))}else if(o.startsWith("template:")){var s=o.substring(9,o.length),u=i.import(s)[s];e[t]=u}else if(o.startsWith("json:")){var c=o.substring(5,o.length),l=i.import(c)[c];e[t]=l}}else y(o)&&_e(o,n,i)}(e,t,n,i)})))}var Te=function(){function t(t,e,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=t,this.eventbus=e,this.timelineProviders=n,this.languageManager=i}var e=t.prototype;return e.init=function(){var t;this._createLayoutTemplate(),this._addInitialisationListeners();var e=this.configuration.timelines;return this._currentTimelineUri=null!=(t=null==e?void 0:e[0].uri)?t:"",this._createTimelineLookup(),this._initializeTimelineProvider()},e._createLayoutTemplate=function(){var t=this.configuration.containerSelector,e=u.default(t);if(!e||!e.length)throw new Error("Container selector not found: "+t);var n=this.configuration.layoutTemplate;n&&n.length?e.html(n):console.warn("layoutTemplate is empty, unable to create layout")},e._initializeTimelineProvider=function(){var t=v(p().mark((function t(){var e,n,i,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(e=this.configuration.timelines)&&e.length){t.next=2;break}throw new Error("No timelines present");case 2:if(r=this.timelineProviders[(i=this.configuration.timelines[0]).type]){t.next=6;break}throw new Error("No timeline provider configured for type "+i.type);case 6:if(null==(n=this._activeTimelineProvider)||n.destroy(),this._activeTimelineProvider=r.provider,this._activeTimelineProvider){t.next=10;break}throw new Error("NO ACTIVE TIMELINE PROVIDER");case 10:return t.next=12,this._activeTimelineProvider.init();case 12:return t.next=14,this._executeActions(this.configuration.initActions,"start");case 14:return t.abrupt("return",this._activeTimelineProvider);case 15:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._cleanUp=function(){var t=v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUpTimeline();case 2:return t.next=4,this._executeActions([].concat(this.configuration.initActions).reverse(),"end");case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.destroy=function(){var t=v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUp();case 2:this.languageManager.destroy(),this._activeTimelineProvider=void 0,this._eventbusRemovers.forEach((function(t){return t()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(t){return t.provider.destroy()})),u.default(this.configuration.containerSelector).empty();case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._addEventListener=function(t,e,n){this._eventbusRemovers.push(this.eventbus.on(t,e,n))},e._addInitialisationListeners=function(){this._addEventListener(tt.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector)),this._addEventListener(tt.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this)),this._addEventListener(tt.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor)),this._addEventListener(tt.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this)),this._addEventListener(tt.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this)),this._addEventListener(tt.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this)),this._addEventListener(tt.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)),this._addEventListener(tt.TIME,this._onTimeHandler.bind(this,Math.floor)),this._addEventListener(tt.SEEK,this._onSeekHandler.bind(this,Math.floor))},e._createTimelineLookup=function(){var t=this;this.configuration.timelines&&(this.configuration.timelines.forEach((function(e){e.timelineActions.forEach(t._addTimelineActionStart.bind(t,e.uri))})),this.configuration.timelines.forEach((function(e){[].concat(e.timelineActions).reverse().forEach(t._addTimelineActionEnd.bind(t,e.uri))})))},e._addTimelineActionStart=function(t,e){var n,i=e.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,t),i),o=e.start.bind(e);null!=(n=e.id)&&n.length&&(o.id=e.id,o.isStart=!0),r.push(o)},e._addTimelineActionEnd=function(t,e){var n=e.duration.end;if(n<0&&(n=e.duration.end=Infinity),isFinite(n)){var i=this._initializeTimelinePosition(this._timeLineActionsLookup[t],n),r=e.end.bind(e);e.id||(r.id=e.id),i.push(r)}},e._initializeUriLookup=function(t,e){return t[e]||(t[e]={}),t[e]},e._initializeTimelinePosition=function(t,e){return t[e]||(t[e]=[]),t[e]},e._executeActions=function(){var t=v(p().mark((function t(e,n,i){var r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i&&(i=0),!(e&&i<e.length)){t.next=6;break}return r=e[i],t.next=5,r[n]();case 5:return t.abrupt("return",this._executeActions(e,n,++i));case 6:return t.abrupt("return",Promise.resolve());case 7:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._handleRequestEngineRoot=function(t,e){e(u.default(t))},e._handleRequestTimelineUri=function(){var t=v(p().mark((function t(e,n){var i,r,o=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===n&&(n=0),this._activeTimelineProvider){t.next=3;break}return t.abrupt("return");case 3:return this._activeTimelineProvider.stop(),t.next=6,this._cleanUpTimeline();case 6:if((i=this.configuration.timelines.find((function(t){return t.uri===e})))&&this._activeTimelineProvider&&this._currentTimelineUri!==i.uri){t.next=9;break}return t.abrupt("return");case 9:this._currentTimelineUri=i.uri,this.eventbus.broadcast(tt.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(r=this.timelineProviders[i.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=r.provider),this._activeTimelineProvider.loop=i.loop,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(tt.FIRST_FRAME,v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o._activeTimelineProvider){t.next=2;break}return t.abrupt("return");case 2:return o._activeTimelineProvider.pause(),o.eventbus.broadcast(tt.DURATION,[o._activeTimelineProvider.getDuration()]),t.next=6,o._executeStartActions();case 6:o._activeTimelineProvider.seek(n),o._onSeekHandler(Math.floor,{offset:n});case 8:case"end":return t.stop()}}),t)})))),this._activeTimelineProvider.playlistItem(e);case 16:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),e._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},e._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},e._getActionsForPosition=function(t,e){return e.filter((function(e){return!e.active&&e.duration.start<=t&&e.duration.end>=t}))},e._getActiveActions=function(t){return t.filter((function(t){return t.active})).sort(xe)},e._executeRelevantActions=function(t,e){var n=this._getRelevantTimelineActions(),i=t.apply(this,[n]);return this._executeActions(i,e,0)},e._handleRequestTimelinePosition=function(t,e){var n;e(t((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},e._handleTimelineComplete=function(){this._cleanUpTimeline()},e._handleExecuteTimelineAction=function(t,e,n){var i=this._getTimelineActionsForUri(t),r=null==i?void 0:i[e];r&&(n?r.start():r.end())},e._resizeTimelineAction=function(){console.error("no resizing implemented")},e._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},e._requestCurrentTimeline=function(t){t(this._currentTimelineUri)},e._getTimelineActionsForUri=function(t){var e,n=this.configuration.timelines.find((function(e){return e.uri===t}));return null!=(e=null==n?void 0:n.timelineActions)?e:[]},e._onTimeHandler=function(t,e){if(!isNaN(e.position)){var n,i,r=t(e.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(tt.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(tt.TIME_UPDATE,[e.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},e._onSeekHandler=function(){var t=v(p().mark((function t(e,n){var i,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!isNaN(n.offset)){t.next=2;break}return t.abrupt("return");case 2:return r=e(n.offset),t.next=5,this._executeSeekActions(r);case 5:null==(i=this._activeTimelineProvider)||i.start();case 6:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),e._executeActionsForPosition=function(t){this._lastPosition=t;var e=this._timeLineActionsLookup[this._currentTimelineUri];if(e){var n=e[t];null==n||n.forEach((function(t){t()}))}},e._executeSeekActions=function(){var t=v(p().mark((function t(e){var n,i,r,o;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this._getRelevantTimelineActions()){t.next=3;break}return t.abrupt("return",Promise.resolve());case 3:return i=this._getActiveActions(n).reverse(),r=this._getActionsForPosition(e,n),o=this._executeActions(i,"end",0),t.next=8,o;case 8:return t.abrupt("return",this._executeActions(r,"start",0));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),xe=function(t,e){return e.duration.start<t.duration.start?-1:e.duration.start>t.duration.start?1:0},we=function(){function t(){this._actionRegistry=new Map}var e=t.prototype;return e.registerAction=function(t,e,n){var i;n&&n.length&&(e=e+":"+n),this._actionRegistry.has(e)||this._actionRegistry.set(e,[]),null==(i=this._actionRegistry.get(e))||i.push(t)},e.handleEvent=function(t,e,n){e&&(t=t+":"+e);var i=this._actionRegistry.get(t);if(i){var r={eventArgs:n};i.forEach((function(t){t.start(r)}))}},t}(),Ie=function(){function t(){this.eventHandlers=new Map,this.eventInterceptors=new Map,this.eventListeners=[],this.clear()}var e=t.prototype;return e.clear=function(){this.eventHandlers=new Map,this.eventListeners=[],this.eventInterceptors=new Map},e._getEventInterceptors=function(t,e){return e&&(t=t+":"+e),this.eventInterceptors.has(t)||this.eventInterceptors.set(t,[]),this.eventInterceptors.get(t)},e._getEventHandlers=function(t,e){return e&&(t=t+":"+e),this.eventHandlers.has(t)||this.eventHandlers.set(t,[]),this.eventHandlers.get(t)},e.on=function(t,e,n){var i=this;return this._getEventHandlers(t,n).push(e),function(){i.off(t,e,n)}},e.once=function(t,e,n){var i=this,r=function r(){e.apply(void 0,arguments),i.off(t,r,n)};return this.on(t,r,n),function(){i.off(t,r,n)}},e.off=function(t,e,n){var i=this._getEventHandlers(t,n);if(i){var r=i.indexOf(e);r>-1&&i.splice(r,1)}},e.broadcast=function(t,e){this._callHandlers(t,void 0,e)},e.broadcastForTopic=function(t,e,n){this._callHandlers(t,e,n)},e.registerEventlistener=function(t){var e=this;return this.eventListeners.push(t),function(){var n=e.eventListeners.indexOf(t);n>-1&&e.eventListeners.splice(n,1)}},e.registerInterceptor=function(t,e,n){var i=this._getEventInterceptors(t,n);return i.push(e),function(){var t=i.indexOf(e);t>-1&&i.splice(t,1)}},e._callHandlers=function(t,e,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(t,e);r&&(this._getEventInterceptors(t,e).forEach((function(t){n=t.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(t,e,n)})),null!=(i=n)&&i.length?r.forEach((function(t){return t.apply(void 0,n)})):r.forEach((function(t){return t()})))},t}(),Pe=function(){function t(t){this.eventbus=void 0,this.eventbus=t}return t.prototype.intercept=function(t){return this.eventbus.broadcast(tt.BEFORE_REQUEST_TIMELINE_URI,t.slice()),t},t}(),Le={__proto__:null,ActionRegistryEventbusListener:we,Eventbus:Ie,RequestVideoUriInterceptor:Pe},Oe=function(){function t(t,e,n){if(this._currentLanguage=void 0,this._eventbus=void 0,this._labelLookup=void 0,this._eventbusRemovers=[],this._currentLanguage=t,this._eventbus=n,!t)throw new Error("language ctor arg cannot have zero length");var i;i=t,H().defaultLanguage=i,this._setRootElementLang(t),this._labelLookup=this._createLabelLookup(e),this._addEventbusListeners(n)}var e=t.prototype;return e.destroy=function(){this._eventbusRemovers.forEach((function(t){return t()}))},e._addEventbusListeners=function(t){this._eventbusRemovers.push(t.on(tt.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusRemovers.push(t.on(tt.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusRemovers.push(t.on(tt.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusRemovers.push(t.on(tt.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},e._handleRequestCurrentLanguage=function(t){t(this._currentLanguage)},e._handleRequestLabelCollection=function(t,e){e(this._labelLookup[t])},e._handleRequestLabelCollections=function(t,e){var n=this;e(t.map((function(t){return n._labelLookup[t]})))},e._handleLanguageChange=function(t){t&&t.length?(this._currentLanguage=t,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},e._setRootElementLang=function(t){var e=this;this._eventbus.broadcast(tt.REQUEST_ENGINE_ROOT,[function(n){var i=e._extractLanguageFromCulture(t);u.default(n).attr("lang",i)}])},e._extractLanguageFromCulture=function(t){return t.indexOf("-")>-1?t.split("-").shift():t},e._createLabelLookup=function(t){return t.reduce((function(t,e){return t[e.id]=e.labels,t}),{})},t}(),Se=function(){function t(t,e,n){var i,r;this._actionsLookup={},this._eventbus=void 0,this._eventRemovers=[],this._importer=void 0,this._resizeTimeout=-1,this._importer=t,this._eventbus=null!=(i=null==n?void 0:n.eventbus)?i:new Ie,x.active=null!=(r=null==n?void 0:n.devtools)&&r,x.active&&this._initializeDevtools(this._eventbus),this._eventRemovers.push(this._eventbus.on(tt.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(tt.REQUEST_ACTION,this._requestActionHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(tt.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 a=this._resizeHandler.bind(this),s=u.default(e);s.on("resize",a),this._eventRemovers.push((function(){return s.off("resize",a)}))}var e=t.prototype;return e._handleSpacePress=function(t,e){return t.preventDefault(),this._eventbus.broadcast(tt.PLAY_TOGGLE_REQUEST),!1},e._initializeDevtools=function(t){var e=this,n=window.__ELIGIUS_DEV_TOOLS__;if(n){var i=n.agent;this._eventRemovers.push(t.registerEventlistener(new T(i))),this._eventRemovers.push(i.subscribe((function(t){if("playcontrol"===t.type)switch(t.data.kind){case"play":e._eventbus.broadcast(tt.PLAY_REQUEST);break;case"stop":e._eventbus.broadcast(tt.STOP_REQUEST);break;case"pause":e._eventbus.broadcast(tt.PAUSE_REQUEST);break;case"seek":e._eventbus.broadcast(tt.SEEK_REQUEST,[t.data.args])}}))),x.send=function(t,e){var n=_(e);try{i.postMessage(t,n)}catch(t){console.error("postmessage failed"),console.error(t),console.log("message",n)}},x.send("eligius-diagnostics-factory","Diagnostics initialized")}else console.warn("__ELIGIUS_DEV_TOOLS__ property not found on window, please install the Eligius Devtools extension.")},e.destroy=function(){this._eventRemovers.forEach((function(t){return t()}))},e._resizeHandler=function(){var t=this;this._resizeTimeout&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=-1),this._resizeTimeout=setTimeout((function(){t._eventbus.broadcast(tt.RESIZE)}),200)},e._importSystemEntryWithEventbusDependency=function(t){return new(this._importSystemEntry(t))(this._eventbus)},e._importSystemEntry=function(t){return this._importer.import(t)[t]},e._requestInstanceHandler=function(t,e){e(this._importSystemEntryWithEventbusDependency(t))},e._requestFunctionHandler=function(t,e){e(this._importSystemEntry(t))},e._requestActionHandler=function(t,e){var n=this._actionsLookup[t];n?e(n):(console.error("Unknown action: "+t),e(null))},e.createEngine=function(t,e){var n,i=this._importSystemEntry(t.engine.systemName),r=void 0;null!=(n=t.eventActions)&&n.length&&(r=new we,this._eventRemovers.push(this._eventbus.registerEventlistener(r))),this._eventRemovers.push(this._eventbus.registerInterceptor(tt.REQUEST_TIMELINE_URI,new Pe(this._eventbus)));var o=(e=e||new fe(this._importer,this._eventbus)).process(t,r),a=o[1];this._actionsLookup=o[0];var s=this._createTimelineProviders(a,this._eventbus),u=new Oe(t.language,t.labels,this._eventbus);return new i(a,this._eventbus,s,u)},e._createTimelineProviders=function(t,e){var n=this;return Object.entries(t.timelineProviderSettings).reduce((function(i,r){var o=r[0],a=r[1];if(!a)return i;var s=n._importSystemEntry(a.systemName);return i[o]={id:a.id,vendor:a.vendor,provider:new s(e,t)},i}),{})},t}(),Ce=Mt,Ne=ue,Ae=Zt,Re=Le,De=function(){function t(){this.engines=new Map,this.engines.set("EligiusEngine",Te)}var e=t.prototype;return e.getOperationNames=function(){return Object.keys(Ce)},e.getControllerNames=function(){return Object.keys(Ne)},e.getProviderNames=function(){return Object.keys(Ae)},e.import=function(t){var e,n,i,r,o,a=null!=(e=null!=(n=null!=(i=null!=(r=Ce[t])?r:Ne[t])?i:Ae[t])?n:Re[t])?e:this.engines.get(t);return(o={})[t]=a,o},t}();exports.Action=P,exports.ActionCreator=Qt,exports.ActionCreatorFactory=Ft,exports.ActionEditor=Vt,exports.ActionRegistryEventbusListener=we,exports.ConfigurationFactory=te,exports.ConfigurationResolver=fe,exports.ControllerNamesProvider=he,exports.DEV_TOOLS_KEY="__ELIGIUS_DEV_TOOLS__",exports.DevToolEventListener=T,exports.Diagnostics=x,exports.EligiusEngine=Te,exports.EligiusResourceImporter=De,exports.EndableAction=L,exports.EndableActionCreator=Ht,exports.EndableActionEditor=Bt,exports.EngineFactory=Se,exports.EventListenerController=ee,exports.Eventbus=Ie,exports.JwPlayerTimelineProvider=Yt,exports.LabelController=ne,exports.LanguageManager=Oe,exports.LottieController=ie,exports.NavigationController=re,exports.OperationEditor=Kt,exports.OperationMetadataProvider=de,exports.OperationNamesProvider=le,exports.ProgressbarController=oe,exports.RequestAnimationFrameTimelineProvider=Jt,exports.RequestVideoUriInterceptor=Pe,exports.RoutingController=ae,exports.SubtitlesController=se,exports.TimeLineEventNamesProvider=pe,exports.TimelineAction=O,exports.TimelineActionCreator=zt,exports.TimelineActionEditor=Wt,exports.TimelineEventNames=tt,exports.TimelineProviderSettingsEditor=$t,exports.TimelineProvidersSettingsEditor=Xt,exports.addClass=A,exports.addControllerToElement=k,exports.animate=q,exports.animateWithClass=j,exports.broadcastEvent=V,exports.calc=J,exports.clearElement=Z,exports.clearOperationData=X,exports.createElement=$,exports.customFunction=et,exports.endAction=nt,exports.endLoop=it,exports.endWhen=rt,exports.extendController=ot,exports.generateImporterSourceCode=function(t,e,n){var i=function(t,e,n){return[].concat(function(t){var e,n=C(t.initActions.concat(t.actions).concat(null!=(e=t.eventActions)?e:[]));if(t.timelines){var i=t.timelines.flatMap((function(t){return t.timelineActions}));n=n.concat(C(i))}return N(n)}(t),n.flatMap((function(t){return i=t.extension,c.default.readdirSync(l.default.join(e,n=t.path)).map((function(t){return{systemName:""+l.default.basename(t,i).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()})),path:"./"+n+"/"+t,defaultImport:!0}}));var n,i})),function(t){var e,n,i,r,o=[];return(e=o).push.apply(e,S(t.initActions)),(n=o).push.apply(n,S(t.actions)),(i=o).push.apply(i,S(t.timelines.flatMap((function(t){return t.timelineActions})))),(r=o).push.apply(r,S(t.eventActions)),N(o)}(t),function(t){return t.timelineProviderSettings?Object.values(t.timelineProviderSettings).map((function(t){return{systemName:t.systemName}})):[]}(t),function(t){return t.engine?[{systemName:t.engine.systemName}]:[]}(t))}(t,e,n),r=function(t){var e=t.filter((function(t){return t.defaultImport})).map((function(t){return"import "+t.systemName+" from '"+t.path+"';"})).concat(t.filter((function(t){return!t.defaultImport})).map((function(t){var e;return"import {"+t.systemName+"} from '"+(null!=(e=t.path)?e:"eligius")+"';"})));return e.push("import { ISimpleResourceImporter } from 'eligius';"),e.push(""),e.push("const imports: Record<string, any> = {"),e.push.apply(e,t.map((function(t){return t.systemName+": { '"+t.systemName+"': "+t.systemName+" },"}))),e.push("};"),e.push(""),e.push("class EligiusResourceImporter implements ISimpleResourceImporter {"),e.push("import(name: string): Record<string, any> {"),e.push("if (imports.hasOwnProperty(name)) { return imports[name]; }"),e.push("throw Error(`Unknown systemName: ${name}`);"),e.push("}}"),e.push(""),e.push("export default EligiusResourceImporter;"),e.join("\n")}(i);return r},exports.getControllerFromElement=at,exports.getControllerInstance=st,exports.getElementDimensions=ut,exports.getImport=ct,exports.getQueryParams=lt,exports.invokeObjectMethod=ht,exports.loadJSON=pt,exports.log=ft,exports.math=vt,exports.metadata=ce,exports.otherwise=gt,exports.removeClass=Et,exports.removeControllerFromElement=bt,exports.removeElement=yt,exports.removePropertiesFromOperationData=_t,exports.reparentElement=Tt,exports.requestAction=xt,exports.resizeAction=wt,exports.selectElement=Pt,exports.setElementAttributes=Lt,exports.setElementContent=Ot,exports.setGlobalData=St,exports.setOperationData=Ct,exports.setStyle=Nt,exports.startAction=At,exports.startLoop=Rt,exports.toggleClass=Dt,exports.toggleElement=Ut,exports.wait=kt,exports.when=qt;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("jquery"),e=require("ts-is-present"),n=require("fs"),i=require("path"),r=require("uuid"),o=require("lottie-web"),a=require("hotkeys-js");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=s(t),c=s(n),l=s(i),h=s(o),d=s(a);function p(){p=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var r=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new x(i||[]);return r._invoke=function(t,e,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 a=n.delegate;if(a){var s=_(a,n);if(s){if(s===l)continue;return s}}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=c(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function d(){}function f(){}var v={};s(v,r,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(I([])));g&&g!==e&&n.call(g,r)&&(v=g);var E=f.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function y(t,e){function i(r,o,a,s){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function _(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=f,s(E,"constructor",f),s(f,"constructor",d),d.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},b(y.prototype),s(y.prototype,o,(function(){return this})),t.AsyncIterator=y,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new y(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(E),s(E,a,"Generator"),s(E,r,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=I,x.prototype={constructor:x,reset:function(t){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(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){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(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function f(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function v(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){f(o,i,r,a,s,"next",t)}function s(t){f(o,i,r,a,s,"throw",t)}a(void 0)}))}}function m(){return m=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},m.apply(this,arguments)}function g(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,E(t,e)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function b(t){return"function"==typeof t}function y(t){return null!==t&&"object"==typeof t}function _(t){if(Array.isArray(t))return t.map(_);if(t instanceof u.default)return"jQuery object";if(y(t)){if("class"===t.constructor.toString().substring(0,5)||!t.constructor.toString().startsWith("function Object()")){var e=t.constructor.toString();return e.substring(0,e.indexOf("{")+1)}return Object.fromEntries(Object.entries(t).map((function(t){return[t[0],_(t[1])]})))}if(b(t)){var n=t.toString();return n.indexOf("{")>-1?n.substring(0,n.indexOf("{")+1):n}return t}var T=function(){function t(t){this.agent=void 0,this.agent=t}return t.prototype.handleEvent=function(t,e,n){var i={eventName:t,eventTopic:e,args:_(n)};try{this.agent.postMessage("eligius-diagnostics-event",i)}catch(t){console.error("postmessage failed"),console.error(t),console.log("message",i)}},t}(),w=function(){function t(){}return t.send=function(t,e){console.log(t,e)},t}();w.active=void 0;var x="undefined"!=typeof structuredClone?structuredClone:function(t){return JSON.parse(JSON.stringify(t))};function I(t){return e.isDefined(t)?x(t):t}var P=function(){function t(t,e,n){this.name=void 0,this.startOperations=void 0,this.eventbus=void 0,this.id="",this._contextStack=[],this.name=t,this.startOperations=e,this.eventbus=n}var e=t.prototype;return e.start=function(t){var e,n=this;w.active&&w.send("eligius-diagnostics-action",(null!=(e=this.name)?e:"Action")+" begins executing start operations"),this._initializeContextStack();var i=new Promise((function(e,i){n.executeOperation(n.startOperations,0,e,i,t)})).catch((function(t){throw w.active&&w.send("eligius-diagnostics-action-error",{name:n.name,error:t}),console.error("Error in action start '"+n.name+"'"),console.error(t),t}));return w.active?i.then((function(t){var e;return w.send("eligius-diagnostics-action",(null!=(e=n.name)?e:"Action")+" finished executing start operations"),t})):i},e._initializeContextStack=function(){this._contextStack=[{currentIndex:-1,eventbus:this.eventbus,operations:this.startOperations}]},e._pushContext=function(t){var e={get currentIndex(){return t.currentIndex},set currentIndex(e){t.currentIndex=e},get eventbus(){return t.eventbus},get operations(){return t.operations},parent:t};return this._contextStack.push(e),e},e._popContext=function(){this._contextStack.pop()},e.executeOperation=function(t,e,n,i,r){var o=this;void 0===r&&(r={});var a,s=this._contextStack[this._contextStack.length-1];if(void 0!==s.newIndex&&(e=s.newIndex,delete s.newIndex),s.currentIndex=e,e<t.length){var u,c=t[e],l=I(null!=(u=c.operationData)?u:{}),h=Object.assign(r,l);"when"===c.systemName?s=this._pushContext(s):"startLoop"===c.systemName&&s.owner!==c&&((s=this._pushContext(s)).owner=c),w.active&&w.send("eligius-diagnostics-operation",{systemName:c.systemName,operationData:h,context:m({},s,{eventbus:void 0})});var d=c.instance.call(s,h);("endWhen"===c.systemName||"endLoop"===c.systemName&&void 0===s.newIndex)&&this._popContext(),"object"==typeof(a=d)&&"function"==typeof a.then?d.then((function(r){return o.executeOperation(t,++e,n,i,r)})).catch((function(t){i(t)})):this.executeOperation(t,++e,n,i,d)}else n(r)},t}(),L=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,r)||this).endOperations=void 0,o.endOperations=i,o}return g(e,t),e.prototype.end=function(t){var e,n=this;if(w.active&&w.send("eligius-diagnostics-action",(null!=(e=this.name)?e:"Action")+" begins executing end operations"),!this.endOperations.length)return Promise.resolve(null!=t?t:{});this._initializeContextStack();var i=new Promise((function(e,i){n.executeOperation(n.endOperations,0,e,i,t)})).catch((function(t){throw w.active&&w.send("eligius-diagnostics-action-error",{name:n.name,error:t}),console.error("Error in action end '"+n.name+"'"),t}));return w.active?i.then((function(t){var e;return w.send("eligius-diagnostics-action",(null!=(e=n.name)?e:"Action")+" finished executing start operations"),t})):i},e}(P),O=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,i,o)||this).duration=void 0,a.active=!1,a.duration=r,a}g(e,t);var n=e.prototype;return n.start=function(e){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,t.prototype.start.call(this,e)):Promise.resolve({})},n.end=function(e){return this.active=!1,t.prototype.end.call(this,e)},e}(L);function C(t){return t&&(e=t.flatMap((function(t){var e;return[].concat(t.startOperations,null!=(e=t.endOperations)?e:[])})))?e.filter((function(t){var e;return!(null==(e=t.operationData)||!e.hasOwnProperty("systemName"))&&t.operationData.systemName.endsWith("Controller")})).map((function(t){var e;return{systemName:(null!=(e=t.operationData)?e:{}).systemName}})):[];var e}function S(t){return t&&(e=t.flatMap((function(t){var e;return[].concat(t.startOperations,null!=(e=t.endOperations)?e:[])})))?e.map((function(t){return{systemName:t.systemName}})):[];var e}function N(t){var e={};return t.filter((function(t){return!e[t.systemName]&&(e[t.systemName]=!0,!0)}))}var A=function(t){return t.selectedElement.addClass(t.className),t},R=function(t,e){return e.data(t)}.bind(null,"eligiusEngineControllers");function D(t,e){return m({},t,e)}function U(t,e,n){t(n?D(e,n):e)}var k=function(t){var e=t.controllerInstance;!function(t,e){t.data("eligiusEngineControllers")||t.data("eligiusEngineControllers",[]);var n=R(t);n&&n.push(e)}(t.selectedElement,e),e.init(t);var n=e.attach(this.eventbus);return n?new Promise((function(e,i){n.then((function(n){U(e,t,n)}),i)})):t},q=function(t){var e=t.animationEasing,n=t.selectedElement,i=t.animationProperties,r=t.animationDuration;return new Promise((function(o,a){try{e?n.animate(i,r,e,(function(){U(o,{},t)})):n.animate(i,r,(function(){U(o,{},t)}))}catch(t){a(t)}}))},j=function(t){var e=t.selectedElement,n=t.className,i=t.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{e.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&e.removeClass(n),U(r,{},t)}))}catch(t){o(t)}}));return e.addClass(n),r};function M(t){return"string"==typeof t}function F(t,e){var n=e,i=null;return t.forEach((function(e,r){if(r===t.length-1){var o=e.split("+");o.length>1&&(e=o[0],i=o[1])}n=n[e]})),i?""+n+i:n}var Q={},H=function(t,e){var n=e?t[e]:t;return n&&n!==t?I(n):n}.bind(null,Q),z=function(t,e){Object.entries(e).forEach((function(e){return t[e[0]]=e[1]}))}.bind(null,Q);function G(t,e,n){if(M(n)){var i,r=n.split(".");switch(null==(i=r.shift())?void 0:i.toLowerCase()){case"operationdata":return F(r,t);case"globaldata":return F(r,H());case"context":return F(r,e)}}return n}var V=function(t){var e=t.eventTopic,n=t.eventName,i=function(t,e,n){if(n){var i=G.bind(null,t,e);return n.map(i)}}(t,this,t.eventArgs);return e?this.eventbus.broadcastForTopic(n,e,i):this.eventbus.broadcast(n,i),function(t){delete t.eventName,delete t.eventTopic,delete t.eventArgs}(t),t},B=[];function W(t,e,n){var i=n!==t?I(n):n;return K(n,i,G.bind(null,t,e)),i}function K(t,e,n){if(!(B.indexOf(t)>-1)){B.push(t);try{Object.entries(t).forEach((function(t){var i=t[0],r=t[1];r instanceof u.default||(M(r)?e[i]=n(r):Array.isArray(r)?r.forEach((function(t,e,i){M(t)?i[e]=n(t):K(t,t,n)})):y(r)&&K(r,r,n))}))}finally{var i=B.indexOf(t);B.splice(i,1)}}}var Y={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"**":function(t,e){return Math.pow(t,e)}},J=function(t){return(t=W(t,this,t)).calculationResult=Y[t.operator](+t.left,+t.right),t},Z=function(t){return t.selectedElement.empty(),t},X=function(t){var e=t.properties;return e?(e.forEach((function(e){delete t[e]})),delete t.properties,t):{}},$=function(t){var e=(t=W(t,this,t)).elementName,n=t.attributes,i=t.text,r=n?" "+Object.entries(n).filter((function(t){return Boolean(t[1])})).map((function(t){return t[0]+'="'+t[1]+'"'})).join(" "):"",o=u.default(i?"<"+e+r+">"+i+"</"+e+">":"<"+e+r+"/>");return t.template=o,t},tt=function(){};tt.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",tt.PLAY_REQUEST="timeline-play-request",tt.STOP_REQUEST="timeline-stop-request",tt.PAUSE_REQUEST="timeline-pause-request",tt.SEEK_REQUEST="timeline-seek-request",tt.RESIZE_REQUEST="timeline-resize-request",tt.CONTAINER_REQUEST="timeline-container-request",tt.DURATION_REQUEST="timeline-duration-request",tt.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",tt.DURATION="timeline-duration",tt.TIME="timeline-time",tt.SEEKED="timeline-seeked",tt.COMPLETE="timeline-complete",tt.RESTART="timeline-restart",tt.PLAY="timeline-play",tt.STOP="timeline-stop",tt.PAUSE="timeline-pause",tt.SEEK="timeline-seek",tt.RESIZE="timeline-resize",tt.POSITION_UPDATE="timeline-position-update",tt.TIME_UPDATE="timeline-time-update",tt.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",tt.FIRST_FRAME="timeline-firstframe",tt.REQUEST_INSTANCE="request-instance",tt.REQUEST_ACTION="request-action",tt.REQUEST_FUNCTION="request-function",tt.REQUEST_TIMELINE_URI="request-timeline-uri",tt.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",tt.REQUEST_ENGINE_ROOT="request-engine-root",tt.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",tt.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",tt.EXECUTE_TIMELINEACTION="execute-timelineaction",tt.RESIZE_TIMELINEACTION="resize-timelineaction",tt.REQUEST_LABEL_COLLECTION="request-label-collection",tt.REQUEST_LABEL_COLLECTIONS="request-label-collections",tt.REQUEST_CURRENT_LANGUAGE="request-current-language",tt.LANGUAGE_CHANGE="language-change";var et=function(t){var e=this,n=t.systemName;return new Promise((function(i,r){e.eventbus.broadcast(tt.REQUEST_FUNCTION,[n,function(n){var o=n.apply(e,[t]);o?o.then((function(){U(i,{},t)}),r):U(i,{},t)}])}))},nt=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=D(t,n),e.end(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),U(i,t)}),r)}))},it=function(t){return void 0!==this.loopIndex&&void 0!==this.loopLength&&this.loopIndex<this.loopLength&&(this.loopIndex=this.loopIndex+1,this.newIndex=this.loopStartIndex,delete this.currentItem),t},rt=function(t){return delete this.whenEvaluation,t},ot=function(t){return t.controllerInstance=Object.assign(t.controllerInstance,t.controllerExtension),t},at=function(t){var e=t.controllerName,n=R(t.selectedElement).find((function(t){return t.name===e}));return n||console.warn("controller for name '"+e+"' was not found on the given element"),t.controllerInstance=n,t},st=function(t){var e=t.systemName;return t.controllerInstance=void 0,this.eventbus.broadcast(tt.REQUEST_INSTANCE,[e,function(e){t.controllerInstance=e}]),t},ut=function(t){var e,n,i=t.selectedElement,r=t.modifier,o={width:null!=(e=i.innerWidth())?e:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&(o=function(t,e){var n=m({},t),i=null;if(e.indexOf("|")>-1){var r=e.split("|");e=r[0],i=r[1]}var o=e.substring(0,1),a=function(t){var e=t.substring(t.length-1,t.length);"h"!==e&&"w"!==e&&"%"!==e&&(e=null);var n="%"===e;return n&&"h"!==(e=t.substring(t.length-1,t.length-2))&&"w"!==e&&(e=null),[e,1,n]}(e),s=a[0],u=a[2],c=parseInt(null!==s?e.substring(1,e.length-(a[1]-1)):e.substring(1),10),l=c,h=c;u&&(l=n.width/100*c,h=n.height/100*c);var d=function(t,e,n,i,r){var o=m({},t);switch(e){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: "+e)}return o}(n,o,s,l,h);return i?function(t,e){var n=m({},e),i=t.substring(0,1),r=t.substring(t.indexOf("[")+1,t.indexOf("]")-(t.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)),t.dimensions=o,t},ct=function(t){return this.eventbus.broadcast(tt.REQUEST_FUNCTION,[t.systemName,function(e){t.importedInstance=e}]),delete t.systemName,t},lt=function(t){var e=new URLSearchParams(window.location.search),n=Object.fromEntries(e.entries()),i=t.defaultValues,r=void 0===i?{}:i;return delete t.defaultValues,t.queryParams=m({},r,n),t},ht=function(t){var e=t.methodName,n=t.methodArguments;return delete t.methodName,delete t.methodArguments,t.methodResult=t.instance[e].apply(t.instance,null!=n?n:[]),t},dt={},pt=function(t){var e=t.url;return t.cache&&dt[e]?(t.json=dt[e],t):fetch(e).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=t.json=n.sent,dt[e]=r,n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}())},ft=function(t){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:t}),console.groupEnd(),t},vt=function(t){return(t=W(t,this,t)).args=t.args.map((function(t){return M(e=t)&&e in Math&&!b(Math[e])?Math[t]:t;var e})),t.mathResult=Math[t.functionName].apply(null,t.args),t};function mt(t){return t.systemName===this.self?(this.counter=this.counter+1,!1):t.systemName===this.matchingName&&0===this.counter||(t.systemName===this.matchingName&&this.counter>0&&(this.counter=this.counter-1),!1)}var gt=function(t){var e,n,i;return this.whenEvaluation&&(this.newIndex=(i=(e=this).operations.slice(n=e.currentIndex+1).findIndex(mt.bind({counter:0,self:"when",matchingName:"endWhen"})))>-1?i+n:e.operations.length),t},Et=function(t){return t.selectedElement.removeClass(t.className),t},bt=function(t){var e=t.controllerName,n=R(t.selectedElement),i=null==n?void 0:n.find((function(t){return t.name===e}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return t},yt=function(t){return t.selectedElement.remove(),t},_t=function(t){var e=t.propertyNames;return e.indexOf("propertyNames")<0&&e.push("propertyNames"),Object.fromEntries(Object.entries(t).filter((function(t){return!e.includes(t[0])})))},Tt=function(t){var e=t.newParentSelector;return t.selectedElement.remove().appendTo(e),t},wt=function(t){return this.eventbus.broadcast(tt.REQUEST_ACTION,[t.systemName,function(e){t.actionInstance=e}]),t},xt=function(t){var e=t.actionInstance;return t=D(t,t.actionOperationData),e.resize?e.resize(t):t};function It(t,e){var n=t.find(e);return n.length||console.warn("selector '"+e+"' wasn't found!"),n}var Pt=function(t){var e=t.selector,n=t.useSelectedElementAsRoot,i=void 0!==n&&n;if(!e)throw new Error("selectElement: selector is either empty or not defined.");return i&&t.selectedElement?(t.selectedElement=It(t.selectedElement,e),t):(this.eventbus.broadcast(tt.REQUEST_ENGINE_ROOT,[function(n){t.selectedElement=It(n,e)}]),t)},Lt=function(t){var e=t.selectedElement;return Object.entries(t.attributes).forEach((function(t){e.attr(t[0],t[1])})),t},Ot=function(t){var e=t.insertionType,n=void 0===e?"overwrite":e,i=t.selectedElement,r=t.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 t.insertionType,t},Ct=function(t){var e=t.properties,n=Object.fromEntries(Object.entries(t).filter((function(t){return e.includes(t[0])})));return z(n),delete t.properties,t},St=function(t){var e=t.override,n=void 0!==e&&e,i=t.properties;delete t.properties,delete t.override;var r=W(t,this,i);return n?r:Object.assign(t,r)},Nt=function(t){var e=W(t,this,t.properties);return t.selectedElement.css(e),t},At=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=D(t,n),e.start(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),U(i,t)}),r)}))},Rt=function(t){var e,n,i,r=t.collection;if(null!==r&&!Array.isArray(r))throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===this.loopIndex&&(this.loopEndIndex=(i=(e=this).operations.slice(n=e.currentIndex+1).findIndex(mt.bind({counter:0,self:"startLoop",matchingName:"endLoop"})))>-1?i+n:e.operations.length,null!=r&&r.length?(this.loopIndex=0,this.loopLength=r.length-1,this.loopStartIndex=this.currentIndex):(this.newIndex=this.loopEndIndex,delete this.loopIndex,delete this.loopLength,delete this.loopStartIndex,delete this.loopEndIndex)),null!=r&&r.length&&void 0!==this.loopIndex&&(this.currentItem=r[this.loopIndex]),t},Dt=function(t){return t.selectedElement.toggleClass(t.className),t},Ut=function(t){return t.selectedElement.toggle(),t},kt=function(t){var e=t.milliseconds;return new Promise((function(n){setTimeout((function(){U(n,t)}),e)}))},qt=function(t){var e=function(t,e,n){var i=t.split(/!=|==|>=|<=|>|</),r=i[0],o=i[1],a=t.substring(r.length,t.length-o.length),s=+r,u=+o;return[isNaN(s)?G(e,n,r):s,a,isNaN(u)?G(e,n,o):u]}(t.expression,t,this);return this.whenEvaluation=jt[e[1]](e[0],e[2]),this.whenEvaluation||(this.newIndex=function(t){var e=t.currentIndex+1,n=t.operations.slice(e),i=n.findIndex(mt.bind({counter:0,self:"when",matchingName:"otherwise"}));if(i>-1)return i+e;var r=n.findIndex(mt.bind({counter:0,self:"when",matchingName:"endWhen"}));return r>-1?r+e:t.operations.length}(this)),delete t.expression,t},jt={"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},"<":function(t,e){return t<e}},Mt={__proto__:null,addClass:A,addControllerToElement:k,animate:q,animateWithClass:j,broadcastEvent:V,calc:J,clearElement:Z,clearOperationData:X,createElement:$,customFunction:et,endAction:nt,endLoop:it,endWhen:rt,extendController:ot,getControllerFromElement:at,getControllerInstance:st,getElementDimensions:ut,getImport:ct,getQueryParams:lt,invokeObjectMethod:ht,loadJSON:pt,log:ft,math:vt,otherwise:gt,removeClass:Et,removeControllerFromElement:bt,removeElement:yt,removePropertiesFromOperationData:_t,reparentElement:Tt,requestAction:wt,resizeAction:xt,selectElement:Pt,setElementAttributes:Lt,setElementContent:Ot,setGlobalData:Ct,setOperationData:St,setStyle:Nt,startAction:At,startLoop:Rt,toggleClass:Dt,toggleElement:Ut,wait:kt,when:qt},Ft=function(){function t(t){this.configurationfactory=void 0,this.configurationfactory=t}var e=t.prototype;return e.createAction=function(t){var e=new Ht(t,this);return this.configurationfactory.addAction(e.actionConfig),e},e.createInitAction=function(t){var e=new Ht(t,this);return this.configurationfactory.addInitAction(e.actionConfig),e},e.createEventAction=function(t){var e=new Qt(t,this);return this.configurationfactory.addEventAction(e.actionConfig),e},e.createTimelineAction=function(t,e){var n=new zt(e,this);return this.configurationfactory.addTimelineAction(t,n.actionConfig),n},e.end=function(){return this.configurationfactory},t}(),Qt=function(){function t(t,e){this.factory=void 0,this.actionConfig=void 0,this.factory=e,this.actionConfig={name:"",id:r.v4(),startOperations:[]},null!=t&&t.length&&(this.actionConfig.name=t)}var e=t.prototype;return e.getId=function(){return this.actionConfig.id},e.setName=function(t){return this.actionConfig.name=t,this},e.getConfiguration=function(t){var e=I(this.actionConfig),n=t.call(this,e);return n&&(this.actionConfig=n),this},e.addStartOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addStartOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},e.addStartOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);return this.actionConfig.startOperations.push({id:r.v4(),systemName:t,operationData:e}),this},e.next=function(){return this.factory},t}(),Ht=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).actionConfig.endOperations=[],i}g(e,t);var n=e.prototype;return n.addEndOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addEndOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},n.addEndOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);var n=this.actionConfig.endOperations;return n||(n=this.actionConfig.endOperations=[]),n.push({id:r.v4(),systemName:t,operationData:e}),this},e}(Qt),zt=function(t){function e(){return t.apply(this,arguments)||this}return g(e,t),e.prototype.addDuration=function(t,e){return this.actionConfig.duration={start:t},e&&(this.actionConfig.duration.end=e),this},e}(Ht);function Gt(t,e,n){n>=t.length?n=0:n<0&&(n=t.length-1),t.splice(n,0,t.splice(e,1)[0])}var Vt=function(){function t(t,e){this.actionConfig=void 0,this.configurationFactory=void 0,this.actionConfig=t,this.configurationFactory=e}var n=t.prototype;return n.updateConfiguration=function(){this.actionConfig=m({},this.actionConfig)},n.getConfiguration=function(t){var e=I(this.actionConfig),n=t.call(this,e);return n&&(this.actionConfig=n),this},n.setName=function(t){return this.actionConfig=m({},this.actionConfig,{name:t}),this},n.getName=function(){return this.actionConfig.name},n.addStartOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addStartOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},n.addStartOperation=function(t,e,n){if(!Mt[t])throw Error("Unknown operation: "+t);var i=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],o={id:null!=n?n:r.v4(),systemName:t,operationData:e};return i.push(o),this.actionConfig=m({},this.actionConfig,{startOperations:i}),new Kt(o,this)},n.editStartOperation=function(t){var n=this.actionConfig.startOperations.find((function(e){return e.id===t}));if(e.isDefined(n))return new Kt(n,this);throw new Error("start operation not found for id "+t)},n.removeStartOperation=function(t){var e=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],n=e.find((function(e){return e.id===t}));if(!n)throw new Error("start operation not found for id "+t);var i=e.indexOf(n);return i>-1&&(e.splice(i,1),this.actionConfig=m({},this.actionConfig,{startOperations:e})),this},n.moveStartOperation=function(t,e){var n=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],i=n.find((function(e){return e.id===t}));if(!i)throw new Error("start operation not found for id "+t);var r=n.indexOf(i);return r>-1&&(Gt(n,r,"up"===e?r+1:r-1),this.actionConfig=m({},this.actionConfig,{startOperations:n})),this},n.next=function(){return this.configurationFactory},t}(),Bt=function(t){function n(){return t.apply(this,arguments)||this}g(n,t);var i=n.prototype;return i.addEndOperationByType=function(t,e){var n=Object.entries(Mt).find((function(e){return e[1]===t}));if(n)return this.addEndOperation(n[0],e);throw new Error("Operation class not found: "+t.toString())},i.addEndOperation=function(t,e){if(!Mt[t])throw Error("Unknown operation: "+t);var n=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i={id:r.v4(),systemName:t,operationData:e};return n.push(i),this.actionConfig.endOperations=n,new Kt(i,this)},i.editEndOperation=function(t){var n=this.actionConfig.endOperations.find((function(e){return e.id===t}));if(e.isDefined(n))return new Kt(n,this);throw new Error("operation not found for id "+t)},i.removeEndOperation=function(t){var n=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i=n.find((function(e){return e.id===t}));if(!e.isDefined(i))throw new Error("operation not found for id "+t);var r=n.indexOf(i);return r>-1&&(n.splice(r,1),this.actionConfig=m({},this.actionConfig,{endOperations:n})),this},i.moveEndOperation=function(t,n){var i=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],r=i.find((function(e){return e.id===t}));if(!e.isDefined(r))throw new Error("operation not found for id "+t);var o=i.indexOf(r);return o>-1&&(Gt(i,o,"up"===n?o+1:o-1),this.actionConfig=m({},this.actionConfig,{endOperations:i})),this},n}(Vt),Wt=function(t){function e(){return t.apply(this,arguments)||this}return g(e,t),e.prototype.setDuration=function(t,e){if(null!=e&&t>e)throw Error("start position cannot be higher than end position");var n={start:t};return e&&(n.end=e),this.actionConfig=m({},this.actionConfig,{duration:n}),this},e}(Bt),Kt=function(){function t(t,e){this.operationConfig=void 0,this.actionEditor=void 0,this.operationConfig=t,this.actionEditor=e}var e=t.prototype;return e.getConfiguration=function(t){var e=I(this.operationConfig),n=t.call(this,e);return n&&(this.operationConfig=n),this},e.getSystemName=function(){return this.operationConfig.systemName},e.setSystemName=function(t){if(!Mt[t])throw Error("Unknown operation: "+t);return this.operationConfig.systemName=t,this.actionEditor.updateConfiguration(),this},e.setOperationData=function(t){return this.operationConfig.operationData=t,this.actionEditor.updateConfiguration(),this},e.setOperationDataItem=function(t,e){var n=this.operationConfig.operationData,i=void 0===n?{}:n;return i[t]=e,this.setOperationData(i)},e.getOperationDataKeys=function(){var t=this.operationConfig.operationData;return t?Object.keys(t):[]},e.getOperationDataValue=function(t){var e=this.operationConfig.operationData;return null==e?void 0:e[t]},e.next=function(){return this.actionEditor},t}(),Yt=function(){function t(t,e){this.eventbus=void 0,this.config=void 0,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=r.v4(),this.loop=!1,this.eventbus=t,this.config=e,this._addEventListeners()}var e=t.prototype;return e._extractUrls=function(t){return t.timelines.filter((function(t){return"mediaplayer"===t.type})).map((function(t){return t.uri}))},e.init=function(){var t=this,e=this.config.timelineProviderSettings.mediaplayer;if(!e)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=e.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 a=o.innerWidth(),s=o.innerHeight();return 0===a&&(a=100),0===s&&(s=300),this._player=r(n),this._player.setup({file:i[0],image:e.poster,height:s,width:a,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){t._playlist.push({file:n,title:n,image:e.poster})})),new Promise((function(e){t._player.once("ready",(function(){t._handlePlayerReady(e)})),t._player.load(t._playlist)}))},e._handlePlayerReady=function(t){var e=this;this._player.once("firstFrame",(function(){e._player.pause(),e.eventbus.broadcast(tt.DURATION,[e.getDuration()]),t()})),this._player.on(tt.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(tt.SEEKED,this._seekedHandler.bind(this)),this._player.on(tt.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){e._player.play()}),10)},e._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(tt.COMPLETE,[this._player.getPlaylistIndex()]))},e._seekedHandler=function(){this.eventbus.broadcast(tt.SEEKED,[this.getPosition(),this.getDuration()])},e.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(t){return t()}))},e._loopHandler=function(t,e){var n=t(e.position);this.loop&&n===t(this._player.getDuration()-1)&&this.seek(0)},e._timeResetLoopHandler=function(){this.loop&&this.seek(0)},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(tt.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.DURATION_REQUEST,this.duration.bind(this)))},e._container=function(t){var e="";"html5"!==this._player.getProvider().name&&(e="_wrapper"),t(u.default("#"+this._videoElementId+e))},e.toggleplay=function(){this._paused?this.start():this.pause()},e.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(tt.PLAY)},e.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(tt.STOP)},e.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(tt.PAUSE)},e.seek=function(t){var e=this._player.getPosition();this._player.seek(t),this.eventbus.broadcast(tt.SEEK,[t,e,this._player.getDuration()])},e.resize=function(t,e){this._player.resize(t,e),this.eventbus.broadcast(tt.RESIZE,[t,e])},e.duration=function(t){t(Math.floor(this.getDuration()))},e.playlistItem=function(t){var e=this._playlist.findIndex((function(e){return e.file===t}));e>-1&&this._player.playlistItem(e)},e.getPosition=function(){return this._player.getPosition()},e.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},e.getState=function(){return this._player.getState()},e.getDuration=function(){return this._player.getDuration()},e.getMute=function(){return this._player.getMute()},e.getVolume=function(){return this._player.getVolume()},e.setMute=function(t){this._player.setMute(t)},e.setVolume=function(t){this._player.setVolume(t)},t}(),Jt=function(){function t(t,e){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=t,this.config=e,this.eventbus=t,this.config=e,this._playlist=this._extractPlaylist(e),this._currentPlaylistItem=this._playlist[0]}var e=t.prototype;return e._extractPlaylist=function(t){return t.timelines.filter((function(t){return"animation"===t.type}))},e.playlistItem=function(t){if(null!==t&&t.length&&0!==this._playlist.length){var e=this._playlist.find((function(e){return e.uri===t}));if(!e)throw new Error("Unknown playlist uri: "+t);this._currentPlaylistItem=e,this._firstFrame=!0}},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(tt.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(tt.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},e._update=function(t){if("running"===this.playState){if(this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(tt.COMPLETE);this._resetToStartPosition(),this.eventbus.broadcast(tt.RESTART),this._broadCastPosition()}this._broadCastPosition()}},e._broadCastPosition=function(){this.eventbus.broadcast(tt.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(tt.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])},e._start=function(){var t;"running"!==this.playState&&(this.playState="running",null==(t=this._abortController)||t.abort(),this._abortController=new AbortController,this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(tt.FIRST_FRAME)),0==this._currentPosition&&this._broadCastPosition(),function(t,e,n){var i,r,o,a=null!=(i=null==(r=document)||null==(o=r.timeline)?void 0:o.currentTime)?i:performance.now();function s(t){e.aborted||(n(t),u(t))}function u(e){var n=Math.round((e-a)/t)*t,i=a+n+t-performance.now();setTimeout((function(){return requestAnimationFrame(s)}),i)}u(a)}(this._tickInterval,this._abortController.signal,this._updateBound))},e._resetToStartPosition=function(){this._currentPosition=0},e._resize=function(){console.error("Not implemented yet, not even sure this needs to be implemented...")},e._container=function(t){t(this._containerElement)},e._stopAnimationInterval=function(t){var e;void 0===t&&(t=!0),null==(e=this._abortController)||e.abort(),this._abortController=void 0,t&&this._resetToStartPosition()},e.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 Promise.resolve()},e.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(t){return t()})),this._containerElement=void 0},e.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},e.start=function(){this._start(),this.eventbus.broadcast(tt.PLAY)},e.stop=function(){this._stopAnimationInterval(),this.playState="stopped",this.eventbus.broadcast(tt.STOP)},e.pause=function(){this._stopAnimationInterval(!1),this.playState="paused",this.eventbus.broadcast(tt.PAUSE)},e.seek=function(t){t<0||t>this._currentPlaylistItem.duration||(this.eventbus.broadcast(tt.SEEK,[t,this._currentPosition,this.getDuration()]),this._currentPosition=t,this.eventbus.broadcast(tt.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(tt.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(tt.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},e.getPosition=function(){return this._currentPosition},e.getDuration=function(){return this._currentPlaylistItem.duration},e.requestDurationHandler=function(t){t(this._currentPlaylistItem.duration)},t}(),Zt={__proto__:null,JwPlayerTimelineProvider:Yt,RequestAnimationFrameTimelineProvider:Jt},Xt=function(){function t(t,e){this.providersSettings=void 0,this.configurationFactory=void 0,this.providersSettings=t,this.configurationFactory=e}var e=t.prototype;return e.addProvider=function(t){if(this.providersSettings[t])throw new Error("Settings for a '"+t+"' provider already exist");var e={id:r.v4(),poster:void 0,selector:void 0,systemName:"",vendor:""};return this.providersSettings[t]=e,new $t(e,this,this.configurationFactory)},e.editProvider=function(t){if(!this.providersSettings[t])throw new Error("No settings for a '"+t+"' provider exist yet");return new $t(this.providersSettings[t],this,this.configurationFactory)},e.next=function(){return this.configurationFactory},t}(),$t=function(){function t(t,e,n){this.providerSettings=void 0,this.providersSettingsEditor=void 0,this.configurationFactory=void 0,this.providerSettings=t,this.providersSettingsEditor=e,this.configurationFactory=n}var e=t.prototype;return e.setVendor=function(t){return this.providerSettings.vendor=t,this},e.setSelector=function(t){return this.providerSettings.selector=t,this},e.setSystemName=function(t){if(!Zt[t])throw new Error("Unknown timeline provider system name: "+t);return this.providerSettings.systemName=t,this},e.next=function(){return this.providersSettingsEditor},e.end=function(){return this.configurationFactory},t}(),te=function(){function t(t){this.actionCreatorFactory=void 0,this.configuration=void 0,this.configuration=t||{},this.actionCreatorFactory=new Ft(this)}t.extend=function(t,e,n){return t[e]=n.bind(t),t},t.extendMultiple=function(e,n){return Object.entries(n).forEach((function(n){return t.extend(e,n[0],n[1])})),e};var e=t.prototype;return e.init=function(t){return this.configuration={id:r.v4(),engine:{systemName:"EligiusEngine"},containerSelector:"[data-ct-container=true]",timelineProviderSettings:{},language:t,availableLanguages:[],layoutTemplate:"",initActions:[],actions:[],timelines:[],labels:[]},this},e.setLayoutTemplate=function(t){return this.configuration.layoutTemplate=t,this},e.setDefaultLanguage=function(t){return this.configuration.language=t,this},e.setContainerSelector=function(t){return this.configuration.containerSelector=t,this},e.editTimelineProviderSettings=function(){return new Xt(this.configuration.timelineProviderSettings||{},this)},e.getConfiguration=function(t){var e=I(this.configuration),n=t.call(this,e);return n&&(this.configuration=n),this},e.addLanguage=function(t,e){var n=this._initializeCollection(this.configuration,"availableLanguages");if(n.find((function(e){return e.languageCode===t})))throw new Error("Language code '"+t+"' already exists");return n.push({id:r.v4(),languageCode:t,label:e}),this},e._internalAddAction=function(t,e){var n=this._initializeCollection(this.configuration,t);null==n||n.push(e)},e._initializeCollection=function(t,e){return t[e]||(t[e]=[]),t[e]},e.addAction=function(t){this._internalAddAction("actions",t)},e.addInitAction=function(t){this._internalAddAction("initActions",t)},e.addEventAction=function(t){this._internalAddAction("eventActions",t)},e.addTimelineAction=function(t,e){var n=this.getTimeline(t);if(!n)throw Error("No timeline found for uri '"+t+"'");this._initializeCollection(n,"timelineActions").push(e)},e.createAction=function(t){return this.actionCreatorFactory.createAction(t)},e.createInitAction=function(t){return this.actionCreatorFactory.createInitAction(t)},e.createEventAction=function(t){return this.actionCreatorFactory.createEventAction(t)},e.createTimelineAction=function(t,e){return this.actionCreatorFactory.createTimelineAction(t,e)},e.addTimeline=function(t,e,n,i,o){var a=this._initializeCollection(this.configuration,"timelines");if(this.getTimeline(t))throw Error("timeline for uri "+t+" already exists");var s={id:r.v4(),type:e,uri:t,duration:n,loop:i,selector:o,timelineActions:[]};return a.push(s),this},e.getTimeline=function(t){return this.configuration.timelines.find((function(e){return e.uri===t}))},e.removeTimeline=function(t){var e=this.getTimeline(t);if(e){var n=this.configuration.timelines.indexOf(e);n>-1&&this.configuration.timelines.splice(n,1)}return this},e._initializeLabel=function(t,e){var n=e.find((function(e){return e.id===t}));return n||(e.push({id:t,labels:[]}),n=e[e.length-1]),n},e._getLabelTranslation=function(t,e){var n=t.find((function(t){return t.languageCode===e}));return n||(n={id:r.v4(),languageCode:e,label:""},t.push(n)),n},e.addLabel=function(t,e,n){var i=this._initializeCollection(this.configuration,"labels"),r=this._initializeLabel(t,i);return this._getLabelTranslation(r.labels,e).label=n,this},e.editAction=function(t){var e=this.configuration.actions.find((function(e){return e.id===t}));if(e)return new Bt(e,this);throw new Error("Action not found for id "+t)},e.editEventAction=function(t){var e,n=null==(e=this.configuration.eventActions)?void 0:e.find((function(e){return e.id===t}));if(n)return new Vt(n,this);throw new Error("Event action not found for id "+t)},e.editInitAction=function(t){var e=this.configuration.initActions.find((function(e){return e.id===t}));if(e)return new Bt(e,this);throw new Error("Init action not found for id "+t)},e.editTimelineAction=function(t,e){var n=this.getTimeline(t);if(!n)throw new Error("Timeline not found for id "+e);var i=n.timelineActions.find((function(t){return t.id===e}));if(i)return new Wt(i,this);throw new Error("Timeline action not found for id "+e)},t}(),ee=function(){function t(){this.operationData=void 0,this.actionInstanceInfos=void 0,this.name="EventListenerController"}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,eventName:t.eventName,actions:t.actions.slice(),actionOperationData:t.actionOperationData?I(t.actionOperationData):void 0}},e.attach=function(t){var e=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=e._isStartAction(n);t.broadcast(tt.REQUEST_ACTION,[r[1],(i=r[0],function(t){var n;null==(n=e.actionInstanceInfos)||n.push({start:i,action:t})})])})),i.on(o,this._eventHandler.bind(this)))}},e._isStartAction=function(t){return"end:"===t.substr(0,"end:".length)?[!1,t.substr("end:".length)]:[!0,t]},e._eventHandler=function(t){if(this.operationData&&this.actionInstanceInfos){var e=this.operationData.actionOperationData?I(this.operationData.actionOperationData):{};t.target&&(e.targetValue=t.target.value),this._executeAction(this.actionInstanceInfos,e,0)}},e._executeAction=function(){var t=v(p().mark((function t(e,n,i){var r,o,a;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i<e.length)){t.next=8;break}return o=(r=e[i]).action,a=r.start?o.start.bind(o):o.end.bind(o),t.next=6,a(n);case 6:this._executeAction(e,Object.assign(n,t.sent),++i);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e.detach=function(t){var e;null==(e=this.operationData)||e.selectedElement.off(this.operationData.eventName)},t}(),ne=function(){function t(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController",this.requestLabelDataBound=void 0}var e=t.prototype;return e.init=function(t){this.operationData=Object.assign({},t)},e.setLabelId=function(t){this.requestLabelDataBound&&(this.requestLabelDataBound(t),this.setLabel())},e.attach=function(t){var e=this;this.operationData&&(t.broadcast(tt.REQUEST_CURRENT_LANGUAGE,[function(t){e.currentLanguage=t}]),this.requestLabelDataBound=this.requestLabelData.bind(this,t),this.requestLabelDataBound(this.operationData.labelId),this.setLabel(),this.listeners.push(t.on(tt.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},e.requestLabelData=function(t,e){var n=this;t.broadcast(tt.REQUEST_LABEL_COLLECTION,[e,function(t){n.createTextDataLookup(t)}])},e.setLabel=function(){var t;this.currentLanguage&&(null==(t=this.operationData)||t.selectedElement.html(this.labelData[this.currentLanguage]))},e.detach=function(t){this.listeners.forEach((function(t){return t()})),this.requestLabelDataBound=void 0},e.handleLanguageChange=function(t){this.currentLanguage=t,this.setLabel()},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t){e.labelData[t.languageCode]=t.label}))},t}(),ie=function(){function t(){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 e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,renderer:t.renderer,loop:t.loop,autoplay:t.autoplay,animationData:t.animationData,json:t.json,labelIds:t.labelIds,viewBox:t.viewBox,iefallback:t.iefallback},t.url.indexOf("[")>-1&&this.parseFilename(t.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))},e.parseFilename=function(t){var e=this;t.substr(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split(",").forEach((function(t){var n=t.split("=");"freeze"===n[0]?e.freezePosition=+n[1]:"end"===n[0]&&(e.endPosition=+n[1])}))},e.attach=function(t){if(this.operationData){var e=this.operationData.labelIds;if(e&&e.length){var n={};t.broadcast(tt.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(t.on(tt.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),t.broadcast(tt.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},e.detach=function(t){this.listeners.forEach((function(t){t()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},e.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},e.createAnimation=function(){var t,e=this;if(this.operationData&&this.serializedData){null==(t=this.animationItem)||t.destroy();var n=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,i=this.operationData.labelIds;i&&i.length&&i.forEach((function(t){var i;n=n.split("!!"+t+"!!").join(e.labelData[t][null!=(i=e.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)}},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t,n){t.forEach((function(t){e.operationData&&(e.labelData[e.operationData.labelIds[n]][t.code]=t.label)}))}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.createAnimation()},e.isIE=function(){var t=!!window.document.documentMode;return!t&&!!window.StyleMedia||t},t}(),re=function(){function t(){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 e=t.prototype;return e.init=function(t){this.container=t.selectedElement,this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.container&&(this.eventbus=t,this.eventhandlers.push(t.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(t.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(t.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(t.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},e.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var t=this.getQueryVariable(0),e=0;t&&(e=this.navLookup[t].videoUrlIndex),this.highlightMenu(e)},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return null},e.handleRequestCurrentNavigation=function(t){if(this.activeNavigationPoint){var e=this.ctrlLookup[this.activeNavigationPoint.labelId];t({navigationData:this.activeNavigationPoint,title:e.labelData[e.currentLanguage||""]})}else t(null)},e.detach=function(t){this.eventhandlers.forEach((function(t){t()})),this.labelControllers.forEach((function(e){e.detach(t)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},e.pushCurrentState=function(t){var e;if(void 0===t&&(t=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};t>-1&&(i.position=t),null==(e=this.eventbus)||e.broadcast("push-history-state",[i])}}},e.buildHtml=function(t,e){var n=u.default("<ul/>");e.forEach(this.addNavElement.bind(this,n)),t.append(n)},e.addNavElement=function(t,e){if(e.visible){var n=u.default("<li/>"),i=u.default("<a href='javascript:;' id='nav_"+e.videoUrlIndex+"'/>");if(n.append(i),this.addLabel(i,e.labelId),this.addClickHandler(i,e.videoUrlIndex),e.children){var r=u.default("<ul/>");e.children.forEach(this.addNavElement.bind(this,r)),n.append(r)}t.append(n)}},e.addClickHandler=function(t,e){t.mouseup(this.menuMouseupHandler.bind(this,e))},e.menuMouseupHandler=function(t){var e,n=this.navVidIdLookup[t];n&&(null==(e=this.eventbus)||e.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},e.handleNavigateVideoUrl=function(t,e){var n;void 0===e&&(e=0),this.highlightMenu(t),null==(n=this.eventbus)||n.broadcast("request-video-url",[t,e]),this.activeNavigationPoint=this.navVidIdLookup[t],this.pushCurrentState(e)},e.highlightMenu=function(t){var e=u.default("#nav_"+t);e.length&&(u.default(".current-menu-item").removeClass("current-menu-item"),e.addClass("current-menu-item"))},e.handleVideoComplete=function(t){var e,n,i=this.navVidIdLookup[t];i.autoNext?null==(e=this.eventbus)||e.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},e.addLabel=function(t,e){var n,i=this,r={selectedElement:t,labelId:e};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(t){t.init(r),t.attach(i.eventbus),i.labelControllers.push(t),i.ctrlLookup[e]=t}])},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),oe=function(){function t(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[],this.duration=0}var e=t.prototype;return e.init=function(t){this.selectedElement=t.selectedElement,this.textElement=t.textElement},e.attach=function(t){var e,n=this;this.detachers.push(t.on(tt.POSITION_UPDATE,this.positionUpdateHandler.bind(this))),t.broadcast(tt.DURATION_REQUEST,[function(t){return n.duration=t}]);var i=this.clickHandler.bind(this,t);null==(e=this.selectedElement)||e.on("click",i),this.detachers.push((function(){var t;return null==(t=n.selectedElement)?void 0:t.off("click",i)}))},e.detach=function(t){this.detachers.forEach((function(t){t()}))},e.positionUpdateHandler=function(t){var e,n,i=100/t.duration*t.position;null==(e=this.selectedElement)||e.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},e.clickHandler=function(t,e){var n=e.target.getBoundingClientRect();t.broadcast(tt.SEEK_REQUEST,[Math.floor(this.duration/100*(100/n.width*(e.clientX-n.left)))])},t}(),ae=function(){function t(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var e=t.prototype;return e.init=function(t){this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.eventhandlers.push(t.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(t.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=t,window.onpopstate=this.handlePopstate.bind(this);var e=this.getQueryVariable(0);if(e){var n=this.navLookup[e],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)},e.handlePopstate=function(t){var e,n,i,r,o=null!=(e=null==(n=t.state)?void 0:n.position)?e:0,a=this.navLookup[t.state?t.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[a.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[a.videoUrlIndex,o,!0])},e.detach=function(t){this.eventhandlers&&this.eventhandlers.forEach((function(t){t()})),this.eventbus=null},e.handleBeforeRequestVideoUrl=function(t,e,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(t){r.pushState(t)}])},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return""},e.handlePushHistoryState=function(t){this.pushState(t)},e.pushState=function(t){if(t&&t.navigationData&&t.navigationData.visible){var e,n=void 0!==t.position?t.position:-1;n<0&&(null==(e=this.eventbus)||e.broadcast("request-current-video-position",[function(t){n=t>3?t-3:0}]));var i=window.history.state;i&&i.navigationId!==t.navigationData.id?window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n):i&&i.navigationId===t.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},t.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n),window.document.title=t.title}},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),se=function(){function t(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var e=t.prototype;return e.attach=function(t){var e=t.on(tt.TIME,this.onTimeHandler.bind(this)),n=t.on(tt.SEEKED,this.onSeekedHandler.bind(this)),i=t.on(tt.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[e,i,n])},e.detach=function(t){this.internalDetach()},e.internalDetach=function(t){t&&t.forEach((function(t){t()}))},e.languageChangeHandler=function(t){this.currentLanguage=t,this.lastFunc&&this.lastFunc()},e.removeTitle=function(t){null==t||t.empty(),this.lastFunc=null},e.onTimeHandler=function(t){var e=this.actionLookup[t.position];e&&(e(),this.lastFunc=e)},e.onSeekedHandler=function(t){for(var e=t.position,n=this.actionLookup[e];!n&&--e>=0;)n=this.actionLookup[e];n?(n(),this.lastFunc=n):this.removeTitle()},e.setTitle=function(t,e){this.currentLanguage&&t.html(e[this.currentLanguage])},e.createActionLookup=function(t,e){for(var n=t.subtitleData,i=n[0].titles,r={},o=0,a=i.length;o<a;o++){for(var s={},u=0,c=n.length;u<c;u++){var l=n[u];s[l.lang]=l.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,e,s),r[i[o].duration.end]=this.removeTitle}return r},e.init=function(t){var e=t.selectedElement;this.removeTitle=this.removeTitle.bind(this,e),this.currentLanguage=t.language,this.actionLookup=this.createActionLookup(t,e)},t}(),ue={__proto__:null,EventListenerController:ee,LabelController:ne,LottieController:ie,NavigationController:re,ProgressbarController:oe,RoutingController:ae,SubtitlesController:se},ce={__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"}},endWhen:function(){return{description:"Ends the current when block"}},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(t){return b(Math[t])})).map((function(t){return{value:t}})),mathResult:"ParameterType:number"}}},otherwise:function(){return{description:"Inverts the control flow for `when` logic"}},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}}}},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}}}},when:function(){return{description:"Evaluates the given expression, when it evaluates to false context.skipNextOperation will be set to true",properties:{expression:{type:"ParameterType:expression",required:!0}}}}},le=function(){function t(){}return t.prototype.getOperationNames=function(){return Object.keys(Mt)},t}(),he=function(){function t(){}return t.prototype.getControllerNames=function(){return Object.keys(ue)},t}(),de=function(){function t(){}return t.prototype.getOperationMetadata=function(t){var e=ce[t];if(!e)throw new Error("Could not find metadata for operation called "+t);return e()},t}(),pe=function(){function t(){}return t.prototype.getEventNames=function(){return Object.values(tt)},t}(),fe=function(){function t(t,e){this.importer=void 0,this.eventbus=void 0,this.importer=t,this.eventbus=e}return t.prototype.process=function(t,n){if(_e(t,t,this.importer),!e.isDefined(t.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:t.id,engine:m({},t.engine),timelineProviderSettings:I(t.timelineProviderSettings),containerSelector:t.containerSelector,language:t.language,layoutTemplate:t.layoutTemplate,availableLanguages:I(t.availableLanguages),actions:ye(t.actions,this.importer,this.eventbus),initActions:ye(t.initActions,this.importer,this.eventbus),labels:I(t.labels),timelineFlow:I(t.timelineFlow),timelines:ve(t.timelines,this.importer,this.eventbus)},r=[];return t.eventActions&&n&&(r=function(t,e,n,i){return t.map((function(t){return ge(t,n)})).map((function(n,r){var o=t[r],a=o.eventName,s=o.eventTopic,u=new P(n.name,n.startOperations,i);return e.registerAction(u,a,s),u}))}(t.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(t,e){var n;return m({},t,((n={})[e.name]=e,n))}),{}),i]},t}();function ve(t,e,n){var i=be.bind(null,e,n);return t.map((function(t){return m({},t,{timelineActions:t.timelineActions.map(i)})}))}function me(t,e){var n;return{id:e.id,systemName:e.systemName,operationData:null!=(n=I(e.operationData))?n:{},instance:t.import(e.systemName)[e.systemName]}}function ge(t,e){var n=me.bind(null,e);return{id:t.id,name:t.name,startOperations:t.startOperations.map(n)}}function Ee(t,e){var n=me.bind(null,e);return m({},ge(t,e),{endOperations:t.endOperations.map(n)})}function be(t,e,n){var i,r=Ee(n,t),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},a=r.id,s=new O(r.name,r.startOperations,r.endOperations,o,e);return s.id=a,s}function ye(t,e,n){return t.map((function(t){return Ee(t,e)})).map((function(t){var e=new L(t.name,t.startOperations,t.endOperations,n);return e.id=t.id,e}))}function _e(t,n,i){e.isDefined(t)&&(Array.isArray(t)?t.forEach((function(t){_e(t,n,i)})):Object.keys(t).forEach((function(e){!function(t,e,n,i){var r,o=e[t];if(M(o)){if(o.startsWith("config:")){var a=o.substring(7,o.length);e[t]=(r=n,F(a.split("."),r))}else if(o.startsWith("template:")){var s=o.substring(9,o.length),u=i.import(s)[s];e[t]=u}else if(o.startsWith("json:")){var c=o.substring(5,o.length),l=i.import(c)[c];e[t]=l}}else y(o)&&_e(o,n,i)}(e,t,n,i)})))}var Te=function(){function t(t,e,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=t,this.eventbus=e,this.timelineProviders=n,this.languageManager=i}var e=t.prototype;return e.init=function(){var t;this._createLayoutTemplate(),this._addInitialisationListeners();var e=this.configuration.timelines;return this._currentTimelineUri=null!=(t=null==e?void 0:e[0].uri)?t:"",this._createTimelineLookup(),this._initializeTimelineProvider()},e._createLayoutTemplate=function(){var t=this.configuration.containerSelector,e=u.default(t);if(!e||!e.length)throw new Error("Container selector not found: "+t);var n=this.configuration.layoutTemplate;n&&n.length?e.html(n):console.warn("layoutTemplate is empty, unable to create layout")},e._initializeTimelineProvider=function(){var t=v(p().mark((function t(){var e,n,i,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(e=this.configuration.timelines)&&e.length){t.next=2;break}throw new Error("No timelines present");case 2:if(r=this.timelineProviders[(i=this.configuration.timelines[0]).type]){t.next=6;break}throw new Error("No timeline provider configured for type "+i.type);case 6:if(null==(n=this._activeTimelineProvider)||n.destroy(),this._activeTimelineProvider=r.provider,this._activeTimelineProvider){t.next=10;break}throw new Error("NO ACTIVE TIMELINE PROVIDER");case 10:return t.next=12,this._activeTimelineProvider.init();case 12:return t.next=14,this._executeActions(this.configuration.initActions,"start");case 14:return t.abrupt("return",this._activeTimelineProvider);case 15:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._cleanUp=function(){var t=v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUpTimeline();case 2:return t.next=4,this._executeActions([].concat(this.configuration.initActions).reverse(),"end");case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.destroy=function(){var t=v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUp();case 2:this.languageManager.destroy(),this._activeTimelineProvider=void 0,this._eventbusRemovers.forEach((function(t){return t()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(t){return t.provider.destroy()})),u.default(this.configuration.containerSelector).empty();case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._addEventListener=function(t,e,n){this._eventbusRemovers.push(this.eventbus.on(t,e,n))},e._addInitialisationListeners=function(){this._addEventListener(tt.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector)),this._addEventListener(tt.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this)),this._addEventListener(tt.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor)),this._addEventListener(tt.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this)),this._addEventListener(tt.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this)),this._addEventListener(tt.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this)),this._addEventListener(tt.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)),this._addEventListener(tt.TIME,this._onTimeHandler.bind(this,Math.floor)),this._addEventListener(tt.SEEK,this._onSeekHandler.bind(this,Math.floor))},e._createTimelineLookup=function(){var t=this;this.configuration.timelines&&(this.configuration.timelines.forEach((function(e){e.timelineActions.forEach(t._addTimelineActionStart.bind(t,e.uri))})),this.configuration.timelines.forEach((function(e){[].concat(e.timelineActions).reverse().forEach(t._addTimelineActionEnd.bind(t,e.uri))})))},e._addTimelineActionStart=function(t,e){var n,i=e.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,t),i),o=e.start.bind(e);null!=(n=e.id)&&n.length&&(o.id=e.id,o.isStart=!0),r.push(o)},e._addTimelineActionEnd=function(t,e){var n=e.duration.end;if(n<0&&(n=e.duration.end=Infinity),isFinite(n)){var i=this._initializeTimelinePosition(this._timeLineActionsLookup[t],n),r=e.end.bind(e);e.id||(r.id=e.id),i.push(r)}},e._initializeUriLookup=function(t,e){return t[e]||(t[e]={}),t[e]},e._initializeTimelinePosition=function(t,e){return t[e]||(t[e]=[]),t[e]},e._executeActions=function(){var t=v(p().mark((function t(e,n,i){var r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i&&(i=0),!(e&&i<e.length)){t.next=6;break}return r=e[i],t.next=5,r[n]();case 5:return t.abrupt("return",this._executeActions(e,n,++i));case 6:return t.abrupt("return",Promise.resolve());case 7:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._handleRequestEngineRoot=function(t,e){e(u.default(t))},e._handleRequestTimelineUri=function(){var t=v(p().mark((function t(e,n){var i,r,o=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===n&&(n=0),this._activeTimelineProvider){t.next=3;break}return t.abrupt("return");case 3:return this._activeTimelineProvider.stop(),t.next=6,this._cleanUpTimeline();case 6:if((i=this.configuration.timelines.find((function(t){return t.uri===e})))&&this._activeTimelineProvider&&this._currentTimelineUri!==i.uri){t.next=9;break}return t.abrupt("return");case 9:this._currentTimelineUri=i.uri,this.eventbus.broadcast(tt.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(r=this.timelineProviders[i.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=r.provider),this._activeTimelineProvider.loop=i.loop,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(tt.FIRST_FRAME,v(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o._activeTimelineProvider){t.next=2;break}return t.abrupt("return");case 2:return o._activeTimelineProvider.pause(),o.eventbus.broadcast(tt.DURATION,[o._activeTimelineProvider.getDuration()]),t.next=6,o._executeStartActions();case 6:o._activeTimelineProvider.seek(n),o._onSeekHandler(Math.floor,{offset:n});case 8:case"end":return t.stop()}}),t)})))),this._activeTimelineProvider.playlistItem(e);case 16:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),e._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},e._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},e._getActionsForPosition=function(t,e){return e.filter((function(e){return!e.active&&e.duration.start<=t&&e.duration.end>=t}))},e._getActiveActions=function(t){return t.filter((function(t){return t.active})).sort(we)},e._executeRelevantActions=function(t,e){var n=this._getRelevantTimelineActions(),i=t.apply(this,[n]);return this._executeActions(i,e,0)},e._handleRequestTimelinePosition=function(t,e){var n;e(t((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},e._handleTimelineComplete=function(){this._cleanUpTimeline()},e._handleExecuteTimelineAction=function(t,e,n){var i=this._getTimelineActionsForUri(t),r=null==i?void 0:i[e];r&&(n?r.start():r.end())},e._resizeTimelineAction=function(){console.error("no resizing implemented")},e._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},e._requestCurrentTimeline=function(t){t(this._currentTimelineUri)},e._getTimelineActionsForUri=function(t){var e,n=this.configuration.timelines.find((function(e){return e.uri===t}));return null!=(e=null==n?void 0:n.timelineActions)?e:[]},e._onTimeHandler=function(t,e){if(!isNaN(e.position)){var n,i,r=t(e.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(tt.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(tt.TIME_UPDATE,[e.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},e._onSeekHandler=function(){var t=v(p().mark((function t(e,n){var i,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!isNaN(n.offset)){t.next=2;break}return t.abrupt("return");case 2:return r=e(n.offset),t.next=5,this._executeSeekActions(r);case 5:null==(i=this._activeTimelineProvider)||i.start();case 6:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),e._executeActionsForPosition=function(t){this._lastPosition=t;var e=this._timeLineActionsLookup[this._currentTimelineUri];if(e){var n=e[t];null==n||n.forEach((function(t){t()}))}},e._executeSeekActions=function(){var t=v(p().mark((function t(e){var n,i,r,o;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this._getRelevantTimelineActions()){t.next=3;break}return t.abrupt("return",Promise.resolve());case 3:return i=this._getActiveActions(n).reverse(),r=this._getActionsForPosition(e,n),o=this._executeActions(i,"end",0),t.next=8,o;case 8:return t.abrupt("return",this._executeActions(r,"start",0));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),we=function(t,e){return e.duration.start<t.duration.start?-1:e.duration.start>t.duration.start?1:0},xe=function(){function t(){this._actionRegistry=new Map}var e=t.prototype;return e.registerAction=function(t,e,n){var i;n&&n.length&&(e=e+":"+n),this._actionRegistry.has(e)||this._actionRegistry.set(e,[]),null==(i=this._actionRegistry.get(e))||i.push(t)},e.handleEvent=function(t,e,n){e&&(t=t+":"+e);var i=this._actionRegistry.get(t);if(i){var r={eventArgs:n};i.forEach((function(t){t.start(r)}))}},t}(),Ie=function(){function t(){this.eventHandlers=new Map,this.eventInterceptors=new Map,this.eventListeners=[],this.clear()}var e=t.prototype;return e.clear=function(){this.eventHandlers=new Map,this.eventListeners=[],this.eventInterceptors=new Map},e._getEventInterceptors=function(t,e){return e&&(t=t+":"+e),this.eventInterceptors.has(t)||this.eventInterceptors.set(t,[]),this.eventInterceptors.get(t)},e._getEventHandlers=function(t,e){return e&&(t=t+":"+e),this.eventHandlers.has(t)||this.eventHandlers.set(t,[]),this.eventHandlers.get(t)},e.on=function(t,e,n){var i=this;return this._getEventHandlers(t,n).push(e),function(){i.off(t,e,n)}},e.once=function(t,e,n){var i=this,r=function r(){e.apply(void 0,arguments),i.off(t,r,n)};return this.on(t,r,n),function(){i.off(t,r,n)}},e.off=function(t,e,n){var i=this._getEventHandlers(t,n);if(i){var r=i.indexOf(e);r>-1&&i.splice(r,1)}},e.broadcast=function(t,e){this._callHandlers(t,void 0,e)},e.broadcastForTopic=function(t,e,n){this._callHandlers(t,e,n)},e.registerEventlistener=function(t){var e=this;return this.eventListeners.push(t),function(){var n=e.eventListeners.indexOf(t);n>-1&&e.eventListeners.splice(n,1)}},e.registerInterceptor=function(t,e,n){var i=this._getEventInterceptors(t,n);return i.push(e),function(){var t=i.indexOf(e);t>-1&&i.splice(t,1)}},e._callHandlers=function(t,e,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(t,e);r&&(this._getEventInterceptors(t,e).forEach((function(t){n=t.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(t,e,n)})),null!=(i=n)&&i.length?r.forEach((function(t){return t.apply(void 0,n)})):r.forEach((function(t){return t()})))},t}(),Pe=function(){function t(t){this.eventbus=void 0,this.eventbus=t}return t.prototype.intercept=function(t){return this.eventbus.broadcast(tt.BEFORE_REQUEST_TIMELINE_URI,t.slice()),t},t}(),Le={__proto__:null,ActionRegistryEventbusListener:xe,Eventbus:Ie,RequestVideoUriInterceptor:Pe},Oe=function(){function t(t,e,n){if(this._currentLanguage=void 0,this._eventbus=void 0,this._labelLookup=void 0,this._eventbusRemovers=[],this._currentLanguage=t,this._eventbus=n,!t)throw new Error("language ctor arg cannot have zero length");var i;i=t,H().defaultLanguage=i,this._setRootElementLang(t),this._labelLookup=this._createLabelLookup(e),this._addEventbusListeners(n)}var e=t.prototype;return e.destroy=function(){this._eventbusRemovers.forEach((function(t){return t()}))},e._addEventbusListeners=function(t){this._eventbusRemovers.push(t.on(tt.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusRemovers.push(t.on(tt.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusRemovers.push(t.on(tt.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusRemovers.push(t.on(tt.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},e._handleRequestCurrentLanguage=function(t){t(this._currentLanguage)},e._handleRequestLabelCollection=function(t,e){e(this._labelLookup[t])},e._handleRequestLabelCollections=function(t,e){var n=this;e(t.map((function(t){return n._labelLookup[t]})))},e._handleLanguageChange=function(t){t&&t.length?(this._currentLanguage=t,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},e._setRootElementLang=function(t){var e=this;this._eventbus.broadcast(tt.REQUEST_ENGINE_ROOT,[function(n){var i=e._extractLanguageFromCulture(t);u.default(n).attr("lang",i)}])},e._extractLanguageFromCulture=function(t){return t.indexOf("-")>-1?t.split("-").shift():t},e._createLabelLookup=function(t){return t.reduce((function(t,e){return t[e.id]=e.labels,t}),{})},t}(),Ce=function(){function t(t,e,n){var i,r;this._actionsLookup={},this._eventbus=void 0,this._eventRemovers=[],this._importer=void 0,this._resizeTimeout=-1,this._importer=t,this._eventbus=null!=(i=null==n?void 0:n.eventbus)?i:new Ie,w.active=null!=(r=null==n?void 0:n.devtools)&&r,w.active&&this._initializeDevtools(this._eventbus),this._eventRemovers.push(this._eventbus.on(tt.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(tt.REQUEST_ACTION,this._requestActionHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(tt.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 a=this._resizeHandler.bind(this),s=u.default(e);s.on("resize",a),this._eventRemovers.push((function(){return s.off("resize",a)}))}var e=t.prototype;return e._handleSpacePress=function(t,e){return t.preventDefault(),this._eventbus.broadcast(tt.PLAY_TOGGLE_REQUEST),!1},e._initializeDevtools=function(t){var e=this,n=window.__ELIGIUS_DEV_TOOLS__;if(n){var i=n.agent;this._eventRemovers.push(t.registerEventlistener(new T(i))),this._eventRemovers.push(i.subscribe((function(t){if("playcontrol"===t.type)switch(t.data.kind){case"play":e._eventbus.broadcast(tt.PLAY_REQUEST);break;case"stop":e._eventbus.broadcast(tt.STOP_REQUEST);break;case"pause":e._eventbus.broadcast(tt.PAUSE_REQUEST);break;case"seek":e._eventbus.broadcast(tt.SEEK_REQUEST,[t.data.args])}}))),w.send=function(t,e){var n=_(e);try{i.postMessage(t,n)}catch(t){console.error("postmessage failed"),console.error(t),console.log("message",n)}},w.send("eligius-diagnostics-factory","Diagnostics initialized")}else console.warn("__ELIGIUS_DEV_TOOLS__ property not found on window, please install the Eligius Devtools extension.")},e.destroy=function(){this._eventRemovers.forEach((function(t){return t()}))},e._resizeHandler=function(){var t=this;this._resizeTimeout&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=-1),this._resizeTimeout=setTimeout((function(){t._eventbus.broadcast(tt.RESIZE)}),200)},e._importSystemEntryWithEventbusDependency=function(t){return new(this._importSystemEntry(t))(this._eventbus)},e._importSystemEntry=function(t){return this._importer.import(t)[t]},e._requestInstanceHandler=function(t,e){e(this._importSystemEntryWithEventbusDependency(t))},e._requestFunctionHandler=function(t,e){e(this._importSystemEntry(t))},e._requestActionHandler=function(t,e){var n=this._actionsLookup[t];n?e(n):(console.error("Unknown action: "+t),e(null))},e.createEngine=function(t,e){var n,i=this._importSystemEntry(t.engine.systemName),r=void 0;null!=(n=t.eventActions)&&n.length&&(r=new xe,this._eventRemovers.push(this._eventbus.registerEventlistener(r))),this._eventRemovers.push(this._eventbus.registerInterceptor(tt.REQUEST_TIMELINE_URI,new Pe(this._eventbus)));var o=(e=e||new fe(this._importer,this._eventbus)).process(t,r),a=o[1];this._actionsLookup=o[0];var s=this._createTimelineProviders(a,this._eventbus),u=new Oe(t.language,t.labels,this._eventbus);return new i(a,this._eventbus,s,u)},e._createTimelineProviders=function(t,e){var n=this;return Object.entries(t.timelineProviderSettings).reduce((function(i,r){var o=r[0],a=r[1];if(!a)return i;var s=n._importSystemEntry(a.systemName);return i[o]={id:a.id,vendor:a.vendor,provider:new s(e,t)},i}),{})},t}(),Se=Mt,Ne=ue,Ae=Zt,Re=Le,De=function(){function t(){this.engines=new Map,this.engines.set("EligiusEngine",Te)}var e=t.prototype;return e.getOperationNames=function(){return Object.keys(Se)},e.getControllerNames=function(){return Object.keys(Ne)},e.getProviderNames=function(){return Object.keys(Ae)},e.import=function(t){var e,n,i,r,o,a=null!=(e=null!=(n=null!=(i=null!=(r=Se[t])?r:Ne[t])?i:Ae[t])?n:Re[t])?e:this.engines.get(t);return(o={})[t]=a,o},t}();exports.Action=P,exports.ActionCreator=Qt,exports.ActionCreatorFactory=Ft,exports.ActionEditor=Vt,exports.ActionRegistryEventbusListener=xe,exports.ConfigurationFactory=te,exports.ConfigurationResolver=fe,exports.ControllerNamesProvider=he,exports.DEV_TOOLS_KEY="__ELIGIUS_DEV_TOOLS__",exports.DevToolEventListener=T,exports.Diagnostics=w,exports.EligiusEngine=Te,exports.EligiusResourceImporter=De,exports.EndableAction=L,exports.EndableActionCreator=Ht,exports.EndableActionEditor=Bt,exports.EngineFactory=Ce,exports.EventListenerController=ee,exports.Eventbus=Ie,exports.JwPlayerTimelineProvider=Yt,exports.LabelController=ne,exports.LanguageManager=Oe,exports.LottieController=ie,exports.NavigationController=re,exports.OperationEditor=Kt,exports.OperationMetadataProvider=de,exports.OperationNamesProvider=le,exports.ProgressbarController=oe,exports.RequestAnimationFrameTimelineProvider=Jt,exports.RequestVideoUriInterceptor=Pe,exports.RoutingController=ae,exports.SubtitlesController=se,exports.TimeLineEventNamesProvider=pe,exports.TimelineAction=O,exports.TimelineActionCreator=zt,exports.TimelineActionEditor=Wt,exports.TimelineEventNames=tt,exports.TimelineProviderSettingsEditor=$t,exports.TimelineProvidersSettingsEditor=Xt,exports.addClass=A,exports.addControllerToElement=k,exports.animate=q,exports.animateWithClass=j,exports.broadcastEvent=V,exports.calc=J,exports.clearElement=Z,exports.clearOperationData=X,exports.createElement=$,exports.customFunction=et,exports.endAction=nt,exports.endLoop=it,exports.endWhen=rt,exports.extendController=ot,exports.generateImporterSourceCode=function(t,e,n){var i=function(t,e,n){return[].concat(function(t){var e,n=S(t.initActions.concat(t.actions).concat(null!=(e=t.eventActions)?e:[]));if(t.timelines){var i=t.timelines.flatMap((function(t){return t.timelineActions}));n=n.concat(S(i))}return N(n)}(t),n.flatMap((function(t){return i=t.extension,c.default.readdirSync(l.default.join(e,n=t.path)).map((function(t){return{systemName:""+l.default.basename(t,i).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()})),path:"./"+n+"/"+t,defaultImport:!0}}));var n,i})),function(t){var e,n,i,r,o=[];return(e=o).push.apply(e,C(t.initActions)),(n=o).push.apply(n,C(t.actions)),(i=o).push.apply(i,C(t.timelines.flatMap((function(t){return t.timelineActions})))),(r=o).push.apply(r,C(t.eventActions)),N(o)}(t),function(t){return t.timelineProviderSettings?Object.values(t.timelineProviderSettings).map((function(t){return{systemName:t.systemName}})):[]}(t),function(t){return t.engine?[{systemName:t.engine.systemName}]:[]}(t))}(t,e,n),r=function(t){var e=t.filter((function(t){return t.defaultImport})).map((function(t){return"import "+t.systemName+" from '"+t.path+"';"})).concat(t.filter((function(t){return!t.defaultImport})).map((function(t){var e;return"import {"+t.systemName+"} from '"+(null!=(e=t.path)?e:"eligius")+"';"})));return e.push("import { ISimpleResourceImporter } from 'eligius';"),e.push(""),e.push("const imports: Record<string, any> = {"),e.push.apply(e,t.map((function(t){return t.systemName+": { '"+t.systemName+"': "+t.systemName+" },"}))),e.push("};"),e.push(""),e.push("class EligiusResourceImporter implements ISimpleResourceImporter {"),e.push("import(name: string): Record<string, any> {"),e.push("if (imports.hasOwnProperty(name)) { return imports[name]; }"),e.push("throw Error(`Unknown systemName: ${name}`);"),e.push("}}"),e.push(""),e.push("export default EligiusResourceImporter;"),e.join("\n")}(i);return r},exports.getControllerFromElement=at,exports.getControllerInstance=st,exports.getElementDimensions=ut,exports.getImport=ct,exports.getQueryParams=lt,exports.invokeObjectMethod=ht,exports.loadJSON=pt,exports.log=ft,exports.math=vt,exports.metadata=ce,exports.otherwise=gt,exports.removeClass=Et,exports.removeControllerFromElement=bt,exports.removeElement=yt,exports.removePropertiesFromOperationData=_t,exports.reparentElement=Tt,exports.requestAction=wt,exports.resizeAction=xt,exports.selectElement=Pt,exports.setElementAttributes=Lt,exports.setElementContent=Ot,exports.setGlobalData=Ct,exports.setOperationData=St,exports.setStyle=Nt,exports.startAction=At,exports.startLoop=Rt,exports.toggleClass=Dt,exports.toggleElement=Ut,exports.wait=kt,exports.when=qt;
2
2
  //# sourceMappingURL=eligius.cjs.production.min.js.map