eligius 1.0.2 → 1.0.4

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.
Files changed (42) hide show
  1. package/README.md +283 -4
  2. package/dist/build/generate-importer-source-code.d.ts +15 -0
  3. package/dist/build/index.d.ts +1 -0
  4. package/dist/configuration/types.d.ts +1 -1
  5. package/dist/diagnostics/devtool-event-lister.d.ts +7 -0
  6. package/dist/diagnostics/diagnostics.d.ts +4 -0
  7. package/dist/diagnostics/index.d.ts +3 -0
  8. package/dist/diagnostics/types.d.ts +8 -0
  9. package/dist/eligius-engine.d.ts +27 -31
  10. package/dist/eligius.cjs.development.js +1601 -1107
  11. package/dist/eligius.cjs.development.js.map +1 -1
  12. package/dist/eligius.cjs.production.min.js +1 -1
  13. package/dist/eligius.cjs.production.min.js.map +1 -1
  14. package/dist/eligius.esm.js +1557 -1072
  15. package/dist/eligius.esm.js.map +1 -1
  16. package/dist/engine-factory.d.ts +1 -0
  17. package/dist/eventbus/types.d.ts +1 -1
  18. package/dist/importer/{webpack-resource-importer.d.ts → eligius-resource-importer.d.ts} +1 -1
  19. package/dist/importer/index.d.ts +1 -1
  20. package/dist/index.d.ts +4 -1
  21. package/dist/operation/broadcast-event.d.ts +0 -1
  22. package/dist/operation/calc.d.ts +14 -0
  23. package/dist/operation/get-controller-instance.d.ts +2 -0
  24. package/dist/operation/helper/get-element-data.d.ts +1 -0
  25. package/dist/operation/helper/modify-dimensions.d.ts +4 -1
  26. package/dist/operation/index.d.ts +2 -0
  27. package/dist/operation/math.d.ts +12 -0
  28. package/dist/operation/metadata/add-globals-to-operation.d.ts +2 -2
  29. package/dist/operation/metadata/calc.d.ts +4 -0
  30. package/dist/operation/metadata/index.d.ts +2 -0
  31. package/dist/operation/metadata/math.d.ts +4 -0
  32. package/dist/operation/metadata/types.d.ts +17 -6
  33. package/dist/operation/select-element.d.ts +2 -0
  34. package/dist/operation/wait.d.ts +3 -0
  35. package/dist/schema-tools/generate-operation-schemas.d.ts +1 -0
  36. package/dist/schema-tools/html-tag-names.d.ts +1 -0
  37. package/dist/types.d.ts +1 -1
  38. package/dist/{test/unit/operation → util}/apply-operation.d.ts +1 -1
  39. package/dist/util/camel-case-to-dash.d.ts +1 -0
  40. package/dist/util/dash-to-camel-case.d.ts +1 -0
  41. package/package.json +91 -97
  42. package/CHANGELOG.md +0 -16
@@ -1,4 +1,6 @@
1
1
  import { isDefined } from 'ts-is-present';
2
+ import fs from 'fs';
3
+ import path from 'path';
2
4
  import lottie from 'lottie-web';
3
5
  import $ from 'jquery';
4
6
  import Mousetrap from 'mousetrap';
@@ -6,6 +8,10 @@ import { v4 } from 'uuid';
6
8
 
7
9
  function deepCopy(original) {
8
10
  if (isDefined(original)) {
11
+ if (typeof structuredClone !== 'undefined') {
12
+ return structuredClone(original);
13
+ }
14
+
9
15
  return JSON.parse(JSON.stringify(original));
10
16
  }
11
17
 
@@ -72,16 +78,16 @@ var Action = /*#__PURE__*/function () {
72
78
  var operationInfo = operations[idx];
73
79
  var copy = operationInfo.operationData ? deepCopy(operationInfo.operationData) : {};
74
80
  var mergedOperationData = Object.assign(previousOperationData, copy);
75
- var result = operationInfo.instance.call(context, mergedOperationData);
81
+ var operationResult = operationInfo.instance.call(context, mergedOperationData);
76
82
 
77
- if (isPromise(result)) {
78
- result.then(function (resultOperationData) {
83
+ if (isPromise(operationResult)) {
84
+ operationResult.then(function (resultOperationData) {
79
85
  _this2.executeOperation(operations, ++idx, resolve, reject, resultOperationData, context);
80
86
  })["catch"](function (error) {
81
87
  reject(error);
82
88
  });
83
89
  } else {
84
- this.executeOperation(operations, ++idx, resolve, reject, result, context);
90
+ this.executeOperation(operations, ++idx, resolve, reject, operationResult, context);
85
91
  }
86
92
  } else {
87
93
  resolve(previousOperationData);
@@ -91,6 +97,351 @@ var Action = /*#__PURE__*/function () {
91
97
  return Action;
92
98
  }();
93
99
 
100
+ function _regeneratorRuntime() {
101
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
102
+
103
+ _regeneratorRuntime = function () {
104
+ return exports;
105
+ };
106
+
107
+ var exports = {},
108
+ Op = Object.prototype,
109
+ hasOwn = Op.hasOwnProperty,
110
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
111
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
112
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
113
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
114
+
115
+ function define(obj, key, value) {
116
+ return Object.defineProperty(obj, key, {
117
+ value: value,
118
+ enumerable: !0,
119
+ configurable: !0,
120
+ writable: !0
121
+ }), obj[key];
122
+ }
123
+
124
+ try {
125
+ define({}, "");
126
+ } catch (err) {
127
+ define = function (obj, key, value) {
128
+ return obj[key] = value;
129
+ };
130
+ }
131
+
132
+ function wrap(innerFn, outerFn, self, tryLocsList) {
133
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
134
+ generator = Object.create(protoGenerator.prototype),
135
+ context = new Context(tryLocsList || []);
136
+ return generator._invoke = function (innerFn, self, context) {
137
+ var state = "suspendedStart";
138
+ return function (method, arg) {
139
+ if ("executing" === state) throw new Error("Generator is already running");
140
+
141
+ if ("completed" === state) {
142
+ if ("throw" === method) throw arg;
143
+ return doneResult();
144
+ }
145
+
146
+ for (context.method = method, context.arg = arg;;) {
147
+ var delegate = context.delegate;
148
+
149
+ if (delegate) {
150
+ var delegateResult = maybeInvokeDelegate(delegate, context);
151
+
152
+ if (delegateResult) {
153
+ if (delegateResult === ContinueSentinel) continue;
154
+ return delegateResult;
155
+ }
156
+ }
157
+
158
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
159
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
160
+ context.dispatchException(context.arg);
161
+ } else "return" === context.method && context.abrupt("return", context.arg);
162
+ state = "executing";
163
+ var record = tryCatch(innerFn, self, context);
164
+
165
+ if ("normal" === record.type) {
166
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
167
+ return {
168
+ value: record.arg,
169
+ done: context.done
170
+ };
171
+ }
172
+
173
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
174
+ }
175
+ };
176
+ }(innerFn, self, context), generator;
177
+ }
178
+
179
+ function tryCatch(fn, obj, arg) {
180
+ try {
181
+ return {
182
+ type: "normal",
183
+ arg: fn.call(obj, arg)
184
+ };
185
+ } catch (err) {
186
+ return {
187
+ type: "throw",
188
+ arg: err
189
+ };
190
+ }
191
+ }
192
+
193
+ exports.wrap = wrap;
194
+ var ContinueSentinel = {};
195
+
196
+ function Generator() {}
197
+
198
+ function GeneratorFunction() {}
199
+
200
+ function GeneratorFunctionPrototype() {}
201
+
202
+ var IteratorPrototype = {};
203
+ define(IteratorPrototype, iteratorSymbol, function () {
204
+ return this;
205
+ });
206
+ var getProto = Object.getPrototypeOf,
207
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
208
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
209
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
210
+
211
+ function defineIteratorMethods(prototype) {
212
+ ["next", "throw", "return"].forEach(function (method) {
213
+ define(prototype, method, function (arg) {
214
+ return this._invoke(method, arg);
215
+ });
216
+ });
217
+ }
218
+
219
+ function AsyncIterator(generator, PromiseImpl) {
220
+ function invoke(method, arg, resolve, reject) {
221
+ var record = tryCatch(generator[method], generator, arg);
222
+
223
+ if ("throw" !== record.type) {
224
+ var result = record.arg,
225
+ value = result.value;
226
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
227
+ invoke("next", value, resolve, reject);
228
+ }, function (err) {
229
+ invoke("throw", err, resolve, reject);
230
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
231
+ result.value = unwrapped, resolve(result);
232
+ }, function (error) {
233
+ return invoke("throw", error, resolve, reject);
234
+ });
235
+ }
236
+
237
+ reject(record.arg);
238
+ }
239
+
240
+ var previousPromise;
241
+
242
+ this._invoke = function (method, arg) {
243
+ function callInvokeWithMethodAndArg() {
244
+ return new PromiseImpl(function (resolve, reject) {
245
+ invoke(method, arg, resolve, reject);
246
+ });
247
+ }
248
+
249
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
250
+ };
251
+ }
252
+
253
+ function maybeInvokeDelegate(delegate, context) {
254
+ var method = delegate.iterator[context.method];
255
+
256
+ if (undefined === method) {
257
+ if (context.delegate = null, "throw" === context.method) {
258
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
259
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
260
+ }
261
+
262
+ return ContinueSentinel;
263
+ }
264
+
265
+ var record = tryCatch(method, delegate.iterator, context.arg);
266
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
267
+ var info = record.arg;
268
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
269
+ }
270
+
271
+ function pushTryEntry(locs) {
272
+ var entry = {
273
+ tryLoc: locs[0]
274
+ };
275
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
276
+ }
277
+
278
+ function resetTryEntry(entry) {
279
+ var record = entry.completion || {};
280
+ record.type = "normal", delete record.arg, entry.completion = record;
281
+ }
282
+
283
+ function Context(tryLocsList) {
284
+ this.tryEntries = [{
285
+ tryLoc: "root"
286
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
287
+ }
288
+
289
+ function values(iterable) {
290
+ if (iterable) {
291
+ var iteratorMethod = iterable[iteratorSymbol];
292
+ if (iteratorMethod) return iteratorMethod.call(iterable);
293
+ if ("function" == typeof iterable.next) return iterable;
294
+
295
+ if (!isNaN(iterable.length)) {
296
+ var i = -1,
297
+ next = function next() {
298
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
299
+
300
+ return next.value = undefined, next.done = !0, next;
301
+ };
302
+
303
+ return next.next = next;
304
+ }
305
+ }
306
+
307
+ return {
308
+ next: doneResult
309
+ };
310
+ }
311
+
312
+ function doneResult() {
313
+ return {
314
+ value: undefined,
315
+ done: !0
316
+ };
317
+ }
318
+
319
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
320
+ var ctor = "function" == typeof genFun && genFun.constructor;
321
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
322
+ }, exports.mark = function (genFun) {
323
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
324
+ }, exports.awrap = function (arg) {
325
+ return {
326
+ __await: arg
327
+ };
328
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
329
+ return this;
330
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
331
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
332
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
333
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
334
+ return result.done ? result.value : iter.next();
335
+ });
336
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
337
+ return this;
338
+ }), define(Gp, "toString", function () {
339
+ return "[object Generator]";
340
+ }), exports.keys = function (object) {
341
+ var keys = [];
342
+
343
+ for (var key in object) keys.push(key);
344
+
345
+ return keys.reverse(), function next() {
346
+ for (; keys.length;) {
347
+ var key = keys.pop();
348
+ if (key in object) return next.value = key, next.done = !1, next;
349
+ }
350
+
351
+ return next.done = !0, next;
352
+ };
353
+ }, exports.values = values, Context.prototype = {
354
+ constructor: Context,
355
+ reset: function (skipTempReset) {
356
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
357
+ },
358
+ stop: function () {
359
+ this.done = !0;
360
+ var rootRecord = this.tryEntries[0].completion;
361
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
362
+ return this.rval;
363
+ },
364
+ dispatchException: function (exception) {
365
+ if (this.done) throw exception;
366
+ var context = this;
367
+
368
+ function handle(loc, caught) {
369
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
370
+ }
371
+
372
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
373
+ var entry = this.tryEntries[i],
374
+ record = entry.completion;
375
+ if ("root" === entry.tryLoc) return handle("end");
376
+
377
+ if (entry.tryLoc <= this.prev) {
378
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
379
+ hasFinally = hasOwn.call(entry, "finallyLoc");
380
+
381
+ if (hasCatch && hasFinally) {
382
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
383
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
384
+ } else if (hasCatch) {
385
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
386
+ } else {
387
+ if (!hasFinally) throw new Error("try statement without catch or finally");
388
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
389
+ }
390
+ }
391
+ }
392
+ },
393
+ abrupt: function (type, arg) {
394
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
395
+ var entry = this.tryEntries[i];
396
+
397
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
398
+ var finallyEntry = entry;
399
+ break;
400
+ }
401
+ }
402
+
403
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
404
+ var record = finallyEntry ? finallyEntry.completion : {};
405
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
406
+ },
407
+ complete: function (record, afterLoc) {
408
+ if ("throw" === record.type) throw record.arg;
409
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
410
+ },
411
+ finish: function (finallyLoc) {
412
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
413
+ var entry = this.tryEntries[i];
414
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
415
+ }
416
+ },
417
+ catch: function (tryLoc) {
418
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
419
+ var entry = this.tryEntries[i];
420
+
421
+ if (entry.tryLoc === tryLoc) {
422
+ var record = entry.completion;
423
+
424
+ if ("throw" === record.type) {
425
+ var thrown = record.arg;
426
+ resetTryEntry(entry);
427
+ }
428
+
429
+ return thrown;
430
+ }
431
+ }
432
+
433
+ throw new Error("illegal catch attempt");
434
+ },
435
+ delegateYield: function (iterable, resultName, nextLoc) {
436
+ return this.delegate = {
437
+ iterator: values(iterable),
438
+ resultName: resultName,
439
+ nextLoc: nextLoc
440
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
441
+ }
442
+ }, exports;
443
+ }
444
+
94
445
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
95
446
  try {
96
447
  var info = gen[key](arg);
@@ -128,7 +479,7 @@ function _asyncToGenerator(fn) {
128
479
  }
129
480
 
130
481
  function _extends() {
131
- _extends = Object.assign || function (target) {
482
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
132
483
  for (var i = 1; i < arguments.length; i++) {
133
484
  var source = arguments[i];
134
485
 
@@ -141,7 +492,6 @@ function _extends() {
141
492
 
142
493
  return target;
143
494
  };
144
-
145
495
  return _extends.apply(this, arguments);
146
496
  }
147
497
 
@@ -153,11 +503,10 @@ function _inheritsLoose(subClass, superClass) {
153
503
  }
154
504
 
155
505
  function _setPrototypeOf(o, p) {
156
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
506
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
157
507
  o.__proto__ = p;
158
508
  return o;
159
509
  };
160
-
161
510
  return _setPrototypeOf(o, p);
162
511
  }
163
512
 
@@ -234,960 +583,398 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
234
583
  return TimelineAction;
235
584
  }(EndableAction);
236
585
 
237
- function getNestedValue(properties, sourceObject) {
238
- if (!properties) {
239
- throw Error('properties arg cannot be null');
240
- }
586
+ function dashToCamelCase(input) {
587
+ return input.replace(/-([a-z])/g, function (g) {
588
+ return g[1].toUpperCase();
589
+ });
590
+ }
241
591
 
242
- if (!sourceObject) {
243
- throw Error('sourceObject arg cannot be null');
244
- }
592
+ /**
593
+ * This function takes an Eligius engine configuration, a root path for the config and an arbitrary list of asset info.
594
+ * The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.
595
+ * I.e. html, json, etc.
596
+ *
597
+ * @param config
598
+ * @param configPath
599
+ * @param assetInfo
600
+ */
245
601
 
246
- var currentInstance = sourceObject;
247
- var suffix = null;
248
- properties.forEach(function (prop, index) {
249
- if (index === properties.length - 1) {
250
- var parts = prop.split('+');
602
+ function generateImporterSourceCode(config, configPath, assetInfo) {
603
+ var importPaths = _gatherImportPaths(config, configPath, assetInfo);
251
604
 
252
- if (parts.length > 1) {
253
- prop = parts[0];
254
- suffix = parts[1];
255
- }
256
- }
605
+ var importerSourceCode = _generateSourceCode(importPaths);
257
606
 
258
- currentInstance = currentInstance[prop];
259
- });
260
- return suffix ? currentInstance + suffix : currentInstance;
607
+ return importerSourceCode;
261
608
  }
262
609
 
263
- function getNestedPropertyValue(propertyChain, sourceObject) {
264
- var properties = propertyChain.split('.');
265
- return getNestedValue(properties, sourceObject);
610
+ function _generateSourceCode(importPaths) {
611
+ var result = importPaths.filter(function (x) {
612
+ return x.defaultImport;
613
+ }).map(function (imp) {
614
+ return "import " + imp.systemName + " from '" + imp.path + "';";
615
+ }).concat(importPaths.filter(function (x) {
616
+ return !x.defaultImport;
617
+ }).map(function (imp) {
618
+ var _imp$path;
619
+
620
+ return "import {" + imp.systemName + "} from '" + ((_imp$path = imp.path) != null ? _imp$path : 'eligius') + "';";
621
+ }));
622
+ result.push('const imports: Record<string, any> = {');
623
+ result.push.apply(result, importPaths.map(function (imp) {
624
+ return imp.systemName + ": { '" + imp.systemName + "': " + imp.systemName + " },";
625
+ }));
626
+ result.push('};');
627
+ result.push('class EligiusResourceImporter implements ISimpleResourceImporter {');
628
+ result.push('import(name: string): Record<string, any> {');
629
+ result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');
630
+ result.push('throw Error(`Unknown systemName: ${name}`);');
631
+ result.push('}}');
632
+ result.push('export default EligiusResourceImporter;');
633
+ return result.join('\n');
266
634
  }
267
635
 
268
- var ConfigurationResolver = /*#__PURE__*/function () {
269
- function ConfigurationResolver(importer, eventbus) {
270
- this.importer = void 0;
271
- this.eventbus = void 0;
272
- this.importer = importer;
273
- this.eventbus = eventbus;
274
- }
636
+ function _gatherImportPaths(config, configPath, assetInfo) {
637
+ return [].concat(_gatherOperations(config), assetInfo.flatMap(function (info) {
638
+ return _gatherAssets(configPath, info.path, info.extension);
639
+ }), _gatherControllers(config), _gatherProviders(config), _gatherEngines(config));
640
+ }
275
641
 
276
- var _proto = ConfigurationResolver.prototype;
642
+ function _gatherAssets(assetPath, subdir, extension) {
643
+ var entries = fs.readdirSync(path.join(assetPath, subdir));
644
+ return entries.map(function (file) {
645
+ var importName = "" + dashToCamelCase(path.basename(file, extension));
646
+ return {
647
+ systemName: importName,
648
+ path: "./" + subdir + "/" + file,
649
+ defaultImport: true
650
+ };
651
+ });
652
+ }
277
653
 
278
- _proto.process = function process(configuration, actionRegistryListener) {
279
- resolvePlaceholders(configuration, configuration, this.importer);
654
+ function _gatherControllers(config) {
655
+ var _importPaths, _importPaths2, _importPaths3, _importPaths4;
280
656
 
281
- if (!isDefined(configuration.timelineProviderSettings)) {
282
- throw new Error('Configuration incomplete: it needs to have at least one timeline provider setting');
283
- }
657
+ var importPaths = [];
284
658
 
285
- var resolvedConfig = {
286
- id: configuration.id,
287
- engine: _extends({}, configuration.engine),
288
- timelineProviderSettings: deepCopy(configuration.timelineProviderSettings),
289
- containerSelector: configuration.containerSelector,
290
- language: configuration.language,
291
- layoutTemplate: configuration.layoutTemplate,
292
- availableLanguages: deepCopy(configuration.availableLanguages),
293
- actions: resolveActions(configuration.actions, this.importer, this.eventbus),
294
- initActions: resolveActions(configuration.initActions, this.importer, this.eventbus),
295
- labels: deepCopy(configuration.labels),
296
- timelineFlow: deepCopy(configuration.timelineFlow),
297
- timelines: resolveTimelines(configuration.timelines, this.importer, this.eventbus)
298
- };
299
- var eventActions = [];
659
+ (_importPaths = importPaths).push.apply(_importPaths, _gatherControllerImportPathsFromActions(config.initActions));
300
660
 
301
- if (configuration.eventActions && actionRegistryListener) {
302
- eventActions = resolveEventActions(configuration.eventActions, actionRegistryListener, this.importer, this.eventbus);
303
- }
661
+ (_importPaths2 = importPaths).push.apply(_importPaths2, _gatherControllerImportPathsFromActions(config.actions));
304
662
 
305
- var actionsLookup = resolvedConfig.actions.concat(eventActions).reduce(function (aggr, action) {
306
- var _extends2;
307
-
308
- return _extends({}, aggr, (_extends2 = {}, _extends2[action.name] = action, _extends2));
309
- }, {});
310
- return [actionsLookup, resolvedConfig];
311
- };
663
+ (_importPaths3 = importPaths).push.apply(_importPaths3, _gatherControllerImportPathsFromActions(config.timelines.flatMap(function (x) {
664
+ return x.timelineActions;
665
+ })));
312
666
 
313
- return ConfigurationResolver;
314
- }();
667
+ (_importPaths4 = importPaths).push.apply(_importPaths4, _gatherControllerImportPathsFromActions(config.eventActions));
315
668
 
316
- function resolveEventActions(eventActionConfigurations, actionRegistryListener, importer, eventbus) {
317
- var resolvedConfigs = eventActionConfigurations.map(function (config) {
318
- return resolveActionConfiguration(config, importer);
319
- });
320
- return resolvedConfigs.map(function (config, index) {
321
- var _eventActionConfigura = eventActionConfigurations[index],
322
- eventName = _eventActionConfigura.eventName,
323
- eventTopic = _eventActionConfigura.eventTopic;
324
- var eventAction = new Action(config.name, config.startOperations, eventbus);
325
- actionRegistryListener.registerAction(eventAction, eventName, eventTopic);
326
- return eventAction;
327
- });
669
+ importPaths = dedupe(importPaths);
670
+ return importPaths;
328
671
  }
329
672
 
330
- function resolveTimelines(timelines, importer, eventbus) {
331
- var resolve = resolveTimelineAction.bind(null, importer, eventbus);
332
- return timelines.map(function (config) {
333
- return _extends({}, config, {
334
- timelineActions: config.timelineActions.map(resolve)
673
+ function _gatherProviders(config) {
674
+ if (config.timelineProviderSettings) {
675
+ return Object.values(config.timelineProviderSettings).map(function (settings) {
676
+ return {
677
+ systemName: settings.systemName
678
+ };
335
679
  });
336
- });
337
- }
338
-
339
- function resolveOperation(importer, operationConfig) {
340
- return {
341
- id: operationConfig.id,
342
- systemName: operationConfig.systemName,
343
- operationData: deepCopy(operationConfig.operationData),
344
- instance: importer["import"](operationConfig.systemName)[operationConfig.systemName]
345
- };
346
- }
347
-
348
- function resolveActionConfiguration(config, importer) {
349
- var resolve = resolveOperation.bind(null, importer);
350
- return {
351
- id: config.id,
352
- name: config.name,
353
- startOperations: config.startOperations.map(resolve)
354
- };
355
- }
680
+ }
356
681
 
357
- function resolveEndableActionConfiguration(config, importer) {
358
- var resolve = resolveOperation.bind(null, importer);
359
- var action = resolveActionConfiguration(config, importer);
360
- return _extends({}, action, {
361
- endOperations: config.endOperations.map(resolve)
362
- });
682
+ return [];
363
683
  }
364
684
 
365
- function resolveTimelineAction(importer, eventbus, actionConfiguration) {
366
- var _actionConfiguration$;
685
+ function _gatherEngines(config) {
686
+ if (config.engine) {
687
+ var systemName = config.engine.systemName;
688
+ return [{
689
+ systemName: systemName
690
+ }];
691
+ }
367
692
 
368
- var resolvedConfig = resolveEndableActionConfiguration(actionConfiguration, importer);
369
- var duration = {
370
- end: (_actionConfiguration$ = actionConfiguration.duration.end) != null ? _actionConfiguration$ : -1,
371
- start: actionConfiguration.duration.start
372
- };
373
- var id = resolvedConfig.id,
374
- name = resolvedConfig.name,
375
- endOperations = resolvedConfig.endOperations,
376
- startOperations = resolvedConfig.startOperations;
377
- var action = new TimelineAction(name, startOperations, endOperations, duration, eventbus);
378
- action.id = id;
379
- return action;
693
+ return [];
380
694
  }
381
695
 
382
- function resolveActions(actionConfigurations, importer, eventbus) {
383
- var resolvedConfigs = actionConfigurations.map(function (config) {
384
- return resolveEndableActionConfiguration(config, importer);
385
- });
386
- return resolvedConfigs.map(function (resolvedConfig) {
387
- var name = resolvedConfig.name,
388
- endOperations = resolvedConfig.endOperations,
389
- startOperations = resolvedConfig.startOperations;
390
- var action = new EndableAction(name, startOperations, endOperations, eventbus);
391
- action.id = resolvedConfig.id;
392
- return action;
393
- });
394
- }
696
+ function _gatherOperations(config) {
697
+ var _config$eventActions;
395
698
 
396
- function resolvePlaceholders(config, rootConfig, importer) {
397
- if (!isDefined(config)) {
398
- return;
399
- }
699
+ var importPaths = _gatherOperationImportPathsFromActions(config.initActions.concat(config.actions).concat((_config$eventActions = config.eventActions) != null ? _config$eventActions : []));
400
700
 
401
- if (Array.isArray(config)) {
402
- config.forEach(function (item) {
403
- resolvePlaceholders(item, rootConfig, importer);
404
- });
405
- } else {
406
- Object.keys(config).forEach(function (key) {
407
- resolvePlaceholder(key, config, rootConfig, importer);
701
+ if (config.timelines) {
702
+ var timelineActions = config.timelines.flatMap(function (x) {
703
+ return x.timelineActions;
408
704
  });
705
+ importPaths = importPaths.concat(_gatherOperationImportPathsFromActions(timelineActions));
409
706
  }
410
- }
411
707
 
412
- function resolvePlaceholder(key, config, rootConfig, importer) {
413
- var value = config[key];
414
-
415
- if (typeof value === 'string') {
416
- if (value.startsWith('config:')) {
417
- var configProperty = value.substr(7, value.length);
418
- config[key] = getNestedPropertyValue(configProperty, rootConfig);
419
- } else if (value.startsWith('template:')) {
420
- var templateKey = value.substr(9, value.length);
421
- config[key] = importer["import"](templateKey)[templateKey];
422
- } else if (value.startsWith('json:')) {
423
- var jsonKey = value.substr(5, value.length);
424
- var json = importer["import"](jsonKey)[jsonKey];
425
- config[key] = json;
426
- }
427
- } else if (typeof value === 'object') {
428
- resolvePlaceholders(config[key], rootConfig, importer);
429
- }
708
+ return dedupe(importPaths);
430
709
  }
431
710
 
432
- var runtime = {exports: {}};
433
-
434
- /**
435
- * Copyright (c) 2014-present, Facebook, Inc.
436
- *
437
- * This source code is licensed under the MIT license found in the
438
- * LICENSE file in the root directory of this source tree.
439
- */
440
-
441
- (function (module) {
442
- var runtime = (function (exports) {
443
-
444
- var Op = Object.prototype;
445
- var hasOwn = Op.hasOwnProperty;
446
- var undefined$1; // More compressible than void 0.
447
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
448
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
449
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
450
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
451
-
452
- function define(obj, key, value) {
453
- Object.defineProperty(obj, key, {
454
- value: value,
455
- enumerable: true,
456
- configurable: true,
457
- writable: true
458
- });
459
- return obj[key];
460
- }
461
- try {
462
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
463
- define({}, "");
464
- } catch (err) {
465
- define = function(obj, key, value) {
466
- return obj[key] = value;
467
- };
711
+ function _gatherControllerImportPathsFromActions(actionsConfig) {
712
+ if (!actionsConfig) {
713
+ return [];
468
714
  }
469
715
 
470
- function wrap(innerFn, outerFn, self, tryLocsList) {
471
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
472
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
473
- var generator = Object.create(protoGenerator.prototype);
474
- var context = new Context(tryLocsList || []);
475
-
476
- // The ._invoke method unifies the implementations of the .next,
477
- // .throw, and .return methods.
478
- generator._invoke = makeInvokeMethod(innerFn, self, context);
716
+ var operations = actionsConfig.flatMap(function (x) {
717
+ var _x$endOperations;
479
718
 
480
- return generator;
481
- }
482
- exports.wrap = wrap;
719
+ return [].concat(x.startOperations, (_x$endOperations = x.endOperations) != null ? _x$endOperations : []);
720
+ });
721
+ return _gatherControllerImportPaths(operations);
722
+ }
483
723
 
484
- // Try/catch helper to minimize deoptimizations. Returns a completion
485
- // record like context.tryEntries[i].completion. This interface could
486
- // have been (and was previously) designed to take a closure to be
487
- // invoked without arguments, but in all the cases we care about we
488
- // already have an existing method we want to call, so there's no need
489
- // to create a new function object. We can even get away with assuming
490
- // the method takes exactly one argument, since that happens to be true
491
- // in every case, so we don't have to touch the arguments object. The
492
- // only additional allocation required is the completion record, which
493
- // has a stable shape and so hopefully should be cheap to allocate.
494
- function tryCatch(fn, obj, arg) {
495
- try {
496
- return { type: "normal", arg: fn.call(obj, arg) };
497
- } catch (err) {
498
- return { type: "throw", arg: err };
499
- }
724
+ function _gatherOperationImportPathsFromActions(actionsConfig) {
725
+ if (!actionsConfig) {
726
+ return [];
500
727
  }
501
728
 
502
- var GenStateSuspendedStart = "suspendedStart";
503
- var GenStateSuspendedYield = "suspendedYield";
504
- var GenStateExecuting = "executing";
505
- var GenStateCompleted = "completed";
506
-
507
- // Returning this object from the innerFn has the same effect as
508
- // breaking out of the dispatch switch statement.
509
- var ContinueSentinel = {};
510
-
511
- // Dummy constructor functions that we use as the .constructor and
512
- // .constructor.prototype properties for functions that return Generator
513
- // objects. For full spec compliance, you may wish to configure your
514
- // minifier not to mangle the names of these two functions.
515
- function Generator() {}
516
- function GeneratorFunction() {}
517
- function GeneratorFunctionPrototype() {}
729
+ var operations = actionsConfig.flatMap(function (x) {
730
+ var _x$endOperations2;
518
731
 
519
- // This is a polyfill for %IteratorPrototype% for environments that
520
- // don't natively support it.
521
- var IteratorPrototype = {};
522
- define(IteratorPrototype, iteratorSymbol, function () {
523
- return this;
732
+ return [].concat(x.startOperations, (_x$endOperations2 = x.endOperations) != null ? _x$endOperations2 : []);
524
733
  });
734
+ return _gatherOperationImportPaths(operations);
735
+ }
525
736
 
526
- var getProto = Object.getPrototypeOf;
527
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
528
- if (NativeIteratorPrototype &&
529
- NativeIteratorPrototype !== Op &&
530
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
531
- // This environment has a native %IteratorPrototype%; use it instead
532
- // of the polyfill.
533
- IteratorPrototype = NativeIteratorPrototype;
534
- }
535
-
536
- var Gp = GeneratorFunctionPrototype.prototype =
537
- Generator.prototype = Object.create(IteratorPrototype);
538
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
539
- define(Gp, "constructor", GeneratorFunctionPrototype);
540
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
541
- GeneratorFunction.displayName = define(
542
- GeneratorFunctionPrototype,
543
- toStringTagSymbol,
544
- "GeneratorFunction"
545
- );
546
-
547
- // Helper for defining the .next, .throw, and .return methods of the
548
- // Iterator interface in terms of a single ._invoke method.
549
- function defineIteratorMethods(prototype) {
550
- ["next", "throw", "return"].forEach(function(method) {
551
- define(prototype, method, function(arg) {
552
- return this._invoke(method, arg);
553
- });
554
- });
737
+ function _gatherControllerImportPaths(operationConfigs) {
738
+ if (!operationConfigs) {
739
+ return [];
555
740
  }
556
741
 
557
- exports.isGeneratorFunction = function(genFun) {
558
- var ctor = typeof genFun === "function" && genFun.constructor;
559
- return ctor
560
- ? ctor === GeneratorFunction ||
561
- // For the native GeneratorFunction constructor, the best we can
562
- // do is to check its .name property.
563
- (ctor.displayName || ctor.name) === "GeneratorFunction"
564
- : false;
565
- };
742
+ return operationConfigs.filter(function (operationConfig) {
743
+ var _operationConfig$oper;
566
744
 
567
- exports.mark = function(genFun) {
568
- if (Object.setPrototypeOf) {
569
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
570
- } else {
571
- genFun.__proto__ = GeneratorFunctionPrototype;
572
- define(genFun, toStringTagSymbol, "GeneratorFunction");
745
+ if ((_operationConfig$oper = operationConfig.operationData) != null && _operationConfig$oper.hasOwnProperty('systemName')) {
746
+ return operationConfig.operationData.systemName.endsWith('Controller');
573
747
  }
574
- genFun.prototype = Object.create(Gp);
575
- return genFun;
576
- };
577
-
578
- // Within the body of any async function, `await x` is transformed to
579
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
580
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
581
- // meant to be awaited.
582
- exports.awrap = function(arg) {
583
- return { __await: arg };
584
- };
585
-
586
- function AsyncIterator(generator, PromiseImpl) {
587
- function invoke(method, arg, resolve, reject) {
588
- var record = tryCatch(generator[method], generator, arg);
589
- if (record.type === "throw") {
590
- reject(record.arg);
591
- } else {
592
- var result = record.arg;
593
- var value = result.value;
594
- if (value &&
595
- typeof value === "object" &&
596
- hasOwn.call(value, "__await")) {
597
- return PromiseImpl.resolve(value.__await).then(function(value) {
598
- invoke("next", value, resolve, reject);
599
- }, function(err) {
600
- invoke("throw", err, resolve, reject);
601
- });
602
- }
603
748
 
604
- return PromiseImpl.resolve(value).then(function(unwrapped) {
605
- // When a yielded Promise is resolved, its final value becomes
606
- // the .value of the Promise<{value,done}> result for the
607
- // current iteration.
608
- result.value = unwrapped;
609
- resolve(result);
610
- }, function(error) {
611
- // If a rejected Promise was yielded, throw the rejection back
612
- // into the async generator function so it can be handled there.
613
- return invoke("throw", error, resolve, reject);
614
- });
615
- }
616
- }
617
-
618
- var previousPromise;
619
-
620
- function enqueue(method, arg) {
621
- function callInvokeWithMethodAndArg() {
622
- return new PromiseImpl(function(resolve, reject) {
623
- invoke(method, arg, resolve, reject);
624
- });
625
- }
626
-
627
- return previousPromise =
628
- // If enqueue has been called before, then we want to wait until
629
- // all previous Promises have been resolved before calling invoke,
630
- // so that results are always delivered in the correct order. If
631
- // enqueue has not been called before, then it is important to
632
- // call invoke immediately, without waiting on a callback to fire,
633
- // so that the async generator function has the opportunity to do
634
- // any necessary setup in a predictable way. This predictability
635
- // is why the Promise constructor synchronously invokes its
636
- // executor callback, and why async functions synchronously
637
- // execute code before the first await. Since we implement simple
638
- // async functions in terms of async generators, it is especially
639
- // important to get this right, even though it requires care.
640
- previousPromise ? previousPromise.then(
641
- callInvokeWithMethodAndArg,
642
- // Avoid propagating failures to Promises returned by later
643
- // invocations of the iterator.
644
- callInvokeWithMethodAndArg
645
- ) : callInvokeWithMethodAndArg();
646
- }
647
-
648
- // Define the unified helper method that is used to implement .next,
649
- // .throw, and .return (see defineIteratorMethods).
650
- this._invoke = enqueue;
651
- }
652
-
653
- defineIteratorMethods(AsyncIterator.prototype);
654
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
655
- return this;
749
+ return false;
750
+ }).map(function (operationConfig) {
751
+ var systemName = operationConfig.operationData.systemName;
752
+ return {
753
+ systemName: systemName
754
+ };
656
755
  });
657
- exports.AsyncIterator = AsyncIterator;
658
-
659
- // Note that simple async functions are implemented on top of
660
- // AsyncIterator objects; they just return a Promise for the value of
661
- // the final result produced by the iterator.
662
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
663
- if (PromiseImpl === void 0) PromiseImpl = Promise;
664
-
665
- var iter = new AsyncIterator(
666
- wrap(innerFn, outerFn, self, tryLocsList),
667
- PromiseImpl
668
- );
669
-
670
- return exports.isGeneratorFunction(outerFn)
671
- ? iter // If outerFn is a generator, return the full iterator.
672
- : iter.next().then(function(result) {
673
- return result.done ? result.value : iter.next();
674
- });
675
- };
676
-
677
- function makeInvokeMethod(innerFn, self, context) {
678
- var state = GenStateSuspendedStart;
679
-
680
- return function invoke(method, arg) {
681
- if (state === GenStateExecuting) {
682
- throw new Error("Generator is already running");
683
- }
684
-
685
- if (state === GenStateCompleted) {
686
- if (method === "throw") {
687
- throw arg;
688
- }
689
-
690
- // Be forgiving, per 25.3.3.3.3 of the spec:
691
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
692
- return doneResult();
693
- }
694
-
695
- context.method = method;
696
- context.arg = arg;
697
-
698
- while (true) {
699
- var delegate = context.delegate;
700
- if (delegate) {
701
- var delegateResult = maybeInvokeDelegate(delegate, context);
702
- if (delegateResult) {
703
- if (delegateResult === ContinueSentinel) continue;
704
- return delegateResult;
705
- }
706
- }
707
-
708
- if (context.method === "next") {
709
- // Setting context._sent for legacy support of Babel's
710
- // function.sent implementation.
711
- context.sent = context._sent = context.arg;
712
-
713
- } else if (context.method === "throw") {
714
- if (state === GenStateSuspendedStart) {
715
- state = GenStateCompleted;
716
- throw context.arg;
717
- }
718
-
719
- context.dispatchException(context.arg);
720
-
721
- } else if (context.method === "return") {
722
- context.abrupt("return", context.arg);
723
- }
724
-
725
- state = GenStateExecuting;
726
-
727
- var record = tryCatch(innerFn, self, context);
728
- if (record.type === "normal") {
729
- // If an exception is thrown from innerFn, we leave state ===
730
- // GenStateExecuting and loop back for another invocation.
731
- state = context.done
732
- ? GenStateCompleted
733
- : GenStateSuspendedYield;
734
-
735
- if (record.arg === ContinueSentinel) {
736
- continue;
737
- }
756
+ }
738
757
 
739
- return {
740
- value: record.arg,
741
- done: context.done
742
- };
743
-
744
- } else if (record.type === "throw") {
745
- state = GenStateCompleted;
746
- // Dispatch the exception by looping back around to the
747
- // context.dispatchException(context.arg) call above.
748
- context.method = "throw";
749
- context.arg = record.arg;
750
- }
751
- }
752
- };
758
+ function _gatherOperationImportPaths(operationConfigs) {
759
+ if (!operationConfigs) {
760
+ return [];
753
761
  }
754
762
 
755
- // Call delegate.iterator[context.method](context.arg) and handle the
756
- // result, either by returning a { value, done } result from the
757
- // delegate iterator, or by modifying context.method and context.arg,
758
- // setting context.delegate to null, and returning the ContinueSentinel.
759
- function maybeInvokeDelegate(delegate, context) {
760
- var method = delegate.iterator[context.method];
761
- if (method === undefined$1) {
762
- // A .throw or .return when the delegate iterator has no .throw
763
- // method always terminates the yield* loop.
764
- context.delegate = null;
765
-
766
- if (context.method === "throw") {
767
- // Note: ["return"] must be used for ES3 parsing compatibility.
768
- if (delegate.iterator["return"]) {
769
- // If the delegate iterator has a return method, give it a
770
- // chance to clean up.
771
- context.method = "return";
772
- context.arg = undefined$1;
773
- maybeInvokeDelegate(delegate, context);
774
-
775
- if (context.method === "throw") {
776
- // If maybeInvokeDelegate(context) changed context.method from
777
- // "return" to "throw", let that override the TypeError below.
778
- return ContinueSentinel;
779
- }
780
- }
781
-
782
- context.method = "throw";
783
- context.arg = new TypeError(
784
- "The iterator does not provide a 'throw' method");
785
- }
786
-
787
- return ContinueSentinel;
788
- }
789
-
790
- var record = tryCatch(method, delegate.iterator, context.arg);
763
+ return operationConfigs.map(function (operationConfig) {
764
+ var systemName = operationConfig.systemName;
765
+ return {
766
+ systemName: systemName
767
+ };
768
+ });
769
+ }
791
770
 
792
- if (record.type === "throw") {
793
- context.method = "throw";
794
- context.arg = record.arg;
795
- context.delegate = null;
796
- return ContinueSentinel;
771
+ function dedupe(importPaths) {
772
+ var lookup = {};
773
+ return importPaths.filter(function (imp) {
774
+ if (lookup[imp.systemName]) {
775
+ return false;
797
776
  }
798
777
 
799
- var info = record.arg;
778
+ lookup[imp.systemName] = true;
779
+ return true;
780
+ });
781
+ }
800
782
 
801
- if (! info) {
802
- context.method = "throw";
803
- context.arg = new TypeError("iterator result is not an object");
804
- context.delegate = null;
805
- return ContinueSentinel;
806
- }
783
+ function getNestedValue(properties, sourceObject) {
784
+ if (!properties) {
785
+ throw Error('properties arg cannot be null');
786
+ }
807
787
 
808
- if (info.done) {
809
- // Assign the result of the finished delegate to the temporary
810
- // variable specified by delegate.resultName (see delegateYield).
811
- context[delegate.resultName] = info.value;
788
+ if (!sourceObject) {
789
+ throw Error('sourceObject arg cannot be null');
790
+ }
812
791
 
813
- // Resume execution at the desired location (see delegateYield).
814
- context.next = delegate.nextLoc;
792
+ var currentInstance = sourceObject;
793
+ var suffix = null;
794
+ properties.forEach(function (prop, index) {
795
+ if (index === properties.length - 1) {
796
+ var parts = prop.split('+');
815
797
 
816
- // If context.method was "throw" but the delegate handled the
817
- // exception, let the outer generator proceed normally. If
818
- // context.method was "next", forget context.arg since it has been
819
- // "consumed" by the delegate iterator. If context.method was
820
- // "return", allow the original .return call to continue in the
821
- // outer generator.
822
- if (context.method !== "return") {
823
- context.method = "next";
824
- context.arg = undefined$1;
798
+ if (parts.length > 1) {
799
+ prop = parts[0];
800
+ suffix = parts[1];
825
801
  }
826
-
827
- } else {
828
- // Re-yield the result returned by the delegate method.
829
- return info;
830
802
  }
831
803
 
832
- // The delegate iterator is finished, so forget it and continue with
833
- // the outer generator.
834
- context.delegate = null;
835
- return ContinueSentinel;
836
- }
837
-
838
- // Define Generator.prototype.{next,throw,return} in terms of the
839
- // unified ._invoke helper method.
840
- defineIteratorMethods(Gp);
841
-
842
- define(Gp, toStringTagSymbol, "Generator");
843
-
844
- // A Generator should always return itself as the iterator object when the
845
- // @@iterator function is called on it. Some browsers' implementations of the
846
- // iterator prototype chain incorrectly implement this, causing the Generator
847
- // object to not be returned from this call. This ensures that doesn't happen.
848
- // See https://github.com/facebook/regenerator/issues/274 for more details.
849
- define(Gp, iteratorSymbol, function() {
850
- return this;
851
- });
852
-
853
- define(Gp, "toString", function() {
854
- return "[object Generator]";
804
+ currentInstance = currentInstance[prop];
855
805
  });
806
+ return suffix ? currentInstance + suffix : currentInstance;
807
+ }
856
808
 
857
- function pushTryEntry(locs) {
858
- var entry = { tryLoc: locs[0] };
859
-
860
- if (1 in locs) {
861
- entry.catchLoc = locs[1];
862
- }
863
-
864
- if (2 in locs) {
865
- entry.finallyLoc = locs[2];
866
- entry.afterLoc = locs[3];
867
- }
809
+ function getNestedPropertyValue(propertyChain, sourceObject) {
810
+ var properties = propertyChain.split('.');
811
+ return getNestedValue(properties, sourceObject);
812
+ }
868
813
 
869
- this.tryEntries.push(entry);
814
+ var ConfigurationResolver = /*#__PURE__*/function () {
815
+ function ConfigurationResolver(importer, eventbus) {
816
+ this.importer = void 0;
817
+ this.eventbus = void 0;
818
+ this.importer = importer;
819
+ this.eventbus = eventbus;
870
820
  }
871
821
 
872
- function resetTryEntry(entry) {
873
- var record = entry.completion || {};
874
- record.type = "normal";
875
- delete record.arg;
876
- entry.completion = record;
877
- }
822
+ var _proto = ConfigurationResolver.prototype;
878
823
 
879
- function Context(tryLocsList) {
880
- // The root entry object (effectively a try statement without a catch
881
- // or a finally block) gives us a place to store values thrown from
882
- // locations where there is no enclosing try statement.
883
- this.tryEntries = [{ tryLoc: "root" }];
884
- tryLocsList.forEach(pushTryEntry, this);
885
- this.reset(true);
886
- }
824
+ _proto.process = function process(configuration, actionRegistryListener) {
825
+ resolvePlaceholders(configuration, configuration, this.importer);
887
826
 
888
- exports.keys = function(object) {
889
- var keys = [];
890
- for (var key in object) {
891
- keys.push(key);
827
+ if (!isDefined(configuration.timelineProviderSettings)) {
828
+ throw new Error('Configuration incomplete: it needs to have at least one timeline provider setting');
892
829
  }
893
- keys.reverse();
894
-
895
- // Rather than returning an object with a next method, we keep
896
- // things simple and return the next function itself.
897
- return function next() {
898
- while (keys.length) {
899
- var key = keys.pop();
900
- if (key in object) {
901
- next.value = key;
902
- next.done = false;
903
- return next;
904
- }
905
- }
906
830
 
907
- // To avoid creating an additional object, we just hang the .value
908
- // and .done properties off the next function object itself. This
909
- // also ensures that the minifier will not anonymize the function.
910
- next.done = true;
911
- return next;
831
+ var resolvedConfig = {
832
+ id: configuration.id,
833
+ engine: _extends({}, configuration.engine),
834
+ timelineProviderSettings: deepCopy(configuration.timelineProviderSettings),
835
+ containerSelector: configuration.containerSelector,
836
+ language: configuration.language,
837
+ layoutTemplate: configuration.layoutTemplate,
838
+ availableLanguages: deepCopy(configuration.availableLanguages),
839
+ actions: resolveActions(configuration.actions, this.importer, this.eventbus),
840
+ initActions: resolveActions(configuration.initActions, this.importer, this.eventbus),
841
+ labels: deepCopy(configuration.labels),
842
+ timelineFlow: deepCopy(configuration.timelineFlow),
843
+ timelines: resolveTimelines(configuration.timelines, this.importer, this.eventbus)
912
844
  };
913
- };
914
-
915
- function values(iterable) {
916
- if (iterable) {
917
- var iteratorMethod = iterable[iteratorSymbol];
918
- if (iteratorMethod) {
919
- return iteratorMethod.call(iterable);
920
- }
921
-
922
- if (typeof iterable.next === "function") {
923
- return iterable;
924
- }
925
-
926
- if (!isNaN(iterable.length)) {
927
- var i = -1, next = function next() {
928
- while (++i < iterable.length) {
929
- if (hasOwn.call(iterable, i)) {
930
- next.value = iterable[i];
931
- next.done = false;
932
- return next;
933
- }
934
- }
935
-
936
- next.value = undefined$1;
937
- next.done = true;
938
-
939
- return next;
940
- };
845
+ var eventActions = [];
941
846
 
942
- return next.next = next;
943
- }
847
+ if (configuration.eventActions && actionRegistryListener) {
848
+ eventActions = resolveEventActions(configuration.eventActions, actionRegistryListener, this.importer, this.eventbus);
944
849
  }
945
850
 
946
- // Return an iterator with no values.
947
- return { next: doneResult };
948
- }
949
- exports.values = values;
950
-
951
- function doneResult() {
952
- return { value: undefined$1, done: true };
953
- }
954
-
955
- Context.prototype = {
956
- constructor: Context,
957
-
958
- reset: function(skipTempReset) {
959
- this.prev = 0;
960
- this.next = 0;
961
- // Resetting context._sent for legacy support of Babel's
962
- // function.sent implementation.
963
- this.sent = this._sent = undefined$1;
964
- this.done = false;
965
- this.delegate = null;
966
-
967
- this.method = "next";
968
- this.arg = undefined$1;
969
-
970
- this.tryEntries.forEach(resetTryEntry);
971
-
972
- if (!skipTempReset) {
973
- for (var name in this) {
974
- // Not sure about the optimal order of these conditions:
975
- if (name.charAt(0) === "t" &&
976
- hasOwn.call(this, name) &&
977
- !isNaN(+name.slice(1))) {
978
- this[name] = undefined$1;
979
- }
980
- }
981
- }
982
- },
983
-
984
- stop: function() {
985
- this.done = true;
986
-
987
- var rootEntry = this.tryEntries[0];
988
- var rootRecord = rootEntry.completion;
989
- if (rootRecord.type === "throw") {
990
- throw rootRecord.arg;
991
- }
992
-
993
- return this.rval;
994
- },
995
-
996
- dispatchException: function(exception) {
997
- if (this.done) {
998
- throw exception;
999
- }
1000
-
1001
- var context = this;
1002
- function handle(loc, caught) {
1003
- record.type = "throw";
1004
- record.arg = exception;
1005
- context.next = loc;
1006
-
1007
- if (caught) {
1008
- // If the dispatched exception was caught by a catch block,
1009
- // then let that catch block handle the exception normally.
1010
- context.method = "next";
1011
- context.arg = undefined$1;
1012
- }
1013
-
1014
- return !! caught;
1015
- }
1016
-
1017
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1018
- var entry = this.tryEntries[i];
1019
- var record = entry.completion;
1020
-
1021
- if (entry.tryLoc === "root") {
1022
- // Exception thrown outside of any try block that could handle
1023
- // it, so set the completion value of the entire function to
1024
- // throw the exception.
1025
- return handle("end");
1026
- }
1027
-
1028
- if (entry.tryLoc <= this.prev) {
1029
- var hasCatch = hasOwn.call(entry, "catchLoc");
1030
- var hasFinally = hasOwn.call(entry, "finallyLoc");
1031
-
1032
- if (hasCatch && hasFinally) {
1033
- if (this.prev < entry.catchLoc) {
1034
- return handle(entry.catchLoc, true);
1035
- } else if (this.prev < entry.finallyLoc) {
1036
- return handle(entry.finallyLoc);
1037
- }
1038
-
1039
- } else if (hasCatch) {
1040
- if (this.prev < entry.catchLoc) {
1041
- return handle(entry.catchLoc, true);
1042
- }
1043
-
1044
- } else if (hasFinally) {
1045
- if (this.prev < entry.finallyLoc) {
1046
- return handle(entry.finallyLoc);
1047
- }
1048
-
1049
- } else {
1050
- throw new Error("try statement without catch or finally");
1051
- }
1052
- }
1053
- }
1054
- },
1055
-
1056
- abrupt: function(type, arg) {
1057
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1058
- var entry = this.tryEntries[i];
1059
- if (entry.tryLoc <= this.prev &&
1060
- hasOwn.call(entry, "finallyLoc") &&
1061
- this.prev < entry.finallyLoc) {
1062
- var finallyEntry = entry;
1063
- break;
1064
- }
1065
- }
1066
-
1067
- if (finallyEntry &&
1068
- (type === "break" ||
1069
- type === "continue") &&
1070
- finallyEntry.tryLoc <= arg &&
1071
- arg <= finallyEntry.finallyLoc) {
1072
- // Ignore the finally entry if control is not jumping to a
1073
- // location outside the try/catch block.
1074
- finallyEntry = null;
1075
- }
1076
-
1077
- var record = finallyEntry ? finallyEntry.completion : {};
1078
- record.type = type;
1079
- record.arg = arg;
851
+ var actionsLookup = resolvedConfig.actions.concat(eventActions).reduce(function (aggr, action) {
852
+ var _extends2;
1080
853
 
1081
- if (finallyEntry) {
1082
- this.method = "next";
1083
- this.next = finallyEntry.finallyLoc;
1084
- return ContinueSentinel;
1085
- }
854
+ return _extends({}, aggr, (_extends2 = {}, _extends2[action.name] = action, _extends2));
855
+ }, {});
856
+ return [actionsLookup, resolvedConfig];
857
+ };
1086
858
 
1087
- return this.complete(record);
1088
- },
859
+ return ConfigurationResolver;
860
+ }();
1089
861
 
1090
- complete: function(record, afterLoc) {
1091
- if (record.type === "throw") {
1092
- throw record.arg;
1093
- }
862
+ function resolveEventActions(eventActionConfigurations, actionRegistryListener, importer, eventbus) {
863
+ var resolvedConfigs = eventActionConfigurations.map(function (config) {
864
+ return resolveActionConfiguration(config, importer);
865
+ });
866
+ return resolvedConfigs.map(function (config, index) {
867
+ var _eventActionConfigura = eventActionConfigurations[index],
868
+ eventName = _eventActionConfigura.eventName,
869
+ eventTopic = _eventActionConfigura.eventTopic;
870
+ var eventAction = new Action(config.name, config.startOperations, eventbus);
871
+ actionRegistryListener.registerAction(eventAction, eventName, eventTopic);
872
+ return eventAction;
873
+ });
874
+ }
1094
875
 
1095
- if (record.type === "break" ||
1096
- record.type === "continue") {
1097
- this.next = record.arg;
1098
- } else if (record.type === "return") {
1099
- this.rval = this.arg = record.arg;
1100
- this.method = "return";
1101
- this.next = "end";
1102
- } else if (record.type === "normal" && afterLoc) {
1103
- this.next = afterLoc;
1104
- }
876
+ function resolveTimelines(timelines, importer, eventbus) {
877
+ var resolve = resolveTimelineAction.bind(null, importer, eventbus);
878
+ return timelines.map(function (config) {
879
+ return _extends({}, config, {
880
+ timelineActions: config.timelineActions.map(resolve)
881
+ });
882
+ });
883
+ }
1105
884
 
1106
- return ContinueSentinel;
1107
- },
885
+ function resolveOperation(importer, operationConfig) {
886
+ return {
887
+ id: operationConfig.id,
888
+ systemName: operationConfig.systemName,
889
+ operationData: deepCopy(operationConfig.operationData),
890
+ instance: importer["import"](operationConfig.systemName)[operationConfig.systemName]
891
+ };
892
+ }
1108
893
 
1109
- finish: function(finallyLoc) {
1110
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1111
- var entry = this.tryEntries[i];
1112
- if (entry.finallyLoc === finallyLoc) {
1113
- this.complete(entry.completion, entry.afterLoc);
1114
- resetTryEntry(entry);
1115
- return ContinueSentinel;
1116
- }
1117
- }
1118
- },
894
+ function resolveActionConfiguration(config, importer) {
895
+ var resolve = resolveOperation.bind(null, importer);
896
+ return {
897
+ id: config.id,
898
+ name: config.name,
899
+ startOperations: config.startOperations.map(resolve)
900
+ };
901
+ }
1119
902
 
1120
- "catch": function(tryLoc) {
1121
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1122
- var entry = this.tryEntries[i];
1123
- if (entry.tryLoc === tryLoc) {
1124
- var record = entry.completion;
1125
- if (record.type === "throw") {
1126
- var thrown = record.arg;
1127
- resetTryEntry(entry);
1128
- }
1129
- return thrown;
1130
- }
1131
- }
903
+ function resolveEndableActionConfiguration(config, importer) {
904
+ var resolve = resolveOperation.bind(null, importer);
905
+ var action = resolveActionConfiguration(config, importer);
906
+ return _extends({}, action, {
907
+ endOperations: config.endOperations.map(resolve)
908
+ });
909
+ }
1132
910
 
1133
- // The context.catch method must only be called with a location
1134
- // argument that corresponds to a known catch block.
1135
- throw new Error("illegal catch attempt");
1136
- },
911
+ function resolveTimelineAction(importer, eventbus, actionConfiguration) {
912
+ var _actionConfiguration$;
1137
913
 
1138
- delegateYield: function(iterable, resultName, nextLoc) {
1139
- this.delegate = {
1140
- iterator: values(iterable),
1141
- resultName: resultName,
1142
- nextLoc: nextLoc
1143
- };
914
+ var resolvedConfig = resolveEndableActionConfiguration(actionConfiguration, importer);
915
+ var duration = {
916
+ end: (_actionConfiguration$ = actionConfiguration.duration.end) != null ? _actionConfiguration$ : -1,
917
+ start: actionConfiguration.duration.start
918
+ };
919
+ var id = resolvedConfig.id,
920
+ name = resolvedConfig.name,
921
+ endOperations = resolvedConfig.endOperations,
922
+ startOperations = resolvedConfig.startOperations;
923
+ var action = new TimelineAction(name, startOperations, endOperations, duration, eventbus);
924
+ action.id = id;
925
+ return action;
926
+ }
1144
927
 
1145
- if (this.method === "next") {
1146
- // Deliberately forget the last sent value so that we don't
1147
- // accidentally pass it on to the delegate.
1148
- this.arg = undefined$1;
1149
- }
928
+ function resolveActions(actionConfigurations, importer, eventbus) {
929
+ var resolvedConfigs = actionConfigurations.map(function (config) {
930
+ return resolveEndableActionConfiguration(config, importer);
931
+ });
932
+ return resolvedConfigs.map(function (resolvedConfig) {
933
+ var name = resolvedConfig.name,
934
+ endOperations = resolvedConfig.endOperations,
935
+ startOperations = resolvedConfig.startOperations;
936
+ var action = new EndableAction(name, startOperations, endOperations, eventbus);
937
+ action.id = resolvedConfig.id;
938
+ return action;
939
+ });
940
+ }
1150
941
 
1151
- return ContinueSentinel;
1152
- }
1153
- };
942
+ function resolvePlaceholders(configFragment, rootConfig, importer) {
943
+ if (!isDefined(configFragment)) {
944
+ return;
945
+ }
1154
946
 
1155
- // Regardless of whether this script is executing as a CommonJS module
1156
- // or not, return the runtime object so that we can declare the variable
1157
- // regeneratorRuntime in the outer scope, which allows this module to be
1158
- // injected easily by `bin/regenerator --include-runtime script.js`.
1159
- return exports;
1160
-
1161
- }(
1162
- // If this script is executing as a CommonJS module, use module.exports
1163
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1164
- // object. Either way, the resulting object will be used to initialize
1165
- // the regeneratorRuntime variable at the top of this file.
1166
- module.exports
1167
- ));
1168
-
1169
- try {
1170
- regeneratorRuntime = runtime;
1171
- } catch (accidentalStrictMode) {
1172
- // This module should not be running in strict mode, so the above
1173
- // assignment should always work unless something is misconfigured. Just
1174
- // in case runtime.js accidentally runs in strict mode, in modern engines
1175
- // we can explicitly access globalThis. In older engines we can escape
1176
- // strict mode using a global Function call. This could conceivably fail
1177
- // if a Content Security Policy forbids using Function, but in that case
1178
- // the proper solution is to fix the accidental strict mode problem. If
1179
- // you've misconfigured your bundler to force strict mode and applied a
1180
- // CSP to forbid Function, and you're not willing to fix either of those
1181
- // problems, please detail your unique predicament in a GitHub issue.
1182
- if (typeof globalThis === "object") {
1183
- globalThis.regeneratorRuntime = runtime;
947
+ if (Array.isArray(configFragment)) {
948
+ configFragment.forEach(function (item) {
949
+ resolvePlaceholders(item, rootConfig, importer);
950
+ });
1184
951
  } else {
1185
- Function("r", "regeneratorRuntime = r")(runtime);
952
+ Object.keys(configFragment).forEach(function (key) {
953
+ resolvePlaceholder(key, configFragment, rootConfig, importer);
954
+ });
1186
955
  }
1187
956
  }
1188
- }(runtime));
1189
957
 
1190
- var _regeneratorRuntime = runtime.exports;
958
+ function resolvePlaceholder(key, configFragment, rootConfig, importer) {
959
+ var configValue = configFragment[key];
960
+
961
+ if (typeof configValue === 'string') {
962
+ if (configValue.startsWith('config:')) {
963
+ var configProperty = configValue.substring(7, configValue.length);
964
+ configFragment[key] = getNestedPropertyValue(configProperty, rootConfig);
965
+ } else if (configValue.startsWith('template:')) {
966
+ var templateKey = configValue.substring(9, configValue.length);
967
+ var template = importer["import"](templateKey)[templateKey];
968
+ configFragment[key] = template;
969
+ } else if (configValue.startsWith('json:')) {
970
+ var jsonKey = configValue.substring(5, configValue.length);
971
+ var json = importer["import"](jsonKey)[jsonKey];
972
+ configFragment[key] = json;
973
+ }
974
+ } else if (typeof configValue === 'object') {
975
+ resolvePlaceholders(configValue, rootConfig, importer);
976
+ }
977
+ }
1191
978
 
1192
979
  var TimelineEventNames = function TimelineEventNames() {};
1193
980
  TimelineEventNames.PLAY_TOGGLE_REQUEST = 'timeline-play-toggle-request';
@@ -1297,19 +1084,19 @@ var EventListenerController = /*#__PURE__*/function () {
1297
1084
  return;
1298
1085
  }
1299
1086
 
1300
- var copy = this.operationData.actionOperationData ? deepCopy(this.operationData.actionOperationData) : {};
1087
+ var actionOperationData = this.operationData.actionOperationData ? deepCopy(this.operationData.actionOperationData) : {};
1301
1088
 
1302
1089
  if (event.target) {
1303
- copy.targetValue = event.target.value;
1090
+ actionOperationData.targetValue = event.target.value;
1304
1091
  }
1305
1092
 
1306
- this._executeAction(this.actionInstanceInfos, copy, 0);
1093
+ this._executeAction(this.actionInstanceInfos, actionOperationData, 0);
1307
1094
  };
1308
1095
 
1309
1096
  _proto._executeAction = /*#__PURE__*/function () {
1310
- var _executeAction2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(actions, operationData, idx) {
1097
+ var _executeAction2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(actions, operationData, idx) {
1311
1098
  var actionInfo, action, method, resultOperationData;
1312
- return _regeneratorRuntime.wrap(function _callee$(_context) {
1099
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1313
1100
  while (1) {
1314
1101
  switch (_context.prev = _context.next) {
1315
1102
  case 0:
@@ -2161,6 +1948,34 @@ var ctrls = {
2161
1948
  SubtitlesController: SubtitlesController
2162
1949
  };
2163
1950
 
1951
+ var DevToolEventListener = /*#__PURE__*/function () {
1952
+ function DevToolEventListener(agent) {
1953
+ this.agent = void 0;
1954
+ this.agent = agent;
1955
+ }
1956
+
1957
+ var _proto = DevToolEventListener.prototype;
1958
+
1959
+ _proto.handleEvent = function handleEvent(eventName, eventTopic, args) {
1960
+ this.agent.postMessage('eligius-diagnostics-event', {
1961
+ eventName: eventName,
1962
+ eventTopic: eventTopic
1963
+ });
1964
+ };
1965
+
1966
+ return DevToolEventListener;
1967
+ }();
1968
+
1969
+ var Diagnostics = /*#__PURE__*/function () {
1970
+ function Diagnostics() {}
1971
+
1972
+ Diagnostics.send = function send(_name, _data) {};
1973
+
1974
+ return Diagnostics;
1975
+ }();
1976
+
1977
+ var DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';
1978
+
2164
1979
  /**
2165
1980
  * EligiusEngine, this is where the magic happens. The engine is responsible for starting and stopping
2166
1981
  * the given timeline provider and triggering the actions associated with it.
@@ -2222,6 +2037,7 @@ var EligiusEngine = /*#__PURE__*/function () {
2222
2037
 
2223
2038
  _proto._initializeTimelineProvider = function _initializeTimelineProvider() {
2224
2039
  var _this$configuration$t,
2040
+ _this$_activeTimeline,
2225
2041
  _this = this;
2226
2042
 
2227
2043
  if (!((_this$configuration$t = this.configuration.timelines) != null && _this$configuration$t.length)) {
@@ -2235,14 +2051,11 @@ var EligiusEngine = /*#__PURE__*/function () {
2235
2051
  throw new Error("No timeline provider configured for type " + firstTimeline.type);
2236
2052
  }
2237
2053
 
2238
- if (this._activeTimelineProvider) {
2239
- this._activeTimelineProvider.destroy();
2240
- }
2241
-
2054
+ (_this$_activeTimeline = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline.destroy();
2242
2055
  this._activeTimelineProvider = providerSettings.provider;
2243
2056
  return new Promise( /*#__PURE__*/function () {
2244
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve) {
2245
- return _regeneratorRuntime.wrap(function _callee$(_context) {
2057
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
2058
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2246
2059
  while (1) {
2247
2060
  switch (_context.prev = _context.next) {
2248
2061
  case 0:
@@ -2281,8 +2094,8 @@ var EligiusEngine = /*#__PURE__*/function () {
2281
2094
  };
2282
2095
 
2283
2096
  _proto._cleanUp = /*#__PURE__*/function () {
2284
- var _cleanUp2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
2285
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
2097
+ var _cleanUp2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2098
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2286
2099
  while (1) {
2287
2100
  switch (_context2.prev = _context2.next) {
2288
2101
  case 0:
@@ -2309,8 +2122,9 @@ var EligiusEngine = /*#__PURE__*/function () {
2309
2122
  }();
2310
2123
 
2311
2124
  _proto.destroy = /*#__PURE__*/function () {
2312
- var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
2313
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
2125
+ var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
2126
+ var containerSelector, container;
2127
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2314
2128
  while (1) {
2315
2129
  switch (_context3.prev = _context3.next) {
2316
2130
  case 0:
@@ -2325,12 +2139,16 @@ var EligiusEngine = /*#__PURE__*/function () {
2325
2139
  });
2326
2140
 
2327
2141
  if (this.timelineProviders) {
2328
- Object.values(this.timelineProviders).forEach(function (info) {
2329
- return info.provider.destroy();
2142
+ Object.values(this.timelineProviders).forEach(function (providerInfo) {
2143
+ return providerInfo.provider.destroy();
2330
2144
  });
2331
2145
  }
2332
2146
 
2333
- case 5:
2147
+ containerSelector = this.configuration.containerSelector;
2148
+ container = $(containerSelector);
2149
+ container.empty();
2150
+
2151
+ case 8:
2334
2152
  case "end":
2335
2153
  return _context3.stop();
2336
2154
  }
@@ -2426,9 +2244,9 @@ var EligiusEngine = /*#__PURE__*/function () {
2426
2244
  };
2427
2245
 
2428
2246
  _proto._executeActions = /*#__PURE__*/function () {
2429
- var _executeActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(actions, methodName, idx) {
2247
+ var _executeActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(actions, methodName, idx) {
2430
2248
  var action;
2431
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
2249
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2432
2250
  while (1) {
2433
2251
  switch (_context4.prev = _context4.next) {
2434
2252
  case 0:
@@ -2473,12 +2291,12 @@ var EligiusEngine = /*#__PURE__*/function () {
2473
2291
  };
2474
2292
 
2475
2293
  _proto._handleRequestTimelineUri = /*#__PURE__*/function () {
2476
- var _handleRequestTimelineUri2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(uri, position, previousVideoPosition) {
2294
+ var _handleRequestTimelineUri2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(uri, position, previousVideoPosition) {
2477
2295
  var _position,
2478
2296
  _this3 = this;
2479
2297
 
2480
2298
  var timelineConfig, newProviderSettings;
2481
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
2299
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2482
2300
  while (1) {
2483
2301
  switch (_context5.prev = _context5.next) {
2484
2302
  case 0:
@@ -2599,9 +2417,9 @@ var EligiusEngine = /*#__PURE__*/function () {
2599
2417
  };
2600
2418
 
2601
2419
  _proto._handleRequestTimelinePosition = function _handleRequestTimelinePosition(floor, resultCallback) {
2602
- var _this$_activeTimeline;
2420
+ var _this$_activeTimeline2;
2603
2421
 
2604
- resultCallback(floor(((_this$_activeTimeline = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline.getPosition()) || -1));
2422
+ resultCallback(floor(((_this$_activeTimeline2 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline2.getPosition()) || -1));
2605
2423
  };
2606
2424
 
2607
2425
  _proto._handleTimelineComplete = function _handleTimelineComplete() {
@@ -2647,19 +2465,19 @@ var EligiusEngine = /*#__PURE__*/function () {
2647
2465
 
2648
2466
  _proto._onTimeHandler = function _onTimeHandler(floor, event) {
2649
2467
  if (!isNaN(event.position)) {
2650
- var _this$_activeTimeline3;
2468
+ var _this$_activeTimeline4;
2651
2469
 
2652
2470
  var pos = floor(event.position);
2653
2471
 
2654
2472
  if (this._lastPosition !== pos) {
2655
- var _this$_activeTimeline2;
2473
+ var _this$_activeTimeline3;
2656
2474
 
2657
2475
  this._executeActionsForPosition(pos);
2658
2476
 
2659
- this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [pos, (_this$_activeTimeline2 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline2.getDuration()]);
2477
+ this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [pos, (_this$_activeTimeline3 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline3.getDuration()]);
2660
2478
  }
2661
2479
 
2662
- this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [event.position, (_this$_activeTimeline3 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline3.getDuration()]);
2480
+ this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [event.position, (_this$_activeTimeline4 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline4.getDuration()]);
2663
2481
  }
2664
2482
  };
2665
2483
 
@@ -2720,29 +2538,31 @@ var EligiusEngine = /*#__PURE__*/function () {
2720
2538
 
2721
2539
  var ActionRegistryEventbusListener = /*#__PURE__*/function () {
2722
2540
  function ActionRegistryEventbusListener() {
2723
- this._actionRegistry = {};
2541
+ this._actionRegistry = new Map();
2724
2542
  }
2725
2543
 
2726
2544
  var _proto = ActionRegistryEventbusListener.prototype;
2727
2545
 
2728
2546
  _proto.registerAction = function registerAction(action, eventName, eventTopic) {
2547
+ var _this$_actionRegistry;
2548
+
2729
2549
  if (eventTopic && eventTopic.length) {
2730
2550
  eventName = eventName + ":" + eventTopic;
2731
2551
  }
2732
2552
 
2733
- if (!this._actionRegistry[eventName]) {
2734
- this._actionRegistry[eventName] = [];
2553
+ if (!this._actionRegistry.has(eventName)) {
2554
+ this._actionRegistry.set(eventName, []);
2735
2555
  }
2736
2556
 
2737
- this._actionRegistry[eventName].push(action);
2557
+ (_this$_actionRegistry = this._actionRegistry.get(eventName)) == null ? void 0 : _this$_actionRegistry.push(action);
2738
2558
  };
2739
2559
 
2740
2560
  _proto.handleEvent = function handleEvent(eventName, eventTopic, args) {
2741
- if (eventTopic && eventTopic.length) {
2561
+ if (eventTopic) {
2742
2562
  eventName = eventName + ":" + eventTopic;
2743
2563
  }
2744
2564
 
2745
- var actions = this._actionRegistry[eventName];
2565
+ var actions = this._actionRegistry.get(eventName);
2746
2566
 
2747
2567
  if (actions) {
2748
2568
  var operationData = {
@@ -2759,8 +2579,8 @@ var ActionRegistryEventbusListener = /*#__PURE__*/function () {
2759
2579
 
2760
2580
  var Eventbus = /*#__PURE__*/function () {
2761
2581
  function Eventbus() {
2762
- this.eventHandlers = {};
2763
- this.eventInterceptors = {};
2582
+ this.eventHandlers = new Map();
2583
+ this.eventInterceptors = new Map();
2764
2584
  this.eventListeners = [];
2765
2585
  this.clear();
2766
2586
  }
@@ -2768,33 +2588,33 @@ var Eventbus = /*#__PURE__*/function () {
2768
2588
  var _proto = Eventbus.prototype;
2769
2589
 
2770
2590
  _proto.clear = function clear() {
2771
- this.eventHandlers = {};
2591
+ this.eventHandlers = new Map();
2772
2592
  this.eventListeners = [];
2773
- this.eventInterceptors = {};
2593
+ this.eventInterceptors = new Map();
2774
2594
  };
2775
2595
 
2776
2596
  _proto._getEventInterceptors = function _getEventInterceptors(eventName, eventTopic) {
2777
- if (eventTopic && eventTopic.length) {
2597
+ if (eventTopic) {
2778
2598
  eventName = eventName + ":" + eventTopic;
2779
2599
  }
2780
2600
 
2781
- if (!this.eventInterceptors[eventName]) {
2782
- this.eventInterceptors[eventName] = [];
2601
+ if (!this.eventInterceptors.has(eventName)) {
2602
+ this.eventInterceptors.set(eventName, []);
2783
2603
  }
2784
2604
 
2785
- return this.eventInterceptors[eventName];
2605
+ return this.eventInterceptors.get(eventName);
2786
2606
  };
2787
2607
 
2788
2608
  _proto._getEventHandlers = function _getEventHandlers(eventName, eventTopic) {
2789
- if (eventTopic && eventTopic.length) {
2609
+ if (eventTopic) {
2790
2610
  eventName = eventName + ":" + eventTopic;
2791
2611
  }
2792
2612
 
2793
- if (!this.eventHandlers[eventName]) {
2794
- this.eventHandlers[eventName] = [];
2613
+ if (!this.eventHandlers.has(eventName)) {
2614
+ this.eventHandlers.set(eventName, []);
2795
2615
  }
2796
2616
 
2797
- return this.eventHandlers[eventName];
2617
+ return this.eventHandlers.get(eventName);
2798
2618
  };
2799
2619
 
2800
2620
  _proto.on = function on(eventName, eventHandler, eventTopic) {
@@ -3012,6 +2832,9 @@ var EngineFactory = /*#__PURE__*/function () {
3012
2832
  this.eventbus = void 0;
3013
2833
  this.importer = importer;
3014
2834
  this.eventbus = eventbus || new Eventbus();
2835
+
2836
+ this._initializeDevtools(this.eventbus);
2837
+
3015
2838
  this.eventbus.on(TimelineEventNames.REQUEST_INSTANCE, this._requestInstanceHandler.bind(this));
3016
2839
  this.eventbus.on(TimelineEventNames.REQUEST_ACTION, this._requestActionHandler.bind(this));
3017
2840
  this.eventbus.on(TimelineEventNames.REQUEST_FUNCTION, this._requestFunctionHandler.bind(this));
@@ -3020,6 +2843,20 @@ var EngineFactory = /*#__PURE__*/function () {
3020
2843
 
3021
2844
  var _proto = EngineFactory.prototype;
3022
2845
 
2846
+ _proto._initializeDevtools = function _initializeDevtools(eventbus) {
2847
+ var diagnosticInfo = window[DEV_TOOLS_KEY];
2848
+
2849
+ if (diagnosticInfo) {
2850
+ var agent = diagnosticInfo.agent;
2851
+ var eventbusListener = new DevToolEventListener(agent);
2852
+ eventbus.registerEventlistener(eventbusListener);
2853
+
2854
+ Diagnostics.send = function (name, data) {
2855
+ agent.postMessage(name, data);
2856
+ };
2857
+ }
2858
+ };
2859
+
3023
2860
  _proto.destroy = function destroy() {
3024
2861
  this.eventbus.clear();
3025
2862
  };
@@ -3138,33 +2975,35 @@ var EngineFactory = /*#__PURE__*/function () {
3138
2975
  * @param operationData
3139
2976
  * @returns
3140
2977
  */
3141
- var addClass = function addClass(operationData) {
2978
+ var addClass$1 = function addClass(operationData) {
3142
2979
  var selectedElement = operationData.selectedElement,
3143
2980
  className = operationData.className;
3144
2981
  selectedElement.addClass(className);
3145
2982
  return operationData;
3146
2983
  };
3147
2984
 
3148
- var controllersName = 'eligiusEngineControllers';
2985
+ var controllersDataName = 'eligiusEngineControllers';
3149
2986
 
3150
2987
  function getElementData(name, element) {
3151
2988
  return element.data(name);
3152
2989
  }
3153
2990
 
3154
- var getElementControllers = /*#__PURE__*/getElementData.bind(null, controllersName);
2991
+ var getElementControllers = /*#__PURE__*/getElementData.bind(null, controllersDataName);
3155
2992
 
3156
2993
  function attachControllerToElement(element, controller) {
3157
- if (!element.data('eligiusEngineControllers')) {
3158
- element.data('eligiusEngineControllers', []);
2994
+ if (!element.data(controllersDataName)) {
2995
+ element.data(controllersDataName, []);
3159
2996
  }
3160
2997
 
3161
2998
  var controllers = getElementControllers(element);
3162
- controllers.push(controller);
2999
+
3000
+ if (controllers) {
3001
+ controllers.push(controller);
3002
+ }
3163
3003
  }
3164
3004
 
3165
3005
  function mergeOperationData(operationData, newOperationData) {
3166
- //return { ...(operationData as any), ...newOperationData } as K;
3167
- return Object.assign(operationData, newOperationData);
3006
+ return _extends({}, operationData, newOperationData);
3168
3007
  }
3169
3008
 
3170
3009
  function internalResolve(resolve, operationData, newOperationData) {
@@ -3182,7 +3021,7 @@ function internalResolve(resolve, operationData, newOperationData) {
3182
3021
  * @returns
3183
3022
  */
3184
3023
 
3185
- var addControllerToElement = function addControllerToElement(operationData) {
3024
+ var addControllerToElement$1 = function addControllerToElement(operationData) {
3186
3025
  var selectedElement = operationData.selectedElement,
3187
3026
  controllerInstance = operationData.controllerInstance;
3188
3027
  attachControllerToElement(selectedElement, controllerInstance);
@@ -3208,7 +3047,7 @@ var addControllerToElement = function addControllerToElement(operationData) {
3208
3047
  * @returns
3209
3048
  */
3210
3049
 
3211
- var animate = function animate(operationData) {
3050
+ var animate$1 = function animate(operationData) {
3212
3051
  var animationEasing = operationData.animationEasing,
3213
3052
  selectedElement = operationData.selectedElement,
3214
3053
  animationProperties = operationData.animationProperties,
@@ -3240,7 +3079,7 @@ var animate = function animate(operationData) {
3240
3079
  * @returns
3241
3080
  */
3242
3081
 
3243
- var animateWithClass = function animateWithClass(operationData) {
3082
+ var animateWithClass$1 = function animateWithClass(operationData) {
3244
3083
  var selectedElement = operationData.selectedElement,
3245
3084
  className = operationData.className,
3246
3085
  removeClass = operationData.removeClass;
@@ -3292,10 +3131,9 @@ function resolveEventArguments(operationData, eventArgs) {
3292
3131
  * event argumetns and optional event topic.
3293
3132
  *
3294
3133
  * @param operationData
3295
- * @returns
3296
3134
  */
3297
3135
 
3298
- var broadcastEvent = function broadcastEvent(operationData) {
3136
+ var broadcastEvent$1 = function broadcastEvent(operationData) {
3299
3137
  var eventArgs = operationData.eventArgs,
3300
3138
  eventTopic = operationData.eventTopic,
3301
3139
  eventName = operationData.eventName;
@@ -3311,33 +3149,6 @@ var broadcastEvent = function broadcastEvent(operationData) {
3311
3149
  return operationData;
3312
3150
  };
3313
3151
 
3314
- /**
3315
- * This operation removes all of the children from the specified selected element.
3316
- */
3317
- var clearElement = function clearElement(operationData) {
3318
- var selectedElement = operationData.selectedElement;
3319
- selectedElement.empty();
3320
- return operationData;
3321
- };
3322
-
3323
- /**
3324
- * This operation removes all of the properties on the current operation date.
3325
- * Or, if the properties property is set only removes the properties defined by that list.
3326
- */
3327
- var clearOperationData = function clearOperationData(operationData) {
3328
- var properties = operationData.properties;
3329
-
3330
- if (properties) {
3331
- properties.forEach(function (name) {
3332
- delete operationData[name];
3333
- });
3334
- delete operationData.properties;
3335
- return operationData;
3336
- }
3337
-
3338
- return {};
3339
- };
3340
-
3341
3152
  var cache = [];
3342
3153
  function resolvePropertyValues(operationData, properties) {
3343
3154
  var copy = properties !== operationData ? deepCopy(properties) : properties;
@@ -3382,6 +3193,71 @@ function resolveProperties(properties, copy, extract) {
3382
3193
  }
3383
3194
  }
3384
3195
 
3196
+ var calcFunctions = {
3197
+ '+': function _(left, right) {
3198
+ return left + right;
3199
+ },
3200
+ '-': function _(left, right) {
3201
+ return left - right;
3202
+ },
3203
+ '*': function _(left, right) {
3204
+ return left * right;
3205
+ },
3206
+ '/': function _(left, right) {
3207
+ return left / right;
3208
+ },
3209
+ '%': function _(left, right) {
3210
+ return left % right;
3211
+ },
3212
+ '**': function _(left, right) {
3213
+ return Math.pow(left, right);
3214
+ }
3215
+ };
3216
+ /**
3217
+ * This operation calculates the given left and right hand sides using the specified operator.
3218
+ *
3219
+ * @param operationData
3220
+ */
3221
+
3222
+ var calc$1 = function calc(operationData) {
3223
+ operationData = resolvePropertyValues(operationData, operationData);
3224
+ var _operationData = operationData,
3225
+ left = _operationData.left,
3226
+ right = _operationData.right,
3227
+ operator = _operationData.operator,
3228
+ _operationData$proper = _operationData.propertyName,
3229
+ propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
3230
+ operationData[propertyName] = calcFunctions[operator](+left, +right);
3231
+ return operationData;
3232
+ };
3233
+
3234
+ /**
3235
+ * This operation removes all of the children from the specified selected element.
3236
+ */
3237
+ var clearElement$1 = function clearElement(operationData) {
3238
+ var selectedElement = operationData.selectedElement;
3239
+ selectedElement.empty();
3240
+ return operationData;
3241
+ };
3242
+
3243
+ /**
3244
+ * This operation removes all of the properties on the current operation date.
3245
+ * Or, if the properties property is set only removes the properties defined by that list.
3246
+ */
3247
+ var clearOperationData$1 = function clearOperationData(operationData) {
3248
+ var properties = operationData.properties;
3249
+
3250
+ if (properties) {
3251
+ properties.forEach(function (name) {
3252
+ delete operationData[name];
3253
+ });
3254
+ delete operationData.properties;
3255
+ return operationData;
3256
+ }
3257
+
3258
+ return {};
3259
+ };
3260
+
3385
3261
  /**
3386
3262
  * This operation creates the DOM element defined by the given properties and assigns
3387
3263
  * the instance to the give property name on the current operation data.
@@ -3391,7 +3267,7 @@ function resolveProperties(properties, copy, extract) {
3391
3267
  * @returns
3392
3268
  */
3393
3269
 
3394
- var createElement = function createElement(operationData) {
3270
+ var createElement$1 = function createElement(operationData) {
3395
3271
  operationData = resolvePropertyValues(operationData, operationData);
3396
3272
  var _operationData = operationData,
3397
3273
  elementName = _operationData.elementName,
@@ -3418,7 +3294,7 @@ var createElement = function createElement(operationData) {
3418
3294
  * @returns
3419
3295
  */
3420
3296
 
3421
- var customFunction = function customFunction(operationData) {
3297
+ var customFunction$1 = function customFunction(operationData) {
3422
3298
  var _this = this;
3423
3299
 
3424
3300
  var systemName = operationData.systemName;
@@ -3446,7 +3322,7 @@ var customFunction = function customFunction(operationData) {
3446
3322
  * @returns
3447
3323
  */
3448
3324
 
3449
- var endAction = function endAction(operationData) {
3325
+ var endAction$1 = function endAction(operationData) {
3450
3326
  var _operationData = operationData,
3451
3327
  actionInstance = _operationData.actionInstance,
3452
3328
  actionOperationData = _operationData.actionOperationData;
@@ -3468,7 +3344,7 @@ var endAction = function endAction(operationData) {
3468
3344
  * @param operationData
3469
3345
  * @returns
3470
3346
  */
3471
- var endLoop = function endLoop(operationData) {
3347
+ var endLoop$1 = function endLoop(operationData) {
3472
3348
  var context = this;
3473
3349
 
3474
3350
  if (!context.skipNextOperation) {
@@ -3488,7 +3364,7 @@ var endLoop = function endLoop(operationData) {
3488
3364
  return operationData;
3489
3365
  };
3490
3366
 
3491
- var extendController = function extendController(operationData) {
3367
+ var extendController$1 = function extendController(operationData) {
3492
3368
  var controllerInstance = operationData.controllerInstance,
3493
3369
  controllerExtension = operationData.controllerExtension;
3494
3370
  operationData.controllerInstance = Object.assign(controllerInstance, controllerExtension);
@@ -3502,7 +3378,7 @@ var extendController = function extendController(operationData) {
3502
3378
  * @returns
3503
3379
  */
3504
3380
 
3505
- var getControllerFromElement = function getControllerFromElement(operationData) {
3381
+ var getControllerFromElement$1 = function getControllerFromElement(operationData) {
3506
3382
  var selectedElement = operationData.selectedElement,
3507
3383
  controllerName = operationData.controllerName;
3508
3384
  var controllers = getElementControllers(selectedElement);
@@ -3527,7 +3403,7 @@ var getControllerFromElement = function getControllerFromElement(operationData)
3527
3403
  * @returns
3528
3404
  */
3529
3405
 
3530
- var getControllerInstance = function getControllerInstance(operationData) {
3406
+ var getControllerInstance$1 = function getControllerInstance(operationData) {
3531
3407
  var systemName = operationData.systemName,
3532
3408
  _operationData$proper = operationData.propertyName,
3533
3409
  propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
@@ -3542,22 +3418,31 @@ var getControllerInstance = function getControllerInstance(operationData) {
3542
3418
  return operationData;
3543
3419
  };
3544
3420
 
3545
- function modifyDimensionsByRatio(ratioModifier, dimensions) {
3546
- //h[ar=8-1]
3421
+ function _modifyDimensionsByRatio(ratioModifier, dimensions) {
3422
+ var modifiedDimensions = _extends({}, dimensions); //h[ar=8-1]
3423
+
3424
+
3547
3425
  var prefix = ratioModifier.substring(0, 1);
3548
- var ratio = ratioModifier.substring(ratioModifier.indexOf('[') + 1, ratioModifier.indexOf(']') - ratioModifier.indexOf('[') - 1);
3426
+ var ratio = ratioModifier.substring(ratioModifier.indexOf('[') + 1, ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1));
3549
3427
  var ratios = ratio.split('=')[1].split('-');
3550
3428
 
3429
+ if (ratios.filter(Boolean).length !== 2) {
3430
+ throw new Error("Badly formatted modifier, expect two ratios: " + ratio);
3431
+ }
3432
+
3551
3433
  if (prefix === 'h') {
3552
- dimensions.height = dimensions.width / +ratios[0] * +ratios[1];
3434
+ modifiedDimensions.height = modifiedDimensions.width / +ratios[0] * +ratios[1];
3553
3435
  } else if (prefix === 'w') {
3554
- dimensions.width = dimensions.height / +ratios[1] * +ratios[0];
3436
+ modifiedDimensions.width = modifiedDimensions.height / +ratios[1] * +ratios[0];
3555
3437
  }
3438
+
3439
+ return modifiedDimensions;
3556
3440
  }
3557
3441
 
3558
- function getModifierSuffix(modifier) {
3442
+ function _getModifierSuffix(modifier //*100h%
3443
+ ) {
3559
3444
  var endIdx = 1;
3560
- var suffix = modifier.substring(modifier.length - 1, 1);
3445
+ var suffix = modifier.substring(modifier.length - endIdx, modifier.length);
3561
3446
 
3562
3447
  if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {
3563
3448
  suffix = null;
@@ -3566,12 +3451,10 @@ function getModifierSuffix(modifier) {
3566
3451
  var isPercent = suffix === '%';
3567
3452
 
3568
3453
  if (isPercent) {
3569
- endIdx = 2;
3570
- suffix = modifier.substring(modifier.length - endIdx, 1);
3454
+ suffix = modifier.substring(modifier.length - endIdx, modifier.length - (endIdx + 1));
3571
3455
 
3572
3456
  if (suffix !== 'h' && suffix !== 'w') {
3573
3457
  suffix = null;
3574
- endIdx = 1;
3575
3458
  }
3576
3459
  }
3577
3460
 
@@ -3579,20 +3462,22 @@ function getModifierSuffix(modifier) {
3579
3462
  }
3580
3463
 
3581
3464
  function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModifier) {
3465
+ var modifiedDimension = _extends({}, dimensions);
3466
+
3582
3467
  switch (prefix) {
3583
3468
  case '+':
3584
3469
  switch (suffix) {
3585
3470
  case 'h':
3586
- dimensions.height += heightModifier;
3471
+ modifiedDimension.height += heightModifier;
3587
3472
  break;
3588
3473
 
3589
3474
  case 'w':
3590
- dimensions.width += widthModifier;
3475
+ modifiedDimension.width += widthModifier;
3591
3476
  break;
3592
3477
 
3593
3478
  default:
3594
- dimensions.height += heightModifier;
3595
- dimensions.width += widthModifier;
3479
+ modifiedDimension.height += heightModifier;
3480
+ modifiedDimension.width += widthModifier;
3596
3481
  }
3597
3482
 
3598
3483
  break;
@@ -3600,16 +3485,16 @@ function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModi
3600
3485
  case '-':
3601
3486
  switch (suffix) {
3602
3487
  case 'h':
3603
- dimensions.height -= heightModifier;
3488
+ modifiedDimension.height -= heightModifier;
3604
3489
  break;
3605
3490
 
3606
3491
  case 'w':
3607
- dimensions.width -= widthModifier;
3492
+ modifiedDimension.width -= widthModifier;
3608
3493
  break;
3609
3494
 
3610
3495
  default:
3611
- dimensions.height -= heightModifier;
3612
- dimensions.width -= widthModifier;
3496
+ modifiedDimension.height -= heightModifier;
3497
+ modifiedDimension.width -= widthModifier;
3613
3498
  }
3614
3499
 
3615
3500
  break;
@@ -3617,16 +3502,16 @@ function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModi
3617
3502
  case '/':
3618
3503
  switch (suffix) {
3619
3504
  case 'h':
3620
- dimensions.height /= heightModifier;
3505
+ modifiedDimension.height /= heightModifier;
3621
3506
  break;
3622
3507
 
3623
3508
  case 'w':
3624
- dimensions.width /= widthModifier;
3509
+ modifiedDimension.width /= widthModifier;
3625
3510
  break;
3626
3511
 
3627
3512
  default:
3628
- dimensions.height /= heightModifier;
3629
- dimensions.width /= widthModifier;
3513
+ modifiedDimension.height /= heightModifier;
3514
+ modifiedDimension.width /= widthModifier;
3630
3515
  }
3631
3516
 
3632
3517
  break;
@@ -3634,16 +3519,16 @@ function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModi
3634
3519
  case '*':
3635
3520
  switch (suffix) {
3636
3521
  case 'h':
3637
- dimensions.height *= heightModifier;
3522
+ modifiedDimension.height *= heightModifier;
3638
3523
  break;
3639
3524
 
3640
3525
  case 'w':
3641
- dimensions.width *= widthModifier;
3526
+ modifiedDimension.width *= widthModifier;
3642
3527
  break;
3643
3528
 
3644
3529
  default:
3645
- dimensions.height *= heightModifier;
3646
- dimensions.width *= widthModifier;
3530
+ modifiedDimension.height *= heightModifier;
3531
+ modifiedDimension.width *= widthModifier;
3647
3532
  }
3648
3533
 
3649
3534
  break;
@@ -3652,7 +3537,7 @@ function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModi
3652
3537
  console.error("Unknown operator found: " + prefix);
3653
3538
  }
3654
3539
 
3655
- return dimensions;
3540
+ return modifiedDimension;
3656
3541
  }
3657
3542
  /**
3658
3543
  * Modifies the given dimensions using the given modifier string.
@@ -3672,6 +3557,8 @@ function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModi
3672
3557
 
3673
3558
 
3674
3559
  function modifyDimensions(dimensions, modifier) {
3560
+ var clonedDimensions = _extends({}, dimensions);
3561
+
3675
3562
  var ratioModifier = null;
3676
3563
 
3677
3564
  if (modifier.indexOf('|') > -1) {
@@ -3683,25 +3570,27 @@ function modifyDimensions(dimensions, modifier) {
3683
3570
 
3684
3571
  var prefix = modifier.substring(0, 1);
3685
3572
 
3686
- var _getModifierSuffix = getModifierSuffix(modifier),
3687
- suffix = _getModifierSuffix[0],
3688
- endIdx = _getModifierSuffix[1],
3689
- isPercent = _getModifierSuffix[2];
3573
+ var _getModifierSuffix2 = _getModifierSuffix(modifier),
3574
+ suffix = _getModifierSuffix2[0],
3575
+ endIdx = _getModifierSuffix2[1],
3576
+ isPercent = _getModifierSuffix2[2];
3690
3577
 
3691
- var value = parseInt(suffix !== null ? modifier.substring(1, modifier.length - endIdx - 1) : modifier.substring(1, modifier.length), 10);
3578
+ var value = parseInt(suffix !== null ? modifier.substring(1, modifier.length - (endIdx - 1)) : modifier.substring(1), 10);
3692
3579
  var widthModifier = value;
3693
3580
  var heightModifier = value;
3694
3581
 
3695
3582
  if (isPercent) {
3696
- widthModifier = dimensions.width / 100 * value;
3697
- heightModifier = dimensions.height / 100 * value;
3583
+ widthModifier = clonedDimensions.width / 100 * value;
3584
+ heightModifier = clonedDimensions.height / 100 * value;
3698
3585
  }
3699
3586
 
3700
- dimensions = _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModifier);
3587
+ var modifiedDimension = _modifyDimensions(clonedDimensions, prefix, suffix, widthModifier, heightModifier);
3701
3588
 
3702
3589
  if (ratioModifier) {
3703
- modifyDimensionsByRatio(ratioModifier, dimensions);
3590
+ return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);
3704
3591
  }
3592
+
3593
+ return modifiedDimension;
3705
3594
  }
3706
3595
 
3707
3596
  /**
@@ -3723,7 +3612,7 @@ function modifyDimensions(dimensions, modifier) {
3723
3612
  * @returns
3724
3613
  */
3725
3614
 
3726
- var getElementDimensions = function getElementDimensions(operationData) {
3615
+ var getElementDimensions$1 = function getElementDimensions(operationData) {
3727
3616
  var _selectedElement$inne, _selectedElement$inne2;
3728
3617
 
3729
3618
  var selectedElement = operationData.selectedElement,
@@ -3738,7 +3627,7 @@ var getElementDimensions = function getElementDimensions(operationData) {
3738
3627
  }
3739
3628
 
3740
3629
  if (modifier) {
3741
- modifyDimensions(dimensions, modifier);
3630
+ dimensions = modifyDimensions(dimensions, modifier);
3742
3631
  }
3743
3632
 
3744
3633
  operationData.dimensions = dimensions;
@@ -3753,7 +3642,7 @@ var getElementDimensions = function getElementDimensions(operationData) {
3753
3642
  * @returns
3754
3643
  */
3755
3644
 
3756
- var getImport = function getImport(operationData) {
3645
+ var getImport$1 = function getImport(operationData) {
3757
3646
  var systemName = operationData.systemName;
3758
3647
 
3759
3648
  var callBack = function callBack(instance) {
@@ -3780,7 +3669,7 @@ var addToCache = function addToCache(key, value) {
3780
3669
  * @returns
3781
3670
  */
3782
3671
 
3783
- var loadJSON = function loadJSON(operationData) {
3672
+ var loadJSON$1 = function loadJSON(operationData) {
3784
3673
  var url = operationData.url,
3785
3674
  cache = operationData.cache,
3786
3675
  _operationData$proper = operationData.propertyName,
@@ -3794,9 +3683,9 @@ var loadJSON = function loadJSON(operationData) {
3794
3683
 
3795
3684
  return new Promise(function (resolve, reject) {
3796
3685
  fetch(url).then( /*#__PURE__*/function () {
3797
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
3686
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
3798
3687
  var json, cacheValue;
3799
- return _regeneratorRuntime.wrap(function _callee$(_context) {
3688
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3800
3689
  while (1) {
3801
3690
  switch (_context.prev = _context.next) {
3802
3691
  case 0:
@@ -3831,7 +3720,7 @@ var loadJSON = function loadJSON(operationData) {
3831
3720
  * @param operationData
3832
3721
  * @returns
3833
3722
  */
3834
- var log = function log(operationData) {
3723
+ var log$1 = function log(operationData) {
3835
3724
  console.group('Operation info');
3836
3725
  console.dir({
3837
3726
  context: this
@@ -3843,13 +3732,45 @@ var log = function log(operationData) {
3843
3732
  return operationData;
3844
3733
  };
3845
3734
 
3735
+ /**
3736
+ * This operation performs the given math function of the specified arguments.
3737
+ *
3738
+ * @param operationData
3739
+ */
3740
+
3741
+ var math$1 = function math(operationData) {
3742
+ operationData = resolvePropertyValues(operationData, operationData);
3743
+ operationData.args = resolveMathConstants(operationData.args);
3744
+ var _operationData = operationData,
3745
+ args = _operationData.args,
3746
+ functionName = _operationData.functionName,
3747
+ _operationData$proper = _operationData.propertyName,
3748
+ propertyName = _operationData$proper === void 0 ? 'mathResult' : _operationData$proper;
3749
+ operationData[propertyName] = Math[functionName].apply(null, args);
3750
+ return operationData;
3751
+ };
3752
+
3753
+ function resolveMathConstants(args) {
3754
+ return args.map(function (arg) {
3755
+ if (isMathProperty(arg)) {
3756
+ return Math[arg];
3757
+ }
3758
+
3759
+ return arg;
3760
+ });
3761
+ }
3762
+
3763
+ function isMathProperty(value) {
3764
+ return typeof value === 'string' && value in Math && typeof Math[value] !== 'function';
3765
+ }
3766
+
3846
3767
  /**
3847
3768
  * This operation removes the spcified class name from the specified selected element.
3848
3769
  *
3849
3770
  * @param operationData
3850
3771
  * @returns
3851
3772
  */
3852
- var removeClass = function removeClass(operationData) {
3773
+ var removeClass$1 = function removeClass(operationData) {
3853
3774
  var selectedElement = operationData.selectedElement,
3854
3775
  className = operationData.className;
3855
3776
  selectedElement.removeClass(className);
@@ -3863,7 +3784,7 @@ var removeClass = function removeClass(operationData) {
3863
3784
  * @returns
3864
3785
  */
3865
3786
 
3866
- var removeControllerFromElement = function removeControllerFromElement(operationData) {
3787
+ var removeControllerFromElement$1 = function removeControllerFromElement(operationData) {
3867
3788
  var selectedElement = operationData.selectedElement,
3868
3789
  controllerName = operationData.controllerName;
3869
3790
  var controllers = getElementControllers(selectedElement);
@@ -3886,7 +3807,7 @@ var removeControllerFromElement = function removeControllerFromElement(operation
3886
3807
  * @param operationData
3887
3808
  * @returns
3888
3809
  */
3889
- var removeElement = function removeElement(operationData) {
3810
+ var removeElement$1 = function removeElement(operationData) {
3890
3811
  var selectedElement = operationData.selectedElement;
3891
3812
  selectedElement.remove();
3892
3813
  return operationData;
@@ -3898,7 +3819,7 @@ var removeElement = function removeElement(operationData) {
3898
3819
  * @param operationData
3899
3820
  * @returns
3900
3821
  */
3901
- var removePropertiesFromOperationData = function removePropertiesFromOperationData(operationData) {
3822
+ var removePropertiesFromOperationData$1 = function removePropertiesFromOperationData(operationData) {
3902
3823
  var propertyNames = operationData.propertyNames;
3903
3824
  propertyNames.forEach(function (name) {
3904
3825
  delete operationData[name];
@@ -3914,7 +3835,7 @@ var removePropertiesFromOperationData = function removePropertiesFromOperationDa
3914
3835
  * @param operationData
3915
3836
  * @returns
3916
3837
  */
3917
- var reparentElement = function reparentElement(operationData) {
3838
+ var reparentElement$1 = function reparentElement(operationData) {
3918
3839
  var selectedElement = operationData.selectedElement,
3919
3840
  newParentSelector = operationData.newParentSelector;
3920
3841
  selectedElement.remove().appendTo(newParentSelector);
@@ -3929,7 +3850,7 @@ var reparentElement = function reparentElement(operationData) {
3929
3850
  * @returns
3930
3851
  */
3931
3852
 
3932
- var requestAction = function requestAction(operationData) {
3853
+ var requestAction$1 = function requestAction(operationData) {
3933
3854
  var systemName = operationData.systemName;
3934
3855
 
3935
3856
  var resultCallback = function resultCallback(action) {
@@ -3947,7 +3868,7 @@ var requestAction = function requestAction(operationData) {
3947
3868
  * @returns
3948
3869
  */
3949
3870
 
3950
- var resizeAction = function resizeAction(operationData) {
3871
+ var resizeAction$1 = function resizeAction(operationData) {
3951
3872
  var _operationData = operationData,
3952
3873
  actionInstance = _operationData.actionInstance,
3953
3874
  actionOperationData = _operationData.actionOperationData;
@@ -3985,7 +3906,7 @@ function findElementBySelector(root, selector, operationData, propertyName) {
3985
3906
  */
3986
3907
 
3987
3908
 
3988
- var selectElement = function selectElement(operationData) {
3909
+ var selectElement$1 = function selectElement(operationData) {
3989
3910
  var selector = operationData.selector,
3990
3911
  _operationData$proper = operationData.propertyName,
3991
3912
  propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
@@ -4016,7 +3937,7 @@ var selectElement = function selectElement(operationData) {
4016
3937
  * @param operationData
4017
3938
  * @returns
4018
3939
  */
4019
- var setElementAttributes = function setElementAttributes(operationData) {
3940
+ var setElementAttributes$1 = function setElementAttributes(operationData) {
4020
3941
  var attributes = operationData.attributes,
4021
3942
  selectedElement = operationData.selectedElement;
4022
3943
  Object.entries(attributes).forEach(function (_ref) {
@@ -4039,7 +3960,7 @@ var setElementAttributes = function setElementAttributes(operationData) {
4039
3960
  * @param operationData
4040
3961
  * @returns
4041
3962
  */
4042
- var setElementContent = function setElementContent(operationData) {
3963
+ var setElementContent$1 = function setElementContent(operationData) {
4043
3964
  var _operationData$insert = operationData.insertionType,
4044
3965
  insertionType = _operationData$insert === void 0 ? 'overwrite' : _operationData$insert,
4045
3966
  selectedElement = operationData.selectedElement,
@@ -4071,7 +3992,7 @@ var setElementContent = function setElementContent(operationData) {
4071
3992
  * @returns
4072
3993
  */
4073
3994
 
4074
- var setOperationData = function setOperationData(operationData) {
3995
+ var setOperationData$1 = function setOperationData(operationData) {
4075
3996
  var _operationData = operationData,
4076
3997
  _operationData$overri = _operationData.override,
4077
3998
  override = _operationData$overri === void 0 ? false : _operationData$overri,
@@ -4099,7 +4020,7 @@ var setOperationData = function setOperationData(operationData) {
4099
4020
  * @returns
4100
4021
  */
4101
4022
 
4102
- var setStyle = function setStyle(operationData) {
4023
+ var setStyle$1 = function setStyle(operationData) {
4103
4024
  var _operationData$proper = operationData.propertyName,
4104
4025
  propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
4105
4026
  var properties = resolvePropertyValues(operationData, operationData.properties);
@@ -4119,7 +4040,7 @@ var setStyle = function setStyle(operationData) {
4119
4040
  * @returns
4120
4041
  */
4121
4042
 
4122
- var startAction = function startAction(operationData) {
4043
+ var startAction$1 = function startAction(operationData) {
4123
4044
  var _operationData = operationData,
4124
4045
  actionInstance = _operationData.actionInstance,
4125
4046
  actionOperationData = _operationData.actionOperationData;
@@ -4145,7 +4066,7 @@ var startAction = function startAction(operationData) {
4145
4066
  * @param operationData
4146
4067
  * @returns
4147
4068
  */
4148
- var startLoop = function startLoop(operationData) {
4069
+ var startLoop$1 = function startLoop(operationData) {
4149
4070
  var context = this;
4150
4071
  var collection = operationData.collection,
4151
4072
  _operationData$proper = operationData.propertyName,
@@ -4179,7 +4100,7 @@ var startLoop = function startLoop(operationData) {
4179
4100
  * @param operationData
4180
4101
  * @returns
4181
4102
  */
4182
- var toggleClass = function toggleClass(operationData) {
4103
+ var toggleClass$1 = function toggleClass(operationData) {
4183
4104
  var selectedElement = operationData.selectedElement,
4184
4105
  className = operationData.className;
4185
4106
  selectedElement.toggleClass(className);
@@ -4192,7 +4113,7 @@ var toggleClass = function toggleClass(operationData) {
4192
4113
  * @param operationData
4193
4114
  * @returns
4194
4115
  */
4195
- var toggleElement = function toggleElement(operationData) {
4116
+ var toggleElement$1 = function toggleElement(operationData) {
4196
4117
  operationData.selectedElement.toggle();
4197
4118
  return operationData;
4198
4119
  };
@@ -4204,52 +4125,54 @@ var toggleElement = function toggleElement(operationData) {
4204
4125
  * @returns
4205
4126
  */
4206
4127
 
4207
- var wait = function wait(operationData) {
4128
+ var wait$1 = function wait(operationData) {
4208
4129
  var milliseconds = operationData.milliseconds;
4209
4130
  return new Promise(function (resolve) {
4210
4131
  setTimeout(function () {
4211
4132
  internalResolve(resolve, operationData);
4212
- }, milliseconds);
4213
- });
4214
- };
4215
-
4216
- var ops = {
4217
- __proto__: null,
4218
- addClass: addClass,
4219
- addControllerToElement: addControllerToElement,
4220
- animate: animate,
4221
- animateWithClass: animateWithClass,
4222
- broadcastEvent: broadcastEvent,
4223
- clearElement: clearElement,
4224
- clearOperationData: clearOperationData,
4225
- createElement: createElement,
4226
- customFunction: customFunction,
4227
- endAction: endAction,
4228
- endLoop: endLoop,
4229
- extendController: extendController,
4230
- getControllerFromElement: getControllerFromElement,
4231
- getControllerInstance: getControllerInstance,
4232
- getElementDimensions: getElementDimensions,
4233
- getImport: getImport,
4234
- loadJSON: loadJSON,
4235
- log: log,
4236
- removeClass: removeClass,
4237
- removeControllerFromElement: removeControllerFromElement,
4238
- removeElement: removeElement,
4239
- removePropertiesFromOperationData: removePropertiesFromOperationData,
4240
- reparentElement: reparentElement,
4241
- requestAction: requestAction,
4242
- resizeAction: resizeAction,
4243
- selectElement: selectElement,
4244
- setElementAttributes: setElementAttributes,
4245
- setElementContent: setElementContent,
4246
- setOperationData: setOperationData,
4247
- setStyle: setStyle,
4248
- startAction: startAction,
4249
- startLoop: startLoop,
4250
- toggleClass: toggleClass,
4251
- toggleElement: toggleElement,
4252
- wait: wait
4133
+ }, milliseconds);
4134
+ });
4135
+ };
4136
+
4137
+ var ops = {
4138
+ __proto__: null,
4139
+ addClass: addClass$1,
4140
+ addControllerToElement: addControllerToElement$1,
4141
+ animate: animate$1,
4142
+ animateWithClass: animateWithClass$1,
4143
+ broadcastEvent: broadcastEvent$1,
4144
+ calc: calc$1,
4145
+ clearElement: clearElement$1,
4146
+ clearOperationData: clearOperationData$1,
4147
+ createElement: createElement$1,
4148
+ customFunction: customFunction$1,
4149
+ endAction: endAction$1,
4150
+ endLoop: endLoop$1,
4151
+ extendController: extendController$1,
4152
+ getControllerFromElement: getControllerFromElement$1,
4153
+ getControllerInstance: getControllerInstance$1,
4154
+ getElementDimensions: getElementDimensions$1,
4155
+ getImport: getImport$1,
4156
+ loadJSON: loadJSON$1,
4157
+ log: log$1,
4158
+ math: math$1,
4159
+ removeClass: removeClass$1,
4160
+ removeControllerFromElement: removeControllerFromElement$1,
4161
+ removeElement: removeElement$1,
4162
+ removePropertiesFromOperationData: removePropertiesFromOperationData$1,
4163
+ reparentElement: reparentElement$1,
4164
+ requestAction: requestAction$1,
4165
+ resizeAction: resizeAction$1,
4166
+ selectElement: selectElement$1,
4167
+ setElementAttributes: setElementAttributes$1,
4168
+ setElementContent: setElementContent$1,
4169
+ setOperationData: setOperationData$1,
4170
+ setStyle: setStyle$1,
4171
+ startAction: startAction$1,
4172
+ startLoop: startLoop$1,
4173
+ toggleClass: toggleClass$1,
4174
+ toggleElement: toggleElement$1,
4175
+ wait: wait$1
4253
4176
  };
4254
4177
 
4255
4178
  var JwPlayerTimelineProvider = /*#__PURE__*/function () {
@@ -4759,13 +4682,13 @@ var operations = ops;
4759
4682
  var controllers = ctrls;
4760
4683
  var providers = prvdrs;
4761
4684
  var eventbus = evtb;
4762
- var WebpackResourceImporter = /*#__PURE__*/function () {
4763
- function WebpackResourceImporter() {
4685
+ var EligiusResourceImporter = /*#__PURE__*/function () {
4686
+ function EligiusResourceImporter() {
4764
4687
  this.engines = new Map();
4765
4688
  this.engines.set('EligiusEngine', EligiusEngine);
4766
4689
  }
4767
4690
 
4768
- var _proto = WebpackResourceImporter.prototype;
4691
+ var _proto = EligiusResourceImporter.prototype;
4769
4692
 
4770
4693
  _proto.getOperationNames = function getOperationNames() {
4771
4694
  return Object.keys(operations);
@@ -4786,8 +4709,570 @@ var WebpackResourceImporter = /*#__PURE__*/function () {
4786
4709
  return _ref4 = {}, _ref4[name] = value, _ref4;
4787
4710
  };
4788
4711
 
4789
- return WebpackResourceImporter;
4712
+ return EligiusResourceImporter;
4790
4713
  }();
4791
4714
 
4792
- export { Action, ActionRegistryEventbusListener, ConfigurationResolver, EligiusEngine, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, WebpackResourceImporter, addClass, addControllerToElement, animate, animateWithClass, broadcastEvent, clearElement, clearOperationData, createElement, customFunction, endAction, endLoop, extendController, getControllerFromElement, getControllerInstance, getElementDimensions, getImport, loadJSON, log, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, requestAction, resizeAction, selectElement, setElementAttributes, setElementContent, setOperationData, setStyle, startAction, startLoop, toggleClass, toggleElement, wait };
4715
+ function addClass() {
4716
+ return {
4717
+ description: 'Add a class to the selected element.',
4718
+ dependentProperties: ['selectedElement'],
4719
+ properties: {
4720
+ className: {
4721
+ type: 'ParameterType:className',
4722
+ required: true
4723
+ }
4724
+ }
4725
+ };
4726
+ }
4727
+
4728
+ function addControllerToElement() {
4729
+ return {
4730
+ description: 'Adds the current controller to the selected element(s)',
4731
+ dependentProperties: ['selectedElement', 'controllerInstance']
4732
+ };
4733
+ }
4734
+
4735
+ function animate() {
4736
+ return {
4737
+ description: 'Animates the selected element with the given animation settings.',
4738
+ dependentProperties: ['selectedElement'],
4739
+ properties: {
4740
+ animationEasing: 'ParameterType:boolean',
4741
+ animationProperties: {
4742
+ type: 'ParameterType:object',
4743
+ required: true
4744
+ },
4745
+ animationDuration: {
4746
+ type: 'ParameterType:integer',
4747
+ required: true
4748
+ }
4749
+ }
4750
+ };
4751
+ }
4752
+
4753
+ function animateWithClass() {
4754
+ return {
4755
+ description: 'Animates the selected element by adding the given animation class.',
4756
+ dependentProperties: ['selectedElement'],
4757
+ properties: {
4758
+ className: {
4759
+ type: 'ParameterType:className',
4760
+ required: true
4761
+ },
4762
+ removeClass: 'ParameterType:boolean'
4763
+ }
4764
+ };
4765
+ }
4766
+
4767
+ function broadcastEvent() {
4768
+ return {
4769
+ description: 'Broadcasts an eventbus event with the given type, topic and optional arguments',
4770
+ properties: {
4771
+ eventArgs: 'ParameterType:array',
4772
+ eventTopic: 'ParameterType:eventTopic',
4773
+ eventName: {
4774
+ type: 'ParameterType:eventName',
4775
+ required: true
4776
+ }
4777
+ }
4778
+ };
4779
+ }
4780
+
4781
+ function calc() {
4782
+ return {
4783
+ description: 'clears the given element',
4784
+ properties: {
4785
+ left: {
4786
+ type: 'ParameterType:integer',
4787
+ description: 'The left operand',
4788
+ required: true
4789
+ },
4790
+ right: {
4791
+ type: 'ParameterType:integer',
4792
+ description: 'The right operand',
4793
+ required: true
4794
+ },
4795
+ operator: [{
4796
+ value: '+',
4797
+ description: 'Adds the left and right operands'
4798
+ }, {
4799
+ value: '-',
4800
+ description: 'Subtracts the left and right operands'
4801
+ }, {
4802
+ value: '*',
4803
+ description: 'Multiplies the left and right operands'
4804
+ }, {
4805
+ value: '/',
4806
+ description: 'Divides the left and right operands'
4807
+ }, {
4808
+ value: '%',
4809
+ description: 'Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number'
4810
+ }, {
4811
+ value: '**',
4812
+ description: 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.'
4813
+ }],
4814
+ propertyName: {
4815
+ type: 'ParameterType:string',
4816
+ defaultValue: 'calculationResult'
4817
+ }
4818
+ }
4819
+ /*outputProperties: {
4820
+ propertyName: {
4821
+ type: 'ParameterType:integer',
4822
+ },
4823
+ },*/
4824
+
4825
+ };
4826
+ }
4827
+
4828
+ function clearElement() {
4829
+ return {
4830
+ description: 'clears the given element',
4831
+ dependentProperties: ['selectedElement']
4832
+ };
4833
+ }
4834
+
4835
+ function clearOperationData() {
4836
+ return {
4837
+ description: 'clears the current operation data',
4838
+ properties: {
4839
+ properties: 'ParameterType:array'
4840
+ }
4841
+ };
4842
+ }
4843
+
4844
+ function createElement() {
4845
+ return {
4846
+ description: 'Creates an HTML element with the given name and optionally adds the given attributes',
4847
+ properties: {
4848
+ elementName: {
4849
+ type: 'ParameterType:htmlElementName',
4850
+ required: true
4851
+ },
4852
+ attributes: 'ParameterType:object',
4853
+ text: 'ParameterType:string'
4854
+ },
4855
+ outputProperties: {
4856
+ template: 'ParameterType:object'
4857
+ }
4858
+ };
4859
+ }
4860
+
4861
+ function customFunction() {
4862
+ return {
4863
+ description: 'Executes the specified custom function',
4864
+ properties: {
4865
+ systemName: {
4866
+ type: 'ParameterType:systemName',
4867
+ required: true
4868
+ }
4869
+ }
4870
+ };
4871
+ }
4872
+
4873
+ function endAction() {
4874
+ return {
4875
+ description: 'Ends the current action',
4876
+ dependentProperties: ['actionInstance'],
4877
+ properties: {
4878
+ actionOperationData: 'ParameterType:object'
4879
+ }
4880
+ };
4881
+ }
4882
+
4883
+ function endLoop() {
4884
+ return {
4885
+ description: 'Ends the current loop'
4886
+ };
4887
+ }
4888
+
4889
+ function extendController() {
4890
+ return {
4891
+ description: 'Extends the current controller',
4892
+ dependentProperties: ['controllerInstance'],
4893
+ properties: {
4894
+ controllerExtension: 'ParameterType:object'
4895
+ }
4896
+ };
4897
+ }
4898
+
4899
+ function getControllerFromElement() {
4900
+ return {
4901
+ description: 'Retrieves the specified controller from the current element',
4902
+ dependentProperties: ['selectedElement'],
4903
+ properties: {
4904
+ controllerName: {
4905
+ type: 'ParameterType:controllerName',
4906
+ required: true
4907
+ }
4908
+ },
4909
+ outputProperties: {
4910
+ controllerInstance: 'ParameterType:object'
4911
+ }
4912
+ };
4913
+ }
4914
+
4915
+ function getControllerInstance() {
4916
+ return {
4917
+ description: 'Retrieves an instance of the specified controller',
4918
+ properties: {
4919
+ systemName: {
4920
+ type: 'ParameterType:controllerName',
4921
+ required: true
4922
+ },
4923
+ propertyName: {
4924
+ type: 'ParameterType:string',
4925
+ defaultValue: 'controllerInstance'
4926
+ }
4927
+ },
4928
+ outputProperties: {
4929
+ controllerInstance: 'ParameterType:object'
4930
+ }
4931
+ };
4932
+ }
4933
+
4934
+ function getElementDimensions() {
4935
+ return {
4936
+ description: 'Calculates the dimensions for the current element',
4937
+ dependentProperties: ['selectedElement'],
4938
+ properties: {
4939
+ modifier: 'ParameterType:dimensionsModifier'
4940
+ },
4941
+ outputProperties: {
4942
+ dimensions: 'ParameterType:dimensions'
4943
+ }
4944
+ };
4945
+ }
4946
+
4947
+ function getImport() {
4948
+ return {
4949
+ description: 'Retrieves a javascript import specified by the given system name',
4950
+ properties: {
4951
+ systemName: {
4952
+ type: 'ParameterType:systemName',
4953
+ required: true
4954
+ }
4955
+ },
4956
+ outputProperties: {
4957
+ importedInstance: 'ParameterType:object'
4958
+ }
4959
+ };
4960
+ }
4961
+
4962
+ function loadJSON() {
4963
+ return {
4964
+ description: 'Load JSON from the given url',
4965
+ properties: {
4966
+ url: {
4967
+ type: 'ParameterType:url',
4968
+ required: true
4969
+ },
4970
+ cache: 'ParameterType:boolean',
4971
+ propertyName: {
4972
+ type: 'ParameterType:string',
4973
+ defaultValue: 'json'
4974
+ }
4975
+ },
4976
+ outputProperties: {
4977
+ json: 'ParameterType:object'
4978
+ }
4979
+ };
4980
+ }
4981
+
4982
+ function log() {
4983
+ return {
4984
+ description: 'Logs the current context and operation data to the console'
4985
+ };
4986
+ }
4987
+
4988
+ function math() {
4989
+ return {
4990
+ description: 'This operation performs the given math function of the specified arguments.',
4991
+ properties: {
4992
+ args: {
4993
+ type: 'ParameterType:array',
4994
+ required: true
4995
+ },
4996
+ functionName: createMathFunctionNames(),
4997
+ propertyName: {
4998
+ type: 'ParameterType:string',
4999
+ defaultValue: 'mathResult'
5000
+ }
5001
+ }
5002
+ };
5003
+ }
5004
+
5005
+ function createMathFunctionNames() {
5006
+ return Object.getOwnPropertyNames(Math).filter(function (x) {
5007
+ return typeof Math[x] === 'function';
5008
+ }).map(function (functionName) {
5009
+ return {
5010
+ value: functionName
5011
+ };
5012
+ });
5013
+ }
5014
+
5015
+ function removeClass() {
5016
+ return {
5017
+ description: 'Removes the specified class from the selected element',
5018
+ dependentProperties: ['selectedElement'],
5019
+ properties: {
5020
+ className: {
5021
+ type: 'ParameterType:className',
5022
+ required: true
5023
+ }
5024
+ }
5025
+ };
5026
+ }
5027
+
5028
+ function removeControllerFromElement() {
5029
+ return {
5030
+ description: 'Removes the specified controller from the selected element',
5031
+ dependentProperties: ['selectedElement'],
5032
+ properties: {
5033
+ controllerName: {
5034
+ type: 'ParameterType:controllerName',
5035
+ required: true
5036
+ }
5037
+ }
5038
+ };
5039
+ }
5040
+
5041
+ function removeElement() {
5042
+ return {
5043
+ description: 'Removes the selected element from the DOM',
5044
+ dependentProperties: ['selectedElement']
5045
+ };
5046
+ }
5047
+
5048
+ function removePropertiesFromOperationData() {
5049
+ return {
5050
+ description: 'Removes the specified properties from the current operation data',
5051
+ properties: {
5052
+ propertyNames: 'ParameterType:array'
5053
+ }
5054
+ };
5055
+ }
5056
+
5057
+ function reparentElement() {
5058
+ return {
5059
+ description: 'Moves the selected element to the new location described by the given selector',
5060
+ dependentProperties: ['selectedElement'],
5061
+ properties: {
5062
+ newParentSelector: {
5063
+ type: 'ParameterType:selector',
5064
+ required: true
5065
+ }
5066
+ }
5067
+ };
5068
+ }
5069
+
5070
+ function requestAction() {
5071
+ return {
5072
+ description: 'Retrieves an instance of the specified action',
5073
+ properties: {
5074
+ systemName: {
5075
+ type: 'ParameterType:actionName',
5076
+ required: true
5077
+ }
5078
+ },
5079
+ outputProperties: {
5080
+ actionInstance: 'ParameterType:object'
5081
+ }
5082
+ };
5083
+ }
5084
+
5085
+ function resizeAction() {
5086
+ return {
5087
+ description: 'Triggers a resize on the current action',
5088
+ dependentProperties: ['actionInstance'],
5089
+ properties: {
5090
+ actionOperationData: 'ParameterType:object'
5091
+ }
5092
+ };
5093
+ }
5094
+
5095
+ function selectElement() {
5096
+ return {
5097
+ description: 'Selects an element using the given selector',
5098
+ properties: {
5099
+ selector: {
5100
+ type: 'ParameterType:selector',
5101
+ required: true
5102
+ },
5103
+ propertyName: 'ParameterType:string',
5104
+ useSelectedElementAsRoot: 'ParameterType:boolean'
5105
+ },
5106
+ outputProperties: {
5107
+ selectedElement: 'ParameterType:object'
5108
+ }
5109
+ };
5110
+ }
5111
+
5112
+ function setElementAttributes() {
5113
+ return {
5114
+ description: 'Sets the given attributes on the selected element',
5115
+ dependentProperties: ['selectedElement'],
5116
+ properties: {
5117
+ attributes: {
5118
+ type: 'ParameterType:object',
5119
+ required: true
5120
+ }
5121
+ }
5122
+ };
5123
+ }
5124
+
5125
+ function setElementContent() {
5126
+ return {
5127
+ description: 'Sets the given HTML content in the selected element',
5128
+ dependentProperties: ['selectedElement'],
5129
+ properties: {
5130
+ insertionType: [{
5131
+ value: 'overwrite',
5132
+ description: 'the contents of the selected element are replaced by the given template',
5133
+ "default": true
5134
+ }, {
5135
+ value: 'append',
5136
+ description: 'the new content will be inserted after the current content'
5137
+ }, {
5138
+ value: 'prepend',
5139
+ description: 'the new content will be inserted before the current content'
5140
+ }],
5141
+ template: {
5142
+ type: 'ParameterType:htmlContent',
5143
+ required: true
5144
+ }
5145
+ }
5146
+ };
5147
+ }
5148
+
5149
+ function setOperationData() {
5150
+ return {
5151
+ description: 'Sets the given properties on the current operation data',
5152
+ properties: {
5153
+ properties: {
5154
+ type: 'ParameterType:object',
5155
+ required: true
5156
+ },
5157
+ override: 'ParameterType:boolean'
5158
+ }
5159
+ };
5160
+ }
5161
+
5162
+ function setStyle() {
5163
+ return {
5164
+ description: 'Sets the given style properties on the selected element',
5165
+ properties: {
5166
+ properties: {
5167
+ type: 'ParameterType:object',
5168
+ required: true
5169
+ },
5170
+ propertyName: {
5171
+ type: 'ParameterType:string',
5172
+ required: false
5173
+ }
5174
+ }
5175
+ };
5176
+ }
5177
+
5178
+ function startAction() {
5179
+ return {
5180
+ description: 'Starts the selected action',
5181
+ dependentProperties: ['actionInstance'],
5182
+ properties: {
5183
+ actionOperationData: 'ParameterType:object'
5184
+ }
5185
+ };
5186
+ }
5187
+
5188
+ function startLoop() {
5189
+ return {
5190
+ description: 'Starts a loop over the given collection',
5191
+ properties: {
5192
+ collection: {
5193
+ type: 'ParameterType:array',
5194
+ required: true
5195
+ },
5196
+ propertyName: {
5197
+ type: 'ParameterType:string',
5198
+ defaultValue: 'currentItem'
5199
+ }
5200
+ }
5201
+ };
5202
+ }
5203
+
5204
+ function toggleClass() {
5205
+ return {
5206
+ description: 'Toggles the given class on the selected element',
5207
+ dependentProperties: ['selectedElement'],
5208
+ properties: {
5209
+ className: {
5210
+ type: 'ParameterType:className',
5211
+ required: true
5212
+ }
5213
+ }
5214
+ };
5215
+ }
5216
+
5217
+ function toggleElement() {
5218
+ return {
5219
+ description: 'Toggles the selected element',
5220
+ dependentProperties: ['selectedElement']
5221
+ };
5222
+ }
5223
+
5224
+ function wait() {
5225
+ return {
5226
+ description: 'Waits the given amount of milliseconds before the action continues',
5227
+ properties: {
5228
+ milliseconds: {
5229
+ type: 'ParameterType:integer',
5230
+ required: true
5231
+ }
5232
+ }
5233
+ };
5234
+ }
5235
+
5236
+ var index = {
5237
+ __proto__: null,
5238
+ addClass: addClass,
5239
+ addControllerToElement: addControllerToElement,
5240
+ animate: animate,
5241
+ animateWithClass: animateWithClass,
5242
+ broadcastEvent: broadcastEvent,
5243
+ calc: calc,
5244
+ clearElement: clearElement,
5245
+ clearOperationData: clearOperationData,
5246
+ createElement: createElement,
5247
+ customFunction: customFunction,
5248
+ endAction: endAction,
5249
+ endLoop: endLoop,
5250
+ extendController: extendController,
5251
+ getControllerFromElement: getControllerFromElement,
5252
+ getControllerInstance: getControllerInstance,
5253
+ getElementDimensions: getElementDimensions,
5254
+ getImport: getImport,
5255
+ loadJSON: loadJSON,
5256
+ log: log,
5257
+ math: math,
5258
+ removeClass: removeClass,
5259
+ removeControllerFromElement: removeControllerFromElement,
5260
+ removeElement: removeElement,
5261
+ removePropertiesFromOperationData: removePropertiesFromOperationData,
5262
+ reparentElement: reparentElement,
5263
+ requestAction: requestAction,
5264
+ resizeAction: resizeAction,
5265
+ selectElement: selectElement,
5266
+ setElementAttributes: setElementAttributes,
5267
+ setElementContent: setElementContent,
5268
+ setOperationData: setOperationData,
5269
+ setStyle: setStyle,
5270
+ startAction: startAction,
5271
+ startLoop: startLoop,
5272
+ toggleClass: toggleClass,
5273
+ toggleElement: toggleElement,
5274
+ wait: wait
5275
+ };
5276
+
5277
+ export { Action, ActionRegistryEventbusListener, ConfigurationResolver, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, addClass$1 as addClass, addControllerToElement$1 as addControllerToElement, animate$1 as animate, animateWithClass$1 as animateWithClass, broadcastEvent$1 as broadcastEvent, calc$1 as calc, clearElement$1 as clearElement, clearOperationData$1 as clearOperationData, createElement$1 as createElement, customFunction$1 as customFunction, endAction$1 as endAction, endLoop$1 as endLoop, extendController$1 as extendController, generateImporterSourceCode, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, index as metadata, removeClass$1 as removeClass, removeControllerFromElement$1 as removeControllerFromElement, removeElement$1 as removeElement, removePropertiesFromOperationData$1 as removePropertiesFromOperationData, reparentElement$1 as reparentElement, requestAction$1 as requestAction, resizeAction$1 as resizeAction, selectElement$1 as selectElement, setElementAttributes$1 as setElementAttributes, setElementContent$1 as setElementContent, setOperationData$1 as setOperationData, setStyle$1 as setStyle, startAction$1 as startAction, startLoop$1 as startLoop, toggleClass$1 as toggleClass, toggleElement$1 as toggleElement, wait$1 as wait };
4793
5278
  //# sourceMappingURL=eligius.esm.js.map